Chromium Code Reviews| Index: net/socket/socket_posix.cc |
| diff --git a/net/socket/socket_posix.cc b/net/socket/socket_posix.cc |
| index 6955aa2a1e83a565c12f2700db5e2d1a618effce..a43f5176409055221b861aec629cfb39db9927c8 100644 |
| --- a/net/socket/socket_posix.cc |
| +++ b/net/socket/socket_posix.cc |
| @@ -98,6 +98,16 @@ int SocketPosix::Open(int address_family) { |
| int SocketPosix::AdoptConnectedSocket(SocketDescriptor socket, |
| const SockaddrStorage& address) { |
| + int rv = AdoptUnconnectedSocket(socket); |
| + if (rv != OK) { |
| + return rv; |
| + } |
|
mmenke
2017/04/21 19:20:38
nit: Don't use braces for one line if bodies.
Raul Vera
2017/05/01 05:35:25
Done. But I'd like to point out that the style gui
mmenke
2017/05/01 18:44:19
Note that you should generally be consistent with
|
| + |
| + SetPeerAddress(address); |
| + return OK; |
| +} |
| + |
| +int SocketPosix::AdoptUnconnectedSocket(SocketDescriptor socket) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DCHECK_EQ(kInvalidSocket, socket_fd_); |
| @@ -109,7 +119,6 @@ int SocketPosix::AdoptConnectedSocket(SocketDescriptor socket, |
| return rv; |
| } |
| - SetPeerAddress(address); |
| return OK; |
| } |