This is an automated email from the ASF dual-hosted git repository.
jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new ab72ebe Android restricts use of AI_V4MAPPED flag. Client: cpp Patch:
Ruslan <[email protected]>
ab72ebe is described below
commit ab72ebe564f890f5e37a9a7f892dc590d3d98834
Author: Ruslan <[email protected]>
AuthorDate: Thu Jun 10 16:19:08 2021 +0300
Android restricts use of AI_V4MAPPED flag.
Client: cpp
Patch: Ruslan <[email protected]>
This closes #2406
---
lib/cpp/src/thrift/transport/TServerSocket.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/cpp/src/thrift/transport/TServerSocket.cpp
b/lib/cpp/src/thrift/transport/TServerSocket.cpp
index 0c32b10..5e7e2c0 100644
--- a/lib/cpp/src/thrift/transport/TServerSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TServerSocket.cpp
@@ -404,7 +404,11 @@ void TServerSocket::listen() {
if (tcp) {
try {
resolved_addresses.resolve(address_, std::to_string(port_), SOCK_STREAM,
+#ifdef ANDROID
+ AI_PASSIVE | AI_ADDRCONFIG);
+#else
AI_PASSIVE | AI_V4MAPPED);
+#endif
} catch (const std::system_error& e) {
GlobalOutput.printf("getaddrinfo() -> %d; %s", e.code().value(),
e.what());
close();