check if receive timeout is infinite before doing the usual preparation for ABSOLUTE_TIMEOUT

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20594 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Hugo Santos 2007-04-06 02:02:18 +00:00
parent 8d00b95aa9
commit 3785f4f0f0
1 changed files with 3 additions and 1 deletions

View File

@ -506,7 +506,9 @@ TCPEndpoint::ReadData(size_t numBytes, uint32 flags, net_buffer** _buffer)
if (flags & MSG_WAITALL)
dataNeeded = numBytes;
bigtime_t timeout = system_time() + socket->receive.timeout;
bigtime_t timeout = socket->receive.timeout;
if (timeout != B_INFINITE_TIMEOUT)
timeout += system_time();
while (fReceiveQueue.PushedData() == 0
&& fReceiveQueue.Available() < dataNeeded