First work on returning service XML
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 27 May 2013 07:37:57 +0000 (09:37 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 27 May 2013 07:37:57 +0000 (09:37 +0200)
src/http_command.c
src/pazpar2_config.c
src/pazpar2_config.h

index dc6750d..dd3d5f5 100644 (file)
@@ -648,6 +648,17 @@ static void session_status(struct http_channel *c, struct http_session *s)
     wrbuf_printf(c->wrbuf, "<session_nmem>%zu</session_nmem>\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 },
index 81f0e55..770ec7d 100644 (file)
@@ -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;
 }
index deacda7..4324fa1 100644 (file)
@@ -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);