For search with a filter an existing clients that are active and
becomes filtered out (inactive, but cached) Pazpar2 would still accept
record ingestion .. This patch fixes that. We mark session=0 in
clients that are not selected for a search (not active, but cached).
{
cl = client_create(db->database->id);
client_set_database(cl, db);
- client_set_session(cl, se);
l = xmalloc(sizeof(*l));
l->client = cl;
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));
l->client = cl;
while (l)
{
struct client_list *l_next = l->next;
+
+ client_lock(l->client);
+ client_set_session(l->client, 0); /* mark client inactive */
+ client_unlock(l->client);
+
xfree(l);
l = l_next;
}