httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: svn commit: r1164894 - in /httpd/httpd/branches/2.2.x: CHANGES docs/conf/httpd.conf.in docs/manual/mod/core.xml include/ap_mmn.h include/http_core.h modules/http/byterange_filter.c server/core.c
Date Wed, 07 Sep 2011 16:34:45 GMT
On 9/3/2011 12:42 PM, covener@apache.org 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);
> 


Mime
View raw message