[asterisk-commits] tilghman: trunk r154366 - in /trunk: ./ channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 4 14:51:18 CST 2008


Author: tilghman
Date: Tue Nov  4 14:51:18 2008
New Revision: 154366

URL: http://svn.digium.com/view/asterisk?view=rev&rev=154366
Log:
Merged revisions 154365 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r154365 | tilghman | 2008-11-04 14:49:33 -0600 (Tue, 04 Nov 2008) | 9 lines
  
  On busy systems, it's possible for the values checked within a single line
  of code to change, unless the structure is locked to ensure a consistent
  state.
  (closes issue #13717)
   Reported by: kowalma
   Patches: 
         20081102__bug13717.diff.txt uploaded by Corydon76 (license 14)
   Tested by: kowalma
........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_iax2.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=154366&r1=154365&r2=154366
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Tue Nov  4 14:51:18 2008
@@ -1785,11 +1785,20 @@
 
 		/* This will occur on the first response to a message that we initiated,
 		 * such as a PING. */
+		if (dcallno) {
+			ast_mutex_lock(&iaxsl[dcallno]);
+		}
 		if (callno && dcallno && iaxs[dcallno] && !iaxs[dcallno]->peercallno && match(sin, callno, dcallno, iaxs[dcallno], check_dcallno)) {
 			iaxs[dcallno]->peercallno = callno;
 			res = dcallno;
 			store_by_peercallno(iaxs[dcallno]);
+			if (!res || !return_locked) {
+				ast_mutex_unlock(&iaxsl[dcallno]);
+			}
 			return res;
+		}
+		if (dcallno) {
+			ast_mutex_unlock(&iaxsl[dcallno]);
 		}
 
 #ifdef IAX_OLD_FIND




More information about the asterisk-commits mailing list