cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libshh sftp download 0 bytes

From: <mikep_at_proatria.com>
Date: Mon, 3 Mar 2008 10:04:44 +0000

On Sat, Mar 01, 2008 at 10:38:39AM +0000, mikep_at_proatria.com wrote:
> I am adding resume support to libcurl. While testing, I wanted to make sure that large files (over 4GB) and zero byte files work, but I found that the download of zero bytes never finishes, I just see calls to my progress function repeating. The reason I posted was to see if anyone else can confirm if a download of zero bytes with sftp works for them (in which case my code is at fault - quite likely).
>
OK - I've found a solution, based on the ftp code. This is included in the patch I've posted for resume support - but the relevant part is:

   /* Setup the actual download */
   if(data->req.size == 0) {
     /* no data to transfer */
     result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
     infof(data, "File already completely downloaded\n");
     state(conn, SSH_STOP);
     break;
   }
   else {
     result = Curl_setup_transfer(conn, FIRSTSOCKET, data->req.size,
                                 FALSE, NULL, -1, NULL);
   }

-- 
Regards 
Mike Protts
Senior Technical Consultant
Pro:Atria Ltd
+44(0) 870 7656453
Received on 2008-03-03