diff --git a/src/socket.c b/src/socket.c index de2f15a..3763f62 100644 --- a/src/socket.c +++ b/src/socket.c @@ -633,14 +633,14 @@ socket_fd_cb( int events, void *aux ) { conn_t *conn = (conn_t *)aux; - if (events & POLLERR) { - error( "Unidentified socket error from %s.\n", conn->name ); - socket_fail( conn ); + if (conn->state == SCK_CONNECTING) { + socket_connected( conn ); return; } - if (conn->state == SCK_CONNECTING) { - socket_connected( conn ); + if (events & POLLERR) { + error( "Unidentified socket error from %s.\n", conn->name ); + socket_fail( conn ); return; }