From: Denys Vlasenko Date: Sat, 4 Feb 2012 20:37:17 +0000 (+0100) Subject: httpd: fix sendfile of files larger than 2 Gb. Closes 4754 X-Git-Tag: 1_20_0~84 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ef43beac63aa7e4b2bccb069e47b5e4902bb895f;p=oweals%2Fbusybox.git httpd: fix sendfile of files larger than 2 Gb. Closes 4754 When built with "sendfile" support, httpd was unable to send large files (>2 GB) in one single connection, terminating it before the full file has been sent. Signed-off-by: Denys Vlasenko --- diff --git a/networking/httpd.c b/networking/httpd.c index 0e4c697f8..ba956318c 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -1623,7 +1623,7 @@ static NOINLINE void send_file_and_exit(const char *url, int what) break; /* fall back to read/write loop */ goto fin; } - IF_FEATURE_HTTPD_RANGES(range_len -= sz;) + IF_FEATURE_HTTPD_RANGES(range_len -= count;) if (count == 0 || range_len == 0) log_and_exit(); }