[Olsr-dev] dot_draw plugin problem

John Hay (spam-protected)
Fri Aug 28 14:05:40 CEST 2009


On Fri, Aug 28, 2009 at 01:36:17PM +0200, John Hay wrote:
> Hi,
> 
> Oops, sorry I confused myself. It is not the http plugin, but the dot_draw
> plugin that is giving me problems.
> 
> > I have been trying out the latest code in the 0.5.6 tree and found that
> > something broke (at least on FreeBSD) with the dot_draw plugin. It allow
> > me to connect to it the first time and I get the data. But then it does
> > not seem to close the connection properly and all later connection
> > attempts just close immediately, with this debug output by olsrd:
> > 
> > (DOT DRAW)Only one connection at once allowed.
> > 
> > Looking with netstat -an, I can see that the connection is in the
> > CLOSED state:
> > 
> > tcp4       0      0 127.0.0.1.2004         127.0.0.1.60050        TIME_WAIT
> > tcp4       0      0 127.0.0.1.2004         127.0.0.1.64620        TIME_WAIT
> > tcp4       0      0 127.0.0.1.2004         127.0.0.1.55640        CLOSED

It looks like some brackets got in the way of handling errors. This
patch fix it for me. Is it ok to push in?

John
-- 
John Hay -- (spam-protected) / (spam-protected)


--- lib/dot_draw/src/olsrd_dot_draw.c.orig	2009-08-22 23:36:37.000000000 +0200
+++ lib/dot_draw/src/olsrd_dot_draw.c	2009-08-28 13:57:48.034033116 +0200
@@ -300,17 +300,16 @@
 
   if (FD_ISSET(outbuffer_socket, &set)) {
     result = write(outbuffer_socket, outbuffer.buf, outbuffer.len);
-    if (result > 0) {
+    if (result > 0)
       abuf_pull(&outbuffer, result);
 
-      if (result <= 0) {
-        /* close this socket and cleanup*/
-        close(outbuffer_socket);
-        abuf_free(&outbuffer);
-        olsr_stop_timer(writetimer_entry);
-        writetimer_entry = NULL;
-        outbuffer_socket = -1;
-      }
+    if (result <= 0) {
+      /* close this socket and cleanup*/
+      close(outbuffer_socket);
+      abuf_free(&outbuffer);
+      olsr_stop_timer(writetimer_entry);
+      writetimer_entry = NULL;
+      outbuffer_socket = -1;
     }
   }
 }




More information about the Olsr-dev mailing list