You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ha...@ooo.lanl.gov> on 1996/07/08 17:10:28 UTC

patch for cookies behaviour (fwd)

I'm starting a batch of bugs mail that I don't think I've forwarded..


> From: Pierre Beyssac <pb...@fasterix.freenix.fr>
> Message-Id: <19...@fasterix.frmug.fr.net>
> Subject: patch for cookies behaviour
> To: apache-bugs@apache.org
> Date: Fri, 5 Jul 1996 01:33:12 +0200 (MET DST)
> X-Mailer: ELM [version 2.4ME+ PL22 (25)]
> MIME-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
> Status: RO
> 
> Hello,
> 
> I'm running Apache 1.1 and noticed that, if the cookies module is
> compiled in, cookies are generated even when the module is not
> activated (no CookieLog directive in httpd.conf).
> 
> I don't know if it's intentional (I'm not an expert), but IMHO it
> would be more logical if the cookies module stayed quiet in that
> case.
> 
> Here's an attempt at a small patch to change this behaviour. It
> seems to work, at least for me.
> 
> Many thanks and congratulations for Apache, by the way.
> 
> --- mod_cookies.c.old	Fri May 24 15:10:14 1996
> +++ mod_cookies.c	Fri Jul  5 01:16:29 1996
> @@ -119,16 +119,23 @@
>  #define COOKIE_NAME "Apache="
>  
>  void make_cookie(request_rec *r)
>  {
> +    cookie_log_state *cls = get_module_config (r->server->module_config,
> +                           &cookies_module);
>      struct timeval tv;
>      char new_cookie[100];	/* blurgh */
>      char *dot;
> -    const char *rname = pstrdup(r->pool, 
> -				get_remote_host(r->connection, r->per_dir_config,
> -						REMOTE_NAME));
> -    
> +    const char *rname;
>      struct timezone tz = { 0 , 0 };
> +
> +    /* Don't make cookies if we're not logging them */
> +    if (*cls->fname == '\0') return;
> +
> +    rname = pstrdup(r->pool, 
> +		    get_remote_host(r->connection, r->per_dir_config,
> +				    REMOTE_NAME));
> +    
>  
>      if ((dot = strchr(rname,'.'))) *dot='\0';	/* First bit of hostname */
>      gettimeofday(&tv, &tz);
>      sprintf(new_cookie,"%s%s%d%ld%d; path=/",
> 
> 
> -- 
> Pierre Beyssac	    pb@fasterix.frmug.fr.net pb@fasterix.freenix.fr
> {Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher
>     Free domains: http://www.eu.org/ or mail dns-manager@EU.org
> 


--
The rumor is that Jack Kevorkian has setup a Windows-NT users group.