From: Dennis Schafroth Date: Wed, 8 Sep 2010 17:11:22 +0000 (+0200) Subject: Remove check/release of preferred block in client_search_response. Do it when ZOOM... X-Git-Tag: v1.5.0~15 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=8552f745cef09828177a0defd7cf06d3510649c1;p=pazpar2-moved-to-github.git Remove check/release of preferred block in client_search_response. Do it when ZOOM message loop. Otherwise logging corrections. --- diff --git a/src/client.c b/src/client.c index a931ca8..0e7fed5 100644 --- a/src/client.c +++ b/src/client.c @@ -447,10 +447,10 @@ static void ingest_raw_record(struct client *cl, ZOOM_record rec) client_show_raw_dequeue(cl); } -static void client_check_preferred_watch(struct client *cl) +void client_check_preferred_watch(struct client *cl) { - yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_url(cl)); struct session *se = cl->session; + yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_url(cl)); if (se) { client_unlock(cl); @@ -458,7 +458,7 @@ static void client_check_preferred_watch(struct client *cl) session_alert_watch(se, SESSION_WATCH_SHOW_PREF); } else - yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_url(cl)); + yaz_log(YLOG_DEBUG, "client_check_preferred_watch: Still locked on preferred targets."); client_lock(cl); } @@ -490,8 +490,6 @@ void client_search_response(struct client *cl) cl->hits = ZOOM_resultset_size(resultset); if (se) se->total_hits += cl->hits; - if (cl->preferred) - client_check_preferred_watch(cl); } } @@ -665,7 +663,8 @@ void client_start_search(struct client *cl) if (opt_preferred) { cl->preferred = atoi(opt_preferred); - yaz_log(YLOG_LOG, "Target %s has preferred: %d", sdb->database->url, cl->preferred); + if (cl->preferred) + yaz_log(YLOG_LOG, "Target %s has preferred status: %d", sdb->database->url, cl->preferred); } client_set_state(cl, Client_Working);