URL specific options
Date: Sun, 9 Feb 2014 13:14:21 +0000
Over the last week or so I have been pushing various changes to the cURL
command tool to enable URL specific options and have finally pushed my
commit to enable this ability in the cURL command line tool. As such you can
now start playing with the ability should you wish to and throw any feedback
this way ;-)
The old operate() function has been split up so that initialisation of
libcurl, memory tracking, locale and parsing of command line arguments, etc.
all takes place before the main operations occur. However, I still have a
few changes to make, but before I make these I have some concerns that I
would like your input on:
* If a username is specified in each separate operation but no password (for
either the host or proxy), the user will be asked for the password in each
operation as they take place. Should this be performed up front before the
first operation is called? Currently this takes place in operate_do() but
could be moved to operate() just after the parsing of the command line
* Should the prompt for this password differentiate each host rather than
prompting "Enter host password for user 'Abc':" or "Enter proxy password for
user 'Xyz':" ?
* The initialisation and clean-up of libcurl source code generation still
takes place in operate_do() as this is the old operate() function.
Technically it is possible to specify this on each operation but should
probably be more of a global option with the initialisation being moved to
the new operate() function. Should we introduce global options that apply to
all operations for options like this?
* I have removed the curl handle freeing from operate_do() as a) This would
destroy the handle after the first operation for any further operations and
b) It was already being performed in config_free_fields(). From my own
testing I don't see any problem with this, but the comment that was in there
has me a little worried. So, does the curl easy handle need to be destroyed
whilst the progress bar variable is still in scope? If so, can I move the
progress bar to be a single instance across all operations by making it
again part of operate() which would then be passed down to operate_do() ?
* Do we need to reset certain curl_easy_setopt() options after each
operation? For example if the user specifies a custom request with -X on the
first operation then it will be inherited on the second if it is not
overridden. Note: Both Test 815 and 816 overwrite it in the second
operation. However, we don't currently have a way to set it back to NULL.
* How should we document the separating ":" character in --help? It doesn't
feel right to mention it in the options but I can't think of the best format
to use if we mention it in the usage line.
* Where is the best place to mention the separator character in the man
Many thanks in advance.
List admin: http://cool.haxx.se/list/listinfo/curl-library
Received on 2014-02-09