X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fclient.c;h=61e0a8ae06965a33b73b9bdfc0c5658580449600;hb=9882f8aaef147d5cc2e898203aa72bb144616dfc;hp=ada96989ff53eaf8369aab602a4853995ec9b061;hpb=89890b732016888cbe8d80bccc1321a48f7bc45b;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index ada9698..61e0a8a 100644 --- a/src/client.c +++ b/src/client.c @@ -692,18 +692,19 @@ void client_start_search(struct client *cl) if (*opt_requestsyn) ZOOM_connection_option_set(link, "preferredRecordSyntax", opt_requestsyn); - if (!*opt_maxrecs) + if (opt_maxrecs && *opt_maxrecs) { - sprintf(maxrecs_str, "%d", cl->maxrecs); - opt_maxrecs = maxrecs_str; + cl->maxrecs = atoi(opt_maxrecs); } - ZOOM_connection_option_set(link, "count", opt_maxrecs); + /* convert back to string representation used in ZOOM API */ + sprintf(maxrecs_str, "%d", cl->maxrecs); + ZOOM_connection_option_set(link, "count", maxrecs_str); - if (atoi(opt_maxrecs) > 20) + if (cl->maxrecs > 20) ZOOM_connection_option_set(link, "presentChunk", "20"); else - ZOOM_connection_option_set(link, "presentChunk", opt_maxrecs); + ZOOM_connection_option_set(link, "presentChunk", maxrecs_str); sprintf(startrecs_str, "%d", cl->startrecs); ZOOM_connection_option_set(link, "start", startrecs_str);