From: Adam Dickmeiss Date: Fri, 21 May 2010 09:49:04 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2 X-Git-Tag: v1.4.1~6 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=3229700a4bfec42f1ca75f1a3526d2aaf8070469;hp=04fb563d9f927258ddf869549ea0efd2fc9c216b;p=pazpar2-moved-to-github.git Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2 --- diff --git a/src/connection.c b/src/connection.c index 79eb40e..19d0477 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 @@ -435,7 +435,7 @@ static int connection_connect(struct connection *con, iochan_man_t iochan_man) ZOOM_connection_connect(link, host->ipport, 0); con->link = link; - con->iochan = iochan_create(0, connection_handler, 0, "connection_socket"); + con->iochan = iochan_create(-1, connection_handler, 0, "connection_socket"); con->state = Conn_Connecting; iochan_settimeout(con->iochan, con->operation_timeout); iochan_setdata(con->iochan, con);