X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp_command.c;h=c92c7c334ad51c8cc91ccdbd283aecec571d30c4;hb=f9c7c18836e77f24e8963d280676bc7943bf1dbb;hp=d4b4a77672c6c49acfe48790d9530e7ec5218287;hpb=c7dba339191653dfa15e2dc76fb5b1dcaa339f5b;p=pazpar2-moved-to-github.git
diff --git a/src/http_command.c b/src/http_command.c
index d4b4a77..c92c7c3 100644
--- a/src/http_command.c
+++ b/src/http_command.c
@@ -470,6 +470,8 @@ static void cmd_init(struct http_channel *c)
wrbuf_puts(c->wrbuf, ""
"" PAZPAR2_PROTOCOL_VERSION "");
+ wrbuf_printf(c->wrbuf, "%d\n", 1000 * ((s->psession->service->session_timeout >= 20) ?
+ (s->psession->service->session_timeout - 10) : 50));
response_close(c, "init");
}
@@ -498,6 +500,7 @@ static void cmd_settings(struct http_channel *c)
{
xmlDoc *doc = xmlParseMemory(rq->content_buf, rq->content_len);
xmlNode *root_n;
+ int ret;
if (!doc)
{
error(rs, PAZPAR2_MALFORMED_SETTING, 0);
@@ -505,10 +508,14 @@ static void cmd_settings(struct http_channel *c)
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);
+ if (ret)
+ {
+ error(rs, PAZPAR2_MALFORMED_SETTING, 0);
+ release_session(c,s);
+ return;
+ }
}
if (process_settings(s->psession, rq, rs) < 0)
{
@@ -1166,7 +1173,8 @@ static void cmd_show(struct http_channel *c)
release_session(c, s);
return;
}
- session_sort(s->psession, sp->name, sp->increasing);
+ session_sort(s->psession, sp->name, sp->increasing,
+ sp->type == Metadata_sortkey_position);
status = session_active_clients(s->psession);