input/curl: work around stream resume bug (fixed in libcurl 7.32.0)
This commit is contained in:
parent
a566c28a49
commit
d6247902ec
2
NEWS
2
NEWS
|
@ -5,6 +5,8 @@ ver 0.18.5 (20??/??/??)
|
||||||
* database
|
* database
|
||||||
- proxy: auto-reload statistics
|
- proxy: auto-reload statistics
|
||||||
- proxy: provide "db_update" in "stats" response
|
- proxy: provide "db_update" in "stats" response
|
||||||
|
* input
|
||||||
|
- curl: work around stream resume bug (fixed in libcurl 7.32.0)
|
||||||
* decoder
|
* decoder
|
||||||
- fluidsynth: auto-detect by default
|
- fluidsynth: auto-detect by default
|
||||||
* clip 24 bit data from libsamplerate
|
* clip 24 bit data from libsamplerate
|
||||||
|
|
|
@ -273,6 +273,16 @@ public:
|
||||||
SocketAction(CURL_SOCKET_TIMEOUT, 0);
|
SocketAction(CURL_SOCKET_TIMEOUT, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a kludge to allow pausing/resuming a stream with
|
||||||
|
* libcurl < 7.32.0. Read the curl_easy_pause manpage for
|
||||||
|
* more information.
|
||||||
|
*/
|
||||||
|
void ResumeSockets() {
|
||||||
|
int running_handles;
|
||||||
|
curl_multi_socket_all(multi, &running_handles);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static int TimerFunction(CURLM *multi, long timeout_ms, void *userp);
|
static int TimerFunction(CURLM *multi, long timeout_ms, void *userp);
|
||||||
|
|
||||||
|
@ -335,6 +345,13 @@ input_curl_resume(struct input_curl *c)
|
||||||
if (c->paused) {
|
if (c->paused) {
|
||||||
c->paused = false;
|
c->paused = false;
|
||||||
curl_easy_pause(c->easy, CURLPAUSE_CONT);
|
curl_easy_pause(c->easy, CURLPAUSE_CONT);
|
||||||
|
|
||||||
|
if (curl_version_num < 0x072000)
|
||||||
|
/* libcurl older than 7.32.0 does not update
|
||||||
|
its sockets after curl_easy_pause(); force
|
||||||
|
libcurl to do it now */
|
||||||
|
curl_multi->ResumeSockets();
|
||||||
|
|
||||||
curl_multi->InvalidateSockets();
|
curl_multi->InvalidateSockets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue