From 6539b0261889bff41972338fa64cd230183fad42 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 29 Jun 2019 02:39:38 +0400 Subject: iproxy: Fix (newly introduced) timeout errors not being handled --- tools/iproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/iproxy.c b/tools/iproxy.c index 21dec51..113938e 100644 --- a/tools/iproxy.c +++ b/tools/iproxy.c @@ -67,7 +67,7 @@ static void *run_stoc_loop(void *arg) while (!cdata->stop_stoc && cdata->fd > 0 && cdata->sfd > 0) { recv_len = socket_receive_timeout(cdata->sfd, buffer, sizeof(buffer), 0, 5000); if (recv_len <= 0) { - if (recv_len == 0) { + if (recv_len == 0 || recv_len == -ETIMEDOUT) { // try again continue; } else { @@ -120,7 +120,7 @@ static void *run_ctos_loop(void *arg) while (!cdata->stop_ctos && cdata->fd>0 && cdata->sfd>0) { recv_len = socket_receive_timeout(cdata->fd, buffer, sizeof(buffer), 0, 5000); if (recv_len <= 0) { - if (recv_len == 0) { + if (recv_len == 0 || recv_len == -ETIMEDOUT) { // try again continue; } else { -- cgit v1.1-32-gdbae