Workaround cURL bug

This commit is contained in:
Přemysl Eric Janouch 2019-02-24 01:41:15 +01:00
parent 15e583beb2
commit 6c1546e919
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -286,6 +286,9 @@ poller_curl_on_socket_action (CURL *easy, curl_socket_t s, int what,
}
if (what == CURL_POLL_REMOVE)
{
// Some annoying cURL bug. Never trust libraries.
fd->fd.closed = fcntl(fd->fd.fd, F_GETFL) < 0 && errno == EBADF;
poller_fd_reset (&fd->fd);
LIST_UNLINK (self->fds, fd);
free (fd);