You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ra...@apache.org on 2014/06/17 06:18:19 UTC

git commit: THRIFT-2539:TSocket.cpp AI_ADDRCONFIG problems on Windows Client: C++ Lib Patch: Michal Gazda

Repository: thrift
Updated Branches:
  refs/heads/master db372ac24 -> 44c9b4411


THRIFT-2539:TSocket.cpp AI_ADDRCONFIG problems on Windows
Client: C++ Lib
Patch: Michal Gazda

AI_ADDRCONFIG keeps Windows from making local connections
when no NICs are present.


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/44c9b441
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/44c9b441
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/44c9b441

Branch: refs/heads/master
Commit: 44c9b4411aac88638797fe37279e632a6799b510
Parents: db372ac
Author: Randy Abernethy <ra...@apache.org>
Authored: Mon Jun 16 21:15:23 2014 -0700
Committer: Randy Abernethy <ra...@apache.org>
Committed: Mon Jun 16 21:15:23 2014 -0700

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/TSocket.cpp | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/44c9b441/lib/cpp/src/thrift/transport/TSocket.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp b/lib/cpp/src/thrift/transport/TSocket.cpp
index dbd29c3..8595506 100755
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -378,6 +378,13 @@ void TSocket::local_open(){
 
   error = getaddrinfo(host_.c_str(), port, &hints, &res0);
 
+#ifdef _WIN32
+  if (error == WSANO_DATA) {
+    hints.ai_flags &= ~AI_ADDRCONFIG;
+    error = getaddrinfo(host_.c_str(), port, &hints, &res0);
+  }
+#endif
+
   if (error) {
     string errStr = "TSocket::open() getaddrinfo() " + getSocketInfo() + string(THRIFT_GAI_STRERROR(error));
     GlobalOutput(errStr.c_str());