]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3313 --resolve Come To ClueCon 2011 http://www.cluecon.com
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 27 May 2011 14:51:05 +0000 (09:51 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 27 May 2011 14:51:05 +0000 (09:51 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index be24a00d98cf7dd3f8516fa470aa1c5075a9023d..329db32582deee1464834238b3c5724558996a04 100644 (file)
@@ -1326,6 +1326,10 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
                                        (statements == 0 || (statements <= 1024 && (switch_micro_time_now() - last_commit)/1000 < profile->trans_timeout)))) {
                                
                                switch_interval_time_t sleepy_time = !statements ? 1000000 : switch_micro_time_now() - last_commit - profile->trans_timeout*1000;
+
+                               if (sleepy_time < 1000 || sleepy_time > 1000000) {
+                                       sleepy_time = 1000;
+                               }
                                
                                if (sql || (switch_queue_pop_timeout(profile->sql_queue, &pop, sleepy_time) == SWITCH_STATUS_SUCCESS && pop)) {
                                        switch_size_t newlen;