[Asterisk-code-review] res rtp asterisk: Prevent simultaneous access to DTLS SSL co... (asterisk[11])
Matt Jordan
asteriskteam at digium.com
Mon Jul 6 07:37:57 CDT 2015
Matt Jordan has posted comments on this change.
Change subject: res_rtp_asterisk: Prevent simultaneous access to DTLS SSL context.
......................................................................
Patch Set 1:
(3 comments)
https://gerrit.asterisk.org/#/c/786/1/res/res_rtp_asterisk.c
File res/res_rtp_asterisk.c:
Line 1767:
: dtls->timeout_timer = -1;
If we aren't -1, that would imply that we scheduled something with ast_sched_add. Why would we not attempt to cancel that here, instead of overwriting the ID?
Line 1802: ast_mutex_lock(&dtls->lock);
:
: if (DTLSv1_get_timeout(dtls->ssl, &dtls_timeout)) {
Since the timer code is relatively tricky, I'd add an assert in here that dtls->timeout_timer == -1. That way, if some condition exists where we start a timer twice, we'll catch it.
Line 1823: ast_mutex_lock(&dtls->lock);
: AST_SCHED_DEL_UNREF(rtp->sched, dtls->timeout_timer, ao2_ref(instance, -1));
: ast_mutex_unlock(&dtls->lock);
I'd add an assert in here that dtls->timeout_timer != -1, for the same reasons in the start_timeout_timer routine.
--
To view, visit https://gerrit.asterisk.org/786
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib75ea2546f29d6efc3d2d37c58df6986c7bd9b91
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes
More information about the asterisk-code-review
mailing list