From: Jaroslav Kysela Date: Wed, 7 Dec 2016 09:46:35 +0000 (+0100) Subject: iptv: http_client_simple_reconnect() must be protected by the mutex lock, fixes ... X-Git-Tag: v4.2.1~182 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aeceb4a30f6426dc05e2975a9de9094955069b1a;p=thirdparty%2Ftvheadend.git iptv: http_client_simple_reconnect() must be protected by the mutex lock, fixes #4119 --- diff --git a/src/input/mpegts/iptv/iptv_http.c b/src/input/mpegts/iptv/iptv_http.c index e05cd45f5..cdb188b9b 100644 --- a/src/input/mpegts/iptv/iptv_http.c +++ b/src/input/mpegts/iptv/iptv_http.c @@ -361,8 +361,10 @@ iptv_http_reconnect ( http_client_t *hc, const char *url ) urlinit(&u); if (!urlparse(url, &u)) { + pthread_mutex_lock(&hc->hc_mutex); hc->hc_keepalive = 0; r = http_client_simple_reconnect(hc, &u, HTTP_VERSION_1_1); + pthread_mutex_unlock(&hc->hc_mutex); if (r < 0) tvherror(LS_IPTV, "cannot reopen http client: %d'", r); } else {