info: do not send buffers of zero length, wget can't handle that
authorFerry Huberts <ferry.huberts@pelagic.nl>
Sat, 20 Feb 2016 20:47:13 +0000 (21:47 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Sun, 21 Feb 2016 12:23:39 +0000 (13:23 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info/olsrd_info.c

index 90a310d..5ee2680 100644 (file)
@@ -239,6 +239,11 @@ static void send_info(unsigned int send_what, int the_socket) {
     functions->olsrd_conf(&abuf);
   }
 
+  if (!abuf.len) {
+    /* wget can't handle output of zero length */
+    abuf_puts(&abuf, "\n");
+  }
+
   if (config->http_headers) {
     http_header_adjust_content_length(&abuf, contentLengthIndex, abuf.len - headerLength);
   }