cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: PRET + Customrequest (STAT) issue

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 18 Jan 2011 22:41:25 +0100 (CET)

On Tue, 18 Jan 2011, ElBandito wrote:

>> 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.

Right, as the actual directory listing is a "body".. I'm sorry if I mislead
you, I just meant that you can avoid the dir listing with that option.

You should be able to use STAT with a regular CURLOPT_QUOTE usage.

>> 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

That's the specification I meant. There's no other to my knowledge.

> "Commands that need PRET & PASV that are defined in RFC959: RETR STOR STOU*
> LIST NLST APPE*"

Thinking about it, the whole PRET thing is designed to overcome a "quirk" with
PASV so it only makes sense when PASV (or EPSV) is used so STAT listings
really shouldn't.

But OTOH, CUSTOMREQUEST is not currently designed to alter behavior. It is
made to allow the app to change the actual reqeust command.

> Maybe it would be possible in the sourcecode to only use PRET for the
> commands mentioned above from the drftpd website?

I think the list is too narrow though, as MLST and MLSD aren't mentioned and
clearly should be subject to the same rules (RFC3659). I would rather say more
genericly that PRET should be used for all commands that after PASV will cause
a data connection to get established and used.

> 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?

I think we should start with treating "STAT" special as I don't think there
are that many other commands like it. If "STAT" is used instead of LIST or
NLST, then libcurl shouldn't do any data connection at all.

You up to making a patch for this?

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