Happy new year
[pazpar2-moved-to-github.git] / src / session.c
index 048d10e..f597d7c 100644 (file)
@@ -113,7 +113,7 @@ static int session_use(int delta)
     return sessions;
 }
 
-int sessions_count(void)
+int sessions_get_count(void)
 {
     return session_use(0);
 }
@@ -834,7 +834,11 @@ enum pazpar2_error_code session_search(struct session *se,
     int no_sortmap = 0;
     struct client_list *l;
 
-    session_log(se, YLOG_DEBUG, "Search");
+    session_log(se, YLOG_LOG, "search query %s", query);
+    if (filter)
+        session_log(se, YLOG_LOG, "search filter %s", filter);
+    if (limit)
+        session_log(se, YLOG_LOG, "search limit %s", limit);
 
     *addinfo = 0;
 
@@ -920,8 +924,9 @@ enum pazpar2_error_code session_search(struct session *se,
             no_working++;
         }
     }
-    yaz_log(YLOG_LOG, "session_search: no_working=%d no_sortmap=%d",
-            no_working, no_sortmap);
+    session_log(se, YLOG_LOG, "search "
+                "working %d sortmap %d failed-query %d failed-limit %d",
+                no_working, no_sortmap, no_failed_query, no_failed_limit);
     session_enter(se, "session_search2");
     if (no_working == 1 && no_sortmap == 1)
     {
@@ -2190,6 +2195,8 @@ static int ingest_to_cluster(struct client *cl,
             if (!value0 || !*value0)
             {
                 const char *empty = yaz_xml_get_prop(n, "empty");
+                if (value0)
+                    xmlFree(value0);
                 if (!empty)
                     continue;
                 wrbuf_puts(wrbuf_disp, (const char *) empty);
@@ -2197,9 +2204,8 @@ static int ingest_to_cluster(struct client *cl,
             else
             {
                 wrbuf_puts(wrbuf_disp, (const char *) value0);
-            }
-            if (value0)
                 xmlFree(value0);
+            }
             ser_md = &service->metadata[md_field_id];
 
             // non-merged metadata