cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler ParserController.java

2001-09-02 Thread remm

remm01/09/02 20:34:08

  Modified:jasper/src/share/org/apache/jasper/compiler
ParserController.java
  Log:
  - Fix (again) bug 821.
  
  Revision  ChangesPath
  1.17  +4 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ParserController.java 2001/07/10 20:12:07 1.16
  +++ ParserController.java 2001/09/03 03:34:08 1.17
  @@ -413,10 +413,10 @@
* baseDirStack.
*/
   private String resolveFileName(String inFileName) {
  -boolean isAbsolute = inFileName.startsWith("/");
  - String fileName = 
  - isAbsolute ?
  - inFileName : (String) baseDirStack.peek() + inFileName;
  +String fileName = inFileName.replace('\\', '/');
  +boolean isAbsolute = fileName.startsWith("/");
  + fileName = isAbsolute ? fileName 
  +: (String) baseDirStack.peek() + fileName;
String baseDir = 
fileName.substring(0, fileName.lastIndexOf("/") + 1);
baseDirStack.push(baseDir);
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java

2001-09-02 Thread larryi

larryi  01/09/02 19:20:08

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Update for beta 2.
  
  Revision  ChangesPath
  1.192 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.191
  retrieving revision 1.192
  diff -u -r1.191 -r1.192
  --- ContextManager.java   2001/09/01 00:49:22 1.191
  +++ ContextManager.java   2001/09/03 02:20:08 1.192
  @@ -148,7 +148,7 @@
   public class ContextManager {
   /** Official name and version
*/
  -public static final String TOMCAT_VERSION = "3.3 Beta 1";
  +public static final String TOMCAT_VERSION = "3.3 Beta 2";
   public static final String TOMCAT_NAME = "Tomcat Web Server";
   
   /** System property used to set the base directory ( tomcat home ).
  
  
  



cvs commit: jakarta-tomcat/src/etc server.xml

2001-09-02 Thread larryi

larryi  01/09/02 19:18:03

  Modified:src/etc  server.xml
  Log:
  Include the modules for mod_jk based connectors by default, with some
  documentation.
  
  Revision  ChangesPath
  1.89  +12 -3 jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- server.xml2001/08/31 09:45:50 1.88
  +++ server.xml2001/09/03 02:18:03 1.89
  @@ -154,10 +154,19 @@
   

   
  -
  +
  +
  +
   

cvs commit: jakarta-tomcat/src/native/mod_jk/netscape jk_nsapi_plugin.c

2001-09-02 Thread larryi

larryi  01/09/02 19:15:26

  Modified:src/native/mod_jk/apache1.3 mod_jk.c
   src/native/mod_jk/netscape jk_nsapi_plugin.c
  Log:
  Update to work with recent changes in Ajp13.java.The absence of
  a content-length header is interpreted to mean an unknown, but non-zero
  length. For a zero length body, a content-length header saying so is now
  required.
  
  The init_ws_service() method now adds a content-length header if not
  present and the length is zero.
  
  Revision  ChangesPath
  1.11  +47 -18jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- mod_jk.c  2001/09/01 01:53:25 1.10
  +++ mod_jk.c  2001/09/03 02:15:26 1.11
  @@ -272,14 +272,14 @@
   }
   }
   
  -if(p->read_body_started) {
  - long rv;
  - if ((rv = ap_get_client_block(p->r, b, len)) < 0) {
  - *actually_read = 0;
  +if(p->read_body_started) {
  + long rv;
  + if ((rv = ap_get_client_block(p->r, b, len)) < 0) {
  + *actually_read = 0;
} else {
  - *actually_read = (unsigned) rv;
  - }
  -return JK_TRUE;
  + *actually_read = (unsigned) rv;
  + }
  +return JK_TRUE;
   }
   }
   return JK_FALSE;
  @@ -457,8 +457,8 @@
   s->server_software = (char *)ap_get_server_version();
   
   s->method   = (char *)r->method;
  -s->content_length = get_content_length(r);
  -s->is_chunked   = r->read_chunked;
  +s->content_length = get_content_length(r);
  +s->is_chunked   = r->read_chunked;
   s->no_more_chunks = 0;
   s->query_string = r->args;
   s->req_uri  = r->uri;
  @@ -515,13 +515,17 @@
   s->headers_values   = NULL;
   s->num_headers  = 0;
   if(r->headers_in && ap_table_elts(r->headers_in)) {
  +BOOL need_content_length_header = (s->content_length == 0);
   array_header *t = ap_table_elts(r->headers_in);
   if(t && t->nelts) {
   int i;
   table_entry *elts = (table_entry *)t->elts;
   s->num_headers = t->nelts;
  -s->headers_names  = ap_palloc(r->pool, sizeof(char *) * t->nelts);
  -s->headers_values = ap_palloc(r->pool, sizeof(char *) * t->nelts);
  + /* allocate an extra header slot in case we need to add a 
content-length header */
  +s->headers_names  = ap_palloc(r->pool, sizeof(char *) * (t->nelts + 1));
  +s->headers_values = ap_palloc(r->pool, sizeof(char *) * (t->nelts + 1));
  +if(!s->headers_names || !s->headers_values)
  + return JK_FALSE;
   for(i = 0 ; i < t->nelts ; i++) {
   char *hname = ap_pstrdup(r->pool, elts[i].key);
   s->headers_values[i] = ap_pstrdup(r->pool, elts[i].val);
  @@ -530,8 +534,31 @@
   *hname = tolower(*hname);
   hname++;
   }
  +if(need_content_length_header &&
  +!strncmp(s->headers_values[i],"content-length",14)) {
  +need_content_length_header = FALSE;
  +}
  +}
  +/* Add a content-length = 0 header if needed. 
  + * Ajp13 assumes an absent content-length header means an unknown, 
  + * but non-zero length body. 
  + */ 
  +if(need_content_length_header) {
  +s->headers_names[s->num_headers] = "content-length"; 
  +s->headers_values[s->num_headers] = "0"; 
  +s->num_headers++;
   }
   }
  +/* Add a content-length = 0 header if needed.*/
  +else if (need_content_length_header) {
  +s->headers_names  = ap_palloc(r->pool, sizeof(char *));
  +s->headers_values = ap_palloc(r->pool, sizeof(char *));
  +if(!s->headers_names || !s->headers_values)
  + return JK_FALSE;
  +s->headers_names[0] = "content-length"; 
  +s->headers_values[0] = "0"; 
  +s->num_headers++;
  +}
   }
   
   return JK_TRUE;
  @@ -789,16 +816,17 @@
   {   
   /* Retrieve the worker name stored by jk_translate() */
   const char *worker_name = ap_table_get(r->notes, JK_WORKER_ID);
  -int rc;
  +int rc;
   
   if(r->proxyreq) {
   return HTTP_INTERNAL_SERVER_ERROR;
  -}
  -
  +}
  +
   /* Set up r->read_chunked flags for chunked encoding, if present */
  -if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) {
  - return rc;
  -}
  +

