From: Dragos Oancea Date: Fri, 30 Apr 2021 14:13:15 +0000 (+0000) Subject: [mod_http_cache] fix race cond at shutdown X-Git-Tag: v1.10.7^2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8413bb77c104711a52cc4da0ce54581fed5c983;p=thirdparty%2Ffreeswitch.git [mod_http_cache] fix race cond at shutdown --- diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.c b/src/mod/applications/mod_http_cache/mod_http_cache.c index 3e6d1b0fa8..d6f4fb6ed8 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.c +++ b/src/mod/applications/mod_http_cache/mod_http_cache.c @@ -781,7 +781,7 @@ static char *url_cache_get(url_cache_t *cache, http_profile_t *profile, switch_c switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Waiting for URL %s to be available\n", url); u->waiters++; url_cache_unlock(cache, session); - while(u->status == CACHED_URL_RX_IN_PROGRESS && switch_time_now() < (u->download_time + download_timeout_ns)) { + while(!gcache.shutdown && u->status == CACHED_URL_RX_IN_PROGRESS && switch_time_now() < (u->download_time + download_timeout_ns)) { switch_sleep(10 * 1000); /* 10 ms */ } url_cache_lock(cache, session);