curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Application gets blocked in libcurl v7.50.2

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 6 Mar 2017 09:20:38 +0100 (CET)

On Mon, 6 Mar 2017, Ray Satiro via curl-library wrote:

> So either fix for timeout <=0 at the very beginning and set the default
> timeout or since it's expired already just return? Should the resolve be
> attempted even if timeout already occurred before the loop?

No, if it already expired it should return error at once. I'll push this:

@@ -357,10 +357,15 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata
*conn,
    long timeout;
    struct timeval now = Curl_tvnow();
    struct Curl_dns_entry *temp_entry;

    timeout = Curl_timeleft(data, &now, TRUE);
+ if(timeout < 0) {
+ /* already expired! */
+ connclose(conn, "Timed out before name resolve started");
+ return CURLE_OPERATION_TIMEDOUT;
+ }
    if(!timeout)
      timeout = CURL_TIMEOUT_RESOLVE * 1000; /* default name resolve timeout */

    /* Wait for the name resolve query to complete. */
    for(;;) {

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-03-06