RPM: enable pazpar2 service at usual run levels
[pazpar2-moved-to-github.git] / src / session.c
index 405d53b..75fbb17 100644 (file)
@@ -86,7 +86,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 struct parameters global_parameters = 
 {
     0,   // dump_records
-    0    // debug_mode
+    0,   // debug_mode
+    0,   // predictable sessions
 };
 
 struct client_list {
@@ -759,12 +760,6 @@ void session_apply_setting(struct session *se, char *dbname, char *setting,
     }
 }
 
-/* Depreciated: use session_destroy */
-void destroy_session(struct session *se)
-{
-    session_destroy(se);
-}
-
 void session_destroy(struct session *se) {
     struct session_database *sdb;
     session_log(se, YLOG_DEBUG, "Destroying");
@@ -780,9 +775,13 @@ void session_destroy(struct session *se) {
     service_destroy(se->service);
     yaz_mutex_destroy(&se->session_mutex);
     wrbuf_destroy(se->wrbuf);
-
 }
 
+/* Depreciated: use session_destroy */
+void destroy_session(struct session *se)
+{
+    session_destroy(se);
+}
 
 size_t session_get_memory_status(struct session *session) {
     size_t session_nmem;
@@ -859,7 +858,8 @@ struct hitsbytarget *hitsbytarget(struct session *se, int *count, NMEM nmem)
         res[*count].state = client_get_state_str(cl);
         res[*count].connected  = client_get_connection(cl) ? 1 : 0;
         session_settings_dump(se, client_get_database(cl), w);
-        res[*count].settings_xml = w;
+        res[*count].settings_xml = nmem_strdup(nmem, wrbuf_cstr(w));
+        wrbuf_destroy(w);
         (*count)++;
     }
     session_leave(se);