Bug 377

Summary: wget should handle the -T timeout option
Product: Busybox Reporter: Raphael Jacquot <sxpert>
Component: NetworkingAssignee: Bradley M. Kuhn <bkuhn>
Status: RESOLVED FIXED    
Severity: enhancement CC: bkuhn, busybox-cvs, sxpert
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:
Attachments: FEATURE_WGET_TIMEOUT: in wget applet, support "-T seconds" option for network read timeout.

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!