View | Details | Raw Unified | Return to bug 56352
Collapse All | Expand All

(-)native/common/jk_connect.c (-4 / +5 lines)
Lines 435-444 Link Here
435
        hints.ai_socktype = SOCK_STREAM;
435
        hints.ai_socktype = SOCK_STREAM;
436
#if JK_HAVE_IPV6
436
#if JK_HAVE_IPV6
437
        if (prefer_ipv6)
437
        if (prefer_ipv6)
438
            hints.ai_family = JK_INET6;
438
            hints.ai_family = AF_INET6;
439
        else
439
        else
440
#endif
440
#endif
441
            hints.ai_family = JK_INET;
441
            hints.ai_family = AF_INET;
442
        error = getaddrinfo(host, NULL, &hints, &ai_list);
442
        error = getaddrinfo(host, NULL, &hints, &ai_list);
443
#if JK_HAVE_IPV6
443
#if JK_HAVE_IPV6
444
        /* XXX:
444
        /* XXX:
Lines 446-452 Link Here
446
         * way to retry the IPv4 address?
446
         * way to retry the IPv4 address?
447
         */
447
         */
448
        if (error == EAI_FAMILY && prefer_ipv6) {
448
        if (error == EAI_FAMILY && prefer_ipv6) {
449
            hints.ai_family = JK_INET;
449
            hints.ai_family = AF_INET;
450
            error = getaddrinfo(host, NULL, &hints, &ai_list);
450
            error = getaddrinfo(host, NULL, &hints, &ai_list);
451
        }
451
        }
452
#endif
452
#endif
Lines 481-496 Link Here
481
                }
481
                }
482
            }
482
            }
483
        }
483
        }
484
        freeaddrinfo(ai_list);
485
        if (ai == NULL) {
484
        if (ai == NULL) {
486
            /* No address found
485
            /* No address found
487
             * XXX: Use better error code?
486
             * XXX: Use better error code?
488
             */
487
             */
488
            freeaddrinfo(ai_list);
489
            JK_TRACE_EXIT(l);
489
            JK_TRACE_EXIT(l);
490
            errno = ENOENT;
490
            errno = ENOENT;
491
            return JK_FALSE;
491
            return JK_FALSE;
492
        }
492
        }
493
        memcpy(&(saddr->sa), ai->ai_addr, ai->ai_addrlen);
493
        memcpy(&(saddr->sa), ai->ai_addr, ai->ai_addrlen);
494
        freeaddrinfo(ai_list);
494
#else /* HAVE_GETADDRINFO */
495
#else /* HAVE_GETADDRINFO */
495
        struct hostent *hoste;
496
        struct hostent *hoste;
496
497

Return to bug 56352