check for socket validity

This commit is contained in:
Christian Grothoff
2020-03-07 17:09:22 +01:00
parent 9f4422e0ca
commit 9ebe27e18d
+5
View File
@@ -505,6 +505,11 @@ MHD_socket_cork_ (MHD_socket sock,
const MHD_SCKT_OPT_BOOL_ on_val = 1;
/* Disable extra buffering */
if (MHD_INVALID_SOCKET == sock)
{
errno = EBADF;
return 0; /* failed */
}
if (0 != setsockopt (sock,
IPPROTO_TCP,
MHD_TCP_CORK_NOPUSH,