On Wed, Sep 7, 2011 at 12:34 PM, William A. Rowe Jr. <[email protected]> wrote: > On 9/3/2011 12:42 PM, [email protected] wrote: >> Author: covener >> Date: Sat Sep 3 17:42:56 2011 >> New Revision: 1164894 >> >> URL: http://svn.apache.org/viewvc?rev=1164894&view=rev >> Log: >> backport revisions 1162584, 1164861, 1162587 from trunk: >> >> Add MaxRanges directive and limit # of accepted ranges to 200 by default. > > So this doesn't make sense in deploying a patch but seems appropriate to at > least allow for compiled-in settings... For purposes of < 2.2.21 patching, > this would be my interpretation, using the same -Define as in the soon to be > released versions. Comments? >
>> Modified: httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c >> URL: >> http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c?rev=1164894&r1=1164893&r2=1164894&view=diff >> ============================================================================== >> --- httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c (original) >> +++ httpd/httpd/branches/2.2.x/modules/http/byterange_filter.c Sat Sep 3 >> 17:42:56 2011 >> @@ -55,6 +55,10 @@ >> #include <unistd.h> >> #endif >> >> +#ifndef DEFAULT_MAX_RANGES >> +#define DEFAULT_MAX_RANGES 200 >> +#endif >> + >> static int ap_set_byterange(request_rec *r, apr_off_t clength, >> apr_array_header_t **indexes); >> >> @@ -290,7 +294,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_ >> num_ranges = ap_set_byterange(r, clength, &indexes); >> >> /* We have nothing to do, get out of the way. */ >> - if (num_ranges == 0) { >> + if (num_ranges == 0 || (DEFAULT_MAX_RANGES > 0 && num_ranges > >> DEFAULT_MAX_RANGES)) { >> r->status = original_status; >> ap_remove_output_filter(f); >> return ap_pass_brigade(f->next, bb); >> > > I think it's useful, but maybe not baked into the same patch as the fix? Just noticing -- should the macro be AP_* before it ships in 2.2.21 or apply_to/? -- Eric Covener [email protected]
