[asterisk-commits] qwell: branch qwell/fun_with_transports r388349 - in /team/qwell/fun_with_tra...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 10 12:12:07 CDT 2013


Author: qwell
Date: Fri May 10 12:12:06 2013
New Revision: 388349

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388349
Log:
Add wrlock to transport container.  Don't update transport on every message, since it won't change (and if it does, it's because sipml5 is broken, which needs to be worked around elsewhere)

Modified:
    team/qwell/fun_with_transports/res/res_sip/location.c
    team/qwell/fun_with_transports/res/res_sip_transport_websocket.c

Modified: team/qwell/fun_with_transports/res/res_sip/location.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/res/res_sip/location.c?view=diff&rev=388349&r1=388348&r2=388349
==============================================================================
--- team/qwell/fun_with_transports/res/res_sip/location.c (original)
+++ team/qwell/fun_with_transports/res/res_sip/location.c Fri May 10 12:12:06 2013
@@ -110,9 +110,7 @@
 {
 	struct ast_sip_contact_transport *ct;
 
-	if (!(ct = ao2_callback(contact_transports, 0, contact_transport_find_by_uri, (void *)contact_uri))) {
-		return NULL;
-	}
+	ct = ao2_callback(contact_transports, 0, contact_transport_find_by_uri, (void *)contact_uri);
 
 	return ct;
 }
@@ -121,9 +119,7 @@
 {
 	struct ast_sip_contact_transport *ct;
 
-	if (!(ct = ao2_callback(contact_transports, 0, contact_transport_find_by_transport, transport))) {
-		return NULL;
-	}
+	ct = ao2_callback(contact_transports, 0, contact_transport_find_by_transport, transport);
 
 	return ct;
 }
@@ -325,7 +321,7 @@
 		ao2_t_ref(contact_transports, -1, "Remove old scheduled qualifies");
 	}
 
-	contact_transports = ao2_t_container_alloc(CONTACT_TRANSPORTS_BUCKETS, NULL, NULL, "Create container for contact transports");
+	contact_transports = ao2_t_container_alloc_options(AO2_ALLOC_OPT_LOCK_RWLOCK, CONTACT_TRANSPORTS_BUCKETS, NULL, NULL, "Create container for contact transports");
 	if (!contact_transports) {
 		return -1;
 	}

Modified: team/qwell/fun_with_transports/res/res_sip_transport_websocket.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/fun_with_transports/res/res_sip_transport_websocket.c?view=diff&rev=388349&r1=388348&r2=388349
==============================================================================
--- team/qwell/fun_with_transports/res/res_sip_transport_websocket.c (original)
+++ team/qwell/fun_with_transports/res/res_sip_transport_websocket.c Fri May 10 12:12:06 2013
@@ -345,9 +345,7 @@
 
 		pjsip_uri_print(PJSIP_URI_IN_CONTACT_HDR, pjsip_uri_get_uri(contact_hdr->uri), contact_uri, sizeof(contact_uri));
 
-		if ((ct = ast_sip_location_retrieve_contact_transport_by_uri(contact_uri))) {
-			ct->transport = rdata->tp_info.transport;
-		} else {
+		if (!(ct = ast_sip_location_retrieve_contact_transport_by_uri(contact_uri))) {
 			if (!(ct = contact_transport_alloc())) {
 				return PJ_TRUE;
 			}




More information about the asterisk-commits mailing list