cURL / Mailing Lists / curl-library / Single Mail

curl-library

libCurl hangs at "Curl_purform" after waking up from Hard sleep on OS X 10.5.8

From: Parimal Das <parimal.das_at_webyog.com>
Date: Wed, 23 Sep 2009 19:01:03 +0530

What i did is

1. I modified ftpget.c to download via HTTP (my code is in the end of mail)
2. Then while it was downloading, i put my OS X machine in hard sleep
3. On again waking up the machine, the process is running but nothing is
getting downloaded. Process is not using any CPU
The call graph for hang is (got from Activity Monitor app)
Call graph:
    843 Thread_2507
      843 start
        843 main
          843 Curl_perform
            843 select$DARWIN_EXTSN
              843 select$DARWIN_EXTSN

Any solution for this?? I saw one similar thread about this issue.

OSX version: 10.5.8 Leopord
Lib Curl version : 7.16.3 (i am using the curl lib which is present by
default in mac.)

Please help.
Adv Thanks

my code here: *(my additions are in bold)*

int main(void)
{
  CURL *curl;
  CURLcode res;
   * struct curl_slist* header_list;*

  struct FtpFile ftpfile={
    "oo.exe", /* name to store the file as if succesful */
    NULL
  };

  curl_global_init(CURL_GLOBAL_DEFAULT);

  curl = curl_easy_init();
  if(curl) {
    * curl_easy_setopt(curl, CURLOPT_URL, "
http://ftp.isu.edu.tw/pub/OpenOffice/stable/3.1.1/OOo_3.1.1_MacOSXIntel_install_en-US.dmg
");*

   * res = curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
      if (res != CURLE_OK)
          return 0;*

      /* Define our callback to get called when there's data to be written
*/
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
    /* Set a pointer to our struct to pass to the callback */
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);

    /* Switch on full protocol/debug output */
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

    res = curl_easy_perform(curl);

    /* always cleanup */
    curl_easy_cleanup(curl);

    if(CURLE_OK != res) {
      /* we failed */
      fprintf(stderr, "curl told us %d\n", res);
    }
  }

  if(ftpfile.stream)
    fclose(ftpfile.stream); /* close the local file */

  curl_global_cleanup();

  return 0;
}

-- 
--
Warm Regards,
Parimal Das
Received on 2009-09-23