[Asterisk-code-review] Bug ASTERISK-25154. Dialog fromtag not updated by request wi... (asterisk[11])

Mark Michelson asteriskteam at digium.com
Wed Jun 10 09:56:59 CDT 2015


Mark Michelson has posted comments on this change.

Change subject: Bug ASTERISK-25154. Dialog fromtag not updated by request with auth
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

I only have one minor finding.

https://gerrit.asterisk.org/#/c/616/1/channels/chan_sip.c
File channels/chan_sip.c:

Line 9115: 				if (args.method != SIP_RESPONSE && args.authentication_present) {
         : 					/* If we have a request that uses athentication, the fromtag may
         : 					 * different from the original call dialog. So update the fromtag */
         : 					sip_pvt_lock(sip_pvt_ptr);
         : 					ast_string_field_set(sip_pvt_ptr, theirtag, args.fromtag);
         : 					sip_pvt_unlock(sip_pvt_ptr);
         : 				}
I think that you should only change sip_pvt_ptr->theirtag if args.fromtag does not match the current sip_pvt_ptr->theirtag. This is because of the way that string fields work under the hood. If requests with authentication arrive frequently during a dialog, setting sip_pvt_ptr->theirtag repeatedly can cause memory usage to increase more than we would like. By restricting this to only happening when the tag is different from what we have stored, we can avoid unnecessary memory growth.


-- 
To view, visit https://gerrit.asterisk.org/616
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I16534adef310303c59dd5989020f580d4305591c
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Damian Ivereigh <damo at launtel.net.au>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list