*/
-/*
- * $Id: http_command.c,v 1.66 2007-10-28 18:55:26 adam Exp $
- */
-
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <sys/types.h>
-#if HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/time.h>
#endif
#include <yaz/snprintf.h>
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <yaz/yaz-util.h>
#include "util.h"
static void cmd_exit(struct http_channel *c)
{
yaz_log(YLOG_WARN, "exit");
- exit(0);
+ http_close_server();
}
static void cmd_init(struct http_channel *c)
else
{
wrbuf_puts(c->wrbuf, "<record>\n");
- wrbuf_printf(c->wrbuf, "<recid>%s</recid>\n", rec->recid);
+ wrbuf_puts(c->wrbuf, "<recid>");
+ wrbuf_xmlputs(c->wrbuf, rec->recid);
+ wrbuf_puts(c->wrbuf, "</recid>\n");
write_metadata(c->wrbuf, service, rec->metadata, 1);
for (r = rec->records; r; r = r->next)
write_subrecord(r, c->wrbuf, service, 1);
write_subrecord(p, c->wrbuf, service, 0); // subrecs w/o details
if (ccount > 1)
wrbuf_printf(c->wrbuf, "<count>%d</count>\n", ccount);
- wrbuf_printf(c->wrbuf, "<recid>%s</recid>\n", rec->recid);
+ wrbuf_puts(c->wrbuf, "<recid>");
+ wrbuf_xmlputs(c->wrbuf, rec->recid);
+ wrbuf_puts(c->wrbuf, "</recid>\n");
wrbuf_puts(c->wrbuf, "</hit>\n");
}