info: allow a small delay between connection accept and request arrival
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 3 Jan 2017 10:31:39 +0000 (11:31 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 4 Jan 2017 08:47:11 +0000 (09:47 +0100)
To compensate for slow networks and far-away nodes

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c

index 9ba73ba..0334333 100644 (file)
@@ -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