-/* $Id: client.c,v 1.20 2007-09-10 16:25:50 adam Exp $
+/* $Id: client.c,v 1.22 2007-09-19 13:23:35 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
void client_set_state(struct client *cl, enum client_state st)
{
cl->state = st;
+ if (cl->session)
+ {
+ int no_active = session_active_clients(cl->session);
+ if (no_active == 0)
+ session_alert_watch(cl->session, SESSION_WATCH_SHOW);
+ }
}
static void client_show_raw_error(struct client *cl, const char *addinfo);
client_show_raw_error(cl, "client connection failure");
yaz_log(YLOG_WARN, "Fatal error from %s", client_get_url(cl));
connection_destroy(cl->connection);
- cl->state = Client_Error;
+ client_set_state(cl, Client_Error);
}
if (*r->searchStatus)
{
cl->hits = *r->resultCount;
- se->total_hits += cl->hits;
+ if (cl->hits < 0)
+ {
+ yaz_log(YLOG_WARN, "Target %s returns hit count %d",
+ cl->database->database->url, cl->hits);
+ }
+ else
+ se->total_hits += cl->hits;
if (r->presentStatus && !*r->presentStatus && r->records)
{
yaz_log(YLOG_DEBUG, "Records in search response %s",