X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fclient.c;h=f42ec23209c8c7718353c09736920682781b557d;hb=d7ba48e5055825167973cfa42ac76a7003f987bc;hp=197c121a7262f6d0d261b344f14f3070b55f92e7;hpb=1e6906064f09482ddc3660971f35c9299e3a6da7;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index 197c121..f42ec23 100644 --- a/src/client.c +++ b/src/client.c @@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.21 2007-09-19 13:00:01 adam Exp $ +/* $Id: client.c,v 1.23 2007-09-20 08:13:27 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -101,7 +101,8 @@ static const char *client_states[] = { "Client_Error", "Client_Failed", "Client_Disconnected", - "Client_Stopped" + "Client_Stopped", + "Client_Continue" }; static struct client *client_freelist = 0; @@ -612,7 +613,13 @@ void client_search_response(struct client *cl, Z_APDU *a) 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", @@ -811,7 +818,7 @@ void client_continue(struct client *cl) if (cl->state == Client_Connected) { client_init_request(cl); } - if (cl->state == Client_Idle) + if (cl->state == Client_Continue || cl->state == Client_Idle) { struct session *se = client_get_session(cl); if (cl->requestid != se->requestid && cl->pquery) { @@ -827,6 +834,8 @@ void client_continue(struct client *cl) cl->records < cl->hits) { client_send_present(cl); } + else + client_set_state(cl, Client_Idle); } } @@ -971,7 +980,8 @@ void client_set_session(struct client *cl, struct session *se) int client_is_active(struct client *cl) { - if (cl->connection && (cl->state == Client_Connecting || + if (cl->connection && (cl->state == Client_Continue || + cl->state == Client_Connecting || cl->state == Client_Initializing || cl->state == Client_Searching || cl->state == Client_Presenting))