log level for http is http (not HTTP)
[pazpar2-moved-to-github.git] / src / session.c
index b590001..41447c6 100644 (file)
@@ -570,7 +570,6 @@ static void select_targets_callback(struct session *se,
         l->next = se->clients_cached;
         se->clients_cached = l;
     }
-    /* set session always. If may be 0 if client is not active */
     client_set_session(cl, se);
 
     l = xmalloc(sizeof(*l));
@@ -619,6 +618,7 @@ static void session_remove_cached_clients(struct session *se)
         client_lock(l->client);
         client_set_session(l->client, 0);
         client_set_database(l->client, 0);
+        client_mark_dead(l->client);
         client_unlock(l->client);
         client_destroy(l->client);
         xfree(l);
@@ -886,6 +886,7 @@ enum pazpar2_error_code session_search(struct session *se,
         *addinfo = "limit";
         session_leave(se, "session_search");
         se->clients_starting = 0;
+        session_reset_active_clients(se, 0);
         return PAZPAR2_MALFORMED_PARAMETER_VALUE;
     }