Commit 78416d1e authored by Pekka Pessi's avatar Pekka Pessi

utils/sip-options.c: fixed output of unkown headers.

darcs-hash:20070130230312-65a35-f8759b2123ca900aba77e5b19eab0e632cd00981.gz
parent 2a88715e
...@@ -331,7 +331,7 @@ int main(int argc, char *argv[]) ...@@ -331,7 +331,7 @@ int main(int argc, char *argv[])
return context->c_retval; return context->c_retval;
} }
/** Handle responses to registration request */ /** Handle responses to OPTIONS request */
static static
int response_to_options(context_t *context, int response_to_options(context_t *context,
nta_outgoing_t *oreq, nta_outgoing_t *oreq,
...@@ -355,12 +355,16 @@ int response_to_options(context_t *context, ...@@ -355,12 +355,16 @@ int response_to_options(context_t *context,
sip_is_content_length(h)) sip_is_content_length(h))
continue; continue;
} }
if (h->sh_class->hc_name) {
snprintf(hname, sizeof hname, "%s: %%s\n", h->sh_class->hc_name); if (h->sh_class->hc_name == NULL) {
sl_header_print(stdout, hname, h); sl_header_print(stdout, NULL, h);
}
else if (h->sh_class->hc_name[0] == '\0') {
sl_header_print(stdout, "%s\n", h);
} }
else { else {
sl_header_print(stdout, NULL, h); snprintf(hname, sizeof hname, "%s: %%s\n", h->sh_class->hc_name);
sl_header_print(stdout, hname, h);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment