Skip to content

Commit

Permalink
modules/lcr: delete possible earlier ruri_user_avp value
Browse files Browse the repository at this point in the history
  when calling next_gws() first time after reload_gws()
- Credits to Yasin Caner
  • Loading branch information
juha-h committed Dec 4, 2015
1 parent 299d2f7 commit d899189
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/lcr/lcr_mod.c
Expand Up @@ -2409,10 +2409,9 @@ void ping_timer(unsigned int ticks, void* param)
* transport parts of R-URI based on first gw_uri_avp value, which is then
* destroyed. Saves R-URI user to ruri_user_avp for later use.
*
* On other calls, rewrites R-URI, where scheme, host, port,
* and transport of URI are taken from the first gw_uri_avp value,
* which is then destroyed. URI user is taken either from ruri_user_avp
* value saved earlier.
* On other calls, rewrites R-URI, where scheme, host, port, and
* transport of URI are taken from the first gw_uri_avp value, which is then
* destroyed. URI user is taken from ruri_user_avp value saved earlier.
*
* Returns 1 upon success and -1 upon failure.
*/
Expand Down Expand Up @@ -2451,6 +2450,7 @@ static int next_gw(struct sip_msg* _m, char* _s1, char* _s2)
/* Save Request-URI user into uri_user_avp for use in subsequent
* invocations. */

delete_avp(ruri_user_avp_type|AVP_VAL_STR, ruri_user_avp);
val.s = _m->parsed_uri.user;
add_avp(ruri_user_avp_type|AVP_VAL_STR, ruri_user_avp, val);
LM_DBG("added ruri_user_avp <%.*s>\n", val.s.len, val.s.s);
Expand Down

1 comment on commit d899189

@ycaner06
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i couldnt explain situation. with this commit dont change anything because this braces only work if ru_avp is null. so ruri_avps already filled first load_gws.
i think we need to add this delete_avp to line 2044 before add_gws_into_avps function in load_gws.

Please sign in to comment.