From 57890a3d7d0eded2e7619cb1edaae129d7c8cb1d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 11 Sep 2014 13:33:43 +0200 Subject: [PATCH] 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. --- src/connection.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 { -- 1.7.10.4