PERFORCE change 122249 for review

Matus Harvan mharvan at FreeBSD.org
Sun Jun 24 23:46:51 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=122249

Change 122249 by mharvan at 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);


More information about the p4-projects mailing list