cvs commit: jakarta-tomcat/src/doc readme

2001-09-02 Thread larryi

larryi  01/09/02 19:13:44

  Modified:src/doc  readme
  Log:
  Updates for beta 2.
  
  Revision  ChangesPath
  1.19  +54 -73jakarta-tomcat/src/doc/readme
  
  Index: readme
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/doc/readme,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- readme2001/08/02 17:15:47 1.18
  +++ readme2001/09/03 02:13:44 1.19
  @@ -1,8 +1,8 @@
  -$Id: readme,v 1.18 2001/08/02 17:15:47 larryi Exp $
  +$Id: readme,v 1.19 2001/09/03 02:13:44 larryi Exp $
   
  Release Notes for:
  
  -   TOMCAT Version 3.3b1
  +   TOMCAT Version 3.3b2
  
   
   
  @@ -42,79 +42,68 @@
   browser at the file "tomcat_ug.html" found in the same directory as this
   file.
   
  -IMPORTANT NOTE: Some important changes have been recently added to
  -Tomcat 3.3b1 which are not yet covered in the accompanying documentation.
  -These changes make Tomcat 3.3b1 quite different from Tomcat 3.2 in a number
  -of ways.  These changes include the following:
  +IMPORTANT NOTE: Some major changes have occurred in Tomcat 3.3 which
  +make it quite different from Tomcat 3.2.x in a number of ways.  Many of
  +these differences are covered in the Tomcat User's Guide (tomcat-ug.html)
  +found in Tomcat's "docs" directory.  Some of the more important changes
  +include the following:
   
   - Class Loading:
   
  -  Tomcat 3.3b1 now uses a new hierarchy of class loaders. It provides for the
  -  separation of the classes used by the Tomcat container and the classes used
  -  by web applications.  This solves a major problem in Tomcat 3.2 where all
  -  web applications had to share Tomcat's XML parser. Now each web applicaton
  -  can have its own XML parser, or if desired all web applications can share
  -  an XML parser different from the one used by Tomcat. As a side effect of
  -  this change, web applications in Tomcat 3.3b1 are not provided an XML
  -  parser by default.  You must supply one if your web application requires
  -  one. For details about where to place jar files, see the README files in the
  -  "lib/container", "lib/common", and "lib/apps" directories of your Tomcat
  -  installation.
  +  Tomcat 3.3 shell and batch files ignore your CLASSPATH environment variable.
   
  +  Also, Tomcat 3.3 uses a much different hierarchy of class loaders from
  +  Tomcat 3.2.x. This allows Tomcat 3.3 to avoid imposing its XML parser
  +  on all the web applications. In fact, web applications in Tomcat 3.3 don't
  +  get an XML parser by default.  You must provide one if needed.
  +
  +  For information on configuring classes, refer to the "Configuring Classes"
  +  section of the Tomcat User's guide (tomcat-ug.html) in Tomcat's doc directory.
  +
   - Tomcat Configuration:
   
  -  The configuration of Tomcat has been reorganized into separate configuration
  -  files.  The conf/modules.xml file contains module definitions for the modules
  -  (a.k.a Interceptors) available in Tomcat 3.3b1. The conf/server.xml file
  -  specifies which modules and connectors the Tomcat container should use along
  -  with their settings.
  -
  -  Web application configuration can now be specified in a conf/apps.xml file or
  -  in separate flies using the name conf/apps-[name].xml. For example,
  -  conf/apps-examples.xml would be the configuration file for the examples web
  -  application.
  -
  -  The tomcat.policy file remains in the "conf" directory.  However, other
  -  configuration files have been moved to directories under "conf".
  -
  -  Another change related to Tomcat configuration is that auto-generated
  -  web server configuration files, such as tomcat-apache.conf, are not generated
  -  by default.  To turn these on, add the following modules after the
  -   module in the server.xml file.  The locations for their
  -  configuration files is also shown.
  -
  -  Apache mod_jk config:
  - Def conf file:conf/auto/mod_jk.conf
  -  Def workers file:conf/jk/workers.properties
  -
  -  Apache mod_jserv config: 
  - Def conf file:conf/jserv/tomcat-apache.conf
  -
  -  IIS config:  
  -  Reg file:conf/jk/iis_redirect.reg-auto
  -  Workers file:conf/jk/workers.properties
  -  Workers map file:conf/jk/uriworkermap.properties
  -
  -  Netscape config: 
  - Conf file:conf/jk/obj.conf-auto
  -  Workers file:conf/jk/workers.properties
  -
  -  Note: The ApacheConfig, JservConfig, and IISConfig by default write a
  -  config file that tries to send all requests for a context to Tomcat.  That
  -  is the best way to insure that behavior specified in the web application's
  -  web.xml functions properly.  If you

cvs commit: jakarta-tomcat/src/doc serverxml.html

2001-09-02 Thread larryi

larryi  01/09/02 19:13:15

  Modified:src/doc  serverxml.html
  Log:
  Document a couple more modules.
  
  Revision  ChangesPath
  1.3   +167 -10   jakarta-tomcat/src/doc/serverxml.html
  
  Index: serverxml.html
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/doc/serverxml.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- serverxml.html2001/08/27 02:19:10 1.2
  +++ serverxml.html2001/09/03 02:13:15 1.3
  @@ -3,7 +3,7 @@
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
   http://www.w3.org/1999/xhtml";>
   
  -  
  +  
 
 
 
  @@ -84,7 +84,7 @@
   This is the main element in server.xml. It has a single child describing
   the tomcat configuration, ContextManager.
   
  -Examples
  +Examples
   
   
 ... ( tomcat configuration )
  @@ -95,7 +95,7 @@
   
   ContextManager
   
  -Description
  +Description
   
   This is the main tag, used to set generic Tomcat options. The following are
   some of the childen it supports:
  @@ -121,7 +121,7 @@
  in ant.
   
   
  -Parameters
  +Parameters
   
   
 
  @@ -151,7 +151,7 @@
 
   
   
  -Examples
  +Example(s)
   
   
   
  @@ -320,7 +320,7 @@
 
   
   
  -Examples
  +Example(s)
   
   
   
  @@ -358,6 +358,22 @@
   
   Generate configuration file for mod_jk to be included in Apache's httpd.conf.
   
  +For additional information on connecting Tomcat to Apache via mod_jk, see the
  +Working with mod_jk document.
  +
  +Important Note: The configuration files are not written as part of a
  +normal startup of Tomcat.  To generate the configuration files on demand,
  +append:
  +jkconf
  +or
  +-jkconf
  +to the startup command.  Tomcat will initialize sufficiently to write the
  +configuration files and then exit. This may be done while Tomcat 3.3 is running.
  +To generate the configuration files during normal startup, add:
  +jkconf="true"
  +to the  element in the
  +server.xml file.
  +
   Parameters
   
   
  @@ -431,7 +447,7 @@
 
   
   
  -Examples
  +Example(s)
   
   
   
  @@ -475,7 +491,7 @@
 
   
   
  -Examples
  +Example(s)
   
   
   
  @@ -541,7 +557,7 @@
 
   
   
  -Examples
  +Example(s)
   
   
 
  @@ -554,6 +570,45 @@
   
   ContextXmlReader
   
  +Type:Configuration
  +
  +Description
  +
  +This module is responsible for reading the XML files that specify contexts to
  +be served by Tomcat.  You specify a single file to read.  However, in addition
  +to that file, all other files in the same directory will be read that match the
  +pattern "base-*.xml", where base is the base name (i.e.
  +no extension) of the file you specified.  Each file may configure one or more
  +context.  Where the context matches a context automatically created by the
  +AutoWebApp module, the configuration file will override
  +the defaults context settings.
  +
  +For details on the syntax of the context configuration file, refer to the
  +Tomcat 3.3 Users Guide.
  +Parameters
  +
  +
  +  
  +Attribute
  +Description
  +Default
  +  
  +  
  +config
  +Context configuration file to read.  It may configure one or more
  +  contexts.
  +conf/server.xml
  +  
  +
  +
  +Example(s)
  +
  +
  +  
  +
  +
  +
  +
   
   
   CredentialsInterceptor
  @@ -574,6 +629,108 @@
   
   IISConfig
   
  +Type: Configuration
  +
  +Description
  +
  +Generate configuration files for isapi_redirect.dll to be used for connecting
  +IIS to Tomcat.  Two files will be generated, iis_redirect.reg and
  +uriworkermap.properties. Both files will be written to
  +conf/auto relative to TOMCAT_HOME.  The iis_redirect.reg
  +contains the needed registry entries for the iis_redirect.dll.
  +You may enter the settings into the registry by double-clicking on this file in
  +Windows Explorer.  The uriworkermap.properties file will be read
  +by the isapi_redirect.dll to get the mappings for determining
  +which requests should be passed to Tomcat.
  +
  +For additional information on connecting Tomcat to IIS, see the
  +Tomcat IIS HowTo document.
  +
  +Important Note: The configuration files are not written as part of a
  +normal startup of Tomcat.  To generate the configuration files on demand,
  +append:
  +jkconf
  +or
  +-jkconf
  +to the startup command.  Tomcat will initialize, write the configuration files,
  +and then shutdown. This may be done while Tomcat 3.3 is running. To generate
  +the configuration files during normal startup, add:
  +jkconf="true"
  +to the  element in the
  +server.xml file.
  +
  +Parameters
  +

cvs commit: jakarta-tomcat/src/webpages index.html

2001-09-02 Thread larryi

larryi  01/09/02 19:10:47

  Modified:src/webpages index.html
  Log:
  Update version to "Beta 2" and fix copyright.
  
  Revision  ChangesPath
  1.17  +3 -3  jakarta-tomcat/src/webpages/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/webpages/index.html,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- index.html2001/09/02 14:14:00 1.16
  +++ index.html2001/09/03 02:10:47 1.17
  @@ -4,13 +4,13 @@
   
   
   
  -Tomcat v3.3 dev
  +Tomcat v3.3 Beta 2
   
   
   Tomcat 
   
   Version
  -3.3 dev
  +3.3 Beta 2
   This is the default Tomcat home page. This page serves as a quick reference
   guide to related resources and is located at:
   
  @@ -64,7 +64,7 @@
   
   
   
  -    Copyright © 2001 Apache Software Foundation 
  +    Copyright © 1999-2001 Apache Software Foundation 
 
 All Rights Reserved 
  
  
  
  



Re: cvs commit: jakarta-tomcat/src/webpages index.html

2001-09-02 Thread Pier Fumagalli

"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> keith   01/09/02 07:14:00
> 
> Modified:src/webpages index.html
> Log:
> front page © date

It's wrong... It should be

Copyright © 1999-2001 Apache Software Foundation

Instead of 

Copyright © 2001 Apache Software Foundation

Pier




RE: cvs commit: jakarta-tomcat/src/webpages index.html

2001-09-02 Thread Keith Wannamaker

I don't know, the 99 just looked pretty stale.
Feel free to change it...  Keith

| -Original Message-
| From: Christopher Cain [mailto:[EMAIL PROTECTED]]
| Sent: Sunday, September 02, 2001 2:19 PM
| To: [EMAIL PROTECTED]
| Subject: Re: cvs commit: jakarta-tomcat/src/webpages index.html
|
|
| Hi Keith.
|
| Just a (very) minor question on this one. Should it actually read "Copyright
| 1999-2001"? I believe that the original copyright is usually retained. I'm of
| course not a lawyer (ack!), but that's what I've always been told. =)




Re: cvs commit: jakarta-tomcat/src/webpages index.html

2001-09-02 Thread Christopher Cain

Hi Keith.

Just a (very) minor question on this one. Should it actually read "Copyright 
1999-2001"? I believe that the original copyright is usually retained. I'm of 
course not a lawyer (ack!), but that's what I've always been told. =)

- Christopher

Quoting [EMAIL PROTECTED]:

> keith   01/09/02 07:14:00
> 
>   Modified:src/webpages index.html
>   Log:
>   front page © date
>   
>   Revision  ChangesPath
>   1.16  +1 -1  jakarta-tomcat/src/webpages/index.html
>   
>   Index: index.html
>   ===
>   RCS file: /home/cvs/jakarta-tomcat/src/webpages/index.html,v
>   retrieving revision 1.15
>   retrieving revision 1.16
>   diff -u -r1.15 -r1.16
>   --- index.html  2000/08/17 20:33:44 1.15
>   +++ index.html  2001/09/02 14:14:00 1.16
>   @@ -64,7 +64,7 @@
>
>
> height="80">
>   -    Copyright © 1999 Apache Software
> Foundation 
>   +    Copyright © 2001 Apache Software
> Foundation 
>  
>  All Rights Reserved 
>   
>



TC 3.3 Estimated Release Date

2001-09-02 Thread Jess Holle and Wendy Vidlak

Is there a new estimate for the Tomcat 3.3 release date?

The classloader separation and performance improvements are really
attractive, but I really need to know when to expect their availability or
they're of no use (until well after their release).

--
Jess Holle

