[Asterisk-code-review] chan sip: Address runaway when realtime peers subscribe to ... (asterisk[13])

Corey Farrell asteriskteam at digium.com
Thu Sep 22 10:22:48 CDT 2016


Corey Farrell has posted comments on this change.

Change subject: chan_sip:  Address runaway when realtime peers subscribe to mailboxes
......................................................................


Patch Set 2: Code-Review-1

(3 comments)

https://gerrit.asterisk.org/#/c/3962/2/channels/chan_sip.c
File channels/chan_sip.c:

Line 5214: 	if (AST_LIST_EMPTY(&peer->mailboxes)) {
This check is unneeded and sketchy without locking peer anyways.  If the list is empty we'll find that out from REMOVE_MAILBOX_WITH_LOCKED_PEER returning NULL.


Line 31724: 			if (regseconds > 0 && ((nowtime - regseconds) > 0)) {
I'm not sure why this is being done, can we get a comment in the commit message about it?


https://gerrit.asterisk.org/#/c/3962/2/channels/sip/include/sip.h
File channels/sip/include/sip.h:

Line 1250: 	struct sip_peer *peer;
Could you swap the order of status and peer?  If enum is smaller storage than a pointer this could leave empty space between status and peer to keep peer aligned to sizeof(void*).  I don't think the compiler would try to align 'id' since it's a char.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I07519ef7f092629e1e844f855abd279d6475cdd0
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list