From: Adam Dickmeiss Date: Wed, 23 Feb 2011 16:01:34 +0000 (+0100) Subject: begin work on more cmd=info stuff X-Git-Tag: v1.5.5~33^2~2 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=330dfe997d099ee125cea44b52adec83af1face6;p=pazpar2-moved-to-github.git begin work on more cmd=info stuff --- diff --git a/src/http_command.c b/src/http_command.c index bdd68a8..5509b34 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1103,6 +1103,8 @@ static void cmd_info(struct http_channel *c) wrbuf_puts(c->wrbuf, " \n"); + info_services(c->server, c->wrbuf); + wrbuf_puts(c->wrbuf, ""); rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 787f680..740ac9c 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -933,6 +933,25 @@ struct conf_service *locate_service(struct conf_server *server, return s; } +void info_services(struct conf_server *server, WRBUF w) +{ + struct conf_service *s = server->service; + wrbuf_puts(w, " \n"); + for (; s; s = s->next) + { + wrbuf_puts(w, " id) + { + wrbuf_puts(w, " id=\""); + wrbuf_xmlputs(w, s->id); + wrbuf_puts(w, "\""); + } + wrbuf_puts(w, "/>"); + + wrbuf_puts(w, "\n"); + } + wrbuf_puts(w, " \n"); +} static int parse_config(struct conf_config *config, xmlNode *root) { diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index 3f33b5f..0bb9cbe 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -164,6 +164,7 @@ struct conf_targetprofiles struct conf_config *config_create(const char *fname, int verbose); void config_destroy(struct conf_config *config); void config_process_events(struct conf_config *config); +void info_services(struct conf_server *server, WRBUF w); struct conf_service *locate_service(struct conf_server *server, const char *service_id);