httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: [PATCH] Re: mod_log_config: Cookie logging patch 1.3.X
Date Thu, 07 Dec 2000 13:19:57 GMT
-0 on this patch

-1 (veto) on the ap_get_token() changes. The modified code stops on
characters other than "," and ";" (change of behavior).

Cheers,
-g

On Thu, Dec 07, 2000 at 11:52:58AM +1100, Martin Pool wrote:
>...
>  /* Retrieve a token, spacing over it and returning a pointer to
>   * the first non-white byte afterwards.  Note that these tokens
>   * are delimited by semis and commas; and can also be delimited
>   * by whitespace at the caller's option.
> - */
> -
> + *
> + * Strictly, HTTP tokens cannot be quoted or contain whitespace.  But
> + * accepting this makes us more forgiving in what we accept, and
> + * allows this function also to be used to read quoted strings.  */
>  API_EXPORT(char *) ap_get_token(pool *p, const char **accept_line, int accept_
> white)
>  {
>      const char *ptr = *accept_line;
> @@ -1368,12 +1418,17 @@
>       * (comments are already gone).
>       */
>  
> -    while (*ptr && (accept_white || !ap_isspace(*ptr))
> -          && *ptr != ';' && *ptr != ',') {
> -       if (*ptr++ == '"')
> +    while (*ptr) {
> +       if (*ptr++ == '"') {
>             while (*ptr)
>                 if (*ptr++ == '"')
>                     break;
> +       } else if (accept_white && ap_isspace(*ptr)) {
> +           /* not stricly part of a token, but the caller wants to accept it a
> nyhow */
> +           ;
> +       } else if (TEST_CHAR(*ptr, T_HTTP_TOKEN_STOP)) {
> +           break;
> +       }
>      }
>...

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message