Bug 9591

Summary: 1.26.2 wget doesn't fetch the whole file
Product: Busybox Reporter: Béla Márkus <bela_markus>
Component: NetworkingAssignee: unassigned
Status: RESOLVED FIXED    
Severity: blocker CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:
Attachments: Config file

Description Béla Márkus 2017-01-13 13:47:33 UTC
BusyBox 1.26.2 wget retrieves files partially with http:// 1.25.1 and 1.24.2 works as expected.

Built on Raspberry Pi3 in piCore Linux.
Comment 1 Denys Vlasenko 2017-01-13 21:14:10 UTC
Can you be more specific.
Which URL it does not download?
Does the same config work on x86?
Please attach your .config.
Please attach tcpdump of the good (old version) and bad wget runs.
Comment 2 Béla Márkus 2017-01-15 15:21:11 UTC
Created attachment 6856 [details]
Config file
Comment 3 Béla Márkus 2017-01-15 15:22:53 UTC
http://repo.tinycorelinux.net/8.x/armv7/tcz/md5.db.gz

Didn't try on x86
Comment 4 Denys Vlasenko 2017-01-16 16:26:36 UTC
It's caused by this:

                /* If we use SSL helper, keeping our end of the socket open for writing
                 * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
                 * even after child closes its copy of the fd.
                 * This helps:
                 */
                shutdown(fileno(sfp), SHUT_WR);

Evidently, nginx is startled to find that we are not going to write anything to the connection. It stops sending data and closes the connection too soon.

commit a6f8651911716d1d1624712eb19e4f3608767c7e which fixes this will be backported to 1.26.x

Thanks.