[Asterisk-code-review] res pjsip outbound registration.c: Fix handle client state d... (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Jun 24 18:08:10 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: res_pjsip_outbound_registration.c: Fix handle_client_state_destruction() refs
......................................................................


Patch Set 1:

(4 comments)

https://gerrit.asterisk.org/#/c/707/1/res/res_pjsip_outbound_registration.c
File res/res_pjsip_outbound_registration.c:

Line 681: 
        : 
> This debug message has been lost in the refactor.
This message must be removed.  It was a ticking time bomb because client_state->client could become a dangling pointer to freed memory outside of the serializer thread.  This patch now sets client_state->client to NULL in handle_client_state_destruction() when it is destroyed.


Line 229: 	[SIP_REGISTRATION_STOPPING] = "Stopped",
> Should this be "Stopping" instead of "Stopped"?
Josh already asked about this on the v13 review.  In the v13 review it was a concern about AMI compatibility.  In master it is less so but it would need an AMI version bump.


Line 694: 	struct registration_response *response = data;
> In a lot of cases, it's a matter of personal taste whether to use RAII_VAR 
I had to remove it in an earlier version of the patch because I needed to control when the unref happened.  Once I removed it I didn't want to put it back.


Line 719: 			if (registration_client_send(response->client_state, tdata) == PJ_SUCCESS) {
        : 				ao2_ref(response, -1);
        : 				return 0;
        : 			}
> Why does control continue in this function on an unsuccessful registration 
It must continue in case the module is unloading.  The client_state->destroy flag could be set.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7b446d8644b6b4550ef5bea49527671de65183f
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list