http: use usock_inet_timeout()
authorFelix Fietkau <nbd@openwrt.org>
Thu, 28 Jan 2016 11:19:54 +0000 (12:19 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 28 Jan 2016 11:19:54 +0000 (12:19 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uclient-http.c

index f080e41239218fe18a3cf4b5a97d950f03e02367..c6336a68705afc09fa58f079057e55e51e479679 100644 (file)
@@ -123,7 +123,9 @@ static int uclient_do_connect(struct uclient_http *uh, const char *port)
 
        memset(&uh->uc.remote_addr, 0, sizeof(uh->uc.remote_addr));
 
-       fd = usock_inet(USOCK_TCP | uh->usock_flags, uh->uc.url->host, port, &uh->uc.remote_addr);
+       fd = usock_inet_timeout(USOCK_TCP | USOCK_NONBLOCK | uh->usock_flags,
+                               uh->uc.url->host, port, &uh->uc.remote_addr,
+                               uh->uc.timeout_msecs);
        if (fd < 0)
                return -1;