Bug 377 - wget should handle the -T timeout option
Summary: wget should handle the -T timeout option
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: unspecified
Hardware: All All
: P5 enhancement
Target Milestone: ---
Assignee: Bradley M. Kuhn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-05 15:13 UTC by Raphael Jacquot
Modified: 2010-08-11 21:49 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:


Attachments
FEATURE_WGET_TIMEOUT: in wget applet, support "-T seconds" option for network read timeout. (7.85 KB, patch)
2010-08-07 22:00 UTC, Bradley M. Kuhn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Jacquot 2009-06-05 15:13:17 UTC
This option is extremely important when wget is used within cron scripts. the option not being available can lead to multiple stuck scripts that need to be cleaned by hand or blasted by some other shell script.
Comment 1 Bradley M. Kuhn 2010-08-06 23:01:18 UTC
In 2008, Matthias Kaehlcke <matthias@kaehlcke.net> posted a patch to the mailing list for this: http://lists.busybox.net/pipermail/busybox/2008-August/066797.html

It does not appear his patch was ever applied; there was some discussion about bloat and then Denys suggested:
> To be honest, whole dance with alarm() in wget needs rewriting,
> poll(..., seconds*1000) + read() would allow signal-less handling
> of progressmeter and/or timeout.

So doing that is probably the right next step here.
Comment 2 Bradley M. Kuhn 2010-08-07 22:00:42 UTC
Created attachment 2329 [details]
FEATURE_WGET_TIMEOUT: in wget applet, support "-T seconds" option for network read timeout.

As Denys suggested, I reworked alarm() -> poll() for the progress meter, and then used that change to add the -T seconds timeout option for wget, which is now FEATURE_WGET_TIMEOUT in the attached patch.
See more details on this mailing list post:
http://lists.busybox.net/pipermail/busybox/2010-August/073074.html
Comment 3 Denys Vlasenko 2010-08-08 00:54:55 UTC
Patch is applied to git, will be in 1.18.x

Thanks!