From: Ian Jackson Date: Wed, 5 May 2010 20:35:57 +0000 (+0100) Subject: do not block reconnections due to us having successfully connected our only connection X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=inn-innduct.git;a=commitdiff_plain;h=ac93723ebee6801697191caf50f3d0b714717068;hp=3fca16a4ee8d432329ce49383132b0de5137a70f do not block reconnections due to us having successfully connected our only connection --- diff --git a/backends/innduct.c b/backends/innduct.c index 772fc89..adf6cad 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -1233,7 +1233,6 @@ static pid_t connecting_child; static int connecting_fdpass_sock; static void connect_attempt_discard(void) { - reconnect_blocking_event(); if (connecting_child) { int status= xwaitpid(&connecting_child, "connect"); if (!(WIFEXITED(status) || @@ -1358,6 +1357,7 @@ static void *connchild_event(oop_source *lp, int fd, oop_event e, void *u) { x: conn_dispose(conn); connect_attempt_discard(); + reconnect_blocking_event(); return OOP_CONTINUE; } @@ -1372,6 +1372,7 @@ static void connect_start(void) { assert(!connecting_fdpass_sock); info("starting connection attempt"); + int ok_reconnect_delay_periods= reconnect_delay_periods; reconnect_blocking_event(); int socks[2]; @@ -1465,6 +1466,9 @@ static void connect_start(void) { connecting_fdpass_sock= socks[0]; xsetnonblock(connecting_fdpass_sock, 1); on_fd_read_except(connecting_fdpass_sock, connchild_event); + + if (!conns.count) + reconnect_delay_periods= ok_reconnect_delay_periods; } /*---------- assigning articles to conns, and transmitting ----------*/