jsoninfo: limit the number of in-flight connection to 3, like txtinfo
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 26 Nov 2015 19:05:10 +0000 (20:05 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 27 Nov 2015 09:17:22 +0000 (10:17 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index fc525cf..494dbcd 100644 (file)
@@ -494,6 +494,10 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
 
   socklen_t addrlen = sizeof(pin);
 
+  if (outbuffer_count >= MAX_CLIENTS) {
+    return;
+  }
+
   if ((ipc_connection = accept(fd, &pin.in, &addrlen)) == -1) {
 #ifndef NODEBUG
     olsr_printf(1, "("PLUGIN_NAME") accept()=%s\n", strerror(errno));