From b1e45fa9dbe4e097133b80d58b45b6e146ed50ba Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 26 Aug 2015 11:55:18 +0200 Subject: [PATCH] Fix pazpar2 crash when using pz:extendrecs PAZ-1024 --- src/client.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client.c b/src/client.c index 75a8e20..267527c 100644 --- a/src/client.c +++ b/src/client.c @@ -825,6 +825,7 @@ int client_fetch_more(struct client *cl) const char *str; int extend_recs = 0; int number = cl->hits - cl->record_offset; + struct connection *co = client_get_connection(cl); str = session_setting_oneval(sdb, PZ_EXTENDRECS); if (!str || !*str) @@ -840,10 +841,13 @@ int client_fetch_more(struct client *cl) if (number > extend_recs) number = extend_recs; - if (number > 0) + if (number <= 0) + yaz_log(YLOG_LOG, "cl=%s. OK no more in total set", client_get_id(cl)); + else if (!co) + yaz_log(YLOG_LOG, "cl=%s. No connection", client_get_id(cl)); + else { ZOOM_resultset set = cl->resultset; - struct connection *co = client_get_connection(cl); str = session_setting_oneval(sdb, PZ_REQUESTSYNTAX); ZOOM_resultset_option_set(set, "preferredRecordSyntax", str); @@ -856,10 +860,6 @@ int client_fetch_more(struct client *cl) connection_continue(co); return 1; } - else - { - yaz_log(YLOG_LOG, "cl=%s. OK no more in total set", client_get_id(cl)); - } return 0; } -- 1.7.10.4