httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Finch <...@dotat.at>
Subject Re: <LimitExcept>, was Re: cvs commit: apache-1.3/src/main http_core.c
Date Tue, 09 Feb 1999 22:42:32 GMT
I think you missed out a bit of my patch when merging the
<LimitExcept> functionality into ap_limit_section: you want to change
the initialisation of limited to
	int limited = tog ? (1 << M_TRACE) : 0;
otherwise TRACE will be limited unless it is mentioned explicitly.

fielding@hyperreal.org wrote:
>  
>  Index: http_core.c
>  ===================================================================
>  RCS file: /home/cvs/apache-1.3/src/main/http_core.c,v
>  retrieving revision 1.248
>  retrieving revision 1.249
>  diff -u -r1.248 -r1.249
>  --- http_core.c	1999/02/06 03:02:11	1.248
>  +++ http_core.c	1999/02/09 20:20:26	1.249
>  @@ -1241,6 +1241,7 @@
>   						  const char *arg)
>   {
>       const char *limited_methods = ap_getword(cmd->pool, &arg, '>');
>  +    void *tog = cmd->cmd->cmd_data;
>       int limited = 0;
>     
>       const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT);
>  @@ -1249,7 +1250,7 @@
>       }
>   
>       /* XXX: NB: Currently, we have no way of checking
>  -     * whether <Limit> sections are closed properly.
>  +     * whether <Limit> or <LimitExcept> sections are closed properly.
>        * (If we would add a srm_command_loop() here we might...)
>        */
>       
>  @@ -1257,26 +1258,31 @@
>           char *method = ap_getword_conf(cmd->pool, &limited_methods);
>           int  methnum = ap_method_number_of(method);
>   
>  -        if (methnum == M_TRACE) {
>  +        if (methnum == M_TRACE && !tog) {
>               return "TRACE cannot be controlled by <Limit>";
>           }
>           else if (methnum == M_INVALID) {
>  -            return ap_pstrcat(cmd->pool, "unknown method \"",
>  -                              method, "\" in <Limit>", NULL);
>  +            return ap_pstrcat(cmd->pool, "unknown method \"", method,
>  +                              "\" in <Limit", tog ? "Except>" : ">", NULL);
>           }
>           else {
>               limited |= (1 << methnum);
>           }
>       }
>   
>  -    cmd->limited = limited;
>  +    /* Killing two features with one function,
>  +     * if (tog == NULL) <Limit>, else <LimitExcept>
>  +     */
>  +    cmd->limited = tog ? ~limited : limited;
>       return NULL;
>   }

Tony.
-- 
f.a.n.finch  dot@dotat.at  fanf@demon.net

Mime
View raw message