Skip to content

Commit

Permalink
Properly propagate parameters with no value
Browse files Browse the repository at this point in the history
  • Loading branch information
vladpaiu committed Aug 19, 2014
1 parent 72028d2 commit a162072
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions modules/dialog/dlg_tophiding.c
Expand Up @@ -189,11 +189,17 @@ int dlg_replace_contact(struct sip_msg* msg, struct dlg_cell* dlg)
for (el=th_param_list;el;el=el->next) {
/* we just iterate over the unknown params */
for (i=0;i<ctu.u_params_no;i++) {
LM_INFO("ZZZ - found param [%.*s]=[%.*s]\n",ctu.u_name[i].len,ctu.u_name[i].s,ctu.u_val[i].len,ctu.u_val[i].s);
if (el->param_name.len == ctu.u_name[i].len &&
memcmp(el->param_name.s,ctu.u_name[i].s,
el->param_name.len) == 0)
suffix_len += ctu.u_name[i].len +
ctu.u_val[i].len + 2; /* ; and = */
(memcmp(el->param_name.s,ctu.u_name[i].s,
el->param_name.len) == 0)) {
if (ctu.u_val[i].len)
suffix_len += 1 /* ; */ + ctu.u_name[i].len +
ctu.u_val[i].len + 1; /* = and value */
else
suffix_len += 1 /* ; */ + ctu.u_name[i].len;
}

}
}
}
Expand Down Expand Up @@ -238,9 +244,11 @@ int dlg_replace_contact(struct sip_msg* msg, struct dlg_cell* dlg)
*p++ = ';';
memcpy(p,ctu.u_name[i].s,ctu.u_name[i].len);
p+=ctu.u_name[i].len;
*p++ = '=';
memcpy(p,ctu.u_val[i].s,ctu.u_val[i].len);
p+=ctu.u_val[i].len;
if (ctu.u_val[i].len) {
*p++ = '=';
memcpy(p,ctu.u_val[i].s,ctu.u_val[i].len);
p+=ctu.u_val[i].len;
}
}
}
}
Expand Down

0 comments on commit a162072

Please sign in to comment.