(libT) prevent possible oscillation in paused_easy_handles reported by vipjml in bug #1079 comment:27

This commit is contained in:
Jordan Lee 2013-04-28 00:06:22 +00:00
parent de6e408a66
commit 68665b939d
1 changed files with 8 additions and 1 deletions

View File

@ -432,7 +432,14 @@ tr_webThreadFunc (void * vsession)
if (paused_easy_handles != NULL)
{
CURL * handle;
while ((handle = tr_list_pop_front (&paused_easy_handles)))
tr_list * tmp;
/* swap paused_easy_handles to prevent oscillation
between writeFunc this while loop */
tmp = paused_easy_handles;
paused_easy_handles = NULL;
while ((handle = tr_list_pop_front (&tmp)))
curl_easy_pause (handle, CURLPAUSE_CONT);
}