|
@@ -4509,12 +4509,13 @@ static void reap_curl(struct pool *pool)
|
|
|
{
|
|
{
|
|
|
struct curl_ent *ent, *iter;
|
|
struct curl_ent *ent, *iter;
|
|
|
struct timeval now;
|
|
struct timeval now;
|
|
|
|
|
+ int reaped = 0;
|
|
|
|
|
|
|
|
gettimeofday(&now, NULL);
|
|
gettimeofday(&now, NULL);
|
|
|
mutex_lock(&pool->pool_lock);
|
|
mutex_lock(&pool->pool_lock);
|
|
|
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
|
|
list_for_each_entry_safe(ent, iter, &pool->curlring, node) {
|
|
|
if (now.tv_sec - ent->tv.tv_sec > 60) {
|
|
if (now.tv_sec - ent->tv.tv_sec > 60) {
|
|
|
- applog(LOG_DEBUG, "Reaped curl %d from pool %d", pool->curls, pool->pool_no);
|
|
|
|
|
|
|
+ reaped++;
|
|
|
pool->curls--;
|
|
pool->curls--;
|
|
|
list_del(&ent->node);
|
|
list_del(&ent->node);
|
|
|
curl_easy_cleanup(ent->curl);
|
|
curl_easy_cleanup(ent->curl);
|
|
@@ -4522,6 +4523,8 @@ static void reap_curl(struct pool *pool)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
mutex_unlock(&pool->pool_lock);
|
|
mutex_unlock(&pool->pool_lock);
|
|
|
|
|
+ if (reaped)
|
|
|
|
|
+ applog(LOG_DEBUG, "Reaped %d curl%s from pool %d", reaped, reaped > 1 ? "s" : "", pool->pool_no);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void *watchpool_thread(void __maybe_unused *userdata)
|
|
static void *watchpool_thread(void __maybe_unused *userdata)
|