projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into protocol-version2
[pazpar2-moved-to-github.git]
/
src
/
http_command.c
diff --git
a/src/http_command.c
b/src/http_command.c
index
5f40d29
..
567189e
100644
(file)
--- a/
src/http_command.c
+++ b/
src/http_command.c
@@
-498,6
+498,7
@@
static void cmd_settings(struct http_channel *c)
{
xmlDoc *doc = xmlParseMemory(rq->content_buf, rq->content_len);
xmlNode *root_n;
{
xmlDoc *doc = xmlParseMemory(rq->content_buf, rq->content_len);
xmlNode *root_n;
+ int ret;
if (!doc)
{
error(rs, PAZPAR2_MALFORMED_SETTING, 0);
if (!doc)
{
error(rs, PAZPAR2_MALFORMED_SETTING, 0);
@@
-505,10
+506,14
@@
static void cmd_settings(struct http_channel *c)
return;
}
root_n = xmlDocGetRootElement(doc);
return;
}
root_n = xmlDocGetRootElement(doc);
-
- settings_read_node_x(root_n, s->psession, apply_local_setting);
-
+ ret = settings_read_node_x(root_n, s->psession, apply_local_setting);
xmlFreeDoc(doc);
xmlFreeDoc(doc);
+ if (ret)
+ {
+ error(rs, PAZPAR2_MALFORMED_SETTING, 0);
+ release_session(c,s);
+ return;
+ }
}
if (process_settings(s->psession, rq, rs) < 0)
{
}
if (process_settings(s->psession, rq, rs) < 0)
{
@@
-726,8
+731,10
@@
static void bytarget_response(struct http_channel *c, struct http_session *s, co
}
wrbuf_printf(c->wrbuf, "<records>%d</records>\n", ht[i].records - ht[i].filtered);
}
wrbuf_printf(c->wrbuf, "<records>%d</records>\n", ht[i].records - ht[i].filtered);
- if (version >= 2)
+ if (version >= 2) {
wrbuf_printf(c->wrbuf, "<filtered>%d</filtered>\n", ht[i].filtered);
wrbuf_printf(c->wrbuf, "<filtered>%d</filtered>\n", ht[i].filtered);
+ wrbuf_printf(c->wrbuf, "<approximation>" ODR_INT_PRINTF "</approximation>\n", ht[i].approximation);
+ }
wrbuf_puts(c->wrbuf, "<state>");
wrbuf_xmlputs(c->wrbuf, ht[i].state);
wrbuf_puts(c->wrbuf, "</state>\n");
wrbuf_puts(c->wrbuf, "<state>");
wrbuf_xmlputs(c->wrbuf, ht[i].state);
wrbuf_puts(c->wrbuf, "</state>\n");