You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Mark Cox <mj...@hyperreal.com> on 1996/03/18 11:49:18 UTC

cvs commit: apache/src CHANGES mod_cookies.c

mjc         96/03/18 02:49:18

  Modified:    src       CHANGES mod_cookies.c
  Log:
  Remove code that checks if browser was "Mozilla" (Netscape and clones)
  before giving out a cookie.  We now always generate a cookie.
  
  Revision  Changes    Path
  1.12      +3 -1      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -C3 -r1.11 -r1.12
  *** CHANGES	1996/03/18 01:55:35	1.11
  --- CHANGES	1996/03/18 10:49:16	1.12
  ***************
  *** 14,20 ****
         Content-type: at all. [Ben Laurie]
    
      *) Long overdue revamp of the Cookies module to stop Apache cookies
  !      colliding with other cookies a site may be using [Mark Cox]
    
      *) Clean up strings.h warning for SGI [Mark Cox]
    
  --- 14,22 ----
         Content-type: at all. [Ben Laurie]
    
      *) Long overdue revamp of the Cookies module to stop Apache cookies
  !      colliding with other cookies a site may be using.  Cookies are now
  !      always generated for every browser, not just Netscape (and clones)
  !      [Mark Cox]
    
      *) Clean up strings.h warning for SGI [Mark Cox]
    
  
  
  
  1.6       +14 -17    apache/src/mod_cookies.c
  
  Index: mod_cookies.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/mod_cookies.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -C3 -r1.5 -r1.6
  *** mod_cookies.c	1996/03/01 15:50:30	1.5
  --- mod_cookies.c	1996/03/18 10:49:16	1.6
  ***************
  *** 1,6 ****
    
    /* ====================================================================
  !  * Copyright (c) 1995 The Apache Group.  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
  --- 1,6 ----
    
    /* ====================================================================
  !  * Copyright (c) 1995, 1996 The Apache Group.  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
  ***************
  *** 70,86 ****
     * "CookieLog somefilename" in one of the config files to enable the Cookie
     * module.
     *
  !  * Bugs:
  !  * 
  !  *   This code is lazy and doesn't bother creating cookies for browsers other
  !  *       than those that report to be "Mozilla". It saves time on requests.
     *   This code doesn't log the initial transaction (the one that created
  !  *       the cookie to start with).
     *
     * Mark Cox, mark@ukweb.com, 6 July 95
     *
     * 6.12.95 MJC Now be more friendly.  Allow our cookies to overlap with
     * others the site may be using.  Use a more descriptive cookie name.
     */
    
    #include "httpd.h"
  --- 70,86 ----
     * "CookieLog somefilename" in one of the config files to enable the Cookie
     * module.
     *
  !  * Note:
     *   This code doesn't log the initial transaction (the one that created
  !  *   the cookie to start with).
     *
     * Mark Cox, mark@ukweb.com, 6 July 95
     *
     * 6.12.95 MJC Now be more friendly.  Allow our cookies to overlap with
     * others the site may be using.  Use a more descriptive cookie name.
  +  *
  +  * 18.3.96 MJC Generate cookies for EVERY request no matter what the 
  +  * browser.
     */
    
    #include "httpd.h"
  ***************
  *** 90,96 ****
    
    module cookies_module;
    
  ! /* Now we have to generate something that is going to be
     * pretty unique.  We can base it on the pid, time, hostip */
    
    #define COOKIE_NAME "Apache="
  --- 90,102 ----
    
    module cookies_module;
    
  ! typedef struct {
  !     char *fname;
  !     int log_fd;
  !     int always;
  ! } cookie_log_state;
  ! 
  ! /* Make Cookie: Now we have to generate something that is going to be
     * pretty unique.  We can base it on the pid, time, hostip */
    
    #define COOKIE_NAME "Apache="
  ***************
  *** 117,128 ****
    
    int spot_cookie(request_rec *r)
    {
  !     char *cookie, *agent;
    
  -     if (!(agent = table_get(r->headers_in,"User-Agent")))
  -         return DECLINED;              /* No user-agent = No cookie */
  -     if (strncmp(agent,"Mozilla",7))   /* Don't bother creating a cookie */
  -         return DECLINED;              /* unless browser is Netscape fudge */
        if ((cookie = table_get (r->headers_in, "Cookie")))
            if (strstr(cookie,COOKIE_NAME))
                return DECLINED;          /* Theres already a cookie, no new one */
  --- 123,130 ----
    
    int spot_cookie(request_rec *r)
    {
  !     char *cookie;
    
        if ((cookie = table_get (r->headers_in, "Cookie")))
            if (strstr(cookie,COOKIE_NAME))
                return DECLINED;          /* Theres already a cookie, no new one */
  ***************
  *** 138,148 ****
    #else
    static mode_t cookie_mode = ( S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH );
    #endif
  - 
  - typedef struct {
  -     char *fname;
  -     int log_fd;
  - } cookie_log_state;
    
    void *make_cookie_log_state (pool *p, server_rec *s)
    {
  --- 140,145 ----