Re: [Bug-wget] [Patch] fix bug #40426, wget hangs with -r and -O -
On 03/14/2015 09:45 PM, Miquel Llobet wrote: I just noticed this patch[1] on the big report which makes a lot more sense. I totally missed the patch Exactly the same happened to me. I didn't notice a patch had already been sent there long after I finished my intent, after hours of extensive hacking. Although the wiki says that patches should be sent to the list, some anonymous submitters send them via the Savannah bug tracker. I'm curious why a system hasn't been set up that automatically notifies the list each time someone submits a patch via the bug tracker. -- Regards, - AJ
Re: [Bug-wget] [PATCH] UTF-8-ify contributors' names in wget.texi (#40472)
Updated patch file, this time using git-diff. On 15 March 2015 at 10:15, Rohan Prinja rohan.pri...@gmail.com wrote: Hi everyone, This is my first time submitting a patch (I'm used to contributing to projects via Github) so I hope I'm not making any mistakes. Attached is a patch for bug #40472: https://savannah.gnu.org/bugs/?40472. PTAL, thank you. Regards, Rohan -- Rohan Prinja Fourth Year, CS Undergrad IIT Bombay diff --git a/doc/wget.texi b/doc/wget.texi index 5a214cf..73ffa6d 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -2,6 +2,7 @@ @c %**start of header @setfilename wget.info +@documentencoding UTF-8 @include version.texi @settitle GNU Wget @value{VERSION} Manual @c Disable the monstrous rectangles beside overfull hbox-es. @@ -59,11 +60,11 @@ Texts. A copy of the license is included in the section entitled @title GNU Wget @value{VERSION} @subtitle The non-interactive download utility @subtitle Updated for Wget @value{VERSION}, @value{UPDATED} -@author by Hrvoje Nik@v{s}i@'{c} and others +@author by Hrvoje Nikšić and others @ignore @c man begin AUTHOR -Originally written by Hrvoje Niksic hnik...@xemacs.org. +Originally written by Hrvoje Nikšić hnik...@xemacs.org. @c man end @c man begin SEEALSO This is @strong{not} the complete manual for GNU Wget. @@ -4101,12 +4102,7 @@ me). @section Contributors @cindex contributors -@iftex -GNU Wget was written by Hrvoje Nik@v{s}i@'{c} @email{hniksic@@xemacs.org}, -@end iftex -@ifnottex -GNU Wget was written by Hrvoje Niksic @email{hniksic@@xemacs.org}. -@end ifnottex +GNU Wget was written by Hrvoje Nikšić @email{hniksic@@xemacs.org}, However, the development of Wget could never have gone as far as it has, were it not for the help of many people, either with bug reports, feature proposals, @@ -4146,14 +4142,8 @@ portability fixes. Gordon Matzigkeit---@file{.netrc} support. @item -@iftex -Zlatko @v{C}alu@v{s}i@'{c}, Tomislav Vujec and Dra@v{z}en -Ka@v{c}ar---feature suggestions and ``philosophical'' discussions. -@end iftex -@ifnottex -Zlatko Calusic, Tomislav Vujec and Drazen Kacar---feature suggestions -and ``philosophical'' discussions. -@end ifnottex +Zlatko Čalušić, Tomislav Vujec and Dražen +Kačar---feature suggestions and ``philosophical'' discussions. @item Darko Budor---initial port to Windows. @@ -4163,21 +4153,11 @@ Antonio Rosella---help and suggestions, plus the initial Italian translation. @item -@iftex -Tomislav Petrovi@'{c}, Mario Miko@v{c}evi@'{c}---many bug reports and +Tomislav Petrović, Mario Mikočević---many bug reports and suggestions. -@end iftex -@ifnottex -Tomislav Petrovic, Mario Mikocevic---many bug reports and suggestions. -@end ifnottex @item -@iftex -Fran@,{c}ois Pinard---many thorough bug reports and discussions. -@end iftex -@ifnottex -Francois Pinard---many thorough bug reports and discussions. -@end ifnottex +François Pinard---many thorough bug reports and discussions. @item Karl Eichwalder---lots of help with internationalization, Makefile @@ -4240,12 +4220,7 @@ Wanderlei Cavassin, Gilles Cedoc, Tim Charron, Noel Cragg, -@iftex -Kristijan @v{C}onka@v{s}, -@end iftex -@ifnottex -Kristijan Conkas, -@end ifnottex +Kristijan Čonkaš, John Daily, Andreas Damm, Ahmon Dancy, @@ -4255,27 +4230,12 @@ Alexander Dergachev, Andrew Deryabin, Ulrich Drepper, Marc Duponcheel, -@iftex -Damir D@v{z}eko, -@end iftex -@ifnottex -Damir Dzeko, -@end ifnottex +Damir Džeko, Alan Eldridge, Hans-Andreas Engel, -@iftex -Aleksandar Erkalovi@'{c}, -@end iftex -@ifnottex -Aleksandar Erkalovic, -@end ifnottex +Aleksandar Erkalović, Andy Eskilsson, -@iftex -Jo@~{a}o Ferreira, -@end iftex -@ifnottex -Joao Ferreira, -@end ifnottex +João Ferreira, Christian Fraenkel, David Fritz, Mike Frysinger, @@ -4300,25 +4260,10 @@ Richard Huveneers, Jonas Jensen, Larry Jones, Simon Josefsson, -@iftex -Mario Juri@'{c}, -@end iftex -@ifnottex -Mario Juric, -@end ifnottex -@iftex -Hack Kampbj@o rn, -@end iftex -@ifnottex -Hack Kampbjorn, -@end ifnottex +Mario Jurić, +Hack Kampbjørn, Const Kaplinsky, -@iftex -Goran Kezunovi@'{c}, -@end iftex -@ifnottex -Goran Kezunovic, -@end ifnottex +Goran Kezunović, Igor Khristophorov, Robert Kleine, KOJIMA Haime, @@ -4327,31 +4272,14 @@ Alexander Kourakos, Martin Kraemer, Sami Krank, Jay Krell, -@tex -$\Sigma\acute{\iota}\mu o\varsigma\; -\Xi\varepsilon\nu\iota\tau\acute{\epsilon}\lambda\lambda\eta\varsigma$ -(Simos KSenitellis), -@end tex -@ifnottex -Simos KSenitellis, -@end ifnottex +Σίμος Ξενιτέλλης (Simos KSenitellis), Christian Lackas, Hrvoje Lacko, Daniel S.@: Lewart, -@iftex -Nicol@'{a}s Lichtmeier, -@end iftex -@ifnottex -Nicolas Lichtmeier, -@end ifnottex +Nicolás Lichtmeier, Dave Love, Alexander V.@: Lukyanov, -@iftex -Thomas Lu@ss{}nig, -@end iftex -@ifnottex -Thomas Lussnig, -@end ifnottex +Thomas Lußnig, Andre Majorel, Aurelien Marchand, Matthew J.@: Mellon, @@ -4372,31 +4300,15 @@ Leonid Petrov, Simone Piunno, Andrew Pollock, Steve
Re: [Bug-wget] Patch: Ports test for restrict-filename to python
Hi, I have attached a new patch which included the old test files I have created and 3 more additional test files along with the changes suggested by Darshit and Zihang. Kindly review it and let me know if my patch requires further improvements. Thanks and Regards, Elita Lobo On Sun, Mar 15, 2015 at 12:18 AM, Darshit Shah dar...@gmail.com wrote: Hi Elita, Thanks for the contribution! It's a good set of patches that ports some important tests to the Python Test Suite. However, I had a couple of suggestions. Could you also please retain the comments from the original tests about why that particular filename was chosen? It adds a lot of value to the test when it explains some of the background information. Also, could you please edit your commit message to be in sync with the GNU ChangeLog style commit messages? Take a look at the existing commit messages for ideas. -- Thanking You, Darshit Shah From e244aa2c7ccc2e5c58eecf81f57c199dbfddf3d4 Mon Sep 17 00:00:00 2001 From: Elita Lobo loboel...@gmail.com Date: Sun, 15 Mar 2015 23:18:07 +0530 Subject: [PATCH] Ports test from old test suite to Python * Test-restrict-lowercase.py: Tests --restrict-filename=lowercase feature * Test-restrict-ascii.py: Tests --restrict-filename=ascii feature * Test-restrict-uppercase.py: Tests --restrict-filename=uppercase feature *Test-nonexisting-quiet.py: Tests Wget's quiet feature * Test-start-pos.py: Tests Wget's --start-pos feature * Test-start-pos--continue.py Tests Wget's --start-pos with -c feature * Makefile.am: Adds newly added testfiles to test suite --- testenv/Makefile.am | 8 - testenv/Test-nonexisting-quiet.py | 48 ++ testenv/Test-restrict-ascii.py | 67 + testenv/Test-restrict-lowercase.py | 57 +++ testenv/Test-restrict-uppercase.py | 57 +++ testenv/Test-start-pos--continue.py | 55 ++ testenv/Test-start-pos.py | 51 7 files changed, 342 insertions(+), 1 deletion(-) create mode 100644 testenv/Test-nonexisting-quiet.py create mode 100644 testenv/Test-restrict-ascii.py create mode 100644 testenv/Test-restrict-lowercase.py create mode 100644 testenv/Test-restrict-uppercase.py create mode 100644 testenv/Test-start-pos--continue.py create mode 100644 testenv/Test-start-pos.py diff --git a/testenv/Makefile.am b/testenv/Makefile.am index a4e0352..a275df2 100644 --- a/testenv/Makefile.am +++ b/testenv/Makefile.am @@ -53,7 +53,13 @@ if HAVE_PYTHON3 Test-Post.py\ Test-504.py \ Test--spider-r.py \ -Test-redirect-crash.py +Test-redirect-crash.py \ +Test-restrict-ascii.py \ +Test-restrict-lowercase.py \ +Test-restrict-uppercase.py \ +Test-nonexisting-quiet.py \ +Test-start-pos.py \ +Test-start-pos--continue.py # added test cases expected to fail here and under TESTS XFAIL_TESTS = diff --git a/testenv/Test-nonexisting-quiet.py b/testenv/Test-nonexisting-quiet.py new file mode 100644 index 000..5b22d0c --- /dev/null +++ b/testenv/Test-nonexisting-quiet.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +from sys import exit +from test.http_test import HTTPTest +from misc.wget_file import WgetFile + + +Test for Wget nonexisting quiet. --quiet turns off Wget's output. + +TEST_NAME = Test nonexisting quiet + File Definitions # +dummyfile = This is a dummy file + +A_File = WgetFile(dummy.html, dummyfile) + +WGET_OPTIONS = --quiet +WGET_URLS = [[nonexistent]] + +Files = [[A_File]] + +ExpectedReturnCode = 8 +ExpectedDownloadedFiles = [] + +### Pre and Post Test Hooks ### +pre_test = { +ServerFiles : Files, +} +test_options = { +WgetCommands :WGET_OPTIONS, +Urls :WGET_URLS +} +post_test = { +ExpectedFiles: ExpectedDownloadedFiles, +ExpectedRetcode : ExpectedReturnCode +} + +err = HTTPTest ( + name=TEST_NAME, + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test +).begin () + +exit(err) + + + + + diff --git a/testenv/Test-restrict-ascii.py b/testenv/Test-restrict-ascii.py new file mode 100644 index 000..c974f68 --- /dev/null +++ b/testenv/Test-restrict-ascii.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +from sys import exit +from test.http_test import HTTPTest +from misc.wget_file import WgetFile + + +This program tests that --restrict-file-names=ascii can be used to +ensure that all high-valued bytes are escaped. The sample filename was +chosen because in former versions of
Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout
Miquel Llobet mllobet...@gmail.com writes: It seems like the correct thing to do. Could you please just use as ChangeLog-style like commit message? Yes! Sorry about that, here is the patch with the new commit message. Let me know if this is correct. Fixed #44516 -o- not logging to stdout src/log.c (log_init): check for hypen on filename, set stdout --- src/log.c.origin 2015-03-13 01:32:27.0 +0100 +++ src/log.c 2015-03-13 01:44:31.0 +0100 @@ -598,11 +598,18 @@ { if (file) { - logfp = fopen (file, appendp ? a : w); - if (!logfp) + if (HYPHENP (file)) { - fprintf (stderr, %s: %s: %s\n, exec_name, file, strerror (errno)); - exit (WGET_EXIT_GENERIC_ERROR); + logfp = stdout; + } + else + { + logfp = fopen (file, appendp ? a : w); + if (!logfp) + { + fprintf (stderr, %s: %s: %s\n, exec_name, file, strerror (errno)); + exit (WGET_EXIT_GENERIC_ERROR); + } } } I think the indentation got screwed here. Would you send the patch attaching what 'git format-patch' gives you or using git send-email? As the patch doesn't change many lines, we can merge it before waiting for the copyright assignments to the FSF. Thanks, Giuseppe
Re: [Bug-wget] Patch: Ports test for restrict-filename to python
Hi Elita, I'm putting my comments inline Subject: [PATCH] Ports test from old test suite to Python * Test-restrict-lowercase.py: Tests --restrict-filename=lowercase feature * Test-restrict-ascii.py: Tests --restrict-filename=ascii feature * Test-restrict-uppercase.py: Tests --restrict-filename=uppercase feature *Test-nonexisting-quiet.py: Tests Wget's quiet feature * Test-start-pos.py: Tests Wget's --start-pos feature * Test-start-pos--continue.py Tests Wget's --start-pos with -c feature * Makefile.am: Adds newly added testfiles to test suite That's one *long* commit message! Could you please take a look at the other commit messages we've written and write yours accordingly? --- /dev/null +++ b/testenv/Test-nonexisting-quiet.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +from sys import exit +from test.http_test import HTTPTest +from misc.wget_file import WgetFile + + +Test for Wget nonexisting quiet. --quiet turns off Wget's output. + +TEST_NAME = Test nonexisting quiet + File Definitions # +dummyfile = This is a dummy file + +A_File = WgetFile(dummy.html, dummyfile) + +WGET_OPTIONS = --quiet +WGET_URLS = [[nonexistent]] + +Files = [[A_File]] + +ExpectedReturnCode = 8 +ExpectedDownloadedFiles = [] + +### Pre and Post Test Hooks ### +pre_test = { +ServerFiles : Files, +} +test_options = { +WgetCommands :WGET_OPTIONS, +Urls :WGET_URLS +} +post_test = { +ExpectedFiles: ExpectedDownloadedFiles, +ExpectedRetcode : ExpectedReturnCode +} + +err = HTTPTest ( + name=TEST_NAME, + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test +).begin () + +exit(err) + + + + + I'm not sure what is the point of this test. A test for non-existent files I can understand, but the we;re not really testing the -q option here. How would you test for the quiet option? Also, trailing newline characters at the end of the file. diff --git a/testenv/Test-restrict-ascii.py b/testenv/Test-restrict-ascii.py new file mode 100644 index 000..c974f68 --- /dev/null +++ b/testenv/Test-restrict-ascii.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +from sys import exit +from test.http_test import HTTPTest +from misc.wget_file import WgetFile + + +This program tests that --restrict-file-names=ascii can be used to +ensure that all high-valued bytes are escaped. The sample filename was +chosen because in former versions of Wget, one could either choose not +to escape any portion of the UTF-8 filename via +--restrict-file-names=nocontrol (which would only be helpful if one +was _on_ a UTF-8 system), or else Wget would escape _portions_ of +characters, leaving irrelevant latin1-looking characters combined +with percent-encoded control characters, instead of encoding all the +bytes of an entire non-ASCII UTF-8 character. + + +TEST_NAME = Restrict filename:ascii + +# gnosis in UTF-8 greek +gnosis = %CE%B3%CE%BD%CF%89%CF%83%CE%B9%CF%82 + File Definitions # + +mainpage = +html +head + titleSome Page Title/title +/head +body + p +Some text... + /p +/body +/html + +A_File = WgetFile(gnosis + .html, mainpage) + +WGET_OPTIONS = --restrict-file-names=ascii +WGET_URLS = [[gnosis + .html]] + If we're _always_ using `gnosis + .html`, why not add that string to the variable directly? +Files = [[A_File]] + +ExpectedReturnCode = 0 +ExpectedDownloadedFiles = [A_File] + +# Pre and Post Test hooks +pre_test = { +ServerFiles :Files, +} Just nitpicking here, but the alignment is off. It's off in other places too, but I'll mention it only here. I realize that this test suite doesn't follow PEP8 at all, and I would like to fix that at some point. But till then it's best to stick to existing formatting style. +test_options = { +WgetCommands:WGET_OPTIONS, +Urls:WGET_URLS +} +post_test = { +ExpectedFiles : ExpectedDownloadedFiles, +ExpectedRetcode : ExpectedReturnCode +} + +err = HTTPTest ( + name=TEST_NAME, + pre_hook=pre_test, + test_params=test_options, + post_hook=post_test +).begin () + +exit(err) + - snip - diff --git a/testenv/Test-start-pos--continue.py b/testenv/Test-start-pos--continue.py new file mode 100644 index 000..dfc1a38 --- /dev/null +++ b/testenv/Test-start-pos--continue.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python3 +from sys import exit +from test.http_test import HTTPTest +from misc.wget_file import WgetFile + + +Tests if Wget correctly starts downloading bytes from the given start position (--start-pos=OFFSET) in the file. + +TEST_NAME = Test start-pos + File Definitions
Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout
Yeah, I'll be using git format patch from now on. Do you prefer pasting the commit on the message or attaching a file? Best, Miquel Llobet On Sun, Mar 15, 2015 at 8:59 PM, Giuseppe Scrivano gscriv...@gnu.org wrote: Miquel Llobet mllobet...@gmail.com writes: It seems like the correct thing to do. Could you please just use as ChangeLog-style like commit message? Yes! Sorry about that, here is the patch with the new commit message. Let me know if this is correct. Fixed #44516 -o- not logging to stdout src/log.c (log_init): check for hypen on filename, set stdout --- src/log.c.origin 2015-03-13 01:32:27.0 +0100 +++ src/log.c 2015-03-13 01:44:31.0 +0100 @@ -598,11 +598,18 @@ { if (file) { - logfp = fopen (file, appendp ? a : w); - if (!logfp) + if (HYPHENP (file)) { - fprintf (stderr, %s: %s: %s\n, exec_name, file, strerror (errno)); - exit (WGET_EXIT_GENERIC_ERROR); + logfp = stdout; + } + else + { + logfp = fopen (file, appendp ? a : w); + if (!logfp) + { + fprintf (stderr, %s: %s: %s\n, exec_name, file, strerror (errno)); + exit (WGET_EXIT_GENERIC_ERROR); + } } } I think the indentation got screwed here. Would you send the patch attaching what 'git format-patch' gives you or using git send-email? As the patch doesn't change many lines, we can merge it before waiting for the copyright assignments to the FSF. Thanks, Giuseppe 0001-Fixed-44516-o-not-logging-to-stdout.patch Description: Binary data
Re: [Bug-wget] [PATCH] Corrected documentation
As per Wget 1.16.3, the default SSL backend is GnuTLS, so the docs are lying. I notice that where the SSL backend should be generally mentioned, OpenSSL is explicitly mentioned. For example: Without this option Wget looks for CA certificates at the system-specified locations, chosen at OpenSSL installation time. Some options are OpenSSL-specific, and those are correctly identified. But there are other concepts that are common to both OpenSSL and GnuTLS, and maybe every other SSL backend out there. These concepts should be explained in general terms, without explicitly naming OpenSSL. Regards, - AJ
[Bug-wget] [PATCH] Corrected documentation
As per Wget 1.16.3, the default SSL backend is GnuTLS, so the docs are lying. The default SSL backend is the one that gets compiled by make if ./configure is run without '--with-ssl'. diff --git a/ChangeLog b/ChangeLog index e69de29..0e6974a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -0,0 +1,4 @@ +2015-03-15 Ander Juaristi ajuari...@gmx.es + +* wget.texi: The default is GnuTLS, not OpenSSL. + diff --git a/doc/wget.texi b/doc/wget.texi index 5a214cf..9a66586 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -1642,7 +1642,7 @@ @cindex SSL To support encrypted HTTP (HTTPS) downloads, Wget must be compiled -with an external SSL library, currently OpenSSL. If Wget is compiled +with an external SSL library. The current default is GnuTLS. If Wget is compiled without SSL support, none of these options are available. @table @samp Regards, - AJ
Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout
Miquel Llobet mllobet...@gmail.com writes: Yeah, I'll be using git format patch from now on. Do you prefer pasting the commit on the message or attaching a file? shouldn't make a difference, but just attach it, less risky to be changed by the mail client. Thanks, Giuseppe
Re: [Bug-wget] [Patch] fix bug #39175 Header value length limited with 256
Miquel Llobet mllobet...@gmail.com writes: Could this be dinamically allocated? Indeed it can! Thanks Giuseppe and Darshit for pointing out. Ideally we should change all the resp_header_copy calls to resp_header_strdup (dynamic resp header copy). There is a bit to code to change, as the function returns are different etc. expect a big patch. since there is a reasonable upperbound value, can't we just have something like: char *hdrval = xmalloc(8192);? What is left to do is ensure we don't leak this buffer when the function exits. Regards, Giuseppe
Re: [Bug-wget] gethttp cleanup
Miquel, I know you were working on gethttp to increase the header size to 8kb, if you already have done something, I promise I will rebase your patch on top of my series :-) I wasn't done yet so it's okay :-) Actually with this single cleanup label idea it should look a lot better, I'd love to work on that. Miquel Llobet On Mon, Mar 16, 2015 at 2:18 AM, Giuseppe Scrivano gscriv...@gnu.org wrote: Hi, spring is coming and it is time for some cleanup. I have refactored a bit gethttp and moved some code to other functions. It is mostly mechanical code movements, and I hope to do some more work on this (if other people want to jump in, you are welcome!) and simplify gethttp even more. It is still a huge beast, but should be weaker after the series below. I will wait for comments before pushing these patches. Miquel, I know you were working on gethttp to increase the header size to 8kb, if you already have done something, I promise I will rebase your patch on top of my series :-) If some GSoC students want to have something more or less easy to warm up, here is an idea: move gethttp to use a single cleanup label at the end of the function. Avoid early exits from gethttp and replace them with goto cleanup, all the cleanups must be done after this point (this means local variables must be properly initialized as they could be cleaned-up before they were supposed to be). Cheers, Giuseppe