X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet.c;h=0496a864e4dd4c028a07ab7bf4f52c353471c02e;hb=a7dbb50c23f447a23b543c92ec096ff178bc2de3;hp=fc9ec574987a97f81d42f757e19648bd800299b0;hpb=ea415ccc1690d6e5864a7500977b181e5c8faafe;p=tinc diff --git a/src/net.c b/src/net.c index fc9ec574..0496a864 100644 --- a/src/net.c +++ b/src/net.c @@ -1,7 +1,7 @@ /* net.c -- most of the network code Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2011 Guus Sliepen + 2000-2012 Guus Sliepen 2006 Scott Lamb 2011 Loïc Grenié @@ -204,18 +204,14 @@ void terminate_connection(connection_t *c, bool report) { } } + free_connection_partially(c); + /* Check if this was our outgoing connection */ if(c->outgoing) { - retry_outgoing(c->outgoing); - c->outgoing = NULL; + c->status.remove = false; + do_outgoing_connection(c); } - - free(c->outbuf); - c->outbuf = NULL; - c->outbuflen = 0; - c->outbufsize = 0; - c->outbufstart = 0; } /* @@ -343,7 +339,7 @@ static void check_network_activity(fd_set * readset, fd_set * writeset) { for(i = 0; i < listen_sockets; i++) { if(FD_ISSET(listen_socket[i].udp, readset)) - handle_incoming_vpn_data(listen_socket[i].udp); + handle_incoming_vpn_data(i); if(FD_ISSET(listen_socket[i].tcp, readset)) handle_new_meta_connection(listen_socket[i].tcp);