X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fconnection.c;h=1406811673e0cf4281b2191de326eee6b83d7b9a;hb=76c3727aac232bb2b3606ff5744a0c1fe8d60976;hp=79eb40e5809c2e7e9785974d3b8bb42b2803b20a;hpb=4153b0ad5760dbcc7e0fb1d370f403c133b18e25;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index 79eb40e..1406811 100644 --- a/src/connection.c +++ b/src/connection.c @@ -207,10 +207,14 @@ static void non_block_events(struct connection *co) { yaz_log(YLOG_LOG, "Error %s from %s", error, client_get_url(cl)); + client_set_diagnostic(cl, err); + client_set_state(cl, Client_Error); + } + else + { + iochan_settimeout(iochan, co->session_timeout); + client_set_state(cl, Client_Idle); } - iochan_settimeout(iochan, co->session_timeout); - client_set_diagnostic(cl, err); - client_set_state(cl, Client_Idle); yaz_cond_broadcast(co->host->cond_ready); } break; @@ -287,15 +291,11 @@ static void connection_handler(IOCHAN iochan, int event) client_set_state(cl, Client_Error); connection_destroy(co); } - else if (client_get_state(co->client) == Client_Idle) + else { yaz_log(YLOG_LOG, "idle timeout %s", client_get_url(cl)); connection_destroy(co); } - else - { - yaz_log(YLOG_LOG, "ignore timeout %s", client_get_url(cl)); - } yaz_mutex_leave(host->mutex); } else