Index: net/socket/tcp_socket_libevent.cc |
diff --git a/net/socket/tcp_socket_libevent.cc b/net/socket/tcp_socket_libevent.cc |
index a7022fd85745bbe57ba1127d66530a141964c428..eda032971e3202805a98ce452084116e9d3169e9 100644 |
--- a/net/socket/tcp_socket_libevent.cc |
+++ b/net/socket/tcp_socket_libevent.cc |
@@ -501,22 +501,20 @@ int TCPSocketLibevent::SetAddressReuse(bool allow) { |
return OK; |
} |
-bool TCPSocketLibevent::SetReceiveBufferSize(int32 size) { |
+int TCPSocketLibevent::SetReceiveBufferSize(int32 size) { |
DCHECK(CalledOnValidThread()); |
int rv = setsockopt(socket_, SOL_SOCKET, SO_RCVBUF, |
- reinterpret_cast<const char*>(&size), |
- sizeof(size)); |
- DCHECK(!rv) << "Could not set socket receive buffer size: " << errno; |
- return rv == 0; |
+ reinterpret_cast<const char*>(&size), sizeof(size)); |
+ return (rv == 0) ? OK : MapSystemErrorWithDefault( |
+ errno, ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR); |
} |
-bool TCPSocketLibevent::SetSendBufferSize(int32 size) { |
+int TCPSocketLibevent::SetSendBufferSize(int32 size) { |
DCHECK(CalledOnValidThread()); |
int rv = setsockopt(socket_, SOL_SOCKET, SO_SNDBUF, |
- reinterpret_cast<const char*>(&size), |
- sizeof(size)); |
- DCHECK(!rv) << "Could not set socket send buffer size: " << errno; |
- return rv == 0; |
+ reinterpret_cast<const char*>(&size), sizeof(size)); |
+ return (rv == 0) ? OK : MapSystemErrorWithDefault( |
+ errno, ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR); |
} |
bool TCPSocketLibevent::SetKeepAlive(bool enable, int delay) { |