]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5325 this should prefer v4 addrs to avoid the blocking on connect as well so you...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 24 Apr 2013 15:49:04 +0000 (10:49 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 24 Apr 2013 15:50:36 +0000 (10:50 -0500)
libs/iksemel/.update
libs/iksemel/src/io-posix.c

index f8d85b56a5f2ed91cf7bd017244ac70a21301830..4cc29586bbd8a87885877402db3f3ec816aa8ef6 100644 (file)
@@ -1 +1 @@
-Wed Apr 24 10:12:23 CDT 2013
+Wed Apr 24 10:48:25 CDT 2013
index 18494a1b9640eeb58b743c426e876133ab58adf1..f0a8e07101957442bc4e2c78d8a674a10a4a3ed3 100644 (file)
@@ -37,9 +37,14 @@ io_connect (iksparser *prs, void **socketptr, const char *server, int port)
        struct addrinfo *addr_res, *addr_ptr;
        char port_str[6];
        int err = 0;
+       int family = AF_INET;
+
+       if (strchr(server, ':')) {
+               family = AF_INET6;
+       }
 
        hints.ai_flags = AI_CANONNAME;
-       hints.ai_family = PF_UNSPEC;
+       hints.ai_family = family;
        hints.ai_socktype = SOCK_STREAM;
        hints.ai_protocol = 0;
        hints.ai_addrlen = 0;
@@ -58,6 +63,7 @@ io_connect (iksparser *prs, void **socketptr, const char *server, int port)
                if (sock != -1) {
                        err = IKS_NET_NOCONN;
                        tmp = connect (sock, addr_ptr->ai_addr, addr_ptr->ai_addrlen);
+
                        if (tmp == 0) break;
                        io_close ((void *) sock);
                        sock = -1;