summaryrefslogtreecommitdiffstats
path: root/src/client/net/serverconnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/net/serverconnection.cpp')
-rw-r--r--src/client/net/serverconnection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp
index c6ffd8c..54d95bc 100644
--- a/src/client/net/serverconnection.cpp
+++ b/src/client/net/serverconnection.cpp
@@ -379,15 +379,17 @@ void ServerConnection::sock_dataArrival()
return;
}
- while (_socket->bytesAvailable())
+ while (_socket->bytesAvailable() > 0)
{
bool retval;
retval = _fromServer.readMessage(_socket); // let the message read data from socket
- if (!retval) // error parsing msg, disconnect client!
+ if (retval == NM_READ_FAILED) // error parsing msg, disconnect client!
{
this->disconnectFromServer();
return;
}
+ if (retval == NM_READ_INCOMPLETE)
+ return;
if (_fromServer.readComplete()) // message is complete
{
this->handleMsg();