1 Apply fix for https://bugs.busybox.net/show_bug.cgi?id=9471 from git
3 diff --git a/networking/wget.c b/networking/wget.c
4 index c82086878..d5a92a950 100644
5 --- a/networking/wget.c
6 +++ b/networking/wget.c
11 +#define SSL_SUPPORTED (ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER)
16 @@ -147,7 +149,7 @@ struct host_info {
18 static const char P_FTP[] ALIGN1 = "ftp";
19 static const char P_HTTP[] ALIGN1 = "http";
20 -#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
22 static const char P_HTTPS[] ALIGN1 = "https";
25 @@ -448,7 +450,7 @@ static void parse_url(const char *src_url, struct host_info *h)
26 if (strcmp(url, P_FTP) == 0) {
27 h->port = bb_lookup_port(P_FTP, "tcp", 21);
29 -#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
31 if (strcmp(url, P_HTTPS) == 0) {
32 h->port = bb_lookup_port(P_HTTPS, "tcp", 443);
33 h->protocol = P_HTTPS;
34 @@ -1089,12 +1091,17 @@ static void download_one_url(const char *url)
38 - /* If we use SSL helper, keeping our end of the socket open for writing
39 - * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
40 - * even after child closes its copy of the fd.
43 - shutdown(fileno(sfp), SHUT_WR);
46 + if (target.protocol == P_HTTPS) {
47 + /* If we use SSL helper, keeping our end of the socket open for writing
48 + * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
49 + * even after child closes its copy of the fd.
52 + shutdown(fileno(sfp), SHUT_WR);
57 * Retrieve HTTP response line and check for "200" status code.