[Asterisk-code-review] pjsip: Add patch to allow all transports to be destroyed. (asterisk[15])

Joshua Colp asteriskteam at digium.com
Tue Nov 14 09:11:30 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/7174 )

Change subject: pjsip: Add patch to allow all transports to be destroyed.
......................................................................

pjsip: Add patch to allow all transports to be destroyed.

If a transport is created with the same transport type, source
IP address, and source port as one that already exists the old
transport is moved into a linked list called "tp_list".

If this old transport is later shutdown it will not be destroyed
as the process checks whether the transport is valid or not. This
check does not look at the "tp_list" when making the determination
causing the transport to not be destroyed.

This change updates the logic to query not just the main storage
method for transports but also the "tp_list".

Upstream issue https://trac.pjsip.org/repos/ticket/2061

ASTERISK-27411

Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429
---
A third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch
1 file changed, 27 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Joshua Colp: Approved for Submit



diff --git a/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch b/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch
new file mode 100644
index 0000000..e42b0f7
--- /dev/null
+++ b/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch
@@ -0,0 +1,27 @@
+diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c
+index e4bec24..a39b56e 100644
+--- a/pjsip/src/pjsip/sip_transport.c
++++ b/pjsip/src/pjsip/sip_transport.c
+@@ -957,7 +957,21 @@ static pj_bool_t is_transport_valid(pjsip_tpmgr *tpmgr, pjsip_transport *tp,
+ 				    const pjsip_transport_key *key,
+ 				    int key_len)
+ {
+-    return (pj_hash_get(tpmgr->table, key, key_len, NULL) == (void*)tp);
++    transport *tp_iter;
++
++    if (pj_hash_get(tpmgr->table, key, key_len, NULL) == (void*)tp) {
++        return PJ_TRUE;
++    }
++
++    tp_iter = tpmgr->tp_list.next;
++    while (tp_iter != &tpmgr->tp_list) {
++        if (tp_iter->tp == tp) {
++            return PJ_TRUE;
++        }
++        tp_iter = tp_iter->next;
++    }
++
++    return PJ_FALSE;
+ }
+ 
+ /*

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429
Gerrit-Change-Number: 7174
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171114/e549a1b0/attachment.html>


More information about the asterisk-code-review mailing list