| Summary: | httpd fails to honor byte range requests if the range begins with 0 | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Rob Walker <rwalker> |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.19.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | change byte range test to use a separate boolean | ||
|
Description
Rob Walker
2012-02-17 19:45:35 UTC
Created attachment 4046 [details]
change byte range test to use a separate boolean
I don't know how sensitive BusyBox is to a word vs. a byte vs. a bit for data. Negative values of range_start could also be used as a positive boolean, instead of the smallint range_req I've proposed. To summarize: if a range is requested and the Range: header is reasonable, set range_start to requested value | ~MAX_INT (sets high bit) range_start == 0 => no byte range requested or served range_start != 0 => serve a byte range starting from (range_start ^ ~MAX_INT) I don't know if BusyBox httpd has been tested or is expected to work with > 2GB files, though. (In reply to comment #2) > I don't know how sensitive BusyBox is to a word vs. a byte vs. a bit for data. You can check the size increase with $ scripts/bloat-o-meter busybox_unstripped.unpatched busybox_unstripped (cp busybox_unstripped busybox_unstripped.unpatched for a pristine build, then apply your patch and rebuild). > Negative values of range_start could also be used as a positive boolean, > instead of the smallint range_req I've proposed. > > To summarize: > if a range is requested and the Range: header is reasonable, set range_start to > requested value | ~MAX_INT (sets high bit) > > range_start == 0 => no byte range requested or served > range_start != 0 => serve a byte range starting from (range_start ^ ~MAX_INT) > > I don't know if BusyBox httpd has been tested or is expected to work with > 2GB > files, though. The httpd works fine with files > 2GB, yes. I propose to change "range_start != 0" condition for range_start >= 0 everywhere, and set range_start = -1 when range is off. |