#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"
" </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
unsigned int res;
seq++;
- if (global_parameters.debug_mode)
+ if (global_parameters.predictable_sessions)
res = seq;
else
{
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);
}
if (settings && *settings == '1')
{
wrbuf_puts(c->wrbuf, "<settings>\n");
- wrbuf_puts(c->wrbuf, wrbuf_cstr(ht[i].settings_xml));
+ wrbuf_puts(c->wrbuf, ht[i].settings_xml);
wrbuf_puts(c->wrbuf, "</settings>\n");
}
wrbuf_puts(c->wrbuf, "</target>");
- wrbuf_destroy(ht[i].settings_xml);
}
wrbuf_puts(c->wrbuf, "</bytarget>");