X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fzoom-sru.c;h=83e162f4b1b511b63df8dbbaca8c530c59241c76;hb=7b1bbfddfb6e9d68c645388e3279a4990a6592ef;hp=433e8714f01499b4ba9d1ad1ef037b71ced37fbd;hpb=6e120dc3c508279e1733049e7aeb4626645d5eef;p=yaz-moved-to-github.git diff --git a/src/zoom-sru.c b/src/zoom-sru.c index 433e871..83e162f 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -1,11 +1,14 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ /** * \file zoom-sru.c * \brief Implements ZOOM SRU */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -135,6 +138,7 @@ zoom_ret ZOOM_connection_srw_send_scan(ZOOM_connection c) #if YAZ_HAVE_XML2 zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) { + const char *facets = 0; int i; int *start, *count; ZOOM_resultset resultset = 0; @@ -154,7 +158,7 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) ZOOM_options_set(resultset->options, "setname", resultset->setname); start = &c->tasks->u.search.start; count = &c->tasks->u.search.count; - const char *facets = ZOOM_options_get(resultset->options, "facets"); + facets = ZOOM_options_get(resultset->options, "facets"); if (facets) { facet_list = yaz_pqf_parse_facet_list(c->odr_out, facets); } @@ -260,8 +264,9 @@ static zoom_ret handle_srw_response(ZOOM_connection c, syntax = c->tasks->u.search.syntax; elementSetName = c->tasks->u.search.elementSetName; - if (!c->tasks->u.search.recv_search_fired) - { + /* Required not for reporting client hit count multiple times into session */ + if (!c->tasks->u.search.recv_search_fired) { + yaz_log(YLOG_DEBUG, "posting ZOOM_EVENT_RECV_SEARCH"); event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); ZOOM_connection_put_event(c, event); c->tasks->u.search.recv_search_fired = 1; @@ -390,6 +395,7 @@ static void handle_srw_scan_response(ZOOM_connection c, int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres, zoom_ret *cret) { +#if YAZ_HAVE_XML2 int ret = 0; const char *addinfo = 0; @@ -444,6 +450,9 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres, ret = -1; } return ret; +#else + return -1; +#endif } /*