+static void echo_extra_args(ODR stream,
+ Z_SRW_extra_arg *extra_args, char **extra_response)
+{
+ if (extra_args)
+ {
+ Z_SRW_extra_arg *a;
+ WRBUF response_xml = wrbuf_alloc();
+ wrbuf_puts(response_xml, "<extra>");
+ for (a = extra_args; a; a = a->next)
+ {
+ wrbuf_puts(response_xml, "<extra name=\"");
+ wrbuf_xmlputs(response_xml, a->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, "</extra>");
+ *extra_response = odr_strdup(stream, wrbuf_cstr(response_xml));
+ wrbuf_destroy(response_xml);
+ }
+
+}
+