On Thu, May 21, 2009 at 6:42 AM, <[email protected]> wrote:

> Author: rpluem
> Date: Thu May 21 10:42:54 2009
> New Revision: 777042
>
> URL: http://svn.apache.org/viewvc?rev=777042&view=rev
> Log:
> * Add CacheIgnoreURLSessionIdentifiers directive to ignore
>  defined session identifiers encoded in the URL when caching.
>
> Modified:
>    httpd/httpd/trunk/CHANGES
>    httpd/httpd/trunk/docs/manual/mod/mod_cache.xml
>    httpd/httpd/trunk/modules/cache/cache_storage.c
>    httpd/httpd/trunk/modules/cache/mod_cache.c
>    httpd/httpd/trunk/modules/cache/mod_cache.h
>
> Modified: httpd/httpd/trunk/modules/cache/mod_cache.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache.c?rev=777042&r1=777041&r2=777042&view=diff
>
> ==============================================================================
> --- httpd/httpd/trunk/modules/cache/mod_cache.c (original)
> +++ httpd/httpd/trunk/modules/cache/mod_cache.c Thu May 21 10:42:54 2009
> @@ -952,6 +952,9 @@
>     /* flag indicating that query-string should be ignored when caching */
>     ps->ignorequerystring = 0;
>     ps->ignorequerystring_set = 0;
> +    /* array of identifiers that should not be used for key calculation */
> +    ps->ignore_session_id = apr_array_make(p, 10, sizeof(char *));
> +    ps->ignore_session_id_set = CACHE_IGNORE_SESSION_ID_UNSET;
>     return ps;
>  }
>
> @@ -1002,6 +1005,10 @@
>         (overrides->ignorequerystring_set == 0)
>         ? base->ignorequerystring
>         : overrides->ignorequerystring;
> +    ps->ignore_session_id =
> +        (overrides->ignore_session_id_set == CACHE_IGNORE_HEADERS_UNSET)
> +        ? base->ignore_session_id
> +        : overrides->ignore_session_id;
>     return ps;
>  }
>  static const char *set_cache_ignore_no_last_mod(cmd_parms *parms, void
> *dummy,
> @@ -1085,6 +1092,34 @@
>     return NULL;
>  }
>
> +static const char *add_ignore_session_id(cmd_parms *parms, void *dummy,
> +                                         const char *identifier)
> +{
> +    cache_server_conf *conf;
> +    char **new;
> +
> +    conf =
> +        (cache_server_conf
> *)ap_get_module_config(parms->server->module_config,
> +                                                  &cache_module);
> +    if (!strncasecmp(identifier, "None", 4)) {
> +        /* if identifier None is listed clear array */
> +        conf->ignore_session_id->nelts = 0;
>

This should be strcasecmp() since the entire parameter has to be "None", no?

Reply via email to