diff options
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 76b943964..27c15c7b7 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -2647,12 +2647,13 @@ static void set_constrained_socket_buffers(int sock, int size) { void *sz = (void*)&size; - if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, sz,(socklen_t)sizeof(size)) < 0) { + socklen_t sz_sz = (socklen_t) sizeof(size); + if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, sz, sz_sz) < 0) { int e = tor_socket_errno(sock); log_warn(LD_NET, "setsockopt() to constrain send " "buffer to %d bytes failed: %s", size, tor_socket_strerror(e)); } - if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, sz,(socklen_t)sizeof(size)) < 0) { + if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, sz, sz_sz) < 0) { int e = tor_socket_errno(sock); log_warn(LD_NET, "setsockopt() to constrain recv " "buffer to %d bytes failed: %s", size, tor_socket_strerror(e)); |