X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient.c;h=5ca81feec0ee2ed4658ebc51469b02b8f9def3c6;hb=6d01755305a7afba15ed4bc90ac9c149ee7d130e;hp=7dc07d87f4bdd01618a4da6b63fc0aebaf22b3ee;hpb=5bbb418c0649c0cf2b289c0899581b42c5a4385d;p=pazpar2-moved-to-github.git diff --git a/src/client.c b/src/client.c index 7dc07d8..5ca81fe 100644 --- a/src/client.c +++ b/src/client.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2011 Index Data + Copyright (C) 2006-2012 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -237,7 +237,7 @@ static void client_show_immediate( error_handler(data, "no resultset"); return; } - rec = ZOOM_resultset_record(resultset, position-1); + rec = ZOOM_resultset_record_immediate(resultset, position-1); if (!rec) { error_handler(data, "no record"); @@ -580,11 +580,12 @@ static void client_record_ingest(struct client *cl) ZOOM_record rec = 0; ZOOM_resultset resultset = cl->resultset; int offset = cl->record_offset; - if ((rec = ZOOM_resultset_record(resultset, offset))) + if ((rec = ZOOM_resultset_record_immediate(resultset, offset))) { cl->record_offset++; - if (cl->session == 0) - ; + if (cl->session == 0) { + /* no operation */ + } else if (ZOOM_record_error(rec, &msg, &addinfo, 0)) { yaz_log(YLOG_WARN, "Record error %s (%s): %s (rec #%d)", @@ -639,8 +640,8 @@ void client_record_response(struct client *cl) if (cl->show_raw && cl->show_raw->active) { ZOOM_record rec = 0; - if ((rec = ZOOM_resultset_record(resultset, - cl->show_raw->position-1))) + if ((rec = ZOOM_resultset_record_immediate( + resultset, cl->show_raw->position-1))) { cl->show_raw->active = 0; ingest_raw_record(cl, rec); @@ -768,7 +769,6 @@ void client_start_search(struct client *cl) yaz_log(YLOG_LOG, "Target %s has preferred status: %d", client_get_id(cl), cl->preferred); } - client_set_state(cl, Client_Working); if (*opt_piggyback) ZOOM_connection_option_set(link, "piggyback", opt_piggyback); @@ -849,11 +849,11 @@ void client_start_search(struct client *cl) if (se->sorted_results->next) { ZOOM_query_destroy(q); - client_set_state_nb(cl, Client_Idle); return; } } } + client_set_state(cl, Client_Working); cl->hits = 0; cl->record_offset = 0; rs = ZOOM_connection_search(link, q); @@ -1067,10 +1067,14 @@ const char *client_get_facet_limit_local(struct client *cl, if (p && !strcmp(p + 1, name) && s->value && !strncmp(s->value, "local:", 6)) { + const char *cp = s->value + 6; + while (*cp == ' ') + cp++; + nmem_strsplit_escape2(nmem, "|", value, values, num, 1, '\\', 1); (*l)++; - return name; + return *cp ? cp : name; } } } @@ -1133,8 +1137,9 @@ static int apply_limit(struct session_database *sdb, wrbuf_puts(w_ccl, ")"); } - else if (!strncmp(s->value, "local:", 6)) - ; + else if (!strncmp(s->value, "local:", 6)) { + /* no operation */ + } else { yaz_log(YLOG_WARN, "Target %s: Bad limitmap '%s'",