Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jun 2007 23:46:50 GMT
From:      Matus Harvan <mharvan@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 122249 for review
Message-ID:  <200706242346.l5ONkoll011332@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122249

Change 122249 by mharvan@mharvan_home on 2007/06/24 23:46:47

	server should not segfault when client disconnects

Affected files ...

.. //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_tcp.c#4 edit
.. //depot/projects/soc2007/mharvan-mtund/mtund.src/tunneld.c#4 edit

Differences ...

==== //depot/projects/soc2007/mharvan-mtund/mtund.src/plugin_tcp.c#4 (text+ko) ====

@@ -24,7 +24,7 @@
  */
 
 typedef struct {
-    int fd; /* udp socket to the other endpoint */
+    int fd; /* tcp socket to the other endpoint */
     int state; /* is a client connected? */
 } plugin_tcp_datat;
 
@@ -253,6 +253,7 @@
     if (! (data->state == PLUGIN_STATE_CONNECTED
 	   || data->state == PLUGIN_STATE_INITIALIZED)) {
 	report_plugin_error(pl, PLUGIN_ERROR_RECEIVE);
+	return;
     }
 
     //fprintf(stderr, "data on plugin fd\n");

==== //depot/projects/soc2007/mharvan-mtund/mtund.src/tunneld.c#4 (text+ko) ====

@@ -80,7 +80,7 @@
 	    *q = p->next;
 
 	    //event_set(&nfdl->ev, fd, EV_READ, ev_callback, arg);
-	    event_set(&p->ev, fd, EV_READ, NULL, NULL);
+	    //event_set(&p->ev, fd, EV_READ, NULL, NULL);
 	    event_del(&p->ev);
 
 	    free(p);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706242346.l5ONkoll011332>