Harden exit command
[pazpar2-moved-to-github.git] / src / http_command.c
index c752b53..65be27c 100644 (file)
@@ -405,7 +405,8 @@ static void cmd_exit(struct http_channel *c)
 
     response_open(c, "exit");
     response_close(c, "exit");
-    http_close_server(c->server);
+    if (global_parameters.debug_mode)
+        http_close_server(c->server);
 }
 
 static void cmd_init(struct http_channel *c)
@@ -726,6 +727,9 @@ static void bytarget_response(struct http_channel *c, struct http_session *s, co
         wrbuf_printf(c->wrbuf, "<diagnostic>%d</diagnostic>\n", ht[i].diagnostic);
         if (ht[i].diagnostic)
         {
+            wrbuf_puts(c->wrbuf, "<message>");
+            wrbuf_xmlputs(c->wrbuf, ht[i].message);
+            wrbuf_puts(c->wrbuf, "</message>\n");
             wrbuf_puts(c->wrbuf, "<addinfo>");
             if (ht[i].addinfo)
                 wrbuf_xmlputs(c->wrbuf, ht[i].addinfo);
@@ -1205,7 +1209,7 @@ static void cmd_show(struct http_channel *c)
         release_session(c, s);
         return;
     }
-    session_sort(s->psession, sp->name, sp->increasing, sp->type == Metadata_sortkey_position);
+    session_sort(s->psession, sp);
 
     status = session_active_clients(s->psession);