net: remove unnecessary casts in socket operations

These methods in the Sock class wrap corresponding syscalls,
accepting void* arguments and casting to char* internally, which is
needed for Windows support and ignored on other platforms because
the syscall itself accepts void*:

Send()
Recv()
GetSockOpt()
SetSockOpt()
This commit is contained in:
Matthew Zipkin
2025-09-12 12:38:01 -04:00
parent d20f10affb
commit 67f632b6de
5 changed files with 8 additions and 16 deletions

View File

@@ -401,7 +401,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
// Set the no-delay option (disable Nagle's algorithm) on the TCP socket.
evutil_socket_t fd = evhttp_bound_socket_get_fd(bind_handle);
int one = 1;
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (sockopt_arg_type)&one, sizeof(one)) == SOCKET_ERROR) {
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&one), sizeof(one)) == SOCKET_ERROR) {
LogInfo("WARNING: Unable to set TCP_NODELAY on RPC server socket, continuing anyway\n");
}
boundSockets.push_back(bind_handle);