Version 1.11.0
[pazpar2-moved-to-github.git] / src / connection.c
index 3afc75f..a25d840 100644 (file)
@@ -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
                 {