[asterisk-commits] pcadach: branch 1.4 r43626 - in /branches/1.4/channels: ./ h323/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Sep 25 13:28:22 MST 2006


Author: pcadach
Date: Mon Sep 25 15:28:21 2006
New Revision: 43626

URL: http://svn.digium.com/view/asterisk?rev=43626&view=rev
Log:
Backport changes of trunk:
1) r43540: Avoid possible deadlock on channel destruction
2) r43590: Disable fastStart if requested by remote side

Modified:
    branches/1.4/channels/chan_h323.c
    branches/1.4/channels/h323/ast_h323.cxx

Modified: branches/1.4/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_h323.c?rev=43626&r1=43625&r2=43626&view=diff
==============================================================================
--- branches/1.4/channels/chan_h323.c (original)
+++ branches/1.4/channels/chan_h323.c Mon Sep 25 15:28:21 2006
@@ -2442,34 +2442,36 @@
 			h323_do_reload();
 		}
 		/* Check for interfaces needing to be killed */
-		ast_mutex_lock(&iflock);
+		if (!ast_mutex_trylock(&iflock)) {
 #if 1
-		do {
-			for (oh323 = iflist; oh323; oh323 = oh323->next) {
+			do {
+				for (oh323 = iflist; oh323; oh323 = oh323->next) {
+					if (!ast_mutex_trylock(&oh323->lock)) {
+						if (oh323->needdestroy) {
+							__oh323_destroy(oh323);
+							break;
+						}
+						ast_mutex_unlock(&oh323->lock);
+					}
+				}
+			} while (/*oh323*/ 0);
+#else
+restartsearch:
+			oh323 = iflist;
+			while(oh323) {
 				if (!ast_mutex_trylock(&oh323->lock)) {
 					if (oh323->needdestroy) {
 						__oh323_destroy(oh323);
-						break;
+						goto restartsearch;
 					}
 					ast_mutex_unlock(&oh323->lock);
+					oh323 = oh323->next;
 				}
 			}
-		} while (/*oh323*/ 0);
-#else
-restartsearch:
-		oh323 = iflist;
-		while(oh323) {
-			if (!ast_mutex_trylock(&oh323->lock)) {
-				if (oh323->needdestroy) {
-					__oh323_destroy(oh323);
-					goto restartsearch;
-				}
-				ast_mutex_unlock(&oh323->lock);
-				oh323 = oh323->next;
-			}
-		}
 #endif
-		ast_mutex_unlock(&iflock);
+			ast_mutex_unlock(&iflock);
+		} else
+			oh323 = (struct oh323_pvt *)1;	/* Force fast loop */
 		pthread_testcancel();
 		/* Wait for sched or io */
 		res = ast_sched_wait(sched);

Modified: branches/1.4/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/h323/ast_h323.cxx?rev=43626&r1=43625&r2=43626&view=diff
==============================================================================
--- branches/1.4/channels/h323/ast_h323.cxx (original)
+++ branches/1.4/channels/h323/ast_h323.cxx Mon Sep 25 15:28:21 2006
@@ -37,6 +37,7 @@
 #include <ptlib.h>
 #include <h323.h>
 #include <h323pdu.h>
+#include <h323neg.h>
 #include <mediafmt.h>
 #include <lid.h>
 
@@ -1105,6 +1106,14 @@
 
 	SetCallOptions(res, TRUE);
 
+	/* Disable fastStart if requested by remote side */
+	if (h245Tunneling && !setupPDU.m_h323_uu_pdu.m_h245Tunneling) {
+		masterSlaveDeterminationProcedure->Stop();
+		capabilityExchangeProcedure->Stop();
+		PTRACE(3, "H225\tFast Start DISABLED!");
+		h245Tunneling = FALSE;
+	}
+
 	return H323Connection::OnReceivedSignalSetup(setupPDU);
 }
 



More information about the asterisk-commits mailing list