[Freeswitch-svn] [commit] r8119 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Wed Apr 16 17:29:08 EDT 2008


Author: anthm
Date: Wed Apr 16 17:29:08 2008
New Revision: 8119

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c

Log:
tweak

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Wed Apr 16 17:29:08 2008
@@ -1969,7 +1969,7 @@
 
 	while (mod_sofia_globals.threads) {
 		switch_yield(1000);
-		if (++sanity >= 5000) {
+		if (++sanity >= 10000) {
 			break;
 		}
 	}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	Wed Apr 16 17:29:08 2008
@@ -2345,28 +2345,28 @@
 	sofia_profile_t *pptr;
 	
 	switch_mutex_lock(mod_sofia_globals.hash_mutex);
-
-	for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
-		switch_hash_this(hi, &var, NULL, &val);
-		if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
-			aliases[i++] = strdup((char *) var);
-			if (i == 512) {
-				abort();
+	if (mod_sofia_globals.profile_hash) {
+		for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+			switch_hash_this(hi, &var, NULL, &val);
+			if ((pptr = (sofia_profile_t *) val) && pptr == profile) {
+				aliases[i++] = strdup((char *) var);
+				if (i == 512) {
+					abort();
+				}
 			}
 		}
-	}
 
-	for (j = 0; j < i && j < 512; j++) {
-		switch_core_hash_delete(mod_sofia_globals.profile_hash, aliases[j]);
-		free(aliases[j]);
-	}
+		for (j = 0; j < i && j < 512; j++) {
+			switch_core_hash_delete(mod_sofia_globals.profile_hash, aliases[j]);
+			free(aliases[j]);
+		}
 
-	for (gp = profile->gateways; gp; gp = gp->next) {
-		switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->name);
-		switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_from);
-		switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_contact);
+		for (gp = profile->gateways; gp; gp = gp->next) {
+			switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->name);
+			switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_from);
+			switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_contact);
+		}
 	}
-
 	switch_mutex_unlock(mod_sofia_globals.hash_mutex);
 }
 



More information about the Freeswitch-svn mailing list