summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/Util.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-04-21 16:44:54 -0700
committerMark Spruiell <mes@zeroc.com>2008-04-21 16:44:54 -0700
commit03c5d848fd7b1fd8ab9442520581e03c894bffe7 (patch)
tree0da06301e63b509ea01f8d93a406562a8b1e94a6 /cpp/src/IceSSL/Util.cpp
parentFixed bug 2972 & 3013 (diff)
downloadice-03c5d848fd7b1fd8ab9442520581e03c894bffe7.tar.bz2
ice-03c5d848fd7b1fd8ab9442520581e03c894bffe7.tar.xz
ice-03c5d848fd7b1fd8ab9442520581e03c894bffe7.zip
bug 3007 - getpeername fails on Windows w/ IPv6
Diffstat (limited to 'cpp/src/IceSSL/Util.cpp')
-rw-r--r--cpp/src/IceSSL/Util.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp
index 3abd92dcee4..2cd122e1752 100644
--- a/cpp/src/IceSSL/Util.cpp
+++ b/cpp/src/IceSSL/Util.cpp
@@ -358,9 +358,23 @@ IceSSL::populateConnectionInfo(SSL* ssl, SOCKET fd, const string& adapterName, b
if(!IceInternal::fdToRemoteAddress(fd, info.remoteAddr))
{
+#ifdef _WIN32
+ //
+ // A bug exists in Windows XP Service Pack 2 that causes getpeername to return a
+ // "socket not connected" error when using IPv6. See the following bug report:
+ //
+ // https://connect.microsoft.com/WNDP/feedback/ViewFeedback.aspx?FeedbackID=338445
+ //
+ // As a workaround, we do not raise a socket exception, but instead return a
+ // "null" value for the remote address.
+ //
+ memset(&info.remoteAddr, 0, sizeof(info.remoteAddr));
+ info.remoteAddr.ss_family = AF_UNSPEC;
+#else
SocketException ex(__FILE__, __LINE__);
ex.error = IceInternal::getSocketErrno();
throw ex;
+#endif
}
return info;