mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Windows: Fix the passed parameter to the setsockopt function
This avoids compiler warnings about missmatched parameter types.
This commit is contained in:
parent
a6b019aaee
commit
fe0ca596d6
1 changed files with 3 additions and 3 deletions
|
@ -152,7 +152,7 @@ LWS_VISIBLE int
|
|||
lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
|
||||
{
|
||||
int optval = 1;
|
||||
socklen_t optlen = sizeof(optval);
|
||||
int optlen = sizeof(optval);
|
||||
u_long optl = 1;
|
||||
DWORD dwBytesRet;
|
||||
struct tcp_keepalive alive;
|
||||
|
@ -162,7 +162,7 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
|
|||
/* enable keepalive on this socket */
|
||||
optval = 1;
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE,
|
||||
(const void *)&optval, optlen) < 0)
|
||||
(const char *)&optval, optlen) < 0)
|
||||
return 1;
|
||||
|
||||
alive.onoff = TRUE;
|
||||
|
@ -177,7 +177,7 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
|
|||
/* Disable Nagle */
|
||||
optval = 1;
|
||||
tcp_proto = getprotobyname("TCP");
|
||||
setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, &optval, optlen);
|
||||
setsockopt(fd, tcp_proto->p_proto, TCP_NODELAY, (const char *)&optval, optlen);
|
||||
|
||||
/* We are nonblocking... */
|
||||
ioctlsocket(fd, FIONBIO, &optl);
|
||||
|
|
Loading…
Add table
Reference in a new issue