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