[svn-commits] russell: branch 1.6.2 r275469 - in /branches/1.6.2: ./ channels/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 10 10:11:07 CDT 2010


Author: russell
Date: Sat Jul 10 10:11:01 2010
New Revision: 275469

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275469
Log:
Merged revisions 245192 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r245192 | mmichelson | 2010-02-06 08:43:03 -0600 (Sat, 06 Feb 2010) | 21 lines
  
  Remove useless sip options related to hash table size.
  
  First off, these options weren't actually doing anything.
  By the time the options were parsed, the peer and dialog
  containers had already been allocated with their default
  values.
  
  Second, hash table size is something that doesn't really
  make sense to change in a config file. If a user is that
  interested in changing the hashtable size, he can modify
  the source itself.
  
  I have removed the parsing of the hash_peer, hash_user,
  and hash_dialog options. I have removed the hash_user_size
  variable altogether since it is not used at all. I also
  changed hash_peer_size and hash_dialog_size to be constant,
  and have changed the symbols to be in all caps as constants
  typically are. I have also removed the entire section in
  sip.conf.sample regarding configurable hashtable sizes.
........

(merge to 1.6.2 inspired by issue #17553)

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_sip.c
    branches/1.6.2/configs/sip.conf.sample

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-blocked' - no diff available.

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=275469&r1=275468&r2=275469
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Sat Jul 10 10:11:01 2010
@@ -2004,18 +2004,13 @@
 };
 
 /* --- Hash tables of various objects --------*/
-
 #ifdef LOW_MEMORY
-static int hash_peer_size = 17;
-static int hash_dialog_size = 17;
-static int hash_user_size = 17;
+static const int HASH_PEER_SIZE = 17;
+static const int HASH_DIALOG_SIZE = 17;
 #else
-static int hash_peer_size = 563;	/*!< Size of peer hash table, prime number preferred! */
-static int hash_dialog_size = 563;
-static int hash_user_size = 563;
+static const int HASH_PEER_SIZE = 563;	/*!< Size of peer hash table, prime number preferred! */
+static const int HASH_DIALOG_SIZE = 563;
 #endif
-
-/*! \brief  The table of TCP threads */
 static struct ao2_container *threadt;
 
 /*! \brief  The peer list: Users, Peers and Friends */
@@ -24998,27 +24993,6 @@
 			} else {
 				ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config);
 			}
-		} else if (!strcasecmp(v->name, "hash_user")) {
-			int i;
-			if (sscanf(v->value, "%30d", &i) == 1 && i > 2) {
-				hash_user_size = i;
-			} else {
-				ast_log(LOG_WARNING, "Invalid hash_user size '%s' at line %d of %s -- should be much larger than 2\n", v->value, v->lineno, config);
-			}
-		} else if (!strcasecmp(v->name, "hash_peer")) {
-			int i;
-			if (sscanf(v->value, "%30d", &i) == 1 && i > 2) {
-				hash_peer_size = i;
-			} else {
-				ast_log(LOG_WARNING, "Invalid hash_peer size '%s' at line %d of %s -- should be much larger than 2\n", v->value, v->lineno, config);
-			}
-		} else if (!strcasecmp(v->name, "hash_dialog")) {
-			int i;
-			if (sscanf(v->value, "%30d", &i) == 1 && i > 2) {
-				hash_dialog_size = i;
-			} else {
-				ast_log(LOG_WARNING, "Invalid hash_dialog size '%s' at line %d of %s -- should be much larger than 2\n", v->value, v->lineno, config);
-			}
 		} else if (!strcasecmp(v->name, "qualify")) {
 			if (!strcasecmp(v->value, "no")) {
 				default_qualify = 0;
@@ -25905,10 +25879,10 @@
 	ast_verbose("SIP channel loading...\n");
 	/* the fact that ao2_containers can't resize automatically is a major worry! */
 	/* if the number of objects gets above MAX_XXX_BUCKETS, things will slow down */
-	peers = ao2_t_container_alloc(hash_peer_size, peer_hash_cb, peer_cmp_cb, "allocate peers");
-	peers_by_ip = ao2_t_container_alloc(hash_peer_size, peer_iphash_cb, peer_ipcmp_cb, "allocate peers_by_ip");
-	dialogs = ao2_t_container_alloc(hash_dialog_size, dialog_hash_cb, dialog_cmp_cb, "allocate dialogs");
-	threadt = ao2_t_container_alloc(hash_dialog_size, threadt_hash_cb, threadt_cmp_cb, "allocate threadt table");
+	peers = ao2_t_container_alloc(HASH_PEER_SIZE, peer_hash_cb, peer_cmp_cb, "allocate peers");
+	peers_by_ip = ao2_t_container_alloc(HASH_PEER_SIZE, peer_iphash_cb, peer_ipcmp_cb, "allocate peers_by_ip");
+	dialogs = ao2_t_container_alloc(HASH_DIALOG_SIZE, dialog_hash_cb, dialog_cmp_cb, "allocate dialogs");
+	threadt = ao2_t_container_alloc(HASH_DIALOG_SIZE, threadt_hash_cb, threadt_cmp_cb, "allocate threadt table");
 	
 	ASTOBJ_CONTAINER_INIT(&regl); /* Registry object list -- not searched for anything */
 	ASTOBJ_CONTAINER_INIT(&submwil); /* MWI subscription object list */

Modified: branches/1.6.2/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/configs/sip.conf.sample?view=diff&rev=275469&r1=275468&r2=275469
==============================================================================
--- branches/1.6.2/configs/sip.conf.sample (original)
+++ branches/1.6.2/configs/sip.conf.sample Sat Jul 10 10:11:01 2010
@@ -381,20 +381,6 @@
 ;session-minse=90
 ;session-refresher=uas
 ;
-;--------------------------- HASH TABLE SIZES ------------------------------------------------
-; For maximum efficiency, adjust the following
-; values to be slightly larger than the maximum number of in-memory objects (devices).
-; Too large, and space is wasted. Too small, and things will run slower.
-; 563 is probably way too big for small (home) applications, but it
-; should cover most small/medium sites.
-; It is recommended to make the sizes be a prime number!
-; This was internally set to 17 for small-memory applications...
-; All tables default to 563, except when compiled in LOW_MEMORY mode,
-; in which case, they default to 17. You can override this by uncommenting
-; the following, and changing the values.
-;hash_users=563
-;hash_peers=563
-;hash_dialogs=563
 
 ;--------------------------- SIP DEBUGGING ---------------------------------------------------
 ;sipdebug = yes                 ; Turn on SIP debugging by default, from




More information about the svn-commits mailing list