cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

curl-multi: Pausing download with connection open

From: Richard Atterer <richard_at_list04.atterer.net>
Date: Thu, 15 Jul 2004 16:12:36 +0200

Hello,

I'm writing a program which can perform several concurrent downloads.
Sometimes, I want to pause a download, but keep its TCP connection(s) open.

I tried to use curl_multi_remove/add_handle() to achieve this, but it
doesn't seem to work. After the curl_multi_add_handle(), libcurl 7.11.2
does not seem to like the re-added object, it tears down the connection and
reconnects:

  * Connection 0 seems to be dead!
  * Closing connection #0
  * About to connect() to ...

Somehow, SocketIsDead() in url.c decides that the connection is dead.
Apparently, no new packet of data has arrived since the last call to
curl_multi_perform(), so the select() in SocketIsDead() returns 0. :-/

Looking at the code, I'm also left wondering whether it is possible that
the open connection of the paused download will be "snatched away" by
another download that I start in the meantime. If this is the case, will a
new connection be opened when I resume the previously paused download?

Maybe the use of curl_multi_remove/add_handle() for pausing some downloads
of a curl-multi application should be documented in the manpages?

BTW, thanks for libcurl!
Cheers,

  Richard

-- 
  __   _
  |_) /|  Richard Atterer     |  GnuPG key:
  | \/|  http://atterer.net  |  0x888354F7
   '` 
Received on 2004-07-15

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET