tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: cvs commit: jakarta-tomcat-connectors/jk/native/apache-2.0 mod_jk.c
Date Thu, 23 Dec 2004 06:49:18 GMT

----- Original Message ----- 
From: "William A. Rowe, Jr." <wrowe@rowe-clan.net>
To: "Tomcat Developers List" <tomcat-dev@jakarta.apache.org>
Sent: Wednesday, December 22, 2004 9:54 PM
Subject: Re: cvs commit: jakarta-tomcat-connectors/jk/native/apache-2.0 
mod_jk.c


> Wait - you mean to tell me instead of converting the hostname
> once to lower - we are strcasecmp'ing every time?  Outch, that
> hurts.
>

This is nothing to do with the hostname.  It's the header names only (not 
the values).  And it has to be cheaper than converting the name once to 
lower and then again to upper later in the code (which is what the change 
was in response to :).  Choosing a case and sticking to it would probably be 
a nice idea for 1.2.9 however.

Actually, AFAIK the entire need_content_length_header logic is obsolete with 
the current released versions of Tomcat.  If we wanted to drop support for 
old versions, we wouldn't need this particular strcasecmp at all.

Host name parsing is done with the usual per-<VirtualHost> config.

> Bill
>
> At 09:14 PM 12/16/2004, billbarker@apache.org wrote:
>>billbarker    2004/12/16 19:14:56
>>
>>  Modified:    jk/native/apache-1.3 mod_jk.c
>>               jk/native/apache-2.0 mod_jk.c
>>  Log:
>>  Now that the SC lookup is case-insensitive, don't waste cycles 
>> converting the header names to lower case
>>
>>  Revision  Changes    Path
>>  1.60      +2 -6 
>> jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
>>
>>  Index: mod_jk.c
>>  ===================================================================
>>  RCS file: 
>> /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
>>  retrieving revision 1.59
>>  retrieving revision 1.60
>>  diff -u -r1.59 -r1.60
>>  --- mod_jk.c  13 Dec 2004 09:11:24 -0000      1.59
>>  +++ mod_jk.c  17 Dec 2004 03:14:56 -0000      1.60
>>  @@ -592,12 +592,8 @@
>>                   char *hname = ap_pstrdup(r->pool, elts[i].key);
>>                   s->headers_values[i] = ap_pstrdup(r->pool, 
>> elts[i].val);
>>                   s->headers_names[i] = hname;
>>  -                while (*hname) {
>>  -                    *hname = tolower(*hname);
>>  -                    hname++;
>>  -                }
>>                   if (need_content_length_header &&
>>  -                    !strncmp(s->headers_values[i], "content-length", 
>> 14)) {
>>  +                    !strcasecmp(s->headers_values[i], 
>> "content-length")) {
>>                       need_content_length_header = JK_FALSE;
>>                   }
>>               }
>>
>>
>>
>>  1.110     +2 -6 
>> jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
>>
>>  Index: mod_jk.c
>>  ===================================================================
>>  RCS file: 
>> /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
>>  retrieving revision 1.109
>>  retrieving revision 1.110
>>  diff -u -r1.109 -r1.110
>>  --- mod_jk.c  13 Dec 2004 09:10:31 -0000      1.109
>>  +++ mod_jk.c  17 Dec 2004 03:14:56 -0000      1.110
>>  @@ -636,12 +636,8 @@
>>                   char *hname = apr_pstrdup(r->pool, elts[i].key);
>>                   s->headers_values[i] = apr_pstrdup(r->pool, 
>> elts[i].val);
>>                   s->headers_names[i] = hname;
>>  -                while (*hname) {
>>  -                    *hname = tolower(*hname);
>>  -                    hname++;
>>  -                }
>>                   if (need_content_length_header &&
>>  -                    !strncmp(s->headers_values[i], "content-length", 
>> 14)) {
>>  +                    !strcasecmp(s->headers_values[i], 
>> "content-length")) {
>>                       need_content_length_header = JK_FALSE;
>>                   }
>>               }
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
> 



This message is intended only for the use of the person(s) listed above as the intended recipient(s),
and may contain information that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended
recipient, you may not read, copy, or distribute this message or any attachment. If you received
this communication in error, please notify us immediately by e-mail and then delete all copies
of this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet
is not secure. Do not send confidential or sensitive information, such as social security
numbers, account numbers, personal identification numbers and passwords, to us via ordinary
(unencrypted) e-mail.



Mime
View raw message