From a4cf982262fc587e3de855fc013a8efed930bf7f Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 11 Jan 2011 16:59:11 +0000 Subject: [PATCH] .Web: sproc.cpp time interval fix git-svn-id: svn://ultimatepp.org/upp/trunk@2990 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Web/sproc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 << ">");