]> granicus.if.org Git - libevent/commitdiff
fix a bug in http_connect for windows; the address was not copied correctly.
authorNiels Provos <provos@gmail.com>
Tue, 24 Jun 2008 21:01:44 +0000 (21:01 +0000)
committerNiels Provos <provos@gmail.com>
Tue, 24 Jun 2008 21:01:44 +0000 (21:01 +0000)
svn:r863

test/regress_http.c

index c929214eb9094c6d41355e0b5c6267fdac20e7f9..972178d265d62746df6cc7e925b4960f15a60baf 100644 (file)
@@ -129,7 +129,7 @@ http_connect(const char *address, u_short port)
        if (!(he = gethostbyname(address))) {
                event_warn("gethostbyname");
        }
-       memcpy(&sin.sin_addr, &he->h_addr, sizeof(struct in_addr));
+       memcpy(&sin.sin_addr, he->h_addr_list[0], he->h_length);
        sin.sin_family = AF_INET;
        sin.sin_port = htons(port);
        slen = sizeof(struct sockaddr_in);