Displaying 5 results from an estimated 5 matches for "terminate_connection".
2013 Nov 07
2
Segfaults on connection loss
Hi there,
I'm seeing quite frequent segfaults around check_dead_connections() and 
terminate_connection() when the tcp meta connection to a node times out 
(or is e.g. firewalled), usually it happens when there's heavy packet loss:
Program terminated with signal 11, Segmentation fault.
#0  edge_del (e=0x1b71ba0) at edge.c:96
96              avl_delete(e->from->edge_tree, e);
(gdb) bt
#0  e...
2008 Sep 30
1
Problem compiling tinc-1.0.8 on gcc-2.95
...ctive) {
+				if(c->status.st.pinged) {
 					ifdebug(CONNECTIONS) logger(LOG_INFO, _("%s (%s) didn't respond to PING in %ld seconds"),
 							   c->name, c->hostname, now - c->last_ping_time);
-					c->status.timeout = true;
+					c->status.st.timeout = true;
 					terminate_connection(c, true);
 				} else if(c->last_ping_time + pinginterval < now) {
 					send_ping(c);
 				}
 			} else {
-				if(c->status.remove) {
+				if(c->status.st.remove) {
 					logger(LOG_WARNING, _("Old connection_t for %s (%s) status %04x still lingering, deleting..."),...
2018 Feb 27
2
tinc 1.1: missing PONG
...break;
+					}
+				}
 
-			if(WSAEnumNetworkEvents(io->fd, io->event, &network_events) != 0) {
-				return false;
+				/*
+				    The fd might be available for write too. However, if we already fired the read callback, that
+				    callback might have deleted the io (e.g. through terminate_connection()), so we can't fire the
+				    write callback here. Instead, we loop back and let the writable io loop above handle it.
+				 */
 			}
 
-			if(network_events.lNetworkEvents & READ_EVENTS) {
-				io->cb(io->data, IO_READ);
-			}
+			/* Continue checking the rest of the events. */
+...
2006 Jun 01
1
Random crashes after sighup
...ection(c);
@@ -297,7 +297,10 @@
 							   _("Error while connecting to %s (%s): %s"),
 							   c->name, c->hostname, strerror(result));
 					closesocket(c->socket);
-					do_outgoing_connection(c);
+					if (c->outgoing) 
+						do_outgoing_connection(c);
+					else
+						terminate_connection(c, false);
 					continue;
 				}
 			}
@@ -427,13 +430,14 @@
 			}
 
 			/* Close connections to hosts that have a changed or deleted host config file */
-			
 			for(node = connection_tree->head; node; node = node->next) {
 				c = node->data;
-				
+
 				if(c->outgoing) {
-					free...
2007 Feb 13
2
[PATCH] Eternal flush, memory leaks
...here. It calls  
do_outgoing_connection(), which on resolve failure calls  
retry_outgoing(), which adds another setup_outgoing_connection()  
event. Events are added as fast as they are taken away, and the flush  
never terminates. And apparently connections are only removed in  
build_fdset() and terminate_connection(), which aren't getting called  
in this tight loop.
I've attached a patch (tinc-1.0.7-flushfix.patch) that only flushes  
events that already exist. I've also attached a patch (flush-1.0.7- 
leaks.patch) that fixes a couple minor memory leaks I spotted in  
"valgrind --tool=memch...