]> granicus.if.org Git - transmission/commitdiff
(libT) prevent possible oscillation in paused_easy_handles reported by vipjml in...
authorJordan Lee <jordan@transmissionbt.com>
Sun, 28 Apr 2013 00:06:22 +0000 (00:06 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 28 Apr 2013 00:06:22 +0000 (00:06 +0000)
libtransmission/web.c

index ad45c45e5b26af2109c070a6857e32209af99be3..f1b90744768c8a4a684fa2b862d726159dcb7685 100644 (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);
         }