From: BobTheCherub Date: Wed, 16 Nov 2016 08:40:21 +0000 (+0800) Subject: Fixed race condition in http_client_unpause which caused bug #3843 X-Git-Tag: v4.2.1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca5f094448fc5c04841932d3e32a9b15c6e02bd5;p=thirdparty%2Ftvheadend.git Fixed race condition in http_client_unpause which caused bug #3843 https://tvheadend.org/issues/3843#change-20135 --- diff --git a/src/httpc.c b/src/httpc.c index 051a3bb87..df7997c3e 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -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); } }