X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=ztest%2Fztest.c;h=c95c4718abf5feeb6b68f268f0fffde1182ed4b4;hp=170fba5e6c754b434d9239d75ff4ad08f3ad338e;hb=1141af3a859ba06226d7b3dd19eb3f83fa2f8753;hpb=a37f819598462f7ecc85b28bd56190e87e761bce diff --git a/ztest/ztest.c b/ztest/ztest.c index 170fba5..c95c471 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -137,6 +137,29 @@ int ztest_search(void *handle, bend_search_rr *rr) return 0; } + if (rr->extra_args) + { + Z_SRW_extra_arg *a; + WRBUF response_xml = wrbuf_alloc(); + wrbuf_puts(response_xml, ""); + for (a = rr->extra_args; a; a = a->next) + { + wrbuf_puts(response_xml, "name); + wrbuf_puts(response_xml, "\""); + if (a->value) + { + wrbuf_puts(response_xml, " value=\""); + wrbuf_xmlputs(response_xml, a->value); + wrbuf_puts(response_xml, "\""); + } + wrbuf_puts(response_xml, "/>"); + } + wrbuf_puts(response_xml, ""); + rr->extra_response_data = + odr_strdup(rr->stream, wrbuf_cstr(response_xml)); + wrbuf_destroy(response_xml); + } rr->hits = get_hit_count(rr->query); return 0; }