浏览代码

2009-12-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Get rid of AI_ADDRCONFIG when --disable-ipv6 opiton is given. It
	causes name resolution error when none of network interface has
	IPv4 address.
	* src/main.cc
Tatsuhiro Tsujikawa 16 年之前
父节点
当前提交
c92975aefb
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 7 0
      ChangeLog
  2. 3 0
      src/main.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2009-12-27  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Get rid of AI_ADDRCONFIG when --disable-ipv6 opiton is given. It
+	causes name resolution error when none of network interface has
+	IPv4 address.
+	* src/main.cc
+
 2009-12-27  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Bump up version number to 1.8.0.

+ 3 - 0
src/main.cc

@@ -210,6 +210,9 @@ downloadresultcode::RESULT main(int argc, char* argv[])
 
     if(op->getAsBool(PREF_DISABLE_IPV6)) {
       SocketCore::setProtocolFamily(AF_INET);
+      // Get rid of AI_ADDRCONFIG. It causes name resolution error
+      // when none of network interface has IPv4 address.
+      setDefaultAIFlags(0);
     }
     // Bind interface
     if(!op->get(PREF_INTERFACE).empty()) {