httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James H. Cloos Jr." <cl...@jhcloos.com>
Subject Re: 1.1b3 now?
Date Tue, 14 May 1996 07:34:12 GMT
Aram> Seond question: Did anyone look at mod_cookie about eating some
Aram> of the client's name?  It does do it even after brian's patch on
Aram> linux atleast.

Ben> I seem to remember we were waiting for confirmation that it was
Ben> definitely cookie related. Is this now proven?

I'm not so sure it is still the cookie module.  I think that problem
was fixed.

We only got 70 truncated hostnames -- and no truncated host numbers --
yesterday.  That is in a 450000 line access_log.

In all but one of the truncated entries, the hostname was recorded as
ns.  (The other was yokohama045, for whatever it is worth.)  Also,
unlike before the fix, the truncation is not happening on hits where
the cookie needs to be set.

OTOH, there *is* still a problem with the cookie module.  The log
entries are broken.  They look like:

	COOKIE "REQUEST" [13/May/1996:00:08:17 -0500] 200
	-0500] -

NB the second line, having the TZ and a responce code of -.  My first
thought was that a \n was being put where a \0 was desired, but I see
this in the module:

    strftime(tstr,MAX_STRING_LEN,"\" [%d/%b/%Y:%H:%M:%S ",t);
    if (r->status != -1)
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] %d\n", sign, timz/3600,
                timz%3600, r->status);
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] -\n", sign, timz/3600,
                timz%3600);

Should that, perhaps, be:

    strftime(tstr,MAX_STRING_LEN,"\" [%d/%b/%Y:%H:%M:%S ",t);
    if (r->status != -1) {
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] %d\n", sign, timz/3600,
                timz%3600, r->status);
    } else {
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] -\n", sign, timz/3600,
                timz%3600);
    }

(or leave the explicit braces out, but it does at least need an else.)

A patch follows.

-JimC

------------------------------------------------------------
# diff -c mod_cookies.c.~1~ mod_cookies.c
*** mod_cookies.c.~1~   Mon Apr 22 20:00:16 1996
--- mod_cookies.c       Tue May 14 02:32:03 1996
***************
*** 253,263 ****
          timz = -timz;
  
      strftime(tstr,MAX_STRING_LEN,"\" [%d/%b/%Y:%H:%M:%S ",t);
!     if (r->status != -1)
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] %d\n", sign, timz/3600,
                timz%3600, r->status);
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] -\n", sign, timz/3600,
                timz%3600);
  
      str = pstrcat(orig->pool, cookiebuf, " \"", orig->the_request, tstr, NULL);
      
--- 253,265 ----
          timz = -timz;
  
      strftime(tstr,MAX_STRING_LEN,"\" [%d/%b/%Y:%H:%M:%S ",t);
!     if (r->status != -1) {
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] %d\n", sign, timz/3600,
                timz%3600, r->status);
+     } else {
        sprintf(&tstr[strlen(tstr)], "%c%02ld%02ld] -\n", sign, timz/3600,
                timz%3600);
+     }
  
      str = pstrcat(orig->pool, cookiebuf, " \"", orig->the_request, tstr, NULL);
      
------------------------------------------------------------

-- 
James H. Cloos, Jr.	<URL:http://www.jhcloos.com/~cloos/>
cloos@jhcloos.com	Work: cloos@io.com
LPF,Usenix,SAGE,ISOC,ACLU

Mime
View raw message