X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhttp_command.c;h=f2f9b208d409de3b6a57983a4b1591b6410e0905;hb=758bd14da56233550801d486d0e7c6e8790cfe11;hp=9fc50a8059c1c2d5dda4562a451b4c4a42fd80e5;hpb=ab0c408e57e6d12f3b9fbe71727616e45e80e8d9;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index 9fc50a8..f2f9b20 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) 2006-2013 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -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) @@ -1354,17 +1355,17 @@ static void cmd_stat(struct http_channel *c) } response_open_no_status(c, "stat"); - wrbuf_printf(c->wrbuf, "%d\n", clients); - wrbuf_printf(c->wrbuf, "" ODR_INT_PRINTF "\n", stat.num_hits); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_records); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_clients); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_no_connection); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_connecting); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_working); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_idle); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_failed); - wrbuf_printf(c->wrbuf, "%d\n", stat.num_error); - wrbuf_printf(c->wrbuf, "%.2f\n", progress); + wrbuf_printf(c->wrbuf, "\n %d\n", clients); + wrbuf_printf(c->wrbuf, " " ODR_INT_PRINTF "\n", stat.num_hits); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_records); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_clients); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_no_connection); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_connecting); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_working); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_idle); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_failed); + wrbuf_printf(c->wrbuf, " %d\n", stat.num_error); + wrbuf_printf(c->wrbuf, " %.2f\n", progress); response_close(c, "stat"); release_session(c, s); } @@ -1372,26 +1373,39 @@ static void cmd_stat(struct http_channel *c) static void cmd_info(struct http_channel *c) { char yaz_version_str[20]; + char yaz_sha1_str[42]; response_open_no_status(c, "info"); - wrbuf_puts(c->wrbuf, " \n"); + wrbuf_puts(c->wrbuf, "\n \n"); wrbuf_puts(c->wrbuf, " wrbuf, " sha1=\"%s\"", PAZPAR2_VERSION_SHA1); #endif wrbuf_puts(c->wrbuf, ">"); wrbuf_xmlputs(c->wrbuf, VERSION); - wrbuf_puts(c->wrbuf, ""); + wrbuf_puts(c->wrbuf, "\n"); - yaz_version(yaz_version_str, 0); + yaz_version(yaz_version_str, yaz_sha1_str); wrbuf_puts(c->wrbuf, " wrbuf, YAZ_VERSION); + wrbuf_puts(c->wrbuf, "\" sha1=\""); + wrbuf_xmlputs(c->wrbuf, yaz_sha1_str); wrbuf_puts(c->wrbuf, "\">"); wrbuf_xmlputs(c->wrbuf, yaz_version_str); wrbuf_puts(c->wrbuf, "\n"); wrbuf_puts(c->wrbuf, " \n"); - +#if HAVE_UNISTD_H + { + char hostname_str[64]; + if (gethostname(hostname_str, sizeof(hostname_str)) == 0) + { + wrbuf_puts(c->wrbuf, " "); + wrbuf_xmlputs(c->wrbuf, hostname_str); + wrbuf_puts(c->wrbuf, "\n"); + } + } +#endif info_services(c->server, c->wrbuf); response_close(c, "info");