diff options
author | vector-of-bool <vectorofbool@gmail.com> | 2017-11-18 02:57:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-20 14:25:20 (GMT) |
commit | 01c42155cca188901214abbbf79317f853fe164d (patch) | |
tree | 42d7358d023116d136fd7826ce77f9144a4d7814 | |
parent | 78f5d571e4b07cc71d44c78ff36a335693298ccb (diff) | |
download | CMake-01c42155cca188901214abbbf79317f853fe164d.zip CMake-01c42155cca188901214abbbf79317f853fe164d.tar.gz CMake-01c42155cca188901214abbbf79317f853fe164d.tar.bz2 |
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).
-rw-r--r-- | Source/cmConnection.cxx | 5 |
1 files 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(); |