Skip to content

Commit

Permalink
core: parser - use case insensitive comparison to get header by name
Browse files Browse the repository at this point in the history
- same for next sibling header
- GH #1217

(cherry picked from commit 4072b0f)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent f05b6bc commit 672ea36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/parser/msg_parser.c
Expand Up @@ -958,7 +958,7 @@ hdr_field_t* get_hdr_by_name(const sip_msg_t* const msg, const char* const name,

for(hdr = msg->headers; hdr; hdr = hdr->next) {
if(hdr->name.len == name_len && *hdr->name.s==*name
&& strncmp(hdr->name.s, name, name_len)==0)
&& strncasecmp(hdr->name.s, name, name_len)==0)
return hdr;
}
return NULL;
Expand All @@ -971,7 +971,7 @@ hdr_field_t* next_sibling_hdr_by_name(const hdr_field_t* const hf)

for(hdr = hf->next; hdr; hdr = hdr->next) {
if(hdr->name.len == hf->name.len && *hdr->name.s==*hf->name.s
&& strncmp(hdr->name.s, hf->name.s, hf->name.len)==0)
&& strncasecmp(hdr->name.s, hf->name.s, hf->name.len)==0)
return hdr;
}
return NULL;
Expand Down

0 comments on commit 672ea36

Please sign in to comment.