bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] More improvements to the --method command


From: Darshit Shah
Subject: [Bug-wget] More improvements to the --method command
Date: Wed, 24 Apr 2013 10:36:03 +0530

The recent patch by Gijs got me thinking if I've missed out on any other
references to the old --post-data and --post-file commands.

In src/http.c, when setting *meth, we no longer need to explicitly test for
opt.post_data || opt.post_file_name to set the method to POST.
This is being handled in main() when we the --method option. Hence this is
redundant code which will NEVER be reached.

Also, the location on the code where the old --post-{data,file} commands
are converted to --body-{data,file} commands was changed.
This is so as to improve the verbose output of Wget. Earlier, any issue
with the --post- commands would create an output that referenced the
corresponding --body commands.
By making the conversion AFTER the sanity checks, the user will not be
confused and see the correct error message on the screen.
This also has the additional advantage that it will prevent the user from
using both --body-{data,file} commands and --post-{data,file} commands.
This is desirable since the this situation the --body-{data,file} values
will ALWAYS be overridden by the --post-{data,file} values.

Attaching a patch for these issues.

-- 
Thanking You,
Darshit Shah
Research Lead, Code Innovation
Kill Code Phobia.
B.E.(Hons.) Mechanical Engineering, '14. BITS-Pilani

Attachment: 0001-Improve-output-in-case-of-post-file-body-commands.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]