[asterisk-commits] rizzo: trunk r75894 - /trunk/main/acl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 19 07:38:13 CDT 2007


Author: rizzo
Date: Thu Jul 19 07:38:13 2007
New Revision: 75894

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75894
Log:
comment out some terribly expensive debugging code
in the body of ast_apply_ha()


Modified:
    trunk/main/acl.c

Modified: trunk/main/acl.c
URL: http://svn.digium.com/view/asterisk/trunk/main/acl.c?view=diff&rev=75894&r1=75893&r2=75894
==============================================================================
--- trunk/main/acl.c (original)
+++ trunk/main/acl.c Thu Jul 19 07:38:13 2007
@@ -206,12 +206,14 @@
 	/* Start optimistic */
 	int res = AST_SENSE_ALLOW;
 	while (ha) {
+#if 0	/* debugging code */
 		char iabuf[INET_ADDRSTRLEN];
 		char iabuf2[INET_ADDRSTRLEN];
 		/* DEBUG */
 		ast_copy_string(iabuf, ast_inet_ntoa(sin->sin_addr), sizeof(iabuf));
 		ast_copy_string(iabuf2, ast_inet_ntoa(ha->netaddr), sizeof(iabuf2));
 		ast_debug(1, "##### Testing %s with %s\n", iabuf, iabuf2);
+#endif
 		/* For each rule, if this address and the netmask = the net address
 		   apply the current rule */
 		if ((sin->sin_addr.s_addr & ha->netmask.s_addr) == ha->netaddr.s_addr)
@@ -332,7 +334,10 @@
 	int s;
 	struct sockaddr_in sin;
 	socklen_t slen;
-
+	static int prof = -1;
+	if (prof == -1)
+		prof = ast_add_profile("ast_ouraddrfor", 0); 
+	ast_mark(prof, 1);
 	s = socket(PF_INET, SOCK_DGRAM, 0);
 	if (s < 0) {
 		ast_log(LOG_WARNING, "Cannot create socket\n");
@@ -354,6 +359,7 @@
 	}
 	close(s);
 	*us = sin.sin_addr;
+	ast_mark(prof, 0);
 	return 0;
 }
 




More information about the asterisk-commits mailing list