Browse Source

Workaround cURL bug

Přemysl Janouch 1 month ago
parent
commit
6c1546e919
Signed by: Přemysl Janouch <p@janouch.name> GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      nncmpp.c

+ 3
- 0
nncmpp.c View File

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

Loading…
Cancel
Save