wok view busybox/stuff/busybox-1.26-bug9471.u @ rev 19654

busybox: add buf 9471 fix (for wget)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 25 09:31:52 2017 +0100 (2017-01-25)
parents
children
line source
1 --- busybox-1.26.2/networking/wget.c
2 +++ busybox-1.26.2/networking/wget.c
3 @@ -1093,12 +1093,19 @@
4 }
6 fflush(sfp);
7 - /* If we use SSL helper, keeping our end of the socket open for writing
8 - * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
9 - * even after child closes its copy of the fd.
10 - * This helps:
11 - */
12 - shutdown(fileno(sfp), SHUT_WR);
13 +/* Tried doing this unconditionally.
14 + * Cloudflare and nginx/1.11.5 are shocked to see SHUT_WR on non-HTTPS.
15 + */
16 +#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
17 + if (target.protocol == P_HTTPS) {
18 + /* If we use SSL helper, keeping our end of the socket open for writing
19 + * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
20 + * even after child closes its copy of the fd.
21 + * This helps:
22 + */
23 + shutdown(fileno(sfp), SHUT_WR);
24 + }
25 +#endif
27 /*
28 * Retrieve HTTP response line and check for "200" status code.