Index: net/socket/unix_domain_client_socket_posix.cc |
diff --git a/net/socket/unix_domain_client_socket_posix.cc b/net/socket/unix_domain_client_socket_posix.cc |
index 5adbca9979e21513886fa8123c9935d566b0bcc1..70ad42baa0ec3af2d92053c47efd059b553850a3 100644 |
--- a/net/socket/unix_domain_client_socket_posix.cc |
+++ b/net/socket/unix_domain_client_socket_posix.cc |
@@ -9,6 +9,7 @@ |
#include "base/logging.h" |
#include "base/posix/eintr_wrapper.h" |
+#include "net/base/ip_endpoint.h" |
#include "net/base/net_errors.h" |
#include "net/base/net_util.h" |
#include "net/socket/socket_libevent.h" |
@@ -98,13 +99,25 @@ bool UnixDomainClientSocket::IsConnectedAndIdle() const { |
} |
int UnixDomainClientSocket::GetPeerAddress(IPEndPoint* address) const { |
- NOTIMPLEMENTED(); |
- return ERR_NOT_IMPLEMENTED; |
+ // Unix domain sockets have no valid associated addr/port; |
+ // return either not connected or address invalid. |
+ DCHECK(address); |
+ |
+ if (!IsConnected()) |
+ return ERR_SOCKET_NOT_CONNECTED; |
+ |
+ return ERR_ADDRESS_INVALID; |
} |
int UnixDomainClientSocket::GetLocalAddress(IPEndPoint* address) const { |
- NOTIMPLEMENTED(); |
- return ERR_NOT_IMPLEMENTED; |
+ // Unix domain sockets have no valid associated addr/port; |
+ // return either not connected or address invalid. |
+ DCHECK(address); |
+ |
+ if (!socket_) |
+ return ERR_SOCKET_NOT_CONNECTED; |
+ |
+ return ERR_ADDRESS_INVALID; |
} |
const BoundNetLog& UnixDomainClientSocket::NetLog() const { |