From: Arran Cudbard-Bell Date: Wed, 5 Jul 2017 00:28:22 +0000 (-0400) Subject: Delete the connection timer in more cases X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9dd9651c67924bbb0a21bf4d1a540705e0e6eb4;p=thirdparty%2Ffreeradius-server.git Delete the connection timer in more cases --- diff --git a/src/main/connection.c b/src/main/connection.c index 1202a5d74d2..2435cce74cd 100644 --- a/src/main/connection.c +++ b/src/main/connection.c @@ -170,6 +170,11 @@ static void _connection_error(UNUSED fr_event_list_t *el, UNUSED int sock, UNUSE fr_connection_t *conn = talloc_get_type_abort(uctx, fr_connection_t); struct timeval now; + /* + * Explicit error occurred, delete the connection timer + */ + fr_event_timer_delete(conn->el, &conn->connection_timer); + ERROR("Connection failed: %s", fr_syserror(fd_errno)); gettimeofday(&now, NULL); connection_state_failed(conn, &now); @@ -187,12 +192,16 @@ static void _connection_writable(UNUSED fr_event_list_t *el, UNUSED int sock, UN fr_connection_t *conn = talloc_get_type_abort(uctx, fr_connection_t); fr_connection_state_t ret; + /* + * Connection is writable, delete the connection timer + */ + fr_event_timer_delete(conn->el, &conn->connection_timer); + ret = conn->open(conn->fd, conn->el, conn->uctx); switch (ret) { case FR_CONNECTION_STATE_CONNECTED: DEBUG2("Connection established"); STATE_TRANSITION(FR_CONNECTION_STATE_CONNECTED); - fr_event_timer_delete(conn->el, &conn->connection_timer); return; /*