From 01c42155cca188901214abbbf79317f853fe164d Mon Sep 17 00:00:00 2001 From: vector-of-bool Date: Fri, 17 Nov 2017 19:57:16 -0700 Subject: server: Fix regression in partial message handling If a partial message is flushed into the input pipe for CMake Server, the parser will try and parse it as a full message because of some bad loop checks. This was introduced accidentally in commit v3.10.0-rc1~365^2~2 (server: Refactor to make the event loop owned by server object, 2017-03-24). --- Source/cmConnection.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx index f482412..28ba12c 100644 --- a/Source/cmConnection.cxx +++ b/Source/cmConnection.cxx @@ -97,11 +97,10 @@ void cmEventBasedConnection::ReadData(const std::string& data) this->RawReadBuffer += data; if (BufferStrategy) { std::string packet = BufferStrategy->BufferMessage(this->RawReadBuffer); - do { + while (!packet.empty()) { ProcessRequest(packet); packet = BufferStrategy->BufferMessage(this->RawReadBuffer); - } while (!packet.empty()); - + } } else { ProcessRequest(this->RawReadBuffer); this->RawReadBuffer.clear(); -- cgit v0.12