The original patch caused a SIGABRT that I missed. wget now returns with an exit status of 3.
Uploading the updated patch file and another with the test to ensure the correct return code. On Tue, Mar 12, 2013 at 2:03 AM, Giuseppe Scrivano <[email protected]>wrote: > Thanks for your your patch! Some comments: > > Darshit Shah <[email protected]> writes: > > > Attaching a patch to make wget abort instead of sending an empty request > if the file pointed to in --post-file does not exist. > > + return FILEBADFILE; > > what exit status will be returned by the wget process? > > I am not sure FILEBADFILE is handled by get_exit_status (in exits.c). I > think we should ensure the exit status is 3 in this case (File I/O > error). > > As additional bonus, could you write a simple test case to exercise your > code? > > You can copy the Test-noop.px file as a starting point then change the > cmdline to something like (add the new file to the Makefile.am file too): > > my $cmdline = $WgetTest::WGETPATH . " --post-file=nothere > http://localhost:{{port}}/"; > > Then you can check that the expected_error_code is 3. > > Cheers, > Giuseppe > -- Thanking You, Darshit Shah Research Lead, Code Innovation Kill Code Phobia. B.E.(Hons.) Mechanical Engineering, '14. BITS-Pilani
non-existing-post-file.patch
Description: Binary data
Test--post-file.patch
Description: Binary data
