Commit 3ca67669 authored by jehan's avatar jehan
Browse files

implement escaped version of replace header

parent 4b2cf2c1
......@@ -654,11 +654,10 @@ void belle_sip_util_copy_headers(belle_sip_message_t *orig, belle_sip_message_t
int belle_sip_get_char (const char*a,int n,char*out) {
char result;
char tmp[3];
unsigned int tmp;
if (*a=='%' && n>2) {
memcpy(tmp,a+1,sizeof(tmp)-1);
tmp[sizeof(tmp)-1]='\0';
*out=(char)((atoi(tmp)*16)/10); /*convert to hexa*/;
sscanf(a+1,"%02x",&tmp);
*out=(char)tmp;
return 3;
} else {
*out=*a;
......
......@@ -606,7 +606,7 @@ void test_header_replaces(void) {
}
void test_header_replaces_escaped(void) {
/* belle_sip_header_replaces_t* L_tmp;
belle_sip_header_replaces_t* L_tmp;
belle_sip_header_replaces_t* L_replaces = belle_sip_header_replaces_create2("12345%40192.168.118.3%3Bto-tag%3D12345%3Bfrom-tag%3D5FFE-3994");
char* l_raw_header = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_replaces));
belle_sip_object_unref(BELLE_SIP_OBJECT(L_replaces));
......@@ -618,7 +618,7 @@ void test_header_replaces_escaped(void) {
CU_ASSERT_STRING_EQUAL(belle_sip_header_replaces_get_call_id(L_replaces), "12345@192.168.118.3");
CU_ASSERT_STRING_EQUAL(belle_sip_header_replaces_get_from_tag(L_replaces), "5FFE-3994");
CU_ASSERT_STRING_EQUAL(belle_sip_header_replaces_get_to_tag(L_replaces), "12345");
belle_sip_object_unref(BELLE_SIP_OBJECT(L_replaces));*/
belle_sip_object_unref(BELLE_SIP_OBJECT(L_replaces));
}
int belle_sip_headers_test_suite() {
......
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