changeset 30619:2fa6d8411b07

Make sure we do not try to use IPv6 with winsock2, we end up connecting to random addresses, causing huge delays.
author reimar
date Sat, 20 Feb 2010 11:13:01 +0000
parents c061152a5d84
children d6f2e0515ad3
files stream/tcp.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tcp.c	Fri Feb 19 23:35:21 2010 +0000
+++ b/stream/tcp.c	Sat Feb 20 11:13:01 2010 +0000
@@ -99,6 +99,14 @@
 	struct timeval to;
 #endif
 
+#if HAVE_WINSOCK2_H && defined(HAVE_AF_INET6)
+	// our winsock name resolution code can not handle IPv6
+	if (af == AF_INET6) {
+		mp_msg(MSGT_NETWORK, MSGL_WARN, "IPv6 not supported for winsock2\n");
+		return TCP_ERROR_FATAL;
+	}
+#endif
+
 	socket_server_fd = socket(af, SOCK_STREAM, 0);