On 09/12/2011 04:15 PM, [email protected] wrote:
> Author: jim
> Date: Mon Sep 12 14:15:53 2011
> New Revision: 1169756
> 
> URL: http://svn.apache.org/viewvc?rev=1169756&view=rev
> Log:
> Add in MaxRangeOverlaps and MaxRangeReversals to accomodate
> more control over acceptable Range headers:
> 
>         See: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/311
> 
> Modified:
>     httpd/httpd/trunk/CHANGES
>     httpd/httpd/trunk/docs/manual/mod/core.xml
>     httpd/httpd/trunk/include/ap_mmn.h
>     httpd/httpd/trunk/include/http_core.h
>     httpd/httpd/trunk/modules/http/byterange_filter.c
>     httpd/httpd/trunk/server/core.c
> 
> Modified: httpd/httpd/trunk/CHANGES
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1169756&r1=1169755&r2=1169756&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/CHANGES [utf-8] (original)
> +++ httpd/httpd/trunk/CHANGES [utf-8] Mon Sep 12 14:15:53 2011
> @@ -12,6 +12,11 @@ Changes with Apache 2.3.15
>       PR 51714. [Stefan Fritsch, Jim Jagielski, Ruediger Pluem, Eric Covener,
>       <lowprio20 gmail.com>]
>  
> +  *) core: Add MaxRangeOverlaps and MaxRangeReversals directives to control
> +     the number of overlapping and reversing ranges (respectively) permitted
> +     before returning the entire resource, with a default limit of 20.
> +     [Jim Jagielski]
> +
>    *) mod_ldap: Optional function uldap_ssl_supported(r) always returned false
>       if called from a virtual host with mod_ldap directives in it.  Did not
>       affect mod_authnz_ldap's usage of mod_ldap.  [Eric Covener]
> @@ -30,7 +35,7 @@ Changes with Apache 2.3.15
>       directive for controlling the revocation checking mode. [Kaspar Brand]
>  
>    *) core: Add MaxRanges directive to control the number of ranges permitted
> -     before returning the entire resource, with a default limit of 200. 
> +     before returning the entire resource, with a default limit of 200.
>       [Eric Covener]


Why all these whitespace changes? This makes it really hard to read these 
patches.

> 
> Modified: httpd/httpd/trunk/server/core.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1169756&r1=1169755&r2=1169756&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/core.c (original)
> +++ httpd/httpd/trunk/server/core.c Mon Sep 12 14:15:53 2011

> @@ -3269,26 +3273,79 @@ static const char *set_max_ranges(cmd_pa
>      core_dir_config *conf = conf_;
>      int val = 0;
>  
> -    if (!strcasecmp(arg, "none")) { 
> +    if (!strcasecmp(arg, "none")) {
>          val = AP_MAXRANGES_NORANGES;
>      }
> -    else if (!strcasecmp(arg, "default")) { 
> +    else if (!strcasecmp(arg, "default")) {
>          val = AP_MAXRANGES_DEFAULT;
>      }
> -    else if (!strcasecmp(arg, "unlimited")) { 
> +    else if (!strcasecmp(arg, "unlimited")) {
>          val = AP_MAXRANGES_UNLIMITED;
>      }
> -    else { 
> +    else {
>          val = atoi(arg);
>          if (val <= 0)
> -            return "MaxRanges requires 'none', 'default', 'unlimited' or " 
> +            return "MaxRanges requires 'none', 'default', 'unlimited' or "
>                     "a positive integer";
>      }
>  
>      conf->max_ranges = val;
> -    
> +
> +    return NULL;
> +}
> +
> +static const char *set_max_overlaps(cmd_parms *cmd, void *conf_, const char 
> *arg)
> +{
> +    core_dir_config *conf = conf_;
> +    int val = 0;
> +
> +    if (!strcasecmp(arg, "none")) {
> +        val = AP_MAXRANGES_NORANGES;
> +    }
> +    else if (!strcasecmp(arg, "default")) {
> +        val = AP_MAXRANGES_DEFAULT;
> +    }
> +    else if (!strcasecmp(arg, "unlimited")) {
> +        val = AP_MAXRANGES_UNLIMITED;

Shouldn't this be AP_MAXOVERLAPS_DEFAULT?

> +    }
> +    else {
> +        val = atoi(arg);
> +        if (val <= 0)
> +            return "MaxRangeOverlaps requires 'none', 'default', 'unlimited' 
> or "
> +            "a positive integer";
> +    }
> +
> +    conf->max_overlaps = val;
> +
>      return NULL;
>  }
> +
> +static const char *set_max_reversals(cmd_parms *cmd, void *conf_, const char 
> *arg)
> +{
> +    core_dir_config *conf = conf_;
> +    int val = 0;
> +
> +    if (!strcasecmp(arg, "none")) {
> +        val = AP_MAXRANGES_NORANGES;
> +    }
> +    else if (!strcasecmp(arg, "default")) {
> +        val = AP_MAXRANGES_DEFAULT;

Shouldn't this be AP_MAXREVERSALS_DEFAULT?

> +    }
> +    else if (!strcasecmp(arg, "unlimited")) {
> +        val = AP_MAXRANGES_UNLIMITED;
> +    }
> +    else {
> +        val = atoi(arg);
> +        if (val <= 0)
> +            return "MaxRangeReversals requires 'none', 'default', 
> 'unlimited' or "
> +            "a positive integer";
> +    }
> +
> +    conf->max_reversals = val;
> +
> +    return NULL;
> +}
> +
>  AP_DECLARE(size_t) ap_get_limit_xml_body(const request_rec *r)
>  {
>      core_dir_config *conf;


Regards

RĂ¼diger

Reply via email to