diff --git a/uppsrc/Web/sproc.cpp b/uppsrc/Web/sproc.cpp index 2f74914c5..40f95eb92 100644 --- a/uppsrc/Web/sproc.cpp +++ b/uppsrc/Web/sproc.cpp @@ -571,8 +571,9 @@ void RemoteSlaveProcess::Recv(int part, int timeout) return; } // LOG("RemoteSlaveProcess::Recv(" << part << ")"); - unsigned end = (IsNull(timeout) ? (unsigned)-1 : GetTickCount() + timeout); - while(GetTickCount() <= (int)end && (socket.Peek() || current_part <= part)) + + int starttick = GetTickCount(); + while( (IsNull(timeout) || int(GetTickCount())-starttick <= timeout) && (socket.Peek() || current_part <= part)) { String data = socket.Read(0); SVRLOG("-> [" << current_part << "] = " << data.GetLength() << " bytes: <" << data << ">");