[Bug 4754] New: httpd with sendfile fails to send large file

bugzilla at busybox.net bugzilla at busybox.net
Sat Feb 4 16:15:37 UTC 2012


           Summary: httpd with sendfile fails to send large file
           Product: Busybox
           Version: 1.19.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at busybox.net
        ReportedBy: green at rg3.name
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0

When built with "sendfile" support, httpd is unable to send large files (> 2
GB) in one single connection, terminating it before the full file has been
sent. Some programs are smart and try to complete the download, which works
(e.g. wget), but some other programs are not smart or do not try to be smart
and end up with a truncated file.

I *think* the bug resides in httpd.c, line 1626. It reads:

            IF_FEATURE_HTTPD_RANGES(range_len -= sz;)

and I believe it should be:

            IF_FEATURE_HTTPD_RANGES(range_len -= count;)

Because sendfile() returns after 2 GB, which is reflected in "count", and it
has to be called more times until the file has been completely sent.

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list