X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp_command.c;h=5b84951de532a0f898e8b54850228a38b36bf6b1;hb=846689d992d2183563cba6aa5f52f60dc8b14ab4;hp=6acc2c341f9b44442cfeca2d9458321be805ad32;hpb=6b40da0ef0f434e21322ec41d92a01a3d1a215f3;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index 6acc2c3..5b84951 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -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 - void print_meminfo(WRBUF wrbuf) { -#ifdef __GNUC__ struct mallinfo minfo; minfo = mallinfo(); wrbuf_printf(wrbuf, " \n" @@ -60,8 +59,10 @@ void print_meminfo(WRBUF wrbuf) { " \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 @@ -269,7 +270,7 @@ unsigned int make_sessionid(void) unsigned int res; seq++; - if (global_parameters.debug_mode) + if (global_parameters.predictable_sessions) res = seq; else { @@ -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 "OK"); + rs->payload = nmem_strdup(c->nmem, buf); + http_send_response(c); http_close_server(c->server); } @@ -721,11 +727,10 @@ static void cmd_bytarget(struct http_channel *c) if (settings && *settings == '1') { wrbuf_puts(c->wrbuf, "\n"); - wrbuf_puts(c->wrbuf, wrbuf_cstr(ht[i].settings_xml)); + wrbuf_puts(c->wrbuf, ht[i].settings_xml); wrbuf_puts(c->wrbuf, "\n"); } wrbuf_puts(c->wrbuf, ""); - wrbuf_destroy(ht[i].settings_xml); } wrbuf_puts(c->wrbuf, "");