[Olsr-dev] [PATCH v1 087/115] info: ipc_action: use a static sink buffer

Ferry Huberts (spam-protected)
Wed Dec 2 21:29:00 CET 2015


From: Ferry Huberts <(spam-protected)>

That is also a bit larger

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/info/olsrd_info.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index 69d08b5..f411d77 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -63,6 +63,8 @@ typedef struct {
   int count;
 } info_plugin_outbuffer_t;
 
+static char sink_buffer[4096];
+
 static const char * name = NULL;
 
 static info_plugin_functions_t *functions = NULL;
@@ -350,9 +352,7 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
 
     if (s == sizeof(requ) - 1) {
       /* input was much too long, just skip the rest */
-      char dummy[1024];
-
-      while (recv(ipc_connection, (void *) &dummy, sizeof(dummy), 0) == sizeof(dummy))
+      while (recv(ipc_connection, (void *) &sink_buffer, sizeof(sink_buffer), 0) == sizeof(sink_buffer))
         ;
     }
 
-- 
2.5.0




More information about the Olsr-dev mailing list