Skip to content

Commit 4ab5e08

Browse files
committed
Fixed warning in Window build for TCP_NODELAY
1 parent fa7c02e commit 4ab5e08

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/Socket.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,17 +1457,18 @@ int Socket_new(const char* addr, size_t addr_len, int port, SOCKET* sock)
14571457
else
14581458
{
14591459
#if defined(NOSIGPIPE)
1460-
int opt = 1;
1460+
{
1461+
int opt = 1;
14611462

1462-
if (setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&opt, sizeof(opt)) != 0)
1463-
Log(LOG_ERROR, -1, "Could not set SO_NOSIGPIPE for socket %d", *sock);
1463+
if (setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&opt, sizeof(opt)) != 0)
1464+
Log(LOG_ERROR, -1, "Could not set SO_NOSIGPIPE for socket %d", *sock);
1465+
}
14641466
#endif
14651467
#if !defined(NO_TCP_NODELAY)
14661468
{
14671469
int opt = 1;
1468-
socklen_t opt_size = sizeof(opt);
1469-
1470-
if (setsockopt(*sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)) != 0)
1470+
1471+
if (setsockopt(*sock, IPPROTO_TCP, TCP_NODELAY, (void*)&opt, sizeof(opt)) != 0)
14711472
Log(LOG_ERROR, -1, "Could not set TCP_NODELAY for socket %d", *sock);
14721473
}
14731474
#endif

0 commit comments

Comments
 (0)