[asterisk-commits] russell: trunk r56731 - /trunk/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Feb 25 17:37:04 MST 2007


Author: russell
Date: Sun Feb 25 18:37:03 2007
New Revision: 56731

URL: http://svn.digium.com/view/asterisk?view=rev&rev=56731
Log:
There is no need to look in the iaxs array for the pvt struct when we already
have a pointer to it.

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=56731&r1=56730&r2=56731
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Sun Feb 25 18:37:03 2007
@@ -1169,7 +1169,7 @@
 #define NEW_ALLOW 	1
 #define NEW_FORCE 	2
 
-static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, struct chan_iax2_pvt *cur)
+static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur)
 {
 	if ((cur->addr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
 		(cur->addr.sin_port == sin->sin_port)) {
@@ -1298,7 +1298,7 @@
 		AST_RWLIST_RDLOCK(&pvt_hash_tbl[hash]);
 		AST_RWLIST_TRAVERSE(&pvt_hash_tbl[hash], pvt, entry) {
 			ast_mutex_lock(&iaxsl[pvt->callno]);
-			if (match(sin, callno, dcallno, iaxs[pvt->callno]))
+			if (match(sin, callno, dcallno, pvt))
 				res = pvt->callno;
 			ast_mutex_unlock(&iaxsl[pvt->callno]);
 			if (res > 0)



More information about the asterisk-commits mailing list