[Olsr-dev] [PATCH v1 38/44] jsoninfo: limit the number of in-flight connection to 3, like txtinfo
Ferry Huberts
(spam-protected)
Fri Nov 27 10:43:31 CET 2015
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
lib/jsoninfo/src/olsrd_jsoninfo.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c
index fc525cf..494dbcd 100644
--- a/lib/jsoninfo/src/olsrd_jsoninfo.c
+++ b/lib/jsoninfo/src/olsrd_jsoninfo.c
@@ -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));
--
2.5.0
More information about the Olsr-dev
mailing list