Implemented and documented MHD_OPTION_LISTEN_SOCKET followed by MHD_INVALID_SOCKET

This commit is contained in:
Evgeny Grin (Karlson2k)
2023-11-12 11:50:30 +03:00
parent a564993122
commit 75dbfbc716
2 changed files with 8 additions and 4 deletions
+2
View File
@@ -1780,6 +1780,8 @@ enum MHD_OPTION
* option is used, MHD will not open its own listen socket(s). The
* argument passed must be of type `MHD_socket` and refer to an
* existing socket that has been bound to a port and is listening.
* If followed by MHD_INVALID_SOCKET value, MHD ignores this option
* and creates socket by itself.
*/
MHD_OPTION_LISTEN_SOCKET = 12,
+6 -4
View File
@@ -7405,11 +7405,12 @@ process_interim_params (struct MHD_Daemon *d,
if (params->listen_fd_set)
{
if (MHD_INVALID_SOCKET == params->listen_fd
if (MHD_INVALID_SOCKET == params->listen_fd)
{
(void) 0; /* Use MHD-created socket */
}
#ifdef MHD_POSIX_SOCKETS
|| 0 > params->listen_fd
#endif /* MHD_POSIX_SOCKETS */
)
else if (0 > params->listen_fd)
{
#ifdef HAVE_MESSAGES
MHD_DLOG (d,
@@ -7418,6 +7419,7 @@ process_interim_params (struct MHD_Daemon *d,
#endif /* HAVE_MESSAGES */
return false;
}
#endif /* MHD_POSIX_SOCKETS */
else if (0 != (d->options & MHD_USE_NO_LISTEN_SOCKET))
{
#ifdef HAVE_MESSAGES