-Original Message-
From: Dave Oxley [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 01, 2001 6:36 PM
To: [EMAIL PROTECTED]
Subject: RE: PATCH: jk_nt_service enhancements - TC3.3


Hope this is better.

By the way the new features are:
Allow adding of service dependancies
Allow adding of service with different user name
Allow adding of service as Automatic startup
New functions to start and stop services on remote machines

Going to add a Bugzilla entry now...

Dave
[EMAIL PROTECTED]


>From: "Ignacio J. Ortega" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>,
>"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: RE: PATCH: jk_nt_service enhancements - TC3.3
>Date: Sat, 1 Sep 2001 20:16:58 +0200
>
>Hola David:
>
>Could you send the patch as a diff -u?
>
>Better if you fill a bug report as a request for enhancements, and
>attaches the patch to it, so we can follow the issue more closely..
>
>Thanks for the feedback and the patch..
>
>Saludos ,
>Ignacio J. Ortega
>
>
> > -Mensaje original-
> > De: Dave Oxley [mailto:[EMAIL PROTECTED]]
> > Enviado el: sábado 1 de septiembre de 2001 14:15
> > Para: [EMAIL PROTECTED]
> > Asunto: PATCH: jk_nt_service enhancements - TC3.3
> >
> >
> > I've made a couple of enhancements to jk_nt_service. Attached
> > is a patch for
> > jk_nt_service.c and the documentation. This change was made
> > against HEAD of
> > jakarta-tomcat. Can someone check it over for possible check in.
> >
> > Dave
> > [EMAIL PROTECTED]
> >
> > _
> > Get your FREE download of MSN Explorer at
> > http://explorer.msn.com/intl.asp
> >


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




cvs commit: jakarta-tomcat/src/webpages index.html

2001-09-02 Thread keith

keith   01/09/02 07:14:00

  Modified:src/webpages index.html
  Log:
  front page © date
  
  Revision  ChangesPath
  1.16  +1 -1  jakarta-tomcat/src/webpages/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/webpages/index.html,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- index.html2000/08/17 20:33:44 1.15
  +++ index.html2001/09/02 14:14:00 1.16
  @@ -64,7 +64,7 @@
   
   
   
  -    Copyright © 1999 Apache Software Foundation 
  +    Copyright © 2001 Apache Software Foundation 
 
 All Rights Reserved 
  
  
  
  



cvs commit: jakarta-tomcat/src/native/mod_jk/iis jk_isapi_plugin.c

2001-09-02 Thread larryi

larryi  01/09/02 00:27:27

  Modified:src/native/mod_jk/iis jk_isapi_plugin.c
  Log:
  Update to work with recent changes in Ajp13.java.  The absence of
  a content-length header is interpreted to mean an unknown, but non-zero
  length. For a zero length body, a content-length header saying so is now
  required.
  
  The init_ws_service() method now adds a content-length header if not
  present and the length is zero.
  
  Revision  ChangesPath
  1.3   +18 -3 jakarta-tomcat/src/native/mod_jk/iis/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/iis/jk_isapi_plugin.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_isapi_plugin.c 2000/12/11 21:17:47 1.2
  +++ jk_isapi_plugin.c 2001/09/02 07:27:27 1.3
  @@ -56,7 +56,7 @@
   /***
* Description: ISAPI plugin for IIS/PWS   *
* Author:  Gal Shachor <[EMAIL PROTECTED]>   *
  - * Version: $Revision: 1.2 $   *
  + * Version: $Revision: 1.3 $   *
***/
   
   #include 
  @@ -84,6 +84,7 @@
*/
   #define URI_HEADER_NAME ("TOMCATURI:")
   #define WORKER_HEADER_NAME  ("TOMCATWORKER:")
  +#define CONTENT_LENGTH  ("CONTENT_LENGTH:")
   
   #define HTTP_URI_HEADER_NAME ("HTTP_TOMCATURI")
   #define HTTP_WORKER_HEADER_NAME  ("HTTP_TOMCATWORKER")
  @@ -872,10 +873,12 @@
   char *headers_buf = jk_pool_strdup(&private_data->p, huge_buf);
   unsigned i;
   unsigned len_of_http_prefix = strlen("HTTP_");
  +BOOL need_content_length_header = (s->content_length == 0);
   
   cnt -= 2; /* For our two special headers */
  -s->headers_names  = jk_pool_alloc(&private_data->p, cnt * sizeof(char 
*));
  -s->headers_values = jk_pool_alloc(&private_data->p, cnt * sizeof(char 
*));
  +/* allocate an extra header slot in case we need to add a 
content-length header */
  +s->headers_names  = jk_pool_alloc(&private_data->p, (cnt + 1) * 
sizeof(char *));
  +s->headers_values = jk_pool_alloc(&private_data->p, (cnt + 1) * 
sizeof(char *));
   
   if(!s->headers_names || !s->headers_values || !headers_buf) {
   return JK_FALSE;
  @@ -890,6 +893,9 @@
   if(!strnicmp(tmp, URI_HEADER_NAME, strlen(URI_HEADER_NAME)) ||
  !strnicmp(tmp, WORKER_HEADER_NAME, strlen(WORKER_HEADER_NAME))) {
   real_header = JK_FALSE;
  +} else if(need_content_length_header &&
  +   !strnicmp(tmp, CONTENT_LENGTH, strlen(CONTENT_LENGTH))) {
  +need_content_length_header = FALSE;
   } else {
   s->headers_names[i]  = tmp;
   }
  @@ -928,6 +934,15 @@
   if(real_header) {
   i++;
   }
  +}
  +/* Add a content-length = 0 header if needed.
  + * Ajp13 assumes an absent content-length header means an unknown,
  + * but non-zero length body.
  + */
  +if(need_content_length_header) {
  +s->headers_names[cnt] = "content-length";
  +s->headers_values[cnt] = "0";
  +cnt++;
   }
   s->num_headers = cnt;
   } else {