Merge "pjsip: Add patch to allow all transports to be destroyed."
This commit is contained in:
commit
69d12bcf3e
27
third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch
vendored
Normal file
27
third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch
vendored
Normal file
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
Loading…
Reference in New Issue