diff options
author | jiayl <jiayl@chromium.org> | 2014-12-11 13:03:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-11 21:04:09 +0000 |
commit | c5f656f044af0a3eaf5d8190bb9bc5abd43344b7 (patch) | |
tree | d06cc07f8ea3cf4c7790b0c23e55325412c304ec /jingle | |
parent | 1dd04910bd1c312ee0098004647b18c1a3578eee (diff) | |
download | chromium_src-c5f656f044af0a3eaf5d8190bb9bc5abd43344b7.zip chromium_src-c5f656f044af0a3eaf5d8190bb9bc5abd43344b7.tar.gz chromium_src-c5f656f044af0a3eaf5d8190bb9bc5abd43344b7.tar.bz2 |
Hide the proxy socket address from the clients of ProxyResolvingClientSocket.
BUG=webrtc:3868
Review URL: https://codereview.chromium.org/787003004
Cr-Commit-Position: refs/heads/master@{#307972}
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/glue/proxy_resolving_client_socket.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/jingle/glue/proxy_resolving_client_socket.cc b/jingle/glue/proxy_resolving_client_socket.cc index 91eb5ae..0b35559d 100644 --- a/jingle/glue/proxy_resolving_client_socket.cc +++ b/jingle/glue/proxy_resolving_client_socket.cc @@ -346,10 +346,22 @@ bool ProxyResolvingClientSocket::IsConnectedAndIdle() const { int ProxyResolvingClientSocket::GetPeerAddress( net::IPEndPoint* address) const { - if (transport_.get() && transport_->socket()) + if (!transport_.get() || !transport_->socket()) { + NOTREACHED(); + return net::ERR_SOCKET_NOT_CONNECTED; + } + if (proxy_info_.is_direct()) return transport_->socket()->GetPeerAddress(address); - NOTREACHED(); - return net::ERR_SOCKET_NOT_CONNECTED; + + net::IPAddressNumber ip_number; + if (net::ParseIPLiteralToNumber(dest_host_port_pair_.host(), &ip_number)) { + *address = net::IPEndPoint(ip_number, dest_host_port_pair_.port()); + } else { + *address = + net::IPEndPoint(net::IPAddressNumber(), dest_host_port_pair_.port()); + } + + return net::OK; } int ProxyResolvingClientSocket::GetLocalAddress( |