cURL / Mailing Lists / curl-library / Single Mail

curl-library

FTP & NOBODY (was: Abort FTP downloads)

From: Christian Vogt <christian.vogt_at_loewe-komp.de>
Date: Mon, 20 Aug 2007 20:09:11 +0200

on 8/17/2007 5:31 PM, Dan Fandrich wrote:
> On Fri, Aug 17, 2007 at 11:43:05AM +0200, Christian Vogt wrote:
>> Is there a way to abort the transfer without dropping the control
>> connection?
>>
>> Are there other ways to validate a given FTP URL and to get the number of
>> bytes to download without actually starting the download? (avoiding the
>> need to abort the transfer)
>
> Try the CURLOPT_NOBODY option.
>

Thanks for that hint!

I played a bit with that option, but it does not solve my particular
problem. When I do an FTP transfer with CURLOPT_NOBODY, the write
callback is called with the 'faked' HTTP-like "Content-Length: %" (which
is ok), but an attempt to get this size after the transfer with a
curl_easy_getinfo() with CURLINFO_CONTENT_LENGTH_DOWNLOAD returns a size
of 0.

I guess this is a bug and will most likely be solved with the changes
mentioned by Daniel Stenberg in his "Kicking out the HTTP-like responses
from FTP?"-thread.

Until then, would you think it is a save hotfix to call
Curl_pgrsSetDownloadSize() from the implementation of the
ftp_state_size_resp() routine in ftp.c?

Thanks,
   Christian

-- 
Mit freundlichen Grüßen / best regards
Christian Vogt
__________________________
Loewe Opta GmbH
Kompetenzzentrum Hannover
Hildesheimer Str. 140
D-30173 Hannover
Telefon ++49 511 56 35 49 - 31
Telefax ++49 511 56 35 49 - 65
e-mail: christian.vogt_at_loewe-komp.de
Loewe Opta GmbH - Sitz Kronach - Registergericht Coburg HRB 641
Vorsitzender des Aufsichtsrates: Prof. Dr. Eberhard Scheffler
Geschäftsführung: Dr. Rainer Hecker (Vorsitzender), Gerhard Schaas,
Oliver Seidl
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
Received on 2007-08-20