From: Adam Dickmeiss Date: Thu, 11 Sep 2014 11:33:43 +0000 (+0200) Subject: Check for session present PAZ-966 X-Git-Tag: v1.7.5~1 X-Git-Url: http://jira.indexdata.com/?a=commitdiff_plain;h=57890a3d7d0eded2e7619cb1edaae129d7c8cb1d;p=pazpar2-moved-to-github.git Check for session present PAZ-966 The session for a client is NULL if the client is no longer attached to a session. Checking for this here, but we don't lock client as we probably should. --- diff --git a/src/connection.c b/src/connection.c index 3afc75f..df01303 100644 --- a/src/connection.c +++ b/src/connection.c @@ -370,7 +370,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 +379,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 {