]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fixed race condition in http_client_unpause which caused bug #3843
authorBobTheCherub <mat@rantell.net>
Wed, 16 Nov 2016 08:40:21 +0000 (16:40 +0800)
committerJaroslav Kysela <perex@perex.cz>
Thu, 17 Nov 2016 08:11:43 +0000 (09:11 +0100)
https://tvheadend.org/issues/3843#change-20135

src/httpc.c

index 051a3bb8717439b4947997ac8586d72236d76cf2..df7997c3eacdc38706be333c31cf6d1c6ab39579 100644 (file)
@@ -199,11 +199,12 @@ void
 http_client_unpause( http_client_t *hc )
 {
   if (hc->hc_pause) {
+    int pevents_pause = hc->hc_pevents_pause;
     tvhtrace(LS_HTTPC, "%04X: resuming input", shortid(hc));
-    http_client_poll_dir(hc, hc->hc_pevents_pause & TVHPOLL_IN,
-                             hc->hc_pevents_pause & TVHPOLL_OUT);
     hc->hc_pause = 0;
     hc->hc_pevents_pause = 0;
+    http_client_poll_dir(hc, pevents_pause & TVHPOLL_IN,
+            pevents_pause & TVHPOLL_OUT);
   }
 }