Fix parameters on iochan_destroy_real
[pazpar2-moved-to-github.git] / src / http_command.c
index 8c21c8c..5b84951 100644 (file)
@@ -41,10 +41,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "settings.h"
 #include "client.h"
 
+#ifdef __LINUX__
 #include <malloc.h>
-
 void print_meminfo(WRBUF wrbuf) {
-#ifdef __GNUC__
     struct mallinfo minfo;
     minfo = mallinfo();
     wrbuf_printf(wrbuf, "  <memory>\n"
@@ -60,8 +59,10 @@ void print_meminfo(WRBUF wrbuf) {
                         "  </memory>\n", 
                  minfo.arena, minfo.uordblks, minfo.fordblks,minfo.ordblks, minfo.keepcost, minfo.hblks, minfo.hblkhd, minfo.arena + minfo.hblkhd, minfo.uordblks + minfo.hblkhd);
 
-#endif
 }
+#else
+#define print_meminfo(x)
+#endif
 
 
 // Update this when the protocol changes
@@ -362,7 +363,12 @@ static int process_settings(struct session *se, struct http_request *rq,
 
 static void cmd_exit(struct http_channel *c)
 {
+    char buf[1024];
+    struct http_response *rs = c->response;
     yaz_log(YLOG_WARN, "exit");
+    sprintf(buf, HTTP_COMMAND_RESPONSE_PREFIX "<exit><status>OK</status></exit>");
+    rs->payload = nmem_strdup(c->nmem, buf);
+    http_send_response(c);
     http_close_server(c->server);
 }