mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
windows check for NULL getprotobyname
From maxkaro on trac #110 https://libwebsockets.org/trac/libwebsockets/ticket/110 Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
408f537975
commit
d3efcd9461
1 changed files with 5 additions and 0 deletions
|
@ -230,6 +230,11 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
|
|||
/* Disable Nagle */
|
||||
optval = 1;
|
||||
tcp_proto = getprotobyname("TCP");
|
||||
if (!tcp_proto) {
|
||||
lwsl_err("getprotobyname() failed with error %d\n", LWS_ERRNO);
|
||||
return 1;
|
||||
}
|
||||
|
||||
setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, (const char *)&optval, optlen);
|
||||
|
||||
/* We are nonblocking... */
|
||||
|
|
Loading…
Add table
Reference in a new issue