1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2026-02-16 14:13:46 +00:00

Fixed potential collection modified exception upon logging message not handled in websocket message handling

This commit is contained in:
Jkorf 2026-01-22 09:57:02 +01:00
parent ce3fa5f186
commit a8321e083e

View File

@ -632,12 +632,12 @@ namespace CryptoExchange.Net.Sockets.Default
|| route.TopicFilter == null
|| route.TopicFilter.Equals(topicFilter, StringComparison.Ordinal))
{
processed = true;
if (isQuery && query!.Completed)
continue;
processed = true;
processor.Handle(this, receiveTime, originalData, result, route);
if (isQuery && !route.MultipleReaders)
{
complete = true;
@ -652,11 +652,14 @@ namespace CryptoExchange.Net.Sockets.Default
}
if (!processed)
{
lock (_listenersLock)
{
_logger.ReceivedMessageNotMatchedToAnyListener(SocketId, topicFilter!,
string.Join(",", _listeners.Select(x => string.Join(",", x.MessageRouter.Routes.Select(x => x.TopicFilter != null ? string.Join(",", x.TopicFilter) : "[null]")))));
}
}
}
/// <summary>
/// Connect the websocket