mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 23:28:09 +00:00
simplify creation of custom headers
This commit is contained in:
parent
60f6726c61
commit
519430c42e
1 changed files with 2 additions and 4 deletions
|
|
@ -800,16 +800,14 @@ int sal_auth_compute_ha1(const char* userid,const char* realm,const char* passwo
|
|||
SalCustomHeader *sal_custom_header_append(SalCustomHeader *ch, const char *name, const char *value){
|
||||
belle_sip_message_t *msg=(belle_sip_message_t*)ch;
|
||||
belle_sip_header_t *h;
|
||||
char *tmp=ms_strdup_printf("%s: %s\r\n",name,value);
|
||||
|
||||
if (msg==NULL){
|
||||
msg=(belle_sip_message_t*)belle_sip_request_new();
|
||||
belle_sip_object_ref(msg);
|
||||
}
|
||||
h=belle_sip_header_parse(tmp);
|
||||
ms_free(tmp);
|
||||
h=belle_sip_header_create(name,value);
|
||||
if (h==NULL){
|
||||
belle_sip_error("Fail to parse extension header.");
|
||||
belle_sip_error("Fail to parse custom header.");
|
||||
return (SalCustomHeader*)msg;
|
||||
}
|
||||
belle_sip_message_add_header(msg,h);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue