From 066ce0916d351e215cd192a06b08a7491cf1071e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 12 Jan 2007 23:07:54 +0000 Subject: [PATCH] info command returns Pazpar2 version + YAZ version (compiled and version in use). info command does not require a session ID anymore. --- src/http_command.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/http_command.c b/src/http_command.c index e29a1bb..0ee4d7c 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* - * $Id: http_command.c,v 1.18 2007-01-11 17:14:06 quinn Exp $ + * $Id: http_command.c,v 1.19 2007-01-12 23:07:54 adam Exp $ */ #include @@ -501,12 +501,23 @@ static void cmd_stat(struct http_channel *c) static void cmd_info(struct http_channel *c) { + char yaz_version_str[8]; struct http_request *rq = c->request; struct http_response *rs = c->response; - struct http_session *s = locate_session(rq, rs); - if (!s) - return; + wrbuf_rewind(c->wrbuf); + wrbuf_puts(c->wrbuf, "\n"); + wrbuf_printf(c->wrbuf, " \n"); + wrbuf_printf(c->wrbuf, " %s\n", VERSION); + + yaz_version(yaz_version_str, 0); + wrbuf_printf(c->wrbuf, " %s\n", + YAZ_VERSION, yaz_version_str); + wrbuf_printf(c->wrbuf, " \n"); + + wrbuf_puts(c->wrbuf, ""); + rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); + http_send_response(c); } struct { -- 1.7.10.4