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).
This commit is contained in:
vector-of-bool
2017-11-17 19:57:16 -07:00
committed by Brad King
parent 78f5d571e4
commit 01c42155cc

View File

@@ -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();