Add a New Comment Rich Markup
Okay, this is a crazy issue, and I'm surprised no one has reported it in so many years! I think this issue has likely existed for 15 years if not more. The problem is simple: We pass the file descriptor of the file to which the downloaded document is saved in order to parse it for any links. So, when you combine -p with -O-, what you get is that Wget waits indefinitely on a read() call on stdout. Which will NEVER return anything. In order to handle -p and -O properly, I think we should download to a temporary file before parsing and then append it to the output file. This is especially important when using -O-. When writing to a real file, we could probably optimize the process by writing directly to the file and then calling fseek() to only process the newly downloaded part of the file. I would wager this is also an issue with -r -O-.
I can verify that this is an issue on all platforms. However, the issue is not when writing to pipes, but rather when writing to a pipe and using --page-requisites
When writing to a terminal as stdout, wget termintesnormally: wget -O - -p https://de.xhamster.com/photos/gallery/scarlett-johansson-15779909/ works like a charm. Piping this output into some other program is not so successful: wget -O - -p https://de.xhamster.com/photos/gallery/scarlett-johansson-15779909/ | wc never really finishes and just hangs. Cygwin under W10. Version is 1.20.3
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 5 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.12