diff options
author | Kolja Nowak <Kolja.Nowak@devolo.de> | 2022-05-18 10:19:31 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-18 10:19:31 +0300 |
commit | b1fff186c5cc039a86febe7d2fa7e24c61b68c60 (patch) | |
tree | f2491152d62762d93a8b0328dccb49779038867d | |
parent | 5d28b72d6991416cb954a0b7d077565f3158810b (diff) | |
download | libmicrohttpd-b1fff186c5cc039a86febe7d2fa7e24c61b68c60.tar.gz libmicrohttpd-b1fff186c5cc039a86febe7d2fa7e24c61b68c60.zip |
I'm trying to use libmicrohttpd on a platform where fcntl(fd, O_NONBLOCK)
doesn't work for sockets. This shouldn't be a problem, as far as I understand,
except in epoll mode, which I'm not using, because epoll() isn't available either.
However, there is a check in daemon.c:internal_add_connection(),
the purpose of which seems to be to prevent using a blocking socket
in epoll mode. At least that's what the debug message says. The code
however does the opposite, it prevents the use of a blocking socket
if epoll mode is *not* used. This was probably never noticed because
platforms without non-blocking sockets are rare.
Please consider applying the following simple fix:
-rw-r--r-- | src/microhttpd/daemon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 64524b1b..8308e6ef 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2985,7 +2985,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
2985 | return MHD_NO; | 2985 | return MHD_NO; |
2986 | } | 2986 | } |
2987 | 2987 | ||
2988 | if ( (0 == (daemon->options & MHD_USE_EPOLL)) && | 2988 | if ( (0 != (daemon->options & MHD_USE_EPOLL)) && |
2989 | (! non_blck) ) | 2989 | (! non_blck) ) |
2990 | { | 2990 | { |
2991 | #ifdef HAVE_MESSAGES | 2991 | #ifdef HAVE_MESSAGES |