From: Adam Dickmeiss Date: Mon, 25 Feb 2013 13:07:02 +0000 (+0100) Subject: Merge branch 'master' into session_lock X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=87d66966f66304ebd8a15a6cb8a918433386bd34;p=pazpar2-moved-to-github.git Merge branch 'master' into session_lock --- 87d66966f66304ebd8a15a6cb8a918433386bd34 diff --cc src/http_command.c index 2e8a6ea,7620e92..0b63e3a --- a/src/http_command.c +++ b/src/http_command.c @@@ -1117,9 -1117,13 +1119,12 @@@ static void show_records(struct http_ch { error(rs, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); return; - } - rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits, &approx_hits); + rl = show_range_start(s->psession, sp, startn, &numn, &total, + &total_hits, &approx_hits, show_records_ready, c); + if (!rl) + return; response_open(c, "show"); wrbuf_printf(c->wrbuf, "\n%d\n", active); diff --cc src/session.c index c4d1cb9,e81c221..ba8ac59 --- a/src/session.c +++ b/src/session.c @@@ -1325,6 -1343,25 +1376,24 @@@ struct record_cluster **show_range_star yaz_timing_get_sys(t)); yaz_timing_destroy(&t); #endif + + if (!session_fetch_more(se)) + session_log(se, YLOG_LOG, "can not fetch more"); + else + { - show_range_stop(se, recs); + session_log(se, YLOG_LOG, "fetching more in progress"); + if (session_set_watch(se, SESSION_WATCH_SHOW, + show_records_ready, chan, chan)) + { + session_log(se, YLOG_WARN, "Ignoring show block"); - session_enter(se, "show_range_start"); + } + else + { ++ show_range_stop(se, recs); + session_log(se, YLOG_LOG, "session watch OK"); + return 0; + } + } return recs; }