From c154a00358d515f834121fe00ef376d15160d9a3 Mon Sep 17 00:00:00 2001 From: angt Date: Tue, 12 Apr 2016 14:11:16 +0000 Subject: [PATCH] Use a bigger timeout when buffers are empty --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 6db553d..dba7bc7 100644 --- a/src/main.c +++ b/src/main.c @@ -1388,9 +1388,12 @@ int main (int argc, char **argv) } struct timeval timeout = { - .tv_usec = 1000, + .tv_usec = 100000, }; + if (buffer_read_size(&sock.write)) + timeout.tv_usec = 1000; + if _0_(select(sock.fd+1, &rfds, NULL, NULL, &timeout)==-1) { if (errno==EINTR) continue;