wok-current 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 9d5829b82b92
children 662559033c60
files busybox/receipt busybox/stuff/busybox-1.26-bug9471.u
line diff
     1.1 --- a/busybox/receipt	Wed Jan 25 03:21:58 2017 +0200
     1.2 +++ b/busybox/receipt	Wed Jan 25 09:31:52 2017 +0100
     1.3 @@ -46,6 +46,7 @@
     1.4  ftpd.u
     1.5  shutdown.u
     1.6  scriptreplay.u
     1.7 +bug9471.u
     1.8  EOT
     1.9      cp $stuff/$PACKAGE-${VERSION%.*}.config .config
    1.10  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/busybox/stuff/busybox-1.26-bug9471.u	Wed Jan 25 09:31:52 2017 +0100
     2.3 @@ -0,0 +1,28 @@
     2.4 +--- busybox-1.26.2/networking/wget.c
     2.5 ++++ busybox-1.26.2/networking/wget.c
     2.6 +@@ -1093,12 +1093,19 @@
     2.7 + 		}
     2.8 + 
     2.9 + 		fflush(sfp);
    2.10 +-		/* If we use SSL helper, keeping our end of the socket open for writing
    2.11 +-		 * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
    2.12 +-		 * even after child closes its copy of the fd.
    2.13 +-		 * This helps:
    2.14 +-		 */
    2.15 +-		shutdown(fileno(sfp), SHUT_WR);
    2.16 ++/* Tried doing this unconditionally.
    2.17 ++ * Cloudflare and nginx/1.11.5 are shocked to see SHUT_WR on non-HTTPS.
    2.18 ++ */
    2.19 ++#if ENABLE_FEATURE_WGET_OPENSSL || ENABLE_FEATURE_WGET_SSL_HELPER
    2.20 ++		if (target.protocol == P_HTTPS) {
    2.21 ++			/* If we use SSL helper, keeping our end of the socket open for writing
    2.22 ++			 * makes our end (i.e. the same fd!) readable (EAGAIN instead of EOF)
    2.23 ++			 * even after child closes its copy of the fd.
    2.24 ++			 * This helps:
    2.25 ++			 */
    2.26 ++			shutdown(fileno(sfp), SHUT_WR);
    2.27 ++		}
    2.28 ++#endif
    2.29 + 
    2.30 + 		/*
    2.31 + 		 * Retrieve HTTP response line and check for "200" status code.