]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 16 Apr 2008 21:29:08 +0000 (21:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 16 Apr 2008 21:29:08 +0000 (21:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8119 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index a27d7189cf9f46b540d80562d536be76413e4ed8..908b82817b46264a1816a9d344e802cbceb3f1ab 100644 (file)
@@ -1969,7 +1969,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown)
 
        while (mod_sofia_globals.threads) {
                switch_yield(1000);
-               if (++sanity >= 5000) {
+               if (++sanity >= 10000) {
                        break;
                }
        }
index ed2969eab4d7b8faf73ced99e23080538a180414..1af6e8ab01c1065ef6d4a2bc5aad76d6ef98aa98 100644 (file)
@@ -2345,28 +2345,28 @@ void sofia_glue_del_profile(sofia_profile_t *profile)
        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);
 }