cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Weird FTP Connect Error Bug

From: <rodney.c.ashworth_at_bt.com>
Date: Mon, 17 Sep 2007 12:38:09 +0100

 

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: 17 September 2007 11:25
To: libcurl development
Subject: Re: Weird FTP Connect Error Bug

On Mon, 17 Sep 2007, Jofell Gallardo wrote:

(Please don't top-post:
http://curl.haxx.se/mail/etiquette.html#top-post)

> I just downloaded v7.17.0, and it seems to not work either. One funny
> thing also was that anything I use with Cocoa's URL Handler seems to
> get the same errors, and AFAIK, Cocoa's URL Handling also uses curl
> beneath it, using v7.13.0.

Can you provide source code for us that repeats the problem on a public
URL?
Then we can help see if the problem is in your code or if it is a
libcurl issue.

7.13.0 is so outdated it's not even funny.

--
  Commercial curl and libcurl Technical Support:
http://haxx.se/curl.html
I'm not sure this email was intended for me however I do have a problem
with 
v7.17.0 running on windows xp.
I'm trying to do a https transaction using the curl_multi interface with
a proxy.
see code below
  CURLM *multi_handle;
  int still_running; /* keep number of running handles */
  CURL *http_handle = curl_easy_init();
  // set the options
	curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1);
	// need proxy for bt
	curl_easy_setopt(http_handle,
CURLOPT_PROXY,_T("myproxy.bt.com:8080"));
	curl_easy_setopt(http_handle, CURLOPT_SSL_VERIFYPEER, 0);
  curl_easy_setopt(http_handle, CURLOPT_URL, szURL);
  /* init a multi stack */
  multi_handle = curl_multi_init();
  /* add the individual transfers */
  curl_multi_add_handle(multi_handle, http_handle);
  /* we start some action by calling perform right away */
  while(CURLM_CALL_MULTI_PERFORM ==
        curl_multi_perform(multi_handle, &still_running));
  while(still_running) {
    struct timeval timeout;
    int rc; /* select() return code */
    fd_set fdread;
    fd_set fdwrite;
    fd_set fdexcep;
    int maxfd;
    FD_ZERO(&fdread);
    FD_ZERO(&fdwrite);
    FD_ZERO(&fdexcep);
    /* set a suitable timeout to play around with */
    timeout.tv_sec = 1;
    timeout.tv_usec = 0;
    /* get file descriptors from the transfers */
    curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
    /* In a real-world program you OF COURSE check the return code of
the
       function calls, *and* you make sure that maxfd is bigger than -1
so
       that the call to select() below makes sense! */
    rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
    switch(rc) {
    case -1:
      /* select error */
      still_running = 0;
      printf("select() returns error, this is badness\n");
      break;
    case 0:
    default:
      /* timeout or readable/writable sockets */
      while(CURLM_CALL_MULTI_PERFORM ==
            curl_multi_perform(multi_handle, &still_running));
      break;
    }
  }
  curl_multi_cleanup(multi_handle);
  curl_easy_cleanup(http_handle);
- the problem is that curl_multi_fdset returns a maxfd value less than
zero which cause the subsequent select to fail.
I tried using the easy interface and that works fine .
regards
Rod Ashworth
Received on 2007-09-17