Skip to content

Commit

Permalink
core: wrapper function to reset avps/xavps from msg environment
Browse files Browse the repository at this point in the history
- use it to clean after processing received msg

(cherry picked from commit 46ea6b0)
(cherry picked from commit 5add6c4)
  • Loading branch information
miconda committed Jun 13, 2017
1 parent d81926d commit 3db2381
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
22 changes: 13 additions & 9 deletions receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
#ifdef STATS
skipped = 0;
#endif
/* free possible loaded avps -bogdan */
reset_avps();
#ifdef WITH_XAVP
xavp_reset_list();
#endif
ksr_msg_env_reset();
LM_DBG("cleaning up\n");
free_sip_msg(msg);
pkg_free(msg);
Expand All @@ -344,13 +340,21 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info)
free_sip_msg(msg);
pkg_free(msg);
error00:
reset_avps();
#ifdef WITH_XAVP
xavp_reset_list();
#endif
ksr_msg_env_reset();
STATS_RX_DROPS;
/* reset log prefix */
log_prefix_set(NULL);
return -1;
}

/**
* clean up msg environment, such as avp and xavp lists
*/
void ksr_msg_env_reset(void)
{
reset_avps();
#ifdef WITH_XAVP
xavp_reset_list();
#endif

}
1 change: 1 addition & 0 deletions receive.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@

int receive_msg(char* buf, unsigned int len, struct receive_info *ri);
unsigned int inc_msg_no(void);
void ksr_msg_env_reset(void);

#endif

0 comments on commit 3db2381

Please sign in to comment.