summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2015-08-13 00:20:12 +0200
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2015-08-13 00:20:12 +0200
commit85ff3cf9f3ab78c4dfa9f9ff34d27e6fe8f73c39 (patch)
tree67c5b52fa031a5717b1bc263fb5745d2ab8b05bd
parente5c9fb3c779c4db507d68e9c4c8fb7fe5f237c41 (diff)
Fix timeout adjustment in c528cec4
-rw-r--r--src/src/ip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/src/ip.c b/src/src/ip.c
index 7991a5850..2d717051e 100644
--- a/src/src/ip.c
+++ b/src/src/ip.c
@@ -455,7 +455,7 @@ time_t start_recv = time(NULL);
int time_left = timeout;
int rc;
-if (timeout <= 0)
+if (time_left <= 0)
{
errno = ETIMEDOUT;
return FALSE;
@@ -484,8 +484,10 @@ do
if (rc < 0 && errno == EINTR)
{
DEBUG(D_transport) debug_printf("EINTR while waiting for socket data\n");
+
/* Watch out, 'continue' jumps to the condition, not to the loops top */
- if (time_left = timeout - (time(NULL) - start_recv)) continue;
+ time_left = timeout - (time(NULL) - start_recv);
+ if (time_left > 0) continue;
}
if (rc <= 0)