aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-02-20 11:13:01 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-02-20 11:13:01 +0000
commit74b5e8b68a586eae6fb41d97ef5aa9132633c2a2 (patch)
tree38592d8528c1e769e34c674fb333bcc929b53943
parent7afaac3a1ff7d8e49fc995e1d40db514017b93c7 (diff)
Make sure we do not try to use IPv6 with winsock2, we end up connecting
to random addresses, causing huge delays. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30661 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--stream/tcp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/stream/tcp.c b/stream/tcp.c
index cf067c2ee7..5dfaa8304f 100644
--- a/stream/tcp.c
+++ b/stream/tcp.c
@@ -99,6 +99,14 @@ connect2Server_with_af(char *host, int port, int af,int verb) {
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);