Re: Enhancing POP3 to support extra commands
Date: Tue, 6 Dec 2011 23:21:28 +0100 (CET)
On Tue, 6 Dec 2011, Graeme Gill wrote:
>> * I don't believe in inventing new CURLOPT_* options for each and every sub
>> command that a protocol can provide. It would quickly grow the amount of
>> options a lot, even if some of the commands would be possible to re-use
>> between protocols.
> Yet the latter seems to be the Curl standard way - see
Not exactly. There's no explitic option to send DELETE to a HTTP server.
There's no option to send "delete" to an FTP server. There's no option to send
"rm" to an SFTP server. They are all sent with the (same) QUOTE option.
> "Just note that you will have to use curl_easy_setopt(3) between the invokes
> to set options for the following curl_easy_perform."
I don't follow how that is related to our discussion. Are you saying we should
not allow multiple commands to get sent during a single curl_easy_perform()
like we already do for FTP and SFTP?
> If several protocols have a similar concept of "list", "delete" etc., then
> having a common way of selecting this reduced cognitive load, eases usage
> and reduces mistakes. Isn't this what's going on with CURLOPT_USE_SSL etc. ?
Yes it is, and you're right that it would offer a more abtract and less
protocol-specific way to do things.
Perhaps that _is_ a way forward... A problem would of course be that we
already have our current system implemented and used since many years, so it
would have to be a new system/option(s).
If someone would start working on such a system I would assist that work.
> Sure, such options are valuable, but why should the user of the API have to
> know the minutia of each protocol to do high level things like list or
> delete ?
I quite agree. It would be awesome to remove that requirement and instead be
able to refer to actual libcurl docs describing how to do things...
> I'm not sure that attempting to turn the current API upside-down is really
> justified for the purpose of adding a couple of common options. The "curl
> way" seems very much to be to use curl_easy_setopt/curl_multi_setopt, so
> CURLOPT_DIRLISTONLY and CURLOPT_DELETE seem perfectly consistent, even if
> they are a little clunky because you typically have to turn then on then
Except that DELETE is just one out of 47 (or 63 or whatever) different
commands that can be used. And they can be used in different times in the
flow and they can be a sequence in a given order. That'd be very hard to do
and certainly not easier to use with single options.
I can tell you never actually used the power of the QUOTE commands with FTP...
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2011-12-06