cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PRET + Customrequest (STAT) issue

From: ElBandito <el.bandito123_at_googlemail.com>
Date: Tue, 18 Jan 2011 13:27:04 +0100

On Mon, 17 Jan 2011, Daniel Stenberg wrote:
> On Mon, 17 Jan 2011, ElBandito wrote:
>> For my at home usage I use a different ftp client and noticed it uses
>> STAT -LA instead of LIST.
>
> The "-LA" parts sounds like a gamle to rely on as its not part of any standard.

It uses -LA like "ls -la" on shell does, those ftps work with it, but
when i only do STAT it really doesnt change anything I wrote about.

>> So I looked through the libcurl docs and noticed CURLOPT_CUSTOMREQUEST, when set to STAT -LA on the same drftpd it fails though:
>
> Yes, as long as you still ask for a file transfer as a file transfer in regular FTP lingo means a separate connection for the data. You can set CURLOPT_NOBODY to avoid that.

Yes good point, did not think about it like that. Although I can't
seem to receive a dirlist at all when I use CURLOPT_NOBODY.
If I try it with CURLOPT_QUOTE +STAT I get the same errors as before.
It either tries to PRET it's way into there,
which the server does not expect and therefore throws that 504 error,
or if I disable the usage of PRET it tries to PASV since it still
thinks a data connection is about to be made.

>> The ftp server expects STAT -LA to come in without preceding PRET.
>
> Isn't that contrary to the intent of and the exact PRET specification?

I don't know if there are different specifications about this, I'm
quoting from http://drftpd.org/index.php/PRET_Specifications
"Commands that need PRET & PASV that are defined in RFC959: RETR STOR
STOU* LIST NLST APPE*"

>> My question now is, is there a way to use STAT instead of LIST already
>> which I've failed to notice ?
>
> Apparently it's not possibly due to it not requiring PRET. But I must admit I don't understand the logic for that, so I'm not really sure what the exact best fix or improvement would be there.

Maybe it would be possible in the sourcecode to only use PRET for the
commands mentioned above from the drftpd website?
Or as another idea maybe a CURLOPT_STATFORLIST or something similar
that will just let libcurl know that STAT is to be used which does not
require any data connections/PASV/PORT/EPSV/EPRT/PRET commands to be
executed to get the dirlist?

Either way, thanks for your reply!

Hendrik
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-18