From 19a0803f7298f5a0d583f5f70582ba29cb373265 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 27 May 2013 09:37:57 +0200 Subject: [PATCH] First work on returning service XML --- src/http_command.c | 12 ++++++++++++ src/pazpar2_config.c | 1 + src/pazpar2_config.h | 1 + 3 files changed, 14 insertions(+) diff --git a/src/http_command.c b/src/http_command.c index dc6750d..dd3d5f5 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -648,6 +648,17 @@ static void session_status(struct http_channel *c, struct http_session *s) wrbuf_printf(c->wrbuf, "%zu\n", session_nmem); } +static void cmd_service(struct http_channel *c) +{ + struct http_session *s = locate_session(c); + if (!s) + return; + + response_open(c, "service"); + response_close(c, "service"); + release_session(c, s); +} + static void cmd_session_status(struct http_channel *c) { struct http_session *s = locate_session(c); @@ -1460,6 +1471,7 @@ struct { { "exit", cmd_exit }, { "session-status", cmd_session_status }, { "server-status", cmd_server_status }, + { "service", cmd_service }, { "ping", cmd_ping }, { "record", cmd_record }, { "info", cmd_info }, diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 81f0e55..770ec7d 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -151,6 +151,7 @@ struct conf_service *service_init(struct conf_server *server, = nmem_malloc(nmem, sizeof(struct conf_sortkey) * service->num_sortkeys); + service->xml_node = 0; return service; } diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index deacda7..4324fa1 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -134,6 +134,7 @@ struct conf_service CCL_bibset ccl_bibset; struct database *databases; struct conf_server *server; + xmlNode *xml_node; }; int conf_service_metadata_field_id(struct conf_service *service, const char * name); -- 1.7.10.4