X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fconnection.c;h=a25d8404d443eb2fa10285a4f7d8a7f59217fb5f;hb=dfa3f5aa5c191a7e528e09789fce3d82d62c8e51;hp=3afc75f718db8d8023c6c04f8dd553612bc865f6;hpb=a76512b8ddfe29c8b37c63ea5c1300b5a38102e4;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index 3afc75f..a25d840 100644 --- a/src/connection.c +++ b/src/connection.c @@ -274,10 +274,7 @@ static void non_block_events(struct connection *co) { struct client *cl = co->client; if (cl) - { - client_check_preferred_watch(cl); client_got_records(cl); - } } } @@ -360,6 +357,11 @@ static void connection_release(struct connection *co) co->client = 0; } +void connection_release2(struct connection *co) +{ + co->client = 0; +} + void connect_resolver_host(struct host *host, iochan_man_t iochan_man) { struct connection *con; @@ -370,7 +372,8 @@ void connect_resolver_host(struct host *host, iochan_man_t iochan_man) { if (con->state == Conn_Closed) { - if (!host->ipport || !con->client) /* unresolved or no client */ + struct client *cl = con->client; + if (!host->ipport || !cl) /* unresolved or no client */ { remove_connection_from_host(con); yaz_mutex_leave(host->mutex); @@ -378,11 +381,12 @@ void connect_resolver_host(struct host *host, iochan_man_t iochan_man) } else { - struct session_database *sdb = client_get_database(con->client); - if (sdb) + struct session_database *sdb = client_get_database(cl); + struct session *se = client_get_session(cl); + if (sdb && se) { yaz_mutex_leave(host->mutex); - client_start_search(con->client); + client_start_search(cl); } else {