cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: curl_multi_fdset always returns -1 for maxfd

From: Vishakha Vaidya <vvaidya_at_adobe.com>
Date: Wed, 12 Nov 2014 12:20:50 +0000

> -----Original Message-----
> From: curl-library [mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
> Sent: Wednesday, November 12, 2014 4:53 PM
> To: libcurl development
> Subject: RE: curl_multi_fdset always returns -1 for maxfd
>
> On Wed, 12 Nov 2014, Vishakha Vaidya wrote:
>
> > curl_easy_setopt(http_handle, CURLOPT_URL, "ftp://b3_15536782:tester@
> > ftp.byethost3.com/htdocs/index2.html");
>
> Interesting. Do you actually have that space in the URL in your real program?
>
> If I remove that space the test program runs fine on my Linux machine.
>
> With that space left in there, libcurl actually tries to resolve the host name with a leading space in the host name and with c-ares it gets the wrong(!) IP address back and > then it never succeeds in connecting to the host.
>
> I'm not entirely sure this is what you see though, my stock resolver tests don't resolve such a host name.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

curl_easy_setopt(http_handle, CURLOPT_URL, "ftp://b3_15536782:tester@ftp.byethost3.com/htdocs/index2.html");
there is no space. Like I said the problem is windows only, on my mac it works fine.

Also if I remove the following code
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
switch(rc) {
    case -1:
      /* select error */
      break;
    case 0:
    default:
      /* timeout or readable/writable sockets */
      curl_multi_perform(multi_handle, &still_running);
      break;
    }
And replace it with just
curl_multi_perform(multi_handle, &still_running);

It still works.

Regards,
Vishakha

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-12