Commit 773591e2 authored by arindam@chromium.org's avatar arindam@chromium.org

Correctly implementing GetPeerName() to point to...

Correctly implementing GetPeerName() to point to TCPClientSocket::GetPeerName(). This is used by the SSL layer in Linux to resolve Peer Names, which caused a trap to be generated ( http://crbug/16166 )

BUG=16166
TEST=fix of the above BUG

Review URL: http://codereview.chromium.org/149242

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20170 0039d316-1c4b-4281-b951-d872f2087c98
parent 60e60c43
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include <ws2tcpip.h> #include <ws2tcpip.h>
#else #elif defined(OS_POSIX)
#include <netdb.h> #include <netdb.h>
#endif #endif
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
...@@ -375,12 +375,9 @@ int SOCKSClientSocket::DoHandshakeReadComplete(int result) { ...@@ -375,12 +375,9 @@ int SOCKSClientSocket::DoHandshakeReadComplete(int result) {
} }
#if defined(OS_LINUX) #if defined(OS_LINUX)
// Identical to posix system call getpeername(). int SOCKSClientSocket::GetPeerName(struct sockaddr* name,
// Needed by ssl_client_socket_nss. socklen_t* namelen) {
int SOCKSClientSocket::GetPeerName(struct sockaddr *name, socklen_t *namelen) { return transport_->GetPeerName(name, namelen);
// Default implementation just permits some unit tests to link.
NOTREACHED();
return ERR_UNEXPECTED;
} }
#endif #endif
......
...@@ -48,9 +48,8 @@ class SOCKSClientSocket : public ClientSocket { ...@@ -48,9 +48,8 @@ class SOCKSClientSocket : public ClientSocket {
virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback);
#if defined(OS_LINUX) #if defined(OS_LINUX)
// Identical to posix system call getpeername().
// Needed by ssl_client_socket_nss. // Needed by ssl_client_socket_nss.
virtual int GetPeerName(struct sockaddr *name, socklen_t *namelen); virtual int GetPeerName(struct sockaddr* name, socklen_t* namelen);
#endif #endif
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment