X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fclient.c;h=9e52b0a9cb637f964eed6de3c9476b08fcf82a4a;hb=6019a6da5031c198bae79830cc8cf6ff2f7dce7e;hp=eee039626a89860ee9e18c71738f575daf423bb8;hpb=d6c8974147d611c767a37f9befaffc7515098caf;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index eee0396..9e52b0a 100644 --- a/src/client.c +++ b/src/client.c @@ -762,6 +762,7 @@ void client_start_search(struct client *cl) int present_chunk = 20; // Default chunk size if (opt_present_chunk && strcmp(opt_present_chunk,"")) { present_chunk = atoi(opt_present_chunk); + yaz_log(YLOG_DEBUG, "Present chunk set to %d", present_chunk); } assert(link); @@ -803,11 +804,13 @@ void client_start_search(struct client *cl) /* A present_chunk less than 1 will disable chunking. */ if (present_chunk > 0 && cl->maxrecs > present_chunk) { sprintf(present_chunk_str, "%d", present_chunk); - ZOOM_connection_option_set(link, "presentChunk", opt_present_chunk); + ZOOM_connection_option_set(link, "presentChunk", present_chunk_str); + yaz_log(YLOG_DEBUG, "Present chunk set to %s", present_chunk_str); } - else + else { ZOOM_connection_option_set(link, "presentChunk", maxrecs_str); - + yaz_log(YLOG_DEBUG, "Present chunk set to %s (maxrecs)", maxrecs_str); + } sprintf(startrecs_str, "%d", cl->startrecs); ZOOM_connection_option_set(link, "start", startrecs_str); @@ -1328,7 +1331,7 @@ Odr_int client_get_hits(struct client *cl) Odr_int client_get_approximation(struct client *cl) { if (cl->record_offset > 0) { - Odr_int approx = (cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset; + Odr_int approx = ((10 * cl->hits * (cl->record_offset - cl->filtered)) / cl->record_offset + 5) /10; yaz_log(YLOG_LOG, "%s: Approx: %lld * %d / %d = %lld ", client_get_id(cl), cl->hits, cl->record_offset - cl->filtered, cl->record_offset, approx); return approx; }