From: Ferry Huberts Date: Tue, 3 Jan 2017 10:31:39 +0000 (+0100) Subject: info: allow a small delay between connection accept and request arrival X-Git-Tag: v0.9.6~37 X-Git-Url: http://olsr.org/git/?p=olsrd.git;a=commitdiff_plain;h=93c47c5b2058eca8cb73dc016a9b4ecd4023a1d8 info: allow a small delay between connection accept and request arrival To compensate for slow networks and far-away nodes Signed-off-by: Ferry Huberts --- diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c index 9ba73ba1..03343331 100644 --- a/lib/info/olsrd_info.c +++ b/lib/info/olsrd_info.c @@ -757,7 +757,9 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int return; } - timeout.tv_sec = timeout.tv_usec = 0; + /* Wait at most this much time for the request to arrive on the connection */ + timeout.tv_sec = 0; + timeout.tv_usec = (outbuffer.count >= MAX_CLIENTS) ? 0 : (20 * 1000); /* 20 msec */ FD_ZERO(&read_fds); #ifndef _WIN32