From 68665b939d2ba08b329af580d5da2c8ab859b47a Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Sun, 28 Apr 2013 00:06:22 +0000 Subject: [PATCH] (libT) prevent possible oscillation in paused_easy_handles reported by vipjml in bug #1079 comment:27 --- libtransmission/web.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libtransmission/web.c b/libtransmission/web.c index ad45c45e5..f1b907447 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -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); } -- 2.40.0