Reformat
[yaz-moved-to-github.git] / src / zoom-sru.c
index 0dc2745..557e812 100644 (file)
@@ -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 <config.h>
+#endif
 
 #include <assert.h>
 #include <string.h>
@@ -156,9 +159,8 @@ zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c)
         start = &c->tasks->u.search.start;
         count = &c->tasks->u.search.count;
         facets = ZOOM_options_get(resultset->options, "facets");
-        if (facets) {
+        if (facets)
             facet_list = yaz_pqf_parse_facet_list(c->odr_out, facets);
-        }
         break;
     case ZOOM_TASK_RETRIEVE:
         resultset = c->tasks->u.retrieve.resultset;
@@ -261,8 +263,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;
@@ -391,6 +394,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;
 
@@ -445,6 +449,9 @@ int ZOOM_handle_sru(ZOOM_connection c, Z_HTTP_Response *hres,
             ret = -1;
     }   
     return ret;
+#else
+    return -1;
+#endif
 }
 
 /*