From 1d0378e0dc3a56c4c76130538a39565b74001217 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sat, 29 May 2021 01:08:14 +0000 Subject: [PATCH] Make processClients reentrant Former-commit-id: e39bdb58ec28d80c5ed2cf15ef6bc7b884e14d4b --- src/networking.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/networking.cpp b/src/networking.cpp index bc76ce662..45d43f063 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -2573,7 +2573,9 @@ void processClients() { serverAssert(GlobalLocksAcquired()); - for (client *c : serverTL->vecclientsProcess) { + while (!serverTL->vecclientsProcess.empty()) { + client *c = serverTL->vecclientsProcess.front(); + serverTL->vecclientsProcess.erase(serverTL->vecclientsProcess.begin()); /* There is more data in the client input buffer, continue parsing it * in case to check if there is a full command to execute. */ std::unique_lock ul(c->lock);