[asterisk-commits] mmichelson: branch group/CCSS r222550 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 7 13:13:16 CDT 2009


Author: mmichelson
Date: Wed Oct  7 13:13:13 2009
New Revision: 222550

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=222550
Log:
Early check if the request will exceed the limit.

This may be taken out later, since the check is done
very early in the process. We'll just have to see when
review time comes along.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=222550&r1=222549&r2=222550
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Oct  7 13:13:13 2009
@@ -709,6 +709,17 @@
 	struct ast_cc_tree_item *tree_item;
 	struct ast_datastore *dial_cc_datastore;
 
+	/*XXX This may be a bit controversial. In an attempt to not allocate
+	 * extra resources, I make sure that a future request will be within
+	 * limits. The problem here is that it is reasonable to think that
+	 * even if we're not within the limits at this point, we may be by
+	 * the time the requestor will have made his request. This may be
+	 * deleted at some point.
+	 */
+	if (!ast_cc_request_within_limits()) {
+		return 0;
+	}
+
 	if (!(interfaces = ast_calloc(1, sizeof(*interfaces)))) {
 		return -1;
 	}




More information about the asterisk-commits mailing list