From 8d9de1cd1d62b61855e5cf0dc166d131092286c2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 12 Oct 2011 12:40:21 +0200 Subject: [PATCH] Honor block=1 for show when re-searching (sort) Note that the condition for block=1 has changed. It will block if any client has more records to be fetched. Previously: block if no records at all have been fetched. --- src/http_command.c | 6 +++--- test/test_url_7.res | 22 ++++++++++++++++++++-- test/test_url_9.res | 22 ++++++++++++++++++++-- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/http_command.c b/src/http_command.c index a4d5106..2f893c8 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -961,8 +961,6 @@ static void cmd_show(struct http_channel *c) if (!sort) sort = "relevance"; - status = session_active_clients(s->psession); - if (!(sp = reclist_parse_sortparms(c->nmem, sort, s->psession->service))) { error(c->response, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort"); @@ -971,6 +969,8 @@ static void cmd_show(struct http_channel *c) } session_sort(s->psession, sp->name, sp->increasing); + status = session_active_clients(s->psession); + if (block) { if (!strcmp(block, "preferred") && !session_is_preferred_clients_ready(s->psession) && reclist_get_num_records(s->psession->reclist) == 0) @@ -986,7 +986,7 @@ static void cmd_show(struct http_channel *c) return; } - else if (status && reclist_get_num_records(s->psession->reclist) == 0) + else if (status) { // if there is already a watch/block. we do not block this one if (session_set_watch(s->psession, SESSION_WATCH_SHOW, diff --git a/test/test_url_7.res b/test/test_url_7.res index 73c55be..fc344e1 100644 --- a/test/test_url_7.res +++ b/test/test_url_7.res @@ -1,10 +1,10 @@ OK 0 -3 +5 31 0 -3 +5 APPLIED GEOLOGY FILE @@ -16,6 +16,24 @@ +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +AUTOMATED FLOOD WARNING NETWORK +The new system will collect rainfall, temperature, soil moisture, wind speed and direction, humidity, and streamflow (above certain values) +1982-PRESENT +title automated flood warning network author medium book + + + +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +BIBLIOGRAPHY OF MAINE GEOLOGY +This data base is a computer based bibliography of marine geology. It allows searching by topic and geographic location, similar to GEOREF. It is currently under development to replace the printed Bibliography of Marine Geology +1692-PRESENT +title bibliography of maine geology author medium book + + + UTAH EARTHQUAKE EPICENTERS Five files of epicenter data arranged by date comprise this data set. These files are searchable by magnitude and longitude/latitude. Hardcopy of listing and plot of requested area available. Epicenter location and date, magnitude, and focal depth available UTAH EARTHQUAKE EPICENTERS diff --git a/test/test_url_9.res b/test/test_url_9.res index 770d050..c6c0bf1 100644 --- a/test/test_url_9.res +++ b/test/test_url_9.res @@ -1,10 +1,28 @@ OK 0 -5 +7 31 0 -5 +7 + + +WATER WELL DATA +This database contains the following information on water wells in Nevada: driller's name, owner's name, location, formations encountered, lithologic descriptions, water level, and water quality +WATER WELL DATA +This database contains the following information on water wells in Nevada: driller's name, owner's name, location, formations encountered, lithologic descriptions, water level, and water quality +1930-PRESENT +title water well data author medium book + + + +UTAH GEOLOGIC MAP BIBLIOGRAPHY +This collection consists of theses, dissertations, and other unpublished maps as well as published maps of the geology of Utah. Some maps of the collection are xeroxed from limited collections. Cross-sections are included in set. Data file consists of map bibliography +UTAH GEOLOGIC MAP BIBLIOGRAPHY +This collection consists of theses, dissertations, and other unpublished maps as well as published maps of the geology of Utah. Some maps of the collection are xeroxed from limited collections. Cross-sections are included in set. Data file consists of map bibliography +-PRESENT +title utah geologic map bibliography author medium book + UTAH GEOLOGICAL AND MINERAL SURVEY PUBLICATIONS -- 1.7.10.4