From bf3573774d1f82286d33cd1a410e0500d3dd1955 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 10 Feb 2011 13:24:17 +0100 Subject: [PATCH] Clean up maxrec and set the cl->maxrecs --- src/client.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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); -- 1.7.10.4