mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-28 04:09:31 +03:00
internal_add_connection: refuse blocking sockets in epoll mode
This commit is contained in:
+16
-3
@@ -2404,9 +2404,8 @@ internal_add_connection (struct MHD_Daemon *daemon,
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( (! MHD_SCKT_FD_FITS_FDSET_ (client_socket,
|
||||
NULL)) &&
|
||||
(0 == (daemon->options & (MHD_USE_POLL | MHD_USE_EPOLL))) )
|
||||
if ( (0 == (daemon->options & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
|
||||
(! MHD_SCKT_FD_FITS_FDSET_ (client_socket, NULL)) )
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
@@ -2415,6 +2414,20 @@ internal_add_connection (struct MHD_Daemon *daemon,
|
||||
(int) FD_SETSIZE);
|
||||
#endif
|
||||
MHD_socket_close_chk_ (client_socket);
|
||||
#if ENFILE
|
||||
errno = ENFILE;
|
||||
#endif
|
||||
return MHD_NO;
|
||||
}
|
||||
|
||||
if ( (0 == (daemon->options & MHD_USE_EPOLL)) &&
|
||||
(! non_blck) )
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
MHD_DLOG (daemon,
|
||||
_ ("Epoll mode supports only non-blocking sockets\n"));
|
||||
#endif
|
||||
MHD_socket_close_chk_ (client_socket);
|
||||
#if EINVAL
|
||||
errno = EINVAL;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user