Re: PATCH - AdaptiveClassLoader.java (oops!)

2001-07-19 Thread David Haraburda

Oops.  Accidentally attached the file with output from multiple runs of
diff:  Here is the correct (smaller) patch, with my apologies...

David
-- 
David Haraburda - [EMAIL PROTECTED]
Everest - Helping You Manage Outsourcing
972-980-0013 x736

--- AdaptiveClassLoader.java.orig   Sat Mar  3 21:47:58 2001
+++ AdaptiveClassLoader.javaFri Jul 20 01:34:57 2001
@@ -15,24 +15,24 @@
  *
  * 3. All advertising materials mentioning features or use of this
  *software must display the following acknowledgment:
- *"This product includes software developed by the Java Apache 
+ *"This product includes software developed by the Java Apache
  *Project for use in the Apache JServ servlet engine project
  *."
  *
- * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and 
- *"Java Apache Project" must not be used to endorse or promote products 
+ * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and
+ *"Java Apache Project" must not be used to endorse or promote products
  *derived from this software without prior written permission.
  *
  * 5. Products derived from this software may not be called "Apache JServ"
- *nor may "Apache" nor "Apache JServ" appear in their names without 
+ *nor may "Apache" nor "Apache JServ" appear in their names without
  *prior written permission of the Java Apache Project.
  *
  * 6. Redistributions of any form whatsoever must retain the following
  *acknowledgment:
- *"This product includes software developed by the Java Apache 
+ *"This product includes software developed by the Java Apache
  *Project for use in the Apache JServ servlet engine project
  *."
- *
+ *
  * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY
  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -123,7 +123,7 @@
  */
 public class AdaptiveClassLoader extends ClassLoader {
 private static final int debug=0;
-
+
 /**
  * Instance of the SecurityManager installed.
  */
@@ -163,7 +163,7 @@
  * compatibility, we'll duplicate the 1.2 private member var.
  */
 protected ClassLoader parent;
-
+
 /**
  * Private class used to maintain information about the classes that
  * we loaded.
@@ -194,7 +194,7 @@
 return origin == null;
 }
 }
-
+
 //--- Constructors
 
 /**
@@ -215,7 +215,7 @@
cache = new Hashtable();
 }
 
-public void setRepository( Vector classRepository ) 
+public void setRepository( Vector classRepository )
throws IllegalArgumentException
 {
// Verify that all the repository are valid.
@@ -275,7 +275,7 @@
 void log( String s ) {
System.out.println("AdaptiveClassLoader: " + s );
 }
-
+
 //--- Methods
 
 /**
@@ -326,7 +326,7 @@
 return false;
 } else {
 return (entry.origin.lastModified() != entry.lastModified);
-
+
 }
 }
 
@@ -348,7 +348,7 @@
if( debug>5 )
log( "cache entry: " + entry.loadedClass.getName());
if (entry.isSystemClass()) continue;
-   
+
 // XXX: Because we want the classloader to be an accurate
 // reflection of the contents of the repository, we also
 // reload if a class origin file is now missing.  This
@@ -381,7 +381,7 @@
  */
 public AdaptiveClassLoader reinstantiate() {
 AdaptiveClassLoader cl=new AdaptiveClassLoader();
-   cl.setParent(parent); 
+   cl.setParent(parent);
cl.setRepository(repository);
return cl;
 }
@@ -435,7 +435,7 @@
 if (sm != null) {
 int i = name.lastIndexOf('.');
 if (i >= 0) {
-sm.checkPackageAccess(name.substring(0,i)); 
+sm.checkPackageAccess(name.substring(0,i));
 sm.checkPackageDefinition(name.substring(0,i));
}
}
@@ -502,10 +502,10 @@
 classCache.lastModified = classCache.origin.lastModified();
if( debug>0) log( "Add to cache() " + name + " " + classCache);
cache.put(name, classCache);
-   
+
if( debug>0) log( "Before define class " + name);
try {
-   classCache.loadedClass = 
+   classCache.loadedClass =
doDefineClass(name, classData,
  cp.getProtectionDomain());
} catch(Throwable t ) {
@@ -529,7 +529,7 @@
 {
return  defineClass(name, classData, 0, classData.length);
 }
-
+
 /**
  * Load a class using the system classloader.
  *
@@ -782,54 +782,76 @@
 }

PATCH - AdaptiveClassLoader.java

2001-07-19 Thread David Haraburda

Hi,

This is a patch for AdaptiveClassLoader -- it fixes the problem(s) I've
described in my previous post.  In short:

The API documentation for java.lang.ClassLoader states that subclasses
of ClassLoader should implement the findResource and findResources
method.  I've added these methods to AdaptiveClassLoader, and fixed up
getResource.  What happens is that when the final method getResources on
java.lang.ClassLoader is called, (as is the case for
javax.naming.InitialContext when it searches for jndi.properties), it
calls findResources on the current instance of the ClassLoader.  Becuase
AdaptiveClassLoader does not override this method, the default
implementation is called, which returns null.  With this patch, the web
application classes and lib directory will be searched, as I would
assume correct behaivor to be.

This patch is against the 3.2.3 source tarball I downloaded when it was
first released a couple of days ago.

Also -- as I stated in a previous post there was a patch for this
submitted awhile back, but it did not get committed and I could find no
explanation why.  My patch does the same thing, although it is a bit
simplier, and only changes this one file.  If this cannot be committed I
would appreciate knowing the reason why, and also would like any
suggestions on what to do with a jndi.properties file in my
WEB-INF/classes directory.

Thanks,
David

-- 
David Haraburda - [EMAIL PROTECTED]
Everest - Helping You Manage Outsourcing
972-980-0013 x736

--- AdaptiveClassLoader.java.orig   Sat Mar  3 21:47:58 2001
+++ AdaptiveClassLoader.javaFri Jul 20 01:31:24 2001
@@ -15,24 +15,24 @@
  *
  * 3. All advertising materials mentioning features or use of this
  *software must display the following acknowledgment:
- *"This product includes software developed by the Java Apache 
+ *"This product includes software developed by the Java Apache
  *Project for use in the Apache JServ servlet engine project
  *."
  *
- * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and 
- *"Java Apache Project" must not be used to endorse or promote products 
+ * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and
+ *"Java Apache Project" must not be used to endorse or promote products
  *derived from this software without prior written permission.
  *
  * 5. Products derived from this software may not be called "Apache JServ"
- *nor may "Apache" nor "Apache JServ" appear in their names without 
+ *nor may "Apache" nor "Apache JServ" appear in their names without
  *prior written permission of the Java Apache Project.
  *
  * 6. Redistributions of any form whatsoever must retain the following
  *acknowledgment:
- *"This product includes software developed by the Java Apache 
+ *"This product includes software developed by the Java Apache
  *Project for use in the Apache JServ servlet engine project
  *."
- *
+ *
  * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY
  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -123,7 +123,7 @@
  */
 public class AdaptiveClassLoader extends ClassLoader {
 private static final int debug=0;
-
+
 /**
  * Instance of the SecurityManager installed.
  */
@@ -163,7 +163,7 @@
  * compatibility, we'll duplicate the 1.2 private member var.
  */
 protected ClassLoader parent;
-
+
 /**
  * Private class used to maintain information about the classes that
  * we loaded.
@@ -194,7 +194,7 @@
 return origin == null;
 }
 }
-
+
 //--- Constructors
 
 /**
@@ -215,7 +215,7 @@
cache = new Hashtable();
 }
 
-public void setRepository( Vector classRepository ) 
+public void setRepository( Vector classRepository )
throws IllegalArgumentException
 {
// Verify that all the repository are valid.
@@ -275,7 +275,7 @@
 void log( String s ) {
System.out.println("AdaptiveClassLoader: " + s );
 }
-
+
 //--- Methods
 
 /**
@@ -326,7 +326,7 @@
 return false;
 } else {
 return (entry.origin.lastModified() != entry.lastModified);
-
+
 }
 }
 
@@ -348,7 +348,7 @@
if( debug>5 )
log( "cache entry: " + entry.loadedClass.getName());
if (entry.isSystemClass()) continue;
-   
+
 // XXX: Because we want the classloader to be an accurate
 // reflection of the contents of the repository, we also
 // reload if a class origin file is now missing.  This
@@ -381,7 +381,7 @@
  */
 public AdaptiveClassLoader reinstantiate() {
 AdaptiveClassLoader cl=new AdaptiveClassLoader();

Re: [TC4] jakarta-regexp.jar

2001-07-19 Thread Craig R. McClanahan



On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote:

> 
> On Thu, Jul 19, 2001 at 10:58:21PM -0700, Craig R. McClanahan wrote:
> > 
> > 
> > On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote:
> > 
> > > Do you have a position on including a jakarta-regexp.jar (or a
> > > jakarta-regexp-1.2.jar or a jakarta-regexp-1.3-dev.jar) directly in
> > > jakarta-tomcat-4.0/lib so we can build it without synching and
> > > building jakarta-regexp?
> > 
> > I'm positive Jon will be +1 for this :-), but I'm very -1 for reasons that
> > have been discussed at length on this and other lists in the past.  
> > Storing JAR files is evil, because it creates dependencies on those
> > particular versions of the JAR files and you cannot reliably recreate a
> > release purely from sources.
> 
> The dependencies are already there, and always will be.  The only
> difference is that at present, the actual jars can slip out from under
> you at any time (which actually just happened to me -- while you
> weren't looking, jakarta-regexp changed the name of their jar file
> which broke your build).
> 

Having seen *way* too many people get burned by loading binaries into CVS
(usually caused by API changes in the projects you depend on, plus the
resultant inability to reliably recreate an old version from sources), I'm
unalterably opposed to putting JAR files into CVS except in extreme
circumstances (i.e. sealing violations).

People who have known me in open source projects for a while will quickly
realize how unusual that position is for me -- about most things I'm
much more easygoing.  But I will not willingly participate in any project
that uses checked in JARs as a standard practice.  I've gotten (and seen
on others) too many scars from that behavior to find it acceptable.

Craig





cvs commit: jakarta-tomcat-4.0/tester/web ResponseWrap01b.jsp ResponseWrap01d.jsp

2001-07-19 Thread craigmcc

craigmcc01/07/19 23:25:54

  Added:   tester/web ResponseWrap01b.jsp ResponseWrap01d.jsp
  Log:
  Add some forgotten unit test files.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-4.0/tester/web/ResponseWrap01b.jsp
  
  Index: ResponseWrap01b.jsp
  ===
  <%@ page contentType="text/plain"%>ResponseWrap01b PASSED
  
  
  
  1.1  jakarta-tomcat-4.0/tester/web/ResponseWrap01d.jsp
  
  Index: ResponseWrap01d.jsp
  ===
  <%@ page contentType="text/plain"%>ResponseWrap01d PASSED
  
  
  



cvs commit: jakarta-tomcat-4.0/webapps/ROOT index.html

2001-07-19 Thread craigmcc

craigmcc01/07/19 23:14:10

  Modified:catalina/src/share/org/apache/catalina Globals.java
   webapps/ROOT index.html
  Added:   .RELEASE-NOTES-4.0-B7.txt
  Log:
  Prepare for Tomcat 4.0-beta-7.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B7.txt
  
  Index: RELEASE-NOTES-4.0-B7.txt
  ===
Apache Tomcat Version 4.0 Beta 7
=
  Release Notes
  =
  
  $Id: RELEASE-NOTES-4.0-B7.txt,v 1.1 2001/07/20 06:14:10 craigmcc Exp $
  
  
  
  INTRODUCTION:
  
  
  
  This document describes the changes that have been made in the current
  beta release of Apache Tomcat, relative to the previous release.
  
  Bug reports should be entered at the bug reporting system for
  Jakarta projects at:
  
  http://nagoya.apache.org/bugzilla/
  
  Please report bugs and feature requests under product name "Tomcat 4".
  
  
  > UPCOMING CHANGE NOTICE:  In a future beta release of Tomcat 4.0, it
  > is likely that the default operational mode will be to run Tomcat
  > under a security manager (rather than the current default of not
  > using one).  This may necessitate editing the policy permissions
  > file ($CATALINA_HOME/conf/catalina.policy) if your web applications
  > require permissions that are not enabled by default (such as connecting
  > to network ports).  You are urged to test your applications with
  > Tomcat 4.0-b5 running under the security manager now, so that this
  > upcoming change will not be disruptive.  To do so, start Tomcat 4.0
  > with the command "$CATALINA_HOME/bin/catalina.sh start -security"
  > (Unix) or "%CATALINA_HOME%\bin\catalina start -security" (Windows).
  
  
  
  NEW FEATURES:
  
  
  
  
  General New Features:
  
  
  
  -
  Catalina New Features:
  -
  
  
  ---
  Jasper New Features:
  ---
  
  
  
  Webapps New Features:
  
  
  
  ==
  BUG FIXES AND IMPROVEMENTS:
  ==
  
  
  --
  Catalina Bug Fixes:
  --
  
  
  
  Jasper Bug Fixes:
  
  
  
  -
  Webapps Bug Fixes:
  -
  
  
  
  KNOWN ISSUES IN THIS RELEASE:
  
  
  
  --
  Tomcat 4.0 and XML Parsers:
  --
  
  Previous versions of Tomcat 4.0 exposed the XML parser used by Jasper (the
  JAXP/1.1 reference implementation) to web applications.  This is no longer
  the case, because Jasper loads its parser with a new class loader instead.
  Keep the following points in mind when considering how to use XML parsers
  in Tomcat 4.0 and your web applications:
  
  * If you wish to make the JAXP/1.1 RI XML parser available to all web
applications, simply move the "jaxp.jar" and "crimson.jar" files from
the "$TOMCAT_HOME/jasper" directory to the "$TOMCAT_HOME/lib" directory.
  
  * If you wish to make another XML parser that is JAXP/1.1-compatible
available to all web applications, install that parser into the
"$TOMCAT_HOME/lib" directory and remove "jaxp.jar" and "crimson.jar"
from the "$TOMCAT_HOME/jasper" directory.  It has been reported that
Xerces 1.3.1 can be used in this fashion, but 2.x alpha releases
can not be.
  
  * If you wish to use an XML parser (such as Xerces) in the WEB-INF/lib
directory of your web application, this should now be possible, because
of the modified JAXP 1.1 parser mentioned below.
  
  WARNING:  Tomcat 4.0 now ships with a modified version of the JAXP/1.1
  (Final) "jaxp.jar" and "crimson.jar" files in the "jasper" subdirectory.
  The "sealed" attribute has been removed from the manifest file for these
  two JARs, to avoid "package sealing violation" errors that were caused by
  them in a JDK 1.3 environment.  You MUST NOT replace these files with a
  different (or later) release of JAXP, unless that later release has had
  the sealed attribute removed, or you will encounter "package sealing violation"
  errors when trying to use a different XML parser in a web application.
  
  
  
  
  
  1.30  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java
  
  Index: Globals.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Globals.java  2001/07/20 03:20:08 1.29
  +++ Globals

cvs commit: jakarta-tomcat-4.0 RELEASE-NOTES-4.0-B6.txt

2001-07-19 Thread craigmcc

craigmcc01/07/19 23:13:49

  Modified:.RELEASE-NOTES-4.0-B6.txt
  Log:
  Remove redundant note from the release notes.
  
  Revision  ChangesPath
  1.3   +372 -18   jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B6.txt
  
  Index: RELEASE-NOTES-4.0-B6.txt
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B6.txt,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RELEASE-NOTES-4.0-B6.txt  2001/06/22 20:31:25 1.2
  +++ RELEASE-NOTES-4.0-B6.txt  2001/07/20 06:13:49 1.3
  @@ -3,7 +3,7 @@
   Release Notes
   =
   
  -$Id: RELEASE-NOTES-4.0-B6.txt,v 1.2 2001/06/22 20:31:25 glenn Exp $
  +$Id: RELEASE-NOTES-4.0-B6.txt,v 1.3 2001/07/20 06:13:49 craigmcc Exp $
   
   
   
  @@ -22,6 +22,13 @@
   Please report bugs and feature requests under product name "Tomcat 4".
   
   
  +> SECURITY NOTE:  This version of Tomcat fixes a security vulnerability
  +> that was first reported on July 16, 2001, related to unnormalized request
  +> URI paths bypassing security constraints defined in the web application
  +> deployment descriptor.  Users who rely on container managed security are
  +> *strongly* urged to update to this release of Tomcat 4.0.
  +
  +
   > UPCOMING CHANGE NOTICE:  In a future beta release of Tomcat 4.0, it
   > is likely that the default operational mode will be to run Tomcat
   > under a security manager (rather than the current default of not
  @@ -40,23 +47,118 @@
   
   
   
  +
  +General New Features:
  +
  +
  +Tomcat 4.0-beta-6 includes a new, experimental, installer for the Windows
  +platform.  This installer operates in a manner similar to installers for other
  +applications on Windows, and also lets you install support for executing
  +Tomcat as a Service under Windows NT.  This version of the download is packaged
  +as a ".exe" file, and contains the same contents as a standard Tomcat binary
  +distribution.  Please try this new installer out and give us your feedback.
  +--> NOTE:  A known issue with this capability is that stopping Tomcat
  +--> service can take so long that it fails and logs an error in the
  +--> NT event log.  The solution to this problem will be to make the
  +--> server shutdown time shorter so that the timeout is not exceeded.
  +
  +Tomcat 4.0-beta-6 now includes an updated version of the Java side of the
  +MOD_WEBAPP connector, used to run Tomcat behind Apache.  Binary versions of
  +the MOD_WEBAPP connector for various platforms will be published (in the same
  +directory where you downloaded Tomcat-4.0-beta-6 shortly).
  +
  +Catalina and Jasper now utilize copies of the web application deployment
  +descriptor and tag library descriptor from the servlet.jar file that is
  +included (generated from the "jakarta-servletapi-4" repository) instead of
  +including their own copies.  This avoids the risk of having Tomcat use versions
  +of the DTDs that are out of synchronization with the servlet API classes.
  +
  +Updated the build process to make it easier to build Tomcat 4.0 from the
  +source distribution.  Rather than requiring environment variables to be
  +created, the new scheme allows the use of "build.properties" files (in either
  +the Tomcat source directory or the user home directory) to define property
  +values.  You can use all standard Ant property replacement expressions in
  +these definitions.  As a result, the "build.bat" and "build.sh" scripts are
  +no longer necessary; simply run the "ant" command directly.  See the install
  +instructions for more information.
  +
  +The build scripts have been enhanced to support the compilation and execution
  +of unit tests for the JUnit unit testing framework .
  +A small set of initial tests have been checked in to illustrate the use of
  +this new feature.
  +
  +
   -
   Catalina New Features:
   -
   
  +Catalina is now in conformance to the requirements of the Servlet 2.3
  +Proposed Final Draft 3 Specification, available at:
  +  http://java.sun.com/products/servlet/download.html
  +
   Created a new Java SecurityManager permission called JndiPermission
   for use in setting security policy for file based JNDI named resources.
   
  +Started creating developer-oriented documentation for Catalina in an XML
  +format that should be compatible with whatever presentation technology
  +that we select.  Initial effort is to create "functional specification"
  +documents that capture the functionality of the default file-serving
  +servlet, the "invoker" servlet that handles anonymous servlet requests
  +(/servlet/*), JDBCRealm, and JNDIRealm.
  +
  +You can now optionally specify that DNS lookups should be performed when an
  +application servlet calls

Re: [TC4] jakarta-regexp.jar

2001-07-19 Thread guru


On Thu, Jul 19, 2001 at 10:58:21PM -0700, Craig R. McClanahan wrote:
> 
> 
> On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote:
> 
> > Do you have a position on including a jakarta-regexp.jar (or a
> > jakarta-regexp-1.2.jar or a jakarta-regexp-1.3-dev.jar) directly in
> > jakarta-tomcat-4.0/lib so we can build it without synching and
> > building jakarta-regexp?
> 
> I'm positive Jon will be +1 for this :-), but I'm very -1 for reasons that
> have been discussed at length on this and other lists in the past.  
> Storing JAR files is evil, because it creates dependencies on those
> particular versions of the JAR files and you cannot reliably recreate a
> release purely from sources.

The dependencies are already there, and always will be.  The only
difference is that at present, the actual jars can slip out from under
you at any time (which actually just happened to me -- while you
weren't looking, jakarta-regexp changed the name of their jar file
which broke your build).

As for building from "pure" source, that argument is a lot less
compelling when your object code is platform-independent Java.  Sure,
it made sense not to depend on statically linked OS-specific object
code, but I can't think of a good reason not to depend on a JAR.  It's
no worse than depending on a GIF.

> > Likewise for servlet.jar / jakarta-servletapi-4.
> > 
> > Note that the project already contains an ant.jar and a jaxp.jar and
> > crimson.jar, and that works just fine :-)
> > 
> 
> Tomcat 4 doesn't have an ant.jar.

My mistake.

>  And the only reason it has jaxp.jar and
> crimson.jar is because the stupid actual release has sealed JARs, which
> *totally* screws up class loading.  As soon as there's a JAXP release that
> removes this restriction, these files are gone.

And as soon as someone screws up JAXP again, it'll break again, and
require a bugfix release of the *source* of Catalina just to allow it
to build.

Or what about the developer who's installed an incompatible JAXP
wasting his time and the list's bandwidth when it could have been
averted by shipping the version of JAXP on which Catalina is
dependent...  (That's until JAXP is "core" and stable and works, none
of which are actually true yet, AFAIK.)

> > > The problem you are having can be easily resolved by simply editing your
> > > local jakarta-turbine-4.0/build.properties or your
> > > ${user.home}/build.properties
> > 
> > Yeah, mine and everyone else's in the world who wants to build it.
> > One less step is one less step that can go wrong.  
> 
> Actually, Jon's suggestion is the right answer.  Developers working from
> source should have *absolute* control over which versions of dependent
> software they build with.

My solution doesn't prevent you from overriding the checked-in version
with one of your own.  I was thinking more that out of the box, it
would work, but that if you have your own jar you can edit
build.properties and retain *absolute* control.  But until you need to
do that, there's less to set up before running "build."  That is...

> > One less step is one less step that can go wrong.  

:-)

-- 
Alex Chaffee   mailto:[EMAIL PROTECTED]
jGuru - Java News and FAQs http://www.jguru.com/alex/
Creator of Gamelan http://www.gamelan.com/
Founder of Purple Technology   http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/



cvs commit: jakarta-tomcat-4.0 INSTALL.txt

2001-07-19 Thread craigmcc

craigmcc01/07/19 23:12:33

  Added:   .INSTALL.txt
  Log:
  Add Rob's installation instructions, tweaked just a little bit.
  
  Revision  ChangesPath
  1.1  jakarta-tomcat-4.0/INSTALL.txt
  
  Index: INSTALL.txt
  ===
Apache Tomcat Version 4.0 Beta 6

  Install Guide
  =
  
  $Id: INSTALL.txt,v 1.1 2001/07/20 06:12:33 craigmcc Exp $
  
  
  
  INTRODUCTION:
  
  
  Welcome!
  
  This document explains how to perform a stand-alone installation of the
  Tomcat 4.0 servlet container.  Once you're up and running, you will have
  access to the more detailed documentation locally via Tomcat's default
  home page, as well as administrative and sample applications.  As well,
  the documentation is available locally at:
  
  $CATALINA_HOME/webapps/docs/index.html
  
  where $CATALINA_HOME is the root of the directory you extracted the Tomcat
  files to.
  
  The absolute latest version of the documentation is always available online
  at the following URL:
  
  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html
  
  Because the documentation released with each version of Tomcat is the latest
  as of that release, there is a good chance the online documentation will be
  slightly updated.
  
  NOTE: It is STRONGLY reccomended that you complete this minimal, stand-alone
  installation before continuing on to more advanced topics.
  
  
  ===
  DOWNLOADING:
  ===
  
  In the rare occasion that you find yourself reading this file without a copy
  of Tomcat 4 to install, you can obtain the latest version here
  
  http://jakarta.apache.org/site/binindex.html
  
  NEW FEATURE NOTE!  Tomcat 4.0-beta-6 includes a new, experimental, installer
  for the Windows platform.  Simply download and execute the
  "jakarta-tomcat-4.0-b6.exe" file from the release directory pointed at by
  the above link.  As an alternative, you can install Tomcat 4.0-beta-6 manually
  from the ZIP file download, in the manner described below.
  
  
  ==
  INSTALLING:
  ==
  
  Fortunately, installing the Tomcat servlet container consists of a few,
  easy steps: extract the archive, and set environment variables.
  
  Of course, since Tomcat is written in Java, it is assumed that you have
  installed at least version 1.2 of the JDK.  You can download the JDK from
  Sun at the following URL
  
  http://java.sun.com/j2se/
  
  Version 1.3.1 (or later) of the JDK is recommended.
  
  1) Unpack the files
  
  You've most likely completed this step already =)
  
  Lets say that for installation (A), you're on a Windows machine and
  you've unpacked the files to "C:\jakarta-tomcat-4.0".  You can use a
  tool like WinZip or pkunzip command-line version.
  
  Or for installation (B) on a *nix machine, you've unpacked it to
  "/usr/local/jakarta-tomcat-4.0"
  
  cd /usr/local
  mv  /usr/local

  tar xzvf jakarta-tomcat-4.0-br.tar.gz
  
  OR
  
  uncompress jakarta-tomcat-4.0-br.tar.Z
  tar xvf jakarta-tomcat-4.0-br.tar
  
  2) Set your environment variables
  
  Tomcat 4 requires 2 environment variables: CATALINA_HOME and JAVA_HOME.
  CATALINA_HOME should be set to the root of your Tomcat installation, and
  JAVA_HOME should be set to the root of your JDK installation.
  
  For the Win9X-series of operating systems, add the following lines to
  your C:\AUTOEXEC.BAT file:
  
  SET CATALINA_HOME=C:\jakarta-tomcat-4.0
  SET JAVA_HOME=C:\jdk1.3.1
  
  In WinNT-based systems, you modify environment variables by first right-
  clicking on the "My Computer" icon, and then "Properties".  You can either
  add these as System or User Environment variables.
  
  For *nix systems,
  
  export CATALINA_HOME=/usr/local/jakarta-tomcat-4.0
  export JAVA_HOME=/usr/local/jdk1.3
  
  This should either be done in a startup script or /etc/profile to make it
  system-wide.  Preferably a startup script so the variables are available
  on Tomcat so it can start on boot if required.
  
  3) Start it
  
  To start the container, execute the script appropriate to your operating
  system.  The startup and shutdown scripts are named appropriately, and
  found in $CATALINA_HOME/bin.  For *nix, that will be the scripts ending
  with the "sh" extension, and for Windows, "bat".
  
  For Win9X, 
  
  cd %CATALINA_HOME%\bin
  startup.bat
  
  For *nix,
  
  cd $CATALINA_HOME/bin
  ./startup.sh
  
  4) Test it
  
  Fire up your web browser, and request
  
  http://localhost:8080/
  
  ...and you should be presented with the

Re: [TC4] jakarta-regexp.jar

2001-07-19 Thread Craig R. McClanahan



On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote:

> 
> Do you have a position on including a jakarta-regexp.jar (or a
> jakarta-regexp-1.2.jar or a jakarta-regexp-1.3-dev.jar) directly in
> jakarta-tomcat-4.0/lib so we can build it without synching and
> building jakarta-regexp?
> 

I'm positive Jon will be +1 for this :-), but I'm very -1 for reasons that
have been discussed at length on this and other lists in the past.  
Storing JAR files is evil, because it creates dependencies on those
particular versions of the JAR files and you cannot reliably recreate a
release purely from sources.

Once I get the beta 6 release out (the release notes will tell you how
busy we've been :-), I will focus on cleaning up the build processes and
docs for jakarta-tomcat-4.0 and jakarta-servletapi-4, and initiating
conversations about what to do with jakarta-tomcat-connectors code that is
included in a Tomcat release.

> Likewise for servlet.jar / jakarta-servletapi-4.
> 
> Note that the project already contains an ant.jar and a jaxp.jar and
> crimson.jar, and that works just fine :-)
> 

Tomcat 4 doesn't have an ant.jar.  And the only reason it has jaxp.jar and
crimson.jar is because the stupid actual release has sealed JARs, which
*totally* screws up class loading.  As soon as there's a JAXP release that
removes this restriction, these files are gone.

> > The problem you are having can be easily resolved by simply editing your
> > local jakarta-turbine-4.0/build.properties or your
> > ${user.home}/build.properties
> 
> Yeah, mine and everyone else's in the world who wants to build it.
> One less step is one less step that can go wrong.  
> 

Actually, Jon's suggestion is the right answer.  Developers working from
source should have *absolute* control over which versions of dependent
software they build with.

> -- 
> Alex Chaffee   mailto:[EMAIL PROTECTED]

Craig McClanahan




Re: [TC4] jakarta-regexp.jar

2001-07-19 Thread guru

On Thu, Jul 19, 2001 at 09:35:43PM -0700, Jon Stevens wrote:
> on 7/19/01 7:08 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 
> > P.S.  I'd like to propose that jakarta-regexp project name all their
> > jars jakarta-regexp.jar no matter what version they are.  This doesn't
> > affect the decision here.
> 
> -1
> 
> Until we have a CJAN, I like version numbers on jar files.

OK, I see your point -- though I personally prefer the version number
to be stored elsewhere than the name of the file, so revving the
version doesn't break all scripts that refer to it.  (Imagine if
installing perl 5 made all scripts that start with #!/usr/bin/perl
break until they were individually changed to #/usr/bin/perl5 (and I
mean after perl 5 was pronounced stable).)

Do you have a position on including a jakarta-regexp.jar (or a
jakarta-regexp-1.2.jar or a jakarta-regexp-1.3-dev.jar) directly in
jakarta-tomcat-4.0/lib so we can build it without synching and
building jakarta-regexp?

Likewise for servlet.jar / jakarta-servletapi-4.

Note that the project already contains an ant.jar and a jaxp.jar and
crimson.jar, and that works just fine :-)

> The problem you are having can be easily resolved by simply editing your
> local jakarta-turbine-4.0/build.properties or your
> ${user.home}/build.properties

Yeah, mine and everyone else's in the world who wants to build it.
One less step is one less step that can go wrong.  

-- 
Alex Chaffee   mailto:[EMAIL PROTECTED]
jGuru - Java News and FAQs http://www.jguru.com/alex/
Creator of Gamelan http://www.gamelan.com/
Founder of Purple Technology   http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/



Re: [TC4] jakarta-regexp.jar

2001-07-19 Thread Jon Stevens

on 7/19/01 7:08 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> P.S.  I'd like to propose that jakarta-regexp project name all their
> jars jakarta-regexp.jar no matter what version they are.  This doesn't
> affect the decision here.

-1

Until we have a CJAN, I like version numbers on jar files.

The problem you are having can be easily resolved by simply editing your
local jakarta-turbine-4.0/build.properties or your
${user.home}/build.properties

-jon




cvs commit: jakarta-tomcat/src/tests/webpages/WEB-INF test-tomcat.xml

2001-07-19 Thread larryi

larryi  01/07/19 21:28:16

  Modified:src/tests/webpages/WEB-INF test-tomcat.xml
  Log:
  Fix some descriptions
  
  Revision  ChangesPath
  1.38  +15 -15jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml
  
  Index: test-tomcat.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- test-tomcat.xml   2001/07/18 21:20:06 1.37
  +++ test-tomcat.xml   2001/07/20 04:28:16 1.38
  @@ -16,7 +16,7 @@
   early tests.
   -->
   
  -   
  +   



  @@ -1220,12 +1220,12 @@
  returnCode="${http.protocol} 404" 
 />
   
  -  
   
  -  
  @@ -1235,12 +1235,12 @@
  returnCode="${http.protocol} 404" 
 />
   
  -  
   
  -  
  @@ -1250,7 +1250,7 @@
  returnCode="${http.protocol} 404" 
 />
   
  -  
  @@ -1260,31 +1260,31 @@
  returnCode="${http.protocol} 404" 
 />
   
  -  
   
  -  
   
  -  
   
  -  
   
  -  
  -  
  @@ -1295,16 +1295,16 @@
  goldenFile="${gdir}/HelloWorld.txt"
 />
   
  -  
  -  
   
  -  
  
  
  



cvs commit: jakarta-tomcat/src/admin/WEB-INF/scripts run-test.bat

2001-07-19 Thread larryi

larryi  01/07/19 20:48:09

  Modified:src/admin/WEB-INF/scripts run-test.bat
  Log:
  Forgot to remove "rem".  Call Ant so CLASSPATH setting is restored.
  
  Revision  ChangesPath
  1.2   +2 -2  jakarta-tomcat/src/admin/WEB-INF/scripts/run-test.bat
  
  Index: run-test.bat
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/scripts/run-test.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- run-test.bat  2001/07/17 13:46:00 1.1
  +++ run-test.bat  2001/07/20 03:48:09 1.2
  @@ -1,4 +1,4 @@
  -rem @echo off
  +@echo off
   
   rem Batch file to run the tomcat sanity test suite
   rem Note: You may send the output to a file using "run-tomcat -l file"
  @@ -24,7 +24,7 @@
   set CLASSPATH=%CLASSPATH%;%_OLDCP%
   
   :runant
  -ant -Dgdir="%TOMCAT_HOME%/webapps/test/Golden" -f 
"%TOMCAT_HOME%/webapps/test/WEB-INF/test-tomcat.xml" %1 %2 %3 %4 %5 %6 %7 %8 %9 client
  +call ant -Dgdir="%TOMCAT_HOME%/webapps/test/Golden" -f 
"%TOMCAT_HOME%/webapps/test/WEB-INF/test-tomcat.xml" %1 %2 %3 %4 %5 %6 %7 %8 %9 client
   
   set CLASSPATH=%_OLDCP%
   
  
  
  



Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnection.java WarpRequest.java WarpRequestHandler.javaWarpResponse.java

2001-07-19 Thread Pier P. Fumagalli


I tagged the webapp portion of j-t-c with the "tomcat_40_b6"... Night...

Pier




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnection.java WarpRequest.java WarpRequestHandler.java WarpResponse.java

2001-07-19 Thread pier

pier01/07/19 20:25:30

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpConnection.java WarpRequest.java
WarpRequestHandler.java WarpResponse.java
  Log:
  Reflect changes of JTC into JT4 for Tomcat B6
  
  Revision  ChangesPath
  1.9   +4 -2  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java
  
  Index: WarpConnection.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WarpConnection.java   2001/07/20 00:00:53 1.8
  +++ WarpConnection.java   2001/07/20 03:25:30 1.9
  @@ -210,7 +210,8 @@
   public void send(WarpPacket packet)
   throws IOException {
   if (Constants.DEBUG) {
  -logger.debug(">> TYPE="+packet.getType()+" LENGTH="+packet.size);
  +String typ=Integer.toHexString(packet.getType());
  +logger.debug(">> TYPE="+typ+" LENGTH="+packet.size);
   logger.debug(">> "+packet.dump());
   }
   
  @@ -251,7 +252,8 @@
   }
   
   if (Constants.DEBUG) {
  -logger.debug("<< TYPE="+packet.getType()+" LENGTH="+packet.size);
  +String typ=Integer.toHexString(packet.getType());
  +logger.debug("<< TYPE="+typ+" LENGTH="+packet.size);
   logger.debug("<< "+packet.dump());
   }
   }
  
  
  
  1.6   +0 -1  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java
  
  Index: WarpRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WarpRequest.java  2001/07/20 00:01:26 1.5
  +++ WarpRequest.java  2001/07/20 03:25:30 1.6
  @@ -62,7 +62,6 @@
   
   public class WarpRequest extends HttpRequestBase {
   private Host host=null;
  -private Context context=null;
   
   public WarpRequest() {
   super();
  
  
  
  1.9   +4 -3  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java
  
  Index: WarpRequestHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WarpRequestHandler.java   2001/07/20 00:01:32 1.8
  +++ WarpRequestHandler.java   2001/07/20 03:25:30 1.9
  @@ -132,8 +132,8 @@
   if (Constants.DEBUG)
   logger.debug("Request content type="+ctyp+" length="+
clen);
  -request.setContentType(ctyp);
  -request.setContentLength(clen);
  +if (ctyp.length()>0) request.setContentType(ctyp);
  +if (clen>0) request.setContentLength(clen);
   break;
   }
   
  @@ -172,7 +172,8 @@
   } catch (Exception e) {
   logger.log(e);
   }
  -response.getStream().close();
  +request.finishRequest();
  +response.finishResponse();
   if (Constants.DEBUG)
   logger.debug("Request has been processed");
   break;
  
  
  
  1.5   +97 -17
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java
  
  Index: WarpResponse.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WarpResponse.java 2001/07/20 00:01:38 1.4
  +++ WarpResponse.java 2001/07/20 03:25:30 1.5
  @@ -84,36 +84,75 @@
   import org.apache.catalina.util.RequestUtil;
   
   public class WarpResponse extends HttpResponseBase {
  +/** The local stream */
  +private Stream localstream;
  +/** The packet used for processing headers */
   private WarpPacket packet;
  +/** The connection to which we are associated */
   private WarpConnection connection;
   
  +/**
  + * Create a new instance of a WarpResponse.
  + */
   public WarpResponse() {
   super();
  -recycle();
  +// A WarpResponse is _always_ associated with a Stream
  +this.localstream=new Str

cvs commit: jakarta-tomcat-4.0/webapps/ROOT index.html

2001-07-19 Thread craigmcc

craigmcc01/07/19 20:20:09

  Modified:catalina/src/share/org/apache/catalina Globals.java
   webapps/ROOT index.html
  Log:
  Updates for Tomcat 4.0-beta-6 release.
  
  Revision  ChangesPath
  1.29  +5 -5  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java
  
  Index: Globals.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Globals.java  2001/07/17 04:21:12 1.28
  +++ Globals.java  2001/07/20 03:20:08 1.29
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v 
1.28 2001/07/17 04:21:12 craigmcc Exp $
  - * $Revision: 1.28 $
  - * $Date: 2001/07/17 04:21:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Globals.java,v 
1.29 2001/07/20 03:20:08 craigmcc Exp $
  + * $Revision: 1.29 $
  + * $Date: 2001/07/20 03:20:08 $
*
* 
*
  @@ -69,7 +69,7 @@
* Global constants that are applicable to multiple packages within Catalina.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.28 $ $Date: 2001/07/17 04:21:12 $
  + * @version $Revision: 1.29 $ $Date: 2001/07/20 03:20:08 $
*/
   
   public final class Globals {
  @@ -210,7 +210,7 @@
   /**
* The descriptive information about this server and version.
*/
  -public static final String SERVER_INFO = "Apache Tomcat/4.0-b6-dev";
  +public static final String SERVER_INFO = "Apache Tomcat/4.0-b6";
   
   
   /**
  
  
  
  1.20  +2 -2  jakarta-tomcat-4.0/webapps/ROOT/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/ROOT/index.html,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- index.html2001/05/15 03:25:48 1.19
  +++ index.html2001/07/20 03:20:09 1.20
  @@ -4,13 +4,13 @@
   
   
   
  -Tomcat (v4.0-b6-dev)
  +Tomcat (v4.0-b6)
   
   
   Tomcat
   
   Version
  -4.0-b6-dev
  +4.0-b6
   This is the default Tomcat home page. This page serves as a quick reference
   guide to related resources and is located at:
   
  
  
  



cvs commit: jakarta-tomcat-site/xdocs index.xml

2001-07-19 Thread alex

alex01/07/19 19:49:48

  Modified:xdocsindex.xml
  Log:
  Tocmat -> Tomcat
  
  Revision  ChangesPath
  1.5   +1 -1  jakarta-tomcat-site/xdocs/index.xml
  
  Index: index.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-site/xdocs/index.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- index.xml 2001/07/20 02:48:06 1.4
  +++ index.xml 2001/07/20 02:49:48 1.5
  @@ -49,7 +49,7 @@
   latest maintenance release, 3.1.1, contained fixes for security problems.  
   There is no active development ongoing for Tomcat 3.1.x.  Users of Tomcat 
   3.1 should update to 3.1.1 to close the security holes and they are 
  -strongly encouraged to migrate to the current production release, Tocmat 
  +strongly encouraged to migrate to the current production release, Tomcat 
   3.2.3. 
   
   Tomcat 3.2.x.  Tomcat 3.2.3 is the current production 
  
  
  



cvs commit: jakarta-tomcat-site/xdocs index.xml

2001-07-19 Thread alex

alex01/07/19 19:48:06

  Modified:xdocsindex.xml
  Log:
  Finish replacing 3.2.1 with 3.2.3
  
  Revision  ChangesPath
  1.4   +2 -2  jakarta-tomcat-site/xdocs/index.xml
  
  Index: index.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-site/xdocs/index.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- index.xml 2001/07/17 18:25:09 1.3
  +++ index.xml 2001/07/20 02:48:06 1.4
  @@ -28,7 +28,7 @@
   
   
   There are several versions of Tomcat currently available for download.  Version 
3.1.1
  -is a legacy release.  Version 3.2.1 is the current production quality release.  
Tomcat 3.3
  +is a legacy release.  Version 3.2.3 is the current production quality release.  
Tomcat 3.3
   is the latest continuation of the Tomcat 3.x architecture.  All Tomcat 3.x releases
   trace their heritage back to the original Servlet and JSP implementations that Sun
   donated to the Apache Software Foundation.  The 3.x versions all implement the
  @@ -50,7 +50,7 @@
   There is no active development ongoing for Tomcat 3.1.x.  Users of Tomcat 
   3.1 should update to 3.1.1 to close the security holes and they are 
   strongly encouraged to migrate to the current production release, Tocmat 
  -3.2.1. 
  +3.2.3. 
   
   Tomcat 3.2.x.  Tomcat 3.2.3 is the current production 
   quality release.  Version 3.2 added few new features; the major effort was 
  
  
  



cvs commit: jakarta-tomcat/src/etc/jk mod_jk.conf

2001-07-19 Thread larryi

larryi  01/07/19 19:59:33

  Modified:src/etc/jk mod_jk.conf
  Log:
  Fix invalid log level.  Supported values are debug, info, error, and emerg.
  
  Revision  ChangesPath
  1.2   +1 -1  jakarta-tomcat/src/etc/jk/mod_jk.conf
  
  Index: mod_jk.conf
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/etc/jk/mod_jk.conf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_jk.conf   2000/09/09 23:21:20 1.1
  +++ mod_jk.conf   2001/07/20 02:59:33 1.2
  @@ -5,7 +5,7 @@
   
   JkWorkersFile /workers.properties
   JkLogFile  logs/jk.log
  -JkLogLevel warn
  +JkLogLevel error
   JkMount /*.jsp ajp12
   JkMount /servlet/* ajp12
   JkMount /examples/* ajp12
  
  
  



Re: cvs commit: jakarta-tomcat-connectors/webapp/javaWarpResponse.java

2001-07-19 Thread Pier P. Fumagalli

[EMAIL PROTECTED] at [EMAIL PROTECTED] wrote:
> 
> Response handles the finishResponse() method correctly, now.

Ok, I admit it, I'm an idiot... :(

Pier




cvs commit: jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes TroubleShooter.java

2001-07-19 Thread pier

pier01/07/19 19:36:10

  Modified:webapps/examples/WEB-INF/classes TroubleShooter.java
  Log:
  Fixed some NullPointerExceptions and display aesthetics.
  
  Revision  ChangesPath
  1.2   +21 -16
jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/TroubleShooter.java
  
  Index: TroubleShooter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/webapps/examples/WEB-INF/classes/TroubleShooter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TroubleShooter.java   2001/01/25 00:42:15 1.1
  +++ TroubleShooter.java   2001/07/20 02:36:10 1.2
  @@ -1,4 +1,4 @@
  -/* $Id: TroubleShooter.java,v 1.1 2001/01/25 00:42:15 pier Exp $
  +/* $Id: TroubleShooter.java,v 1.2 2001/07/20 02:36:10 pier Exp $
*
*/
   
  @@ -21,6 +21,9 @@
   }
   
   public void printValue(PrintWriter out, String key, String val) {
  +if (val!=null) {
  +if (val.length()>255) val=val.substring(0,128)+" (... more)";
  +}
   out.println("   ");
   out.println(""+key+"");
   out.println(""+val+"");
  @@ -160,7 +163,7 @@
   
   printHeader(out,"Cookies in this request:");
   Cookie[] cookies = request.getCookies();
  -for (int i = 0; i < cookies.length; i++) {
  +if (cookies!=null) for (int i = 0; i < cookies.length; i++) {
   Cookie cookie = cookies[i];
   printValue(out,cookie.getName(),cookie.getValue());
   }
  @@ -181,21 +184,23 @@
   
   printHeader(out,"Session information:");
   SimpleDateFormat format = new SimpleDateFormat("/MM/dd hh:mm:ss.SSS z");
  -HttpSession session = request.getSession();
  +HttpSession session = request.getSession(false);
  +if (session!=null) {
   printValue(out,"Requested Session Id:", request.getRequestedSessionId());
  -printValue(out,"Current Session Id:", session.getId());
  -printValue(out,"Current Time:", format.format(new Date()));
  -printValue(out,"Session Created Time:", format.format(new 
Date(session.getCreationTime(;
  -printValue(out,"Session Last Accessed Time:", format.format(new 
Date(session.getLastAccessedTime(;
  -printValue(out,"Session Max Inactive Interval Seconds:", 
Integer.toString(session.getMaxInactiveInterval()));
  -printVoid(out);
  -
  -printHeader(out,"Session values:");
  -enum = session.getAttributeNames();
  -while (enum.hasMoreElements()) {
  -String key = (String) enum.nextElement();
  -Object val = session.getAttribute(key);
  -printValue(out,key,val.toString());
  +printValue(out,"Current Session Id:", session.getId());
  +printValue(out,"Current Time:", format.format(new Date()));
  +printValue(out,"Session Created Time:", format.format(new 
Date(session.getCreationTime(;
  +printValue(out,"Session Last Accessed Time:", format.format(new 
Date(session.getLastAccessedTime(;
  +printValue(out,"Session Max Inactive Interval Seconds:", 
Integer.toString(session.getMaxInactiveInterval()));
  +printVoid(out);
  +
  +printHeader(out,"Session values:");
  +enum = session.getAttributeNames();
  +while (enum.hasMoreElements()) {
  +String key = (String) enum.nextElement();
  +Object val = session.getAttribute(key);
  +printValue(out,key,val.toString());
  +}
   }
   printVoid(out);
   
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpResponse.java

2001-07-19 Thread pier

pier01/07/19 19:34:42

  Modified:webapp/java WarpResponse.java
  Log:
  Response handles the finishResponse() method correctly, now.
  The outputStream instance is recycled between requests.
  
  Revision  ChangesPath
  1.6   +97 -17jakarta-tomcat-connectors/webapp/java/WarpResponse.java
  
  Index: WarpResponse.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpResponse.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WarpResponse.java 2001/07/19 23:35:56 1.5
  +++ WarpResponse.java 2001/07/20 02:34:41 1.6
  @@ -84,36 +84,75 @@
   import org.apache.catalina.util.RequestUtil;
   
   public class WarpResponse extends HttpResponseBase {
  +/** The local stream */
  +private Stream localstream;
  +/** The packet used for processing headers */
   private WarpPacket packet;
  +/** The connection to which we are associated */
   private WarpConnection connection;
   
  +/**
  + * Create a new instance of a WarpResponse.
  + */
   public WarpResponse() {
   super();
  -recycle();
  +// A WarpResponse is _always_ associated with a Stream
  +this.localstream=new Stream(this);
  +this.setStream(localstream);
   }
   
  +/**
  + * Recycle this WarpResponse instance.
  + */
   public void recycle() {
  +// Recycle our parent
   super.recycle();
  -this.setStream(new Stream(this));
  +// Recycle the stream
  +this.localstream.recycle();
  +// Tell the parent that a stream is already in use.
  +this.setStream(localstream);
   }
   
  +/**
  + * Set the WarpPacket instance used to process headers.
  + */
   public void setPacket(WarpPacket packet) {
   this.packet=packet;
   }
   
  +/**
  + * Return the WarpPacket instance used to process headers.
  + */
   public WarpPacket getPacket() {
   return(this.packet);
   }
  -
  +
  +/**
  + * Associate this WarpResponse instance with a specific
  + * WarpConnection instance.
  + */
   public void setConnection(WarpConnection connection) {
   this.connection=connection;
   }
   
  +/**
  + * Return the WarpConnection associated this instance of
  + * WarpResponse.
  + */
   public WarpConnection getConnection() {
   return(this.connection);
   }
   
   /**
  + * Flush output and finish.
  + */
  +public void finishResponse()
  +throws IOException {
  +super.finishResponse();
  +this.localstream.finish();
  +}
  +
  +/**
* Send the HTTP response headers, if this has not already occurred.
*/
   protected void sendHeaders() throws IOException {
  @@ -205,38 +244,79 @@
   
   committed = true;
   }
  -
  -private class Stream extends OutputStream {
  -private WarpConnection connection;
  -private WarpPacket packet;
  -
  -private Stream(WarpResponse response) {
  +
  +/** 
  + * The OutputStream that will handle all response body
  + * transmission.
  + */
  +protected class Stream extends OutputStream {
  +/** The response associated with this stream instance. */
  +private WarpResponse response=null;
  +/** The packet used by this stream instance. */
  +private WarpPacket packet=null;
  +/** Wether close() was called or not. */
  +private boolean closed=false;
  +
  +/**
  + * Construct a new instance of a WarpResponse.Stream
  + * associated with a parent WarpResponse.
  + */
  +protected Stream(WarpResponse response) {
   super();
  -this.connection=response.getConnection();
  +this.response=response;
   this.packet=new WarpPacket();
  -packet.setType(Constants.TYPE_RES_BODY);
   }
   
  +/**
  + * Write one byte of data to the WarpPacket nested
  + * within this WarpResponse.Stream. All data is buffered
  + * until the flush() or close() method is
  + * not called.
  + */
   public void write(int b) 
   throws IOException {
  +if (closed) throw new IOException("Stream closed");
   packet.buffer[packet.size++]=(byte)b;
   }
   
  +/**
  + * Flush the current packet to the WARP client.
  + */
   public void flush()
   throws IOException {
  -this.connection.send(packet);
  -packet.reset();
  +if (closed) throw new IOException("Stream closed");
   packet.setType(Constants.TYPE_RES_BODY);
  +response.getConnection().send(packet);
  +

cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequestHandler.java

2001-07-19 Thread pier

pier01/07/19 19:33:52

  Modified:webapp/java WarpRequestHandler.java
  Log:
  Fixed small bug with content type/length.
  Now the request and response objects are "finished" properly.
  
  Revision  ChangesPath
  1.10  +4 -3  jakarta-tomcat-connectors/webapp/java/WarpRequestHandler.java
  
  Index: WarpRequestHandler.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpRequestHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WarpRequestHandler.java   2001/07/19 23:35:26 1.9
  +++ WarpRequestHandler.java   2001/07/20 02:33:52 1.10
  @@ -132,8 +132,8 @@
   if (Constants.DEBUG)
   logger.debug("Request content type="+ctyp+" length="+
clen);
  -request.setContentType(ctyp);
  -request.setContentLength(clen);
  +if (ctyp.length()>0) request.setContentType(ctyp);
  +if (clen>0) request.setContentLength(clen);
   break;
   }
   
  @@ -172,7 +172,8 @@
   } catch (Exception e) {
   logger.log(e);
   }
  -response.getStream().close();
  +request.finishRequest();
  +response.finishResponse();
   if (Constants.DEBUG)
   logger.debug("Request has been processed");
   break;
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequest.java

2001-07-19 Thread pier

pier01/07/19 19:32:12

  Modified:webapp/java WarpRequest.java
  Log:
  Removed private context (which might have caused some troubles).
  
  Revision  ChangesPath
  1.7   +0 -1  jakarta-tomcat-connectors/webapp/java/WarpRequest.java
  
  Index: WarpRequest.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpRequest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WarpRequest.java  2001/07/19 23:35:07 1.6
  +++ WarpRequest.java  2001/07/20 02:32:12 1.7
  @@ -62,7 +62,6 @@
   
   public class WarpRequest extends HttpRequestBase {
   private Host host=null;
  -private Context context=null;
   
   public WarpRequest() {
   super();
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnection.java

2001-07-19 Thread pier

pier01/07/19 19:31:07

  Modified:webapp/java WarpConnection.java
  Log:
  Better debugging output (packet types dumped in HEX)
  
  Revision  ChangesPath
  1.17  +4 -2  jakarta-tomcat-connectors/webapp/java/WarpConnection.java
  
  Index: WarpConnection.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnection.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WarpConnection.java   2001/07/19 23:37:55 1.16
  +++ WarpConnection.java   2001/07/20 02:31:07 1.17
  @@ -210,7 +210,8 @@
   public void send(WarpPacket packet)
   throws IOException {
   if (Constants.DEBUG) {
  -logger.debug(">> TYPE="+packet.getType()+" LENGTH="+packet.size);
  +String typ=Integer.toHexString(packet.getType());
  +logger.debug(">> TYPE="+typ+" LENGTH="+packet.size);
   logger.debug(">> "+packet.dump());
   }
   
  @@ -251,7 +252,8 @@
   }
   
   if (Constants.DEBUG) {
  -logger.debug("<< TYPE="+packet.getType()+" LENGTH="+packet.size);
  +String typ=Integer.toHexString(packet.getType());
  +logger.debug("<< TYPE="+typ+" LENGTH="+packet.size);
   logger.debug("<< "+packet.dump());
   }
   }
  
  
  



[TC4] jakarta-regexp.jar

2001-07-19 Thread guru

The build files for tc4 refer to jakarta-regexp-1.2.jar.

However, the regexp project currently builds a file called
"jakarta-regexp-1.3-dev.jar".  The jakarta-regexp-1.2.jar is nowhere
to be found, so the build breaks for someone (like me) following the
instructions for a clean checkout-and-build.

To forestall this sort of thing from happening in the future, let's
just check a binary jar file into jakarta-tomcat-4.0 as
jakarta-tomcat-4.0/lib/jakarta-regexp.jar

That way our build will work even if jakarta-regexp changes the name
of their jar, or breaks the interfaces, or whatever.  Plus, if they do
rev their release, and we want to incorporate it, we can do it by
checking in their new jar as our old name, and then we don't even have
to change the build files.

I've made the changes locally... Tell me if I shouldn't check it in.

 - Alex

P.S.  I'd like to propose that jakarta-regexp project name all their
jars jakarta-regexp.jar no matter what version they are.  This doesn't
affect the decision here.


-- 
Alex Chaffee   mailto:[EMAIL PROTECTED]
jGuru - Java News and FAQs http://www.jguru.com/alex/
Creator of Gamelan http://www.gamelan.com/
Founder of Purple Technology   http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/



Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnectionHandler.java WarpConstants.java WarpContext.javaWarpDebug.java WarpEngineMapper.java WarpHandler.javaWarpHandlerTable.java WarpInputStream.java WarpOutputStream.javaWarpReader.java WarpTable.java

2001-07-19 Thread Pier P. Fumagalli

Pier P. Fumagalli at [EMAIL PROTECTED] wrote:
> 
> Must have done something in the last updates (SHIT!)... It serves one
> request (perfectly), but the following ones are just headers...
> 
> DAMN ME!
> 
> Working on it... (SHIT!)

Ok, now I'm talking to myself, and that's SCARY...
The bitch serves all requests I want for my TroubleShoot servlet, I can
reload and reload on my browser, and everything comes out so nicely...
BUT, HelloWorldExample just goes once...

Now, either I'm stupid or I'm stupid... So, I must be definitely stupid.

Pier




Re: [DOC] INSTALL.txt

2001-07-19 Thread Pier P. Fumagalli

Rob S. at [EMAIL PROTECTED] wrote:

> Agreed... (re: Win/Unix sections).  Is a Mac section worth it?  I don't have
> access to a Mac and haven't the slightest clue how they work =)

Mac? Under OS/9 it doesn't work (only Java platform 1 over there)... OS/X is
basically a unix box, so, no worries there...

Pier




Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnectionHandler.java WarpConstants.java WarpContext.javaWarpDebug.java WarpEngineMapper.java WarpHandler.javaWarpHandlerTable.java WarpInputStream.java WarpOutputStream.javaWarpReader.java WarpTable.java

2001-07-19 Thread Pier P. Fumagalli

Pier P. Fumagalli at [EMAIL PROTECTED] wrote:

> [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote:
> 
>> pier01/07/19 17:05:36
>> 
>> Removed: catalina/src/share/org/apache/catalina/connector/warp
>>   WarpConnectionHandler.java WarpConstants.java
>>   WarpContext.java WarpDebug.java
>>   WarpEngineMapper.java WarpHandler.java
>>   WarpHandlerTable.java WarpInputStream.java
>>   WarpOutputStream.java WarpReader.java
>>   WarpTable.java
>> Log:
>> Removed old files.
> 
> Will start running the watchdog and tomcat tests...

Must have done something in the last updates (SHIT!)... It serves one
request (perfectly), but the following ones are just headers...

DAMN ME!

Working on it... (SHIT!)

Pier




Re: Nice script to change all those cvsroots?

2001-07-19 Thread guru

On Fri, Jul 20, 2001 at 12:22:32AM +0200, Martin van den Bemt wrote:
> Has anyone got a nice script to replace the jakarta.apache.org cvsroot to
> the cvs.apache.org cvs root? 

This does all and only what you want:

find . -name Root -print | grep CVS | xargs perl -pi -e 
's/jakarta\.apache\.org/cvs.apache.org/g'


-- 
Alex Chaffee   mailto:[EMAIL PROTECTED]
jGuru - Java News and FAQs http://www.jguru.com/alex/
Creator of Gamelan http://www.gamelan.com/
Founder of Purple Technology   http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/



RE: [DOC] INSTALL.txt

2001-07-19 Thread Craig R. McClanahan

I'm going to include this in the beta 6 release tonight, after a couple of
tweaks (and a mention of the new Windows-installer based version that Remy
has created).  Also, we'll need pointers to the RPMs that Henri so
graciously creates, and corresponding directions to install them.

MacOS X is, AFAIK, similar enough to the other Unixes that it doesn't need
a separate section.

Craig


On Thu, 19 Jul 2001, Rob S. wrote:

> Agreed... (re: Win/Unix sections).  Is a Mac section worth it?  I don't have
> access to a Mac and haven't the slightest clue how they work =)
> 
> I also redid the default homepage (ROOT/index.html) but forgot to send a
> copy home from work =(
> 
> - r
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 19, 2001 8:40 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [DOC] INSTALL.txt
> >
> >
> > Neat!
> >
> > It might be better to split "INSTALLATION" into two separate sections,
> > one for Windows, one for Unix.  HOWTOs work best with fewer
> > conditionals.
> >
> >  - A
> >
> > On Tue, Jul 17, 2001 at 08:23:10PM -0400, Rob S. wrote:
> > > Along the right line?  Used the formatting from the TC4 readme files.
> > >
> > > Needs some polish.
> > >
> > > - r
> >
> >
> 
> 




RE: [DOC] INSTALL.txt

2001-07-19 Thread Rob S.

Agreed... (re: Win/Unix sections).  Is a Mac section worth it?  I don't have
access to a Mac and haven't the slightest clue how they work =)

I also redid the default homepage (ROOT/index.html) but forgot to send a
copy home from work =(

- r

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 8:40 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [DOC] INSTALL.txt
>
>
> Neat!
>
> It might be better to split "INSTALLATION" into two separate sections,
> one for Windows, one for Unix.  HOWTOs work best with fewer
> conditionals.
>
>  - A
>
> On Tue, Jul 17, 2001 at 08:23:10PM -0400, Rob S. wrote:
> > Along the right line?  Used the formatting from the TC4 readme files.
> >
> > Needs some polish.
> >
> > - r
>
>




Re: [DOC] INSTALL.txt

2001-07-19 Thread guru

Neat!

It might be better to split "INSTALLATION" into two separate sections,
one for Windows, one for Unix.  HOWTOs work best with fewer
conditionals.

 - A

On Tue, Jul 17, 2001 at 08:23:10PM -0400, Rob S. wrote:
> Along the right line?  Used the formatting from the TC4 readme files.
> 
> Needs some polish.
> 
> - r




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

2001-07-19 Thread craigmcc

craigmcc01/07/19 17:32:36

  Modified:jasper/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  Don't get confused by the ":" character that javac includes in the pathname on
  error messages (at least on Win2K and XP).
  
  PR: Bugzilla #2693
  Submitted by: James Turner <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.11  +4 -4  
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Compiler.java 2001/07/12 21:40:56 1.10
  +++ Compiler.java 2001/07/20 00:32:36 1.11
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Compiler.java,v
 1.10 2001/07/12 21:40:56 horwat Exp $
  - * $Revision: 1.10 $
  - * $Date: 2001/07/12 21:40:56 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Compiler.java,v
 1.11 2001/07/20 00:32:36 craigmcc Exp $
  + * $Revision: 1.11 $
  + * $Date: 2001/07/20 00:32:36 $
*
* 
* 
  @@ -308,7 +308,7 @@
   if (line==null) break;
   
   // line number is between a set of colons
  -int beginColon=line.indexOf(':');
  +int beginColon=line.indexOf(':', 2); // Drive letter on Windows !!
   int endColon=line.indexOf(':', beginColon+1);
   
   if (beginColon<0 || endColon<0) {
  
  
  



Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Incze Lajos

On Thu, Jul 19, 2001 at 01:43:32PM -0700, Jonathan Reichhold wrote:
> Actually I've got a thought on how to add in debug messages without recompiling.  
>For a horrible hack say I've got a java class
> like:
> 
> //Constants.java
> public class Constants{
> public static boolean isDebug(){return true;}
> }
> 
> And in my main code I call:
> if(Constants.isDebug()) log(someNastyFunction());
> 

But why don't you have two Constants.java of this type:

public class Constants {
publict static final boolean DEBUG = true; // or false
}


and:

if( Constants.DEBUG ) {
log( ... );
}

incze



Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warpWarpConnectionHandler.java WarpConstants.java WarpContext.javaWarpDebug.java WarpEngineMapper.java WarpHandler.javaWarpHandlerTable.java WarpInputStream.java WarpOutputStream.javaWarpReader.java WarpTable.java

2001-07-19 Thread Pier P. Fumagalli

[EMAIL PROTECTED] at [EMAIL PROTECTED] wrote:

> pier01/07/19 17:05:36
> 
> Removed: catalina/src/share/org/apache/catalina/connector/warp
>   WarpConnectionHandler.java WarpConstants.java
>   WarpContext.java WarpDebug.java
>   WarpEngineMapper.java WarpHandler.java
>   WarpHandlerTable.java WarpInputStream.java
>   WarpOutputStream.java WarpReader.java
>   WarpTable.java
> Log:
> Removed old files.

Will start running the watchdog and tomcat tests... 




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnectionHandler.java WarpConstants.java WarpContext.java WarpDebug.java WarpEngineMapper.java WarpHandler.java WarpHandlerTable.java WarpInputStream.java WarpOutputStream.java WarpReader.java WarpTable.java

2001-07-19 Thread pier

pier01/07/19 17:05:36

  Removed: catalina/src/share/org/apache/catalina/connector/warp
WarpConnectionHandler.java WarpConstants.java
WarpContext.java WarpDebug.java
WarpEngineMapper.java WarpHandler.java
WarpHandlerTable.java WarpInputStream.java
WarpOutputStream.java WarpReader.java
WarpTable.java
  Log:
  Removed old files.



cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpResponse.java

2001-07-19 Thread pier

pier01/07/19 17:01:38

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpResponse.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.4   +139 -131  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java
  
  Index: WarpResponse.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpResponse.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WarpResponse.java 2001/01/24 23:10:51 1.3
  +++ WarpResponse.java 2001/07/20 00:01:38 1.4
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,12 +56,13 @@
* = */
   package org.apache.catalina.connector.warp;
   
  -import org.apache.catalina.connector.HttpResponseBase;
   import java.io.IOException;
  -import java.io.OutputStreamWriter;
  +import java.io.OutputStream;
   import java.io.PrintWriter;
   import java.net.MalformedURLException;
   import java.net.URL;
  +import java.security.AccessController;
  +import java.security.PrivilegedAction;
   import java.text.SimpleDateFormat;
   import java.util.ArrayList;
   import java.util.Date;
  @@ -69,166 +70,173 @@
   import java.util.Iterator;
   import java.util.Locale;
   import java.util.TimeZone;
  +import javax.servlet.ServletResponse;
   import javax.servlet.http.Cookie;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpSession;
  -import javax.servlet.http.HttpUtils;
  +//import javax.servlet.http.HttpUtils;
   import org.apache.catalina.HttpResponse;
   import org.apache.catalina.Globals;
   import org.apache.catalina.Logger;
  +import org.apache.catalina.connector.HttpResponseBase;
   import org.apache.catalina.util.CookieTools;
   import org.apache.catalina.util.RequestUtil;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpResponse.java,v 1.3 2001/01/24 23:10:51 pier Exp $
  - */
   public class WarpResponse extends HttpResponseBase {
  -
  -// -- CONSTANTS
  -
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -
  -/** The WarpRequestHandler associated with this response. */
  -private WarpRequestHandler handler=null;
  -
  -/** The WarpPacket used to write data. */
  -private WarpPacket packet=new WarpPacket();
  +private WarpPacket packet;
  +private WarpConnection connection;
   
  -private boolean committed=false;
  +public WarpResponse() {
  +super();
  +recycle();
  +}
   
  -/**
  - * Return the WarpRequestHandler associated with this response.
  - */
  -protected WarpRequestHandler getWarpRequestHandler() {
  -return(this.handler);
  +public void recycle() {
  +super.recycle();
  +this.setStream(new Stream(this));
   }
   
  -/**
  - * Set the WarpRequestHandler associated with this response.
  - */
  -protected void setWarpRequestHandler(WarpRequestHandler handler) {
  -this.handler=handler;
  +public void setPacket(WarpPacket packet) {
  +this.packet=packet;
  +}
  +
  +public WarpPacket getPacket() {
  +return(this.packet);
   }
  +
  +public void setConnection(WarpConnection connection) {
  +this.connection=connection;
  +}
   
  -public boolean isCommitted() {
  -return(this.committed);
  +public WarpConnection getConnection() {
  +return(this.connection);
   }
   
  +/**
  + * Send the HTTP response headers, if this has not already occurred.
  + */
   protected void sendHeaders() throws IOException {
  -if (DEBUG) this.debug("Sending status and headers");
  -
  -if (isCommitted()) return;
  -
  + if (isCommitted()) return;
  +if ("HTTP/0.9".equals(re

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpRequestHandler.java

2001-07-19 Thread pier

pier01/07/19 17:01:32

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpRequestHandler.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.8   +125 -126  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java
  
  Index: WarpRequestHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequestHandler.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WarpRequestHandler.java   2001/01/24 23:10:51 1.7
  +++ WarpRequestHandler.java   2001/07/20 00:01:32 1.8
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,139 +56,138 @@
* = */
   package org.apache.catalina.connector.warp;
   
  +import java.io.File;
   import java.io.IOException;
  +import java.net.URL;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpRequestHandler.java,v 1.7 2001/01/24 23:10:51 pier Exp $
  - */
  -public class WarpRequestHandler extends WarpHandler {
  -
  -/** The WarpReader associated with this WarpConnectionHandler. */
  -private WarpReader reader=new WarpReader();
  -/** The WarpPacket used to write data. */
  -private WarpPacket packet=new WarpPacket();
  -/** Wether we had an error in the request header. */
  -private boolean headererr=false;
  -
  -/** The WarpRequest object associated with this request handler. */
  -protected WarpRequest request=null;
  -/** The WarpRequest object associated with this request handler. */
  -protected WarpResponse response=null;
  -
  -/**
  - * Process a WARP packet.
  - * 
  - * This method is the one which will actually perform the operation of
  - * analyzing the packet and doing whatever needs to be done.
  - * 
  - * This method will return true if another packet is expected for this
  - * RID, or it will return false if this was the last packet for this RID.
  - * When we return false this handler is unregistered, and the Thread
  - * started in the init() method is terminated.
  - *
  - * @param type The WARP packet type.
  - * @param buffer The WARP packet payload.
  - * @return If more packets are expected for this RID, true is returned,
  - * false if this was the last packet.
  - */
  -public boolean process(int type, byte buffer[]) {
  -WarpConnector connector=this.getConnector();
  -WarpEngine engine=(WarpEngine)connector.getContainer();
  -String arg1=null;
  -String arg2=null;
  -int valu=-1;
  -
  -this.reader.reset(buffer);
  -this.packet.reset();
  -try {
  -switch (type) {
  -// The Request method
  -case WarpConstants.TYP_REQINIT_MET:
  -arg1=reader.readString();
  -if (DEBUG) this.debug("Request Method "+arg1);
  -this.request.setMethod(arg1);
  -break;
  -
  -// The Request URI
  -case WarpConstants.TYP_REQINIT_URI:
  -arg1=reader.readString();
  -if (DEBUG) this.debug("Request URI "+arg1);
  -this.request.setRequestURI(arg1);
  -break;
  -
  -// The Request query arguments
  -case WarpConstants.TYP_REQINIT_ARG:
  -arg1=reader.readString();
  -if (DEBUG) this.debug("Request Query Argument "+arg1);
  -this.request.setQueryString(arg1);
  -break;
  -
  -// The Request protocol
  -case WarpConstants.TYP_REQINIT_PRO:
  -arg1=reader.readString();
  -if (DEBUG) this.debug("Request Protocol "+arg1);
  -this.request.setProtocol(arg1);
  -break;
  -
  -// A

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpRequest.java

2001-07-19 Thread pier

pier01/07/19 17:01:26

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpRequest.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.5   +16 -101   
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java
  
  Index: WarpRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpRequest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WarpRequest.java  2001/01/24 23:10:50 1.4
  +++ WarpRequest.java  2001/07/20 00:01:26 1.5
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,108 +56,23 @@
* = */
   package org.apache.catalina.connector.warp;
   
  +import org.apache.catalina.Context;
  +import org.apache.catalina.Host;
   import org.apache.catalina.connector.HttpRequestBase;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpRequest.java,v 1.4 2001/01/24 23:10:50 pier Exp $
  - */
   public class WarpRequest extends HttpRequestBase {
  -
  -// -- CONSTANTS
  -
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -
  -//  LOCAL VARIABLES
  -
  -/** The Warp Host ID of this request. */
  -private int hostid=-1;
  -/** The Warp Application ID of this request. */
  -private int applid=-1;
  -/** The Warp Request ID of this request. */
  -private int id=-1;
  -/** The WarpRequestHandler associated with this request. */
  -private WarpRequestHandler handler=null;
  -
  -// --- BEAN METHODS
  -
  -/**
  - * Return the WarpRequestHandler associated with this request.
  - */
  -protected WarpRequestHandler getWarpRequestHandler() {
  -return(this.handler);
  -}
  -
  -/**
  - * Set the WarpRequestHandler associated with this request.
  - */
  -protected void setWarpRequestHandler(WarpRequestHandler handler) {
  -this.handler=handler;
  -}
  -
  -/**
  - * Return the Host ID associated with this WarpRequest instance.
  - */
  -protected int getRequestID() {
  -return(this.id);
  -}
  -
  -/**
  - * Set the Host ID associated with this WarpRequest instance.
  - */
  -protected void setRequestID(int id) {
  -if (DEBUG) this.debug("Setting RequestID to "+id);
  -this.id=id;
  -}
  -
  -/**
  - * Return the Host ID associated with this WarpRequest instance.
  - */
  -protected int getRequestedHostID() {
  -return(this.hostid);
  -}
  -
  -/**
  - * Set the Application ID associated with this WarpRequest instance.
  - */
  -protected void setRequestedHostID(int id) {
  -if (DEBUG) this.debug("Setting request HostID to "+id);
  -this.hostid=id;
  -}
  -
  -/**
  - * Return the Application ID associated with this WarpRequest instance.
  - */
  -protected int getRequestedApplicationID() {
  -return(this.applid);
  -}
  -
  -/**
  - * Set the Host ID associated with this WarpRequest instance.
  - */
  -protected void setRequestedApplicationID(int id) {
  -if (DEBUG) this.debug("Setting request ApplicationID to "+id);
  -this.applid=id;
  -}
  -
  -// -- DEBUGGING METHODS
  -
  -/**
  - * Dump a debug message.
  - */
  -private void debug(String msg) {
  -if (DEBUG) WarpDebug.debug(this,msg);
  -}
  -
  -/**
  - * Dump information for an Exception.
  - */
  -private void debug(Exception exc) {
  -if (DEBUG) WarpDebug.debug(this,exc);
  +private Host host=null;
  +private Context context=null;
  +
  +

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpPacket.java

2001-07-19 Thread pier

pier01/07/19 17:01:19

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpPacket.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.6   +171 -53   
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpPacket.java
  
  Index: WarpPacket.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpPacket.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WarpPacket.java   2001/01/24 23:10:49 1.5
  +++ WarpPacket.java   2001/07/20 00:01:19 1.6
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,70 +56,188 @@
* = */
   package org.apache.catalina.connector.warp;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpPacket.java,v 1.5 2001/01/24 23:10:49 pier Exp $
  - */
  -public class WarpPacket {
  -
  -/** The default size. */
  -private static final int defaultsize=4096;
  -
  -/** The current buffer. */
  -private byte buf[];
  +import java.io.UnsupportedEncodingException;
   
  -/** The current position in the buffer. */
  -private int pos;
  +public class WarpPacket {
   
  +/** This packet's data buffer */
  +protected byte buffer[]=null;
  +/** Number of bytes stored in the buffer */
  +protected int size=0;
  +
  +/* Pointer to the last byte read in the buffer */
  +private int pointer=0;
  +/* Type of this packet */
  +private int type=-1;
  +/* Maximum value for a 16 bit unsigned value (0x0 +1) */
  +private static final int MAX_LENGTH=65536;
  +
  +/**
  + * Construct a new WarpPacket instance.
  + */
   public WarpPacket() {
   super();
  -this.buf=new byte[defaultsize];
  +this.buffer=new byte[MAX_LENGTH];
   this.reset();
   }
   
  +/**
  + * Reset this packet.
  + */
   public void reset() {
  -this.pos=0;
  -if (this.buf.length>(defaultsize<<1)) this.buf=new byte[defaultsize];
  -}
  -
  -public void writeShort(int k) {
  -// Check if we have room
  -if ((this.pos+2)65535)
  +throw new IllegalArgumentException("Unsigned short is too big");
  +
  +if ((this.size+2)>=MAX_LENGTH)
  +throw new ArrayIndexOutOfBoundsException("Too much data");
  +
  +this.buffer[this.size++]=(byte) ((value>>8)&0x0ff);
  +this.buffer[this.size++]=(byte) ((value>>0)&0x0ff);
  +}
  +
  +/**
  + * Write a signed integer value (32 bit) in the packet buffer.
  + *
  + * @param value The signed integer value to write.
  + * @exception ArrayIndexOutOfBoundsException If the packet buffer cannot
  + *contain the new value.
  + */
  +public void writeInteger(int value) {
  +if ((this.size+4)>=MAX_LENGTH)
  +throw new ArrayIndexOutOfBoundsException("Too much data");
  +
  +this.buffer[this.size++]=(byte) ((value>>24)&0x0ff);
  +this.buffer[this.size++]=(byte) ((value>>16)&0x0ff);
  +this.buffer[this.size++]=(byte) ((value>>8)&0x0ff);
  +this.buffer[this.size++]=(byte) ((value>>0)&0x0ff);
  +}
  +
  +/**
  + * Write a string into the packet buffer.
  + *
  + * @param string The string to write into the packet buffer.
  + * @exception ArrayIndexOutOfBoundsException If the packet buffer cannot
  + *contain the new value.
  + * @exception RuntimeException If the platform doesn't support UTF-8
  + *encoding.
  + */
  +public void writeString(String string) {
  +try {
  +byte temp[]=string.getBytes("UTF-8");
  +if ((this.size+temp.length+2)>MAX_LENGTH)
  +throw new ArrayIndexOutOfBoundsException("Too much data");
  +
  +this.writeUnsignedShort(temp.length);
  +System.arraycopy(temp,0,this.buffer,this.size,temp.length);
  +

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpHost.java

2001-07-19 Thread pier

pier01/07/19 17:01:12

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpHost.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.8   +13 -115   
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpHost.java
  
  Index: WarpHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpHost.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WarpHost.java 2001/01/24 23:10:48 1.7
  +++ WarpHost.java 2001/07/20 00:01:12 1.8
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,127 +56,25 @@
* = */
   package org.apache.catalina.connector.warp;
   
  +import java.io.IOException;
   import javax.servlet.ServletException;
  +
  +import org.apache.catalina.Container;
  +import org.apache.catalina.Context;
   import org.apache.catalina.Request;
   import org.apache.catalina.Response;
  -import java.io.IOException;
  -import java.net.URL;
  -import org.apache.catalina.Container;
  -import org.apache.catalina.core.StandardHost;
   import org.apache.catalina.core.StandardContext;
  -import org.apache.catalina.startup.HostConfig;
  -import org.apache.catalina.LifecycleException;
  +import org.apache.catalina.core.StandardHost;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpHost.java,v 1.7 2001/01/24 23:10:48 pier Exp $
  - */
   public class WarpHost extends StandardHost {
  -
  -// -- CONSTANTS
  -
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -/** The class used for contexts. */
  -private static String cc="org.apache.catalina.connector.warp.WarpContext";
  -
  -//  LOCAL VARIABLES
  -
  -/** The Warp Host ID of this Host. */
  -private int id=-1;
  -/** The ID to use for the next dynamically configured application. */
  -private int applid=0;
  -
  -/**
  - * Create a new instance of a WarpHost.
  - */
  -public WarpHost() {
  -super();
  -HostConfig conf=new HostConfig();
  -conf.setContextClass(cc);
  -this.setContextClass(cc);
  -this.addLifecycleListener(conf);
  -this.setDebug(9);
  -}
  -
  -// - PUBLIC METHODS
  -
  -public void invoke(Request req, Response res)
  -throws ServletException, IOException {
  -if (DEBUG) this.debug("Invoked");
  -super.invoke(req,res);
  -}
  -
   public Container map(Request request, boolean update) {
  -if (DEBUG) this.debug("Trying to map request to context");
  -if (request instanceof WarpRequest) {
  -WarpRequest r=(WarpRequest)request;
  -
  - Container children[]=this.findChildren();
  - for (int x=0; x


cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpEngine.java

2001-07-19 Thread pier

pier01/07/19 17:01:06

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpEngine.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.11  +9 -163
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java
  
  Index: WarpEngine.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpEngine.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WarpEngine.java   2001/01/24 23:10:46 1.10
  +++ WarpEngine.java   2001/07/20 00:01:06 1.11
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -58,177 +58,23 @@
   
   import java.io.IOException;
   import javax.servlet.ServletException;
  -import javax.servlet.ServletRequest;
  -import javax.servlet.http.HttpServletResponse;
  +
   import org.apache.catalina.Container;
  -import org.apache.catalina.Engine;
  -import org.apache.catalina.Globals;
   import org.apache.catalina.Host;
  -import org.apache.catalina.LifecycleException;
   import org.apache.catalina.Request;
   import org.apache.catalina.Response;
   import org.apache.catalina.core.StandardEngine;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpEngine.java,v 1.10 2001/01/24 23:10:46 pier Exp $
  - */
   public class WarpEngine extends StandardEngine {
  -
  -// -- CONSTANTS
  -
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -/** The descriptive information related to this implementation. */
  -private static final String info="WarpEngine/"+WarpConstants.VERSION;
  -
  -//  LOCAL VARIABLES
  -
  -/** The Java class name of the default Mapper class for this Container. */
  -private String mapper="org.apache.catalina.connector.warp.WarpEngineMapper";
  -/** The root path for web applications. */
  -private String appbase="";
  -/** The Host ID to use for the next dynamically configured host. */
  -private int hostid=0;
  -
  -//  CONSTRUCTOR
  -
  -/**
  - * Create a new WarpEngine component with the default basic Valve.
  - */
  -public WarpEngine() {
  -super();
  -super.addDefaultMapper(this.mapper);
  -if (DEBUG) this.debug("New instance created");
  -this.setDebug(9);
  -}
  -
  -// - PUBLIC METHODS
  -
  -public void invoke(Request req, Response res)
  -throws ServletException, IOException {
  -if (DEBUG) this.debug("Invoked");
  -super.invoke(req,res);
  -}
  -
   public Container map(Request request, boolean update) {
  -if (DEBUG) this.debug("Trying to map request to host");
  +this.log("Mapping request");
   if (request instanceof WarpRequest) {
  -WarpRequest r=(WarpRequest)request;
  -
  - Container children[]=this.findChildren();
  - for (int x=0; x


cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnector.java

2001-07-19 Thread pier

pier01/07/19 17:01:00

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpConnector.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.12  +356 -233  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnector.java
  
  Index: WarpConnector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnector.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WarpConnector.java2001/05/09 23:42:17 1.11
  +++ WarpConnector.java2001/07/20 00:01:00 1.12
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,193 +56,171 @@
* = */
   package org.apache.catalina.connector.warp;
   
  -import java.io.*;
  -import java.net.*;
  -import org.apache.catalina.Container;
  +import java.io.IOException;
  +import java.net.InetAddress;
  +import java.net.ServerSocket;
  +import java.net.Socket;
  +import java.util.Random;
  +import java.util.Vector;
  +
   import org.apache.catalina.Connector;
  +import org.apache.catalina.Container;
  +import org.apache.catalina.Context;
  +import org.apache.catalina.Lifecycle;
  +import org.apache.catalina.Lifecycle;
  +import org.apache.catalina.LifecycleException;
  +import org.apache.catalina.LifecycleListener;
  +import org.apache.catalina.Logger;
   import org.apache.catalina.Request;
   import org.apache.catalina.Response;
   import org.apache.catalina.net.DefaultServerSocketFactory;
   import org.apache.catalina.net.ServerSocketFactory;
  -import org.apache.catalina.Lifecycle;
  -import org.apache.catalina.LifecycleEvent;
  -import org.apache.catalina.LifecycleException;
  -import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.util.LifecycleSupport;
  -import org.apache.catalina.connector.HttpRequestBase;
  -import org.apache.catalina.connector.HttpResponseBase;
   
  -/**
  - *
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpConnector.java,v 1.11 2001/05/09 23:42:17 craigmcc Exp $
  - */
   public class WarpConnector implements Connector, Lifecycle, Runnable {
   
  -// -- CONSTANTS
  +/*  */
  +/* Instance variables   */
  +/*  */
  +
  +/*  */
  +/* Local variables */
  +
  +/** The running thread accepting connections */
  +private Thread thread=null;
  +/** The server socket. */
  +private ServerSocket server=null;
  +/** Our WarpLogger. */
  +private WarpLogger logger=null;
  +/** Our list of deployed web applications. */
  +private Vector applications=new Vector();
  +/** The unique ID of this connector instance. */
  +protected int uniqueId=-1;
   
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -/** The descriptive information related to this implementation. */
  -private static final String info="WarpConnector/"+WarpConstants.VERSION;
  +/*  */
  +/* Bean variables */
   
  -//  LOCAL VARIABLES
  -
  -/** The lifecycle event support for this component. */
  -private LifecycleSupport lifecycle=null;
  -/** The server socket factory for this connector. */
  -private ServerSocket socket=null;
  -/** Wether the start() method was called or not. */
  -private boolean started=false;
  -/** The accept count for the server socket. */
  -private int count = 10;
  -/** Should we enable DNS lookups? */
  -private boolean enableLookups = false;
  -
  -// 

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp WarpConnection.java

2001-07-19 Thread pier

pier01/07/19 17:00:54

  Modified:catalina/src/share/org/apache/catalina/connector/warp
WarpConnection.java
  Log:
  New WARP implementation from Jakarta-Tomcat-Connectors
  
  Revision  ChangesPath
  1.8   +137 -260  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java
  
  Index: WarpConnection.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/WarpConnection.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WarpConnection.java   2001/01/24 23:10:42 1.7
  +++ WarpConnection.java   2001/07/20 00:00:53 1.8
  @@ -2,7 +2,7 @@
*   *
* The Apache Software License,  Version 1.1 *
*   *
  - * Copyright (c) 1999, 2000  The Apache Software Foundation. *
  + *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
*   All rights reserved.*
*   *
* = *
  @@ -56,326 +56,203 @@
* = */
   package org.apache.catalina.connector.warp;
   
  -import java.io.*;
  -import java.net.*;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.io.OutputStream;
  +import java.net.Socket;
  +
   import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleEvent;
  -import org.apache.catalina.LifecycleException;
   import org.apache.catalina.LifecycleListener;
  -import org.apache.catalina.util.LifecycleSupport;
  +
  +public class WarpConnection implements LifecycleListener, Runnable {
   
  -/**
  - *
  - * @author mailto:[EMAIL PROTECTED]";>Pier Fumagalli
  - * @author Copyright © 1999, 2000 http://www.apache.org";>The
  - * Apache Software Foundation.
  - * @version CVS $Id: WarpConnection.java,v 1.7 2001/01/24 23:10:42 pier Exp $
  - */
  -public class WarpConnection implements Lifecycle, Runnable {
  -
  -// -- CONSTANTS
  -
  -/** Our debug flag status (Used to compile out debugging information). */
  -private static final boolean DEBUG=WarpDebug.DEBUG;
  -
  -//  LOCAL VARIABLES
  -
  -/** The lifecycle event support for this component. */
  -private LifecycleSupport lifecycle=null;
  -/** The WarpHandlerTable contains the list of all current handlers. */
  -private WarpHandlerTable table=null;
  -/** The name of this connection. */
  -private String name=null;
  -/** Wether we started or not. */
  +/*  */
  +/* Instance variables   */
  +/*  */
  +
  +/*  */
  +/* Local variables */
  +
  +/** Our socket input stream. */
  +private InputStream input=null;
  +/** Our socket output stream. */
  +private OutputStream output=null;
  +/** The started flag. */
   private boolean started=false;
  -/** The number of active connections. */
  -private static int num=0;
  +/** The local thread. */
  +private Thread thread=null;
  +/** Our logger. */
  +private WarpLogger logger=null;
   
  -//  BEAN PROPERTIES
  +/*  */
  +/* Bean variables */
   
  -/** The socket used in this connection. */
  +/** The socket this connection is working on. */
   private Socket socket=null;
  -/** The connector wich created this connection. */
  +/** The connector instance. */
   private WarpConnector connector=null;
   
  -//  CONSTRUCTOR
  +/*  */
  +/* Constructor  */
  +/*  */
   
   /**
  - * Create a new WarpConnection instance.
  + * Construct a new instance of a WarpConnection.
*/
   public WarpConnection() {
   super();
  -this.lifecycle=new LifecycleSupport(this);
  -this.table=new WarpHandlerTable();
  -  

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp Constants.java WarpConfigurationHandler.java WarpLogger.java

2001-07-19 Thread pier

pier01/07/19 16:59:15

  Added:   catalina/src/share/org/apache/catalina/connector/warp
Constants.java WarpConfigurationHandler.java
WarpLogger.java
  Log:
  New WARP classes.
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/warp/Constants.java
  
  Index: Constants.java
  ===
  /* = *
   *   *
   * The Apache Software License,  Version 1.1 *
   *   *
   *  Copyright (c) 1999-2001 The Apache Software Foundation.  *
   *   All rights reserved.*
   *   *
   * = *
   *   *
   * Redistribution and use in source and binary forms,  with or without modi- *
   * fication, are permitted provided that the following conditions are met:   *
   *   *
   * 1. Redistributions of source code  must retain the above copyright notice *
   *notice, this list of conditions and the following disclaimer.  *
   *   *
   * 2. Redistributions  in binary  form  must  reproduce the  above copyright *
   *notice,  this list of conditions  and the following  disclaimer in the *
   *documentation and/or other materials provided with the distribution.   *
   *   *
   * 3. The end-user documentation  included with the redistribution,  if any, *
   *must include the following acknowlegement: *
   *   *
   *   "This product includes  software developed  by the Apache  Software *
   *Foundation ."  *
   *   *
   *Alternately, this acknowlegement may appear in the software itself, if *
   *and wherever such third-party acknowlegements normally appear. *
   *   *
   * 4. The names  "The  Jakarta  Project",  "Tomcat",  and  "Apache  Software *
   *Foundation"  must not be used  to endorse or promote  products derived *
   *from this  software without  prior  written  permission.  For  written *
   *permission, please contact <[EMAIL PROTECTED]>.*
   *   *
   * 5. Products derived from this software may not be called "Apache" nor may *
   *"Apache" appear in their names without prior written permission of the *
   *Apache Software Foundation.*
   *   *
   * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES *
   * INCLUDING, BUT NOT LIMITED TO,  THE IMPLIED WARRANTIES OF MERCHANTABILITY *
   * AND FITNESS FOR  A PARTICULAR PURPOSE  ARE DISCLAIMED.  IN NO EVENT SHALL *
   * THE APACHE  SOFTWARE  FOUNDATION OR  ITS CONTRIBUTORS  BE LIABLE  FOR ANY *
   * DIRECT,  INDIRECT,   INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL *
   * DAMAGES (INCLUDING,  BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS *
   * OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS;  OR BUSINESS INTERRUPTION) *
   * HOWEVER CAUSED AND  ON ANY  THEORY  OF  LIABILITY,  WHETHER IN  CONTRACT, *
   * STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
   * ANY  WAY  OUT OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF  ADVISED  OF THE *
   * POSSIBILITY OF SUCH DAMAGE.   *
   *   *
   * = *
   *   *
   * This software  consists of voluntary  contributions made  by many indivi- *
   * duals on behalf of the  Apache Software Foundation.  For more information *
   * on the Apache Software Foundation, please see .   *
   *   *
   * ==

cvs commit: jakarta-tomcat-connectors/webapp/apache-1.3 mod_webapp.c

2001-07-19 Thread pier

pier01/07/19 16:55:01

  Modified:webapp/apache-1.3 mod_webapp.c
  Log:
  Added Content-Type direct handling thru wa_request.
  
  Revision  ChangesPath
  1.20  +4 -1  jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c
  
  Index: mod_webapp.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_webapp.c  2001/07/15 08:43:43 1.19
  +++ mod_webapp.c  2001/07/19 23:55:01 1.20
  @@ -57,7 +57,7 @@
   
   /**
* @author  Pier Fumagalli 
  - * @version $Id: mod_webapp.c,v 1.19 2001/07/15 08:43:43 pier Exp $
  + * @version $Id: mod_webapp.c,v 1.20 2001/07/19 23:55:01 pier Exp $
*/
   
   #include 
  @@ -451,6 +451,7 @@
   req->user=apr_pstrdup(req->pool,con->user);
   req->auth=apr_pstrdup(req->pool,con->ap_auth_type);
   req->clen=0;
  +req->ctyp="\0";
   req->rlen=0;
   
   /* Copy headers into webapp request structure */
  @@ -467,6 +468,8 @@
   apr_pstrdup(req->pool,ele[x].val));
   if (strcasecmp(ele[x].key,"Content-Length")==0)
   req->clen=atol(ele[x].val);
  +if (strcasecmp(ele[x].key,"Content-Type")==0)
  +req->ctyp=apr_pstrdup(req->pool,ele[x].val);
   }
   }
   
  
  
  



Re: cvs commit: jakarta-tomcat-connectors/webapp/javaWarpConnection.java

2001-07-19 Thread Christopher Cain


"Pier P. Fumagalli" wrote:
> 
> FUCK! Why does MacOS/X crashes right in the middle of a commit?

(Comment on Apple being able to find it with both hands and a flashlight
withheld ;-)



cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp.c

2001-07-19 Thread pier

pier01/07/19 16:53:41

  Modified:webapp/lib pr_warp.c
  Log:
  Readded request handling.
  
  Revision  ChangesPath
  1.10  +182 -4jakarta-tomcat-connectors/webapp/lib/pr_warp.c
  
  Index: pr_warp.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- pr_warp.c 2001/07/18 19:19:26 1.9
  +++ pr_warp.c 2001/07/19 23:53:41 1.10
  @@ -54,7 +54,7 @@
*   *
* = */
   
  -/* @version $Id: pr_warp.c,v 1.9 2001/07/18 19:19:26 pier Exp $ */
  +/* @version $Id: pr_warp.c,v 1.10 2001/07/19 23:53:41 pier Exp $ */
   #include "pr_warp.h"
   
   /* Initialize this provider. */
  @@ -73,8 +73,11 @@
   wa_debug(WA_MARK,"Opening connection \"%s\"",curr->name);
   if (n_connect(curr)==wa_true) {
   wa_debug(WA_MARK,"Connection \"%s\" opened",curr->name);
  -if (n_configure(curr)==wa_true)
  +if (c_configure(curr)==wa_true) {
   wa_debug(WA_MARK,"Connection \"%s\" configured",curr->name);
  +} else {
  +wa_log(WA_MARK,"Cannot configure connection \"%s\"",curr->name);
  +}
   } else wa_log(WA_MARK,"Cannot open connection \"%s\"",curr->name);
   elem=elem->next;
   }
  @@ -185,9 +188,184 @@
   return(apr_psprintf(pool,"Application ID: %d",(int)(appl->conf)));
   }
   
  +/* Transmit headers */
  +static int headers(void *d, const char *n, const char *v) {
  +warp_header *data=(warp_header *)d;
  +wa_connection *conn=data->conn;
  +warp_config *conf=(warp_config *)conn->conf;
  +warp_packet *pack=data->pack;
  +
  +pack->type=TYPE_REQ_HEADER;
  +p_write_string(pack,(char *)n);
  +p_write_string(pack,(char *)v);
  +if (n_send(conf->sock,pack)!=wa_true) {
  +data->fail=wa_true;
  +return(FALSE);
  +}
  +wa_debug(WA_MARK,"Req. header %s: %s",n,v);
  +return(TRUE);
  +}
  +
   /* Handle a connection from the web server. */
  -static int warp_handle(wa_request *r, wa_application *a) {
  -return(wa_rerror(WA_MARK,r,500,"Not yet implemented"));
  +static int warp_handle(wa_request *r, wa_application *appl) {
  +warp_header *h=(warp_header *)apr_palloc(r->pool,sizeof(warp_header));
  +wa_connection *conn=appl->conn;
  +warp_config *conf=(warp_config *)conn->conf;
  +warp_packet *pack=p_create(r->pool);
  +int status=0;
  +
  +// Check packet
  +if (pack==NULL)
  +return(wa_rerror(WA_MARK,r,500,"Cannot create WARP packet"));
  +
  +// Check application
  +if (((int)(appl->conf))==-1)
  +return(wa_rerror(WA_MARK,r,404,"Application not deployed"));
  +
  +// Attempt to reconnect if disconnected
  +if (conf->sock==NULL) {
  +if (n_connect(conn)==wa_true) {
  +wa_debug(WA_MARK,"Connection \"%s\" opened",conn->name);
  +if (c_configure(conn)==wa_true) {
  +wa_debug(WA_MARK,"Connection \"%s\" configured",conn->name);
  +} else {
  +wa_log(WA_MARK,"Cannot configure connection %s",conn->name);
  +return(wa_rerror(WA_MARK,r,500,
  + "Cannot configure connection \"%s\"",
  + conn->name));
  +}
  +} else {
  +wa_log(WA_MARK,"Cannot open connection %s",conn->name);
  +return(wa_rerror(WA_MARK,r,500,"Cannot open connection %s",
  + conn->name));
  +}
  +}
  +
  +// Let's do it
  +pack->type=TYPE_REQ_INIT;
  +p_write_int(pack,(int)(appl->conf));
  +p_write_string(pack,r->meth);
  +p_write_string(pack,r->ruri);
  +p_write_string(pack,r->args);
  +p_write_string(pack,r->prot);
  +if (n_send(conf->sock,pack)!=wa_true) {
  +n_disconnect(conn);
  +return(wa_rerror(WA_MARK,r,500,"Communitcation interrupted"));
  +} else {
  +wa_debug(WA_MARK,"Req. %s %s %s",r->meth,r->ruri,r->prot);
  +}
  +
  +p_reset(pack);
  +pack->type=TYPE_REQ_CONTENT;
  +p_write_string(pack,r->ctyp);
  +p_write_int(pack,r->clen);
  +if (n_send(conf->sock,pack)!=wa_true) {
  +n_disconnect(conn);
  +return(wa_rerror(WA_MARK,r,500,"Communitcation interrupted"));
  +} else {
  +wa_debug(WA_MARK,"Req. content typ=%s len=%d",r->ctyp,r->clen);
  +}
  +
  +if (r->schm!=NULL) {
  +p_reset(pack);
  +pack->type=TYPE_REQ_SCHEME;
  +p_write_string(pack,r->schm);
  +if (n_send(conf->sock,pack)!=wa_true) {
  +n_disconnect(conn);
  +return(wa_rerror(WA_MARK,r,500,"Communitcation interrupt

cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_packet.c

2001-07-19 Thread pier

pier01/07/19 16:52:40

  Modified:webapp/lib pr_warp_packet.c
  Log:
  Fixed bug truncating strings at the end.
  
  Revision  ChangesPath
  1.4   +3 -3  jakarta-tomcat-connectors/webapp/lib/pr_warp_packet.c
  
  Index: pr_warp_packet.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp_packet.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- pr_warp_packet.c  2001/07/19 04:23:07 1.3
  +++ pr_warp_packet.c  2001/07/19 23:52:40 1.4
  @@ -54,7 +54,7 @@
*   *
* = */
   
  -/* @version $Id: pr_warp_packet.c,v 1.3 2001/07/19 04:23:07 pier Exp $ */
  +/* @version $Id: pr_warp_packet.c,v 1.4 2001/07/19 23:52:40 pier Exp $ */
   #include "pr_warp.h"
   
   void p_reset(warp_packet *pack) {
  @@ -112,10 +112,10 @@
   return(wa_false);
   }
   
  -*x=(char *)apr_palloc(pack->pool,(len+1)*sizeof(char));
  +*x=(char *)apr_palloc(pack->pool,(len+2)*sizeof(char));
   if (*x==NULL) return(wa_false);
   
  -apr_cpystrn(*x,&pack->buff[pack->curr],len);
  +apr_cpystrn(*x,&pack->buff[pack->curr],len+1);
   pack->curr+=len;
   return(wa_true);
   }
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

2001-07-19 Thread pier

pier01/07/19 16:51:48

  Modified:webapp/lib pr_warp_config.c
  Log:
  Changed names for configuration functions.
  
  Revision  ChangesPath
  1.4   +13 -5 jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c
  
  Index: pr_warp_config.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp_config.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- pr_warp_config.c  2001/07/19 04:25:24 1.3
  +++ pr_warp_config.c  2001/07/19 23:51:48 1.4
  @@ -54,10 +54,10 @@
*   *
* = */
   
  -/* @version $Id: pr_warp_config.c,v 1.3 2001/07/19 04:25:24 pier Exp $ */
  +/* @version $Id: pr_warp_config.c,v 1.4 2001/07/19 23:51:48 pier Exp $ */
   #include "pr_warp.h"
   
  -wa_boolean n_check(wa_connection *conn, warp_packet *pack) {
  +wa_boolean c_check(wa_connection *conn, warp_packet *pack) {
   warp_config *conf=(warp_config *)conn->conf;
   int maj=-1;
   int min=-1;
  @@ -99,7 +99,7 @@
   return(wa_true);
   }
   
  -wa_boolean n_configure(wa_connection *conn) {
  +wa_boolean c_configure(wa_connection *conn) {
   warp_config *conf=(warp_config *)conn->conf;
   wa_chain *elem=warp_applications;
   apr_pool_t *pool=NULL;
  @@ -115,11 +115,12 @@
   
   if ((pack=p_create(wa_pool))==NULL) {
   wa_log(WA_MARK,"Cannot create WARP configuration packet");
  +n_disconnect(conn);
   apr_pool_destroy(pool);
   return(wa_false);
   }
   
  -if ((ret=n_check(conn,pack))==wa_false) n_disconnect(conn);
  +if ((ret=c_check(conn,pack))==wa_false) n_disconnect(conn);
   
   while (elem!=NULL) {
   wa_application *appl=(wa_application *)elem->curr;
  @@ -136,6 +137,7 @@
   
   if (n_recv(conf->sock,pack)!=wa_true) {
   wa_log(WA_MARK,"Cannot read packet (%s:%d)",WA_MARK);
  +n_disconnect(conn);
   return(wa_false);
   }
   if (pack->type==TYPE_ERROR) {
  @@ -148,10 +150,10 @@
   pack->type=TYPE_FATAL;
   p_write_string(pack,"Invalid packet received");
   n_send(conf->sock,pack);
  +n_disconnect(conn);
   }
   p_read_int(pack,(int *)&appl->conf);
   p_read_string(pack,&temp);
  -wa_debug(WA_MARK,"TEMP=\"%s\"",temp);
   appl->lpth=apr_pstrdup(wa_pool,temp);
   appl->depl=wa_true;
   wa_debug(WA_MARK,"Application \"%s\" deployed with root=%s id=%d",
  @@ -166,10 +168,16 @@
   
   if (n_recv(conf->sock,pack)!=wa_true) {
   wa_log(WA_MARK,"Cannot read packet (%s:%d)",WA_MARK);
  +n_disconnect(conn);
   return(wa_false);
   }
   if (pack->type!=TYPE_CONF_PROCEED) {
   wa_log(WA_MARK,"Cannot proceed on this connection");
  +p_reset(pack);
  +pack->type=TYPE_FATAL;
  +p_write_string(pack,"Expected PROCEED packet not received");
  +n_send(conf->sock,pack);
  +n_disconnect(conn);
   return(wa_false);
   }
   
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/lib wa_request.c

2001-07-19 Thread pier

pier01/07/19 16:50:48

  Modified:webapp/lib wa_request.c
  Log:
  Set default content-type string.
  
  Revision  ChangesPath
  1.14  +2 -1  jakarta-tomcat-connectors/webapp/lib/wa_request.c
  
  Index: wa_request.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_request.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- wa_request.c  2001/07/19 04:21:38 1.13
  +++ wa_request.c  2001/07/19 23:50:47 1.14
  @@ -55,7 +55,7 @@
*   *
* = */
   
  -/* @version $Id: wa_request.c,v 1.13 2001/07/19 04:21:38 pier Exp $ */
  +/* @version $Id: wa_request.c,v 1.14 2001/07/19 23:50:47 pier Exp $ */
   #include 
   
   /* Allocate a new request structure. */
  @@ -107,6 +107,7 @@
   req->user=NULL;
   req->auth=NULL;
   req->clen=0;
  +req->ctyp="\0";
   req->rlen=0;
   
   /* All done */
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/lib wa_main.c

2001-07-19 Thread pier

pier01/07/19 16:50:03

  Modified:webapp/lib wa_main.c
  Log:
  Better debugging output.
  
  Revision  ChangesPath
  1.9   +8 -4  jakarta-tomcat-connectors/webapp/lib/wa_main.c
  
  Index: wa_main.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- wa_main.c 2001/07/13 01:15:36 1.8
  +++ wa_main.c 2001/07/19 23:50:03 1.9
  @@ -55,7 +55,7 @@
*   *
* = */
   
  -/* @version $Id: wa_main.c,v 1.8 2001/07/13 01:15:36 pier Exp $ */
  +/* @version $Id: wa_main.c,v 1.9 2001/07/19 23:50:03 pier Exp $ */
   #include 
   
   /* The current APR memory pool. */
  @@ -189,6 +189,9 @@
   /* Dump some debugging information. */
   void wa_debug(const char *f, const int l, const char *fmt, ...) {
   #ifdef DEBUG
  +char hdr[128];
  +char dta[640];
  +char buf[768];
   apr_time_t at;
   char st[128];
   va_list ap;
  @@ -196,9 +199,10 @@
   at=apr_time_now();
   apr_ctime(st, at);
   va_start(ap,fmt);
  -fprintf(stderr,"[%s] %d (%s:%d) ",st,getpid(),f,l);
  -vfprintf(stderr,fmt,ap);
  -fprintf(stderr,"\n");
  +apr_snprintf(hdr,128,"[%s] %d (%s:%d)",st,getpid(),f,l);
  +apr_vsnprintf(dta,640,fmt,ap);
  +apr_snprintf(buf,728,"%s %s\n",hdr,dta);
  +fprintf(stderr,"%s",buf);
   fflush(stderr);
   va_end(ap);
   #endif /* ifdef DEBUG */
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp.h

2001-07-19 Thread pier

pier01/07/19 16:49:00

  Modified:webapp/lib pr_warp.h
  Log:
  Added WARP header structure to process headers from table.
  Added packet types for request.
  Changed function names for configuration.
  
  Revision  ChangesPath
  1.4   +24 -3 jakarta-tomcat-connectors/webapp/lib/pr_warp.h
  
  Index: pr_warp.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/pr_warp.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- pr_warp.h 2001/07/19 04:22:13 1.3
  +++ pr_warp.h 2001/07/19 23:49:00 1.4
  @@ -54,7 +54,7 @@
*   *
* = */
   
  -/* @version $Id: pr_warp.h,v 1.3 2001/07/19 04:22:13 pier Exp $ */
  +/* @version $Id: pr_warp.h,v 1.4 2001/07/19 23:49:00 pier Exp $ */
   #ifndef _PR_WARP_H_
   #define _PR_WARP_H_
   
  @@ -90,6 +90,13 @@
   char buff[65536];
   } warp_packet;
   
  +/* Structure for processin headers in WARP */
  +typedef struct warp_header {
  +wa_connection *conn;
  +warp_packet *pack;
  +wa_boolean fail;
  +} warp_header;
  +
   /* * */
   /* DEFINITIONS   */
   /* * */
  @@ -109,6 +116,20 @@
   #define TYPE_CONF_DONE0x04
   #define TYPE_CONF_PROCEED 0x05
   
  +#define TYPE_REQ_INIT 0x10
  +#define TYPE_REQ_CONTENT  0x11
  +#define TYPE_REQ_SCHEME   0x12
  +#define TYPE_REQ_AUTH 0x13
  +#define TYPE_REQ_HEADER   0x14
  +#define TYPE_REQ_PROCEED  0x1f
  +
  +#define TYPE_RES_STATUS   0x20
  +#define TYPE_RES_HEADER   0x21
  +#define TYPE_RES_COMMIT   0x2f
  +#define TYPE_RES_BODY 0x30
  +#define TYPE_RES_DONE 0x3f
  +
  +
   /* * */
   /* PACKET FUNCTIONS FROM PR_WARP_PACKET.C*/
   /* * */
  @@ -132,7 +153,7 @@
   /* * */
   /* CONFIGURATION FUNCTIONS FROM PR_WARP_CONFIG.C */
   /* * */
  -wa_boolean n_check(wa_connection *conn, warp_packet *pack);
  -wa_boolean n_configure(wa_connection *conn);
  +wa_boolean c_check(wa_connection *conn, warp_packet *pack);
  +wa_boolean c_configure(wa_connection *conn);
   
   #endif /* ifndef _PR_WARP_H_ */
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/include wa_request.h

2001-07-19 Thread pier

pier01/07/19 16:47:31

  Modified:webapp/include wa_request.h
  Log:
  Added content-type to the request structure.
  
  Revision  ChangesPath
  1.6   +3 -1  jakarta-tomcat-connectors/webapp/include/wa_request.h
  
  Index: wa_request.h
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/include/wa_request.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- wa_request.h  2001/05/10 21:15:01 1.5
  +++ wa_request.h  2001/07/19 23:47:31 1.6
  @@ -58,7 +58,7 @@
   /**
* @package Request Handling
* @author  Pier Fumagalli 
  - * @version $Id: wa_request.h,v 1.5 2001/05/10 21:15:01 pier Exp $
  + * @version $Id: wa_request.h,v 1.6 2001/07/19 23:47:31 pier Exp $
*/
   #ifndef _WA_REQUEST_H_
   #define _WA_REQUEST_H_
  @@ -122,6 +122,8 @@
   char *auth;
   /** The content length of this request. */
   long clen;
  +/** The content type of this request. */
  +char *ctyp;
   /** The number of bytes read out of this request body. */
   long rlen;
   /** The current headers table. */
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java Constants.java.in

2001-07-19 Thread pier

pier01/07/19 16:46:30

  Modified:webapp/java Constants.java.in
  Log:
  Added types.
  
  Revision  ChangesPath
  1.4   +15 -0 jakarta-tomcat-connectors/webapp/java/Constants.java.in
  
  Index: Constants.java.in
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Constants.java.in 2001/07/19 14:37:12 1.3
  +++ Constants.java.in 2001/07/19 23:46:30 1.4
  @@ -148,4 +148,19 @@
* No payload:
*/
   public static final int TYPE_CONF_PROCEED=0x05;
  +
  +public static final int TYPE_REQ_INIT=0x10;
  +public static final int TYPE_REQ_CONTENT=0x11;
  +public static final int TYPE_REQ_SCHEME=0x12;
  +public static final int TYPE_REQ_AUTH=0x13;
  +public static final int TYPE_REQ_HEADER=0x14;
  +public static final int TYPE_REQ_PROCEED=0x1f;
  +
  +public static final int TYPE_RES_STATUS=0x20;
  +public static final int TYPE_RES_HEADER=0x21;
  +public static final int TYPE_RES_COMMIT=0x2f;
  +public static final int TYPE_RES_BODY=0x30;
  +public static final int TYPE_RES_DONE=0x3f;
  +
  +
   }
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnector.java WarpPacket.java

2001-07-19 Thread pier

pier01/07/19 16:45:30

  Modified:webapp/java WarpConnector.java WarpPacket.java
  Log:
  Forgot bean method to set port.
  Added applications table.
  
  Revision  ChangesPath
  1.16  +34 -0 jakarta-tomcat-connectors/webapp/java/WarpConnector.java
  
  Index: WarpConnector.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnector.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WarpConnector.java2001/07/19 02:45:33 1.15
  +++ WarpConnector.java2001/07/19 23:45:30 1.16
  @@ -122,6 +122,8 @@
   private int acceptCount=10;
   /** The server appBase for hosts created via WARP. */
   private String appBase="webapps";
  +/** The debug level. */
  +private int debug=0;
   
   /*  */
   /* Lifecycle variables */
  @@ -333,6 +335,13 @@
   }
   
   /**
  + * Return the port to which this Connector will bind to.
  + */
  +public void setPort(int port) {
  +this.port=port;
  +}
  +
  +/**
* Set the IP address to which this Connector will bind to.
*
* @param address The bind IP address
  @@ -383,6 +392,20 @@
   if (Constants.DEBUG) logger.debug("Setting appBase to "+appBase);
   }
   
  +/**
  + * Return the debug level.
  + */
  +public int getDebug() {
  +return(this.debug);
  +}
  +
  +/**
  + * Set the debug level.
  + */
  +public void setDebug(int debug) {
  +this.debug=debug;
  +}
  +
   /*  */
   /* Lifecycle methods*/
   /*  */
  @@ -459,6 +482,17 @@
   id=this.applications.indexOf(context);
   }
   return(id);
  +}
  +
  +/**
  + * Return the application for a given ID.
  + */
  +protected Context applicationContext(int id) {
  +try {
  +return((Context)this.applications.elementAt(id));
  +} catch (ArrayIndexOutOfBoundsException e) {
  +return(null);
  +}
   }
   
   /**
  
  
  
  1.12  +6 -8  jakarta-tomcat-connectors/webapp/java/WarpPacket.java
  
  Index: WarpPacket.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpPacket.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WarpPacket.java   2001/07/15 08:40:58 1.11
  +++ WarpPacket.java   2001/07/19 23:45:30 1.12
  @@ -181,9 +181,8 @@
   if ((this.pointer+2)>this.size)
   throw new ArrayIndexOutOfBoundsException("No data available");
   
  -int k=0;
  -k=(k<<8)|(this.buffer[this.pointer++]);
  -k=(k<<8)|(this.buffer[this.pointer++]);
  +int k=(this.buffer[this.pointer++])&0xff;
  +k=(k<<8)+((this.buffer[this.pointer++])&0xff);
   
   return(k);
   }
  @@ -199,11 +198,10 @@
   if ((this.pointer+4)>this.size)
   throw new ArrayIndexOutOfBoundsException("No data available");
   
  -int k=0;
  -k=(k<<8)|(this.buffer[this.pointer++]);
  -k=(k<<8)|(this.buffer[this.pointer++]);
  -k=(k<<8)|(this.buffer[this.pointer++]);
  -k=(k<<8)|(this.buffer[this.pointer++]);
  +int k=(this.buffer[this.pointer++])&0xff;
  +k=(k<<8)+((this.buffer[this.pointer++])&0xff);
  +k=(k<<8)+((this.buffer[this.pointer++])&0xff);
  +k=(k<<8)+((this.buffer[this.pointer++])&0xff);
   
   return(k);
   }
  
  
  



Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Louis Tribble

Craig wrote:
> - The typical approach with the JSR47 API or with Log4J is to let the
>   logger decide whether to really output the message or not.  So, you
>   would instrument your code with things like (conceptual, not real API):
> 
>   logger.log("The object is " + myObject, Logger.DEBUG);
> 
>   and let the logger configuration decide whether you care about debug
>   messages or not.
> 
> - However, there is a performance problem with leaving this code in --
>   you will be doing the string concatenation (and the method call)
>   whether or not you want debug messages printed!  If you are liberal
>   about debug messages, especially inside frequently executed methods,
>   this can have adverse impacts on performance (and increased garbage
>   collection).

Often the toString() are much worse than the concatenations. After we realized 
what a HUGE impact this had on performance, we added a bunch of overloadings
so that you could convert the above to the equivalent of:

 logger.log(Logger.DEBUG, "The object is {0}", myObject);

where the formatting is only done once it's known that the category is enabled
(we used named categories instead of levels, but that's another discussion). I just
went and looked at log4j and java.util.logging and it looks like both would require 
going through a wrapper class to get this feature.

The number of overloadings is a bit of a pain for the implementer once you 
consider that you would often want to log boolean, int, and in some applications
float parameters, but not for the caller.

Louis Tribble





Re: cvs commit: jakarta-tomcat-connectors/webapp/javaWarpConnection.java

2001-07-19 Thread Pier P. Fumagalli

FUCK! Why does MacOS/X crashes right in the middle of a commit?
Back in one minute after restart...

Pier




cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnection.java

2001-07-19 Thread pier

pier01/07/19 16:37:55

  Modified:webapp/java WarpConnection.java
  Log:
  Handle requests.
  
  Revision  ChangesPath
  1.16  +6 -2  jakarta-tomcat-connectors/webapp/java/WarpConnection.java
  
  Index: WarpConnection.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnection.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WarpConnection.java   2001/07/19 04:19:01 1.15
  +++ WarpConnection.java   2001/07/19 23:37:55 1.16
  @@ -179,16 +179,20 @@
* Process data from the socket.
*/
   public void run() {
  +WarpPacket packet=new WarpPacket();
  +
   if (Constants.DEBUG) logger.debug("Connection starting");
   
   try {
   this.input=this.socket.getInputStream();
   this.output=this.socket.getOutputStream();
  -boolean success=new WarpConfigurationHandler().handle(this);
  -if (!success) {
  +if (!new WarpConfigurationHandler().handle(this,packet)) {
   logger.log("Configuration handler returned false");
   this.stop();
   }
  +WarpRequestHandler requestHandler=new WarpRequestHandler();
  +while (requestHandler.handle(this,packet));
  +this.stop();
   } catch (IOException e) {
   logger.log("Exception on socket",e);
   }
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpConfigurationHandler.java

2001-07-19 Thread pier

pier01/07/19 16:36:57

  Modified:webapp/java WarpConfigurationHandler.java
  Log:
  Creating WarpContainers instead of standard ones (but the standard ones are
  still allowed)
  
  Revision  ChangesPath
  1.9   +19 -13
jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java
  
  Index: WarpConfigurationHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WarpConfigurationHandler.java 2001/07/19 04:19:01 1.8
  +++ WarpConfigurationHandler.java 2001/07/19 23:36:56 1.9
  @@ -65,6 +65,7 @@
   import org.apache.catalina.Deployer;
   import org.apache.catalina.Host;
   import org.apache.catalina.core.StandardHost;
  +import org.apache.catalina.core.StandardContext;
   
   public class WarpConfigurationHandler {
   
  @@ -76,11 +77,10 @@
   super();
   }
   
  -public boolean handle(WarpConnection connection)
  +public boolean handle(WarpConnection connection, WarpPacket packet)
   throws IOException {
   WarpLogger logger=new WarpLogger(this);
   logger.setContainer(connection.getConnector().getContainer());
  -WarpPacket packet=new WarpPacket();
   
   // Prepare the Welcome packet
   packet.setType(Constants.TYPE_CONF_WELCOME);
  @@ -134,9 +134,6 @@
   }
   
   case Constants.TYPE_CONF_DONE: {
  -packet.reset();
  -packet.setType(Constants.TYPE_CONF_PROCEED);
  -connection.send(packet);
   return(true);
   }
   
  @@ -145,7 +142,12 @@
   }
   
   default: {
  -logger.log("Invalid packet with type "+packet.getType());
  +String msg="Invalid packet with type "+packet.getType();
  +logger.log(msg);
  +packet.reset();
  +packet.setType(Constants.TYPE_FATAL);
  +packet.writeString(msg);
  +connection.send(packet);
   return(false);
   }
   }
  @@ -162,11 +164,13 @@
   
   Host host=(Host)container.findChild(hostName);
   if (host==null) {
  -host=new StandardHost();
  -host.setName(hostName);
  -host.setParent(container);
  -host.setAppBase(connection.getConnector().getAppBase());
  -container.addChild(host);
  +WarpHost whost=new WarpHost();
  +whost.setName(hostName);
  +whost.setParent(container);
  +whost.setAppBase(connection.getConnector().getAppBase());
  +whost.setDebug(connection.getConnector().getDebug());
  +container.addChild(whost);
  +host=whost;
   if (Constants.DEBUG)
   logger.debug("Created new host "+host.getName());
   } else if (Constants.DEBUG) {
  @@ -207,8 +211,10 @@
   logger.debug("Application URL \""+url.toString()+"\"");
   
   deployer.install(applPath, url);
  -return(deployer.findDeployedApp(applPath));
  -
  +StandardContext context=null;
  +context=(StandardContext)deployer.findDeployedApp(applPath);
  +context.setDebug(connection.getConnector().getDebug());
  +return(context);
   } else {
   if (Constants.DEBUG)
   logger.debug("Found application for \""+appl.getName()+"\"");
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpResponse.java

2001-07-19 Thread pier

pier01/07/19 16:35:56

  Added:   webapp/java WarpResponse.java
  Log:
  Re-enabling WarpResponse
  
  Revision  ChangesPath
  1.5   +139 -131  jakarta-tomcat-connectors/webapp/java/WarpResponse.java
  
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequestHandler.java

2001-07-19 Thread pier

pier01/07/19 16:35:26

  Added:   webapp/java WarpRequestHandler.java
  Log:
  Re-enabling WarpRequestHandler
  
  Revision  ChangesPath
  1.9   +125 -126  jakarta-tomcat-connectors/webapp/java/WarpRequestHandler.java
  
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpRequest.java

2001-07-19 Thread pier

pier01/07/19 16:35:07

  Added:   webapp/java WarpRequest.java
  Log:
  Re-enabling WarpRequest
  
  Revision  ChangesPath
  1.6   +16 -101   jakarta-tomcat-connectors/webapp/java/WarpRequest.java
  
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpHost.java

2001-07-19 Thread pier

pier01/07/19 16:34:35

  Added:   webapp/java WarpHost.java
  Log:
  Re-enabling Warp Host.
  
  Revision  ChangesPath
  1.9   +13 -115   jakarta-tomcat-connectors/webapp/java/WarpHost.java
  
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpEngine.java

2001-07-19 Thread pier

pier01/07/19 16:34:07

  Added:   webapp/java WarpEngine.java
  Log:
  Re-enabling WARP engine.
  
  Revision  ChangesPath
  1.12  +9 -163jakarta-tomcat-connectors/webapp/java/WarpEngine.java
  
  
  
  



Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Craig R. McClanahan



On Thu, 19 Jul 2001, Jonathan Reichhold wrote:

> > This hack definitely works.  As long as you're willing to pay the overhead
> > for the method call, it's essentially equivalent to asking Log4J whether
> > or not debugging output is enabled, which does something similar (but asks
> > the instantiated logger object, instead of being a static method).
> 
> I'm not sure if Log4j has an accesible boolean like this (maybe it
> does, haven't used it yet),

It's accessible, but via a method call.  That's still a *lot* cheaper than
doing useless string concatenations, but not quite as cheap as an integer
comparison.  I don't have the Log4J APIs available right at the moment,
but there's a call on the logger object that can be used to check for
enabled levels (or at least for debug).

Craig McClanahan




Re: Nice script to change all those cvsroots?

2001-07-19 Thread Jeff Turner

A collection of invaluable scripts for CVS:

http://www.red-bean.com/cvsutils/

"cvsco" is the one I use daily.. removes all local modifications.

Among them:

 "cvschroot makes it possible to change CVS/Root in all subdirectories
 to the given value."


--Jeff


On Fri, Jul 20, 2001 at 12:22:32AM +0200, Martin van den Bemt wrote:
> Has anyone got a nice script to replace the jakarta.apache.org cvsroot to
> the cvs.apache.org cvs root? It's a lot of time to checkout everything again
> and gives lot's of other problems (losing changes I made to ant and tomcat
> eg..). It is for linux btw.
> Just a not : I have a checkout of all the jakarta projects, so I will save a
> lot of traffic to the cvs server with a nice change script.. (I'm not a guru
> on bash scripts..)
> 
> Mvgr,
> Martin



Nice script to change all those cvsroots?

2001-07-19 Thread Martin van den Bemt

Has anyone got a nice script to replace the jakarta.apache.org cvsroot to
the cvs.apache.org cvs root? It's a lot of time to checkout everything again
and gives lot's of other problems (losing changes I made to ant and tomcat
eg..). It is for linux btw.
Just a not : I have a checkout of all the jakarta projects, so I will save a
lot of traffic to the cvs server with a nice change script.. (I'm not a guru
on bash scripts..)

Mvgr,
Martin




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup StopTomcat.java

2001-07-19 Thread costin

costin  01/07/19 14:52:48

  Modified:src/share/org/apache/tomcat/startup StopTomcat.java
  Log:
  Allow users to specify the location of ajp12.id
  
  Revision  ChangesPath
  1.8   +17 -2 
jakarta-tomcat/src/share/org/apache/tomcat/startup/StopTomcat.java
  
  Index: StopTomcat.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/StopTomcat.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StopTomcat.java   2001/03/27 20:27:41 1.7
  +++ StopTomcat.java   2001/07/19 21:52:48 1.8
  @@ -83,6 +83,7 @@
   String secret;
   // explicit command line params ( for port, host or secret )
   boolean commandLineParams=false;
  +String secretFile=null;
   
   public StopTomcat() 
   {
  @@ -90,6 +91,10 @@
   
   //  Parameters 
   
  +public void setSecretFile( String s ) {
  + secretFile=s;
  +}
  +
   public void setH( String s ) {
tomcatHome=s;
System.getProperties().put("tomcat.home", s);
  @@ -140,8 +145,10 @@
// read TOMCAT_HOME/conf/ajp12.id unless command line params
// specify a port/host/secret
try {
  + if( secretFile==null )
  + secretFile=tchome + "/conf/ajp12.id";
BufferedReader rd=new BufferedReader
  - ( new FileReader( tchome + "/conf/ajp12.id"));
  + ( new FileReader(secretFile));
String line=rd.readLine();

if( port < 0 ) {
  @@ -158,7 +165,7 @@
if( secret==null ) secret=line;
} catch( IOException ex ) {
//ex.printStackTrace();
  - System.out.println("Can't read " + tchome + "/conf/ajp12.id");
  + System.out.println("Can't read " + secretFile);
//  System.out.println(ex.toString());
if( ! commandLineParams )
return;
  @@ -279,6 +286,14 @@
commandLineParams=true;
if (i < args.length) 
secret=args[i];
  + else
  + return false;
  + }
  + if (arg.equalsIgnoreCase("-ajpid") ) {
  + i++;
  + commandLineParams=true;
  + if (i < args.length) 
  + secretFile=args[i];
else
return false;
}
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2001-07-19 Thread costin

costin  01/07/19 14:45:52

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Another try.
  
  Revision  ChangesPath
  1.6   +3 -3  
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jdk12Interceptor.java 2001/07/19 21:44:24 1.5
  +++ Jdk12Interceptor.java 2001/07/19 21:45:52 1.6
  @@ -93,13 +93,13 @@
   public void postServletDestroy( Context ctx, Handler sw )
throws TomcatException
   {
  - jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
   }
   
   public void postServletInit( Context ctx, Handler sw )
throws TomcatException
   {
  - jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
   }
   
   /** Called before service method is invoked. 
  @@ -125,7 +125,7 @@
if( request != null )
fixJDKContextClassLoader(request.getContext());
else
  - jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  + jdk11Compat.setContextClassLoader(this.getClass().getClassLoader());
return 0;
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/generators Jdk12Interceptor.java

2001-07-19 Thread costin

costin  01/07/19 14:44:24

  Modified:src/share/org/apache/tomcat/modules/generators
Jdk12Interceptor.java
  Log:
  Second part of the 2696 fix.
  
  Revision  ChangesPath
  1.5   +9 -2  
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java
  
  Index: Jdk12Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/Jdk12Interceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Jdk12Interceptor.java 2001/03/31 22:32:05 1.4
  +++ Jdk12Interceptor.java 2001/07/19 21:44:24 1.5
  @@ -89,12 +89,17 @@
   {
fixJDKContextClassLoader(ctx);
   }
  +
  +public void postServletDestroy( Context ctx, Handler sw )
  + throws TomcatException
  +{
  + jdk11Compat.setContextClassLoader(this.getClass().getLoader());
  +}
   
   public void postServletInit( Context ctx, Handler sw )
throws TomcatException
   {
  - // no need to change the cl - next requst will do that
  - // ( it's per-thread information )
  + jdk11Compat.setContextClassLoader(this.getClass().getLoader());
   }
   
   /** Called before service method is invoked. 
  @@ -119,6 +124,8 @@
request=child.getParent();
if( request != null )
fixJDKContextClassLoader(request.getContext());
  + else
  + jdk11Compat.setContextClassLoader(this.getClass().getLoader());
return 0;
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/xml XmlMapper.java

2001-07-19 Thread costin

costin  01/07/19 14:43:02

  Modified:src/share/org/apache/tomcat/util/compat Jdk11Compat.java
Jdk12Support.java
   src/share/org/apache/tomcat/util/xml XmlMapper.java
  Log:
  First part of the 2696 fix.
  
  Revision  ChangesPath
  1.6   +7 -1  
jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk11Compat.java
  
  Index: Jdk11Compat.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk11Compat.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jdk11Compat.java  2001/06/17 18:09:14 1.5
  +++ Jdk11Compat.java  2001/07/19 21:43:02 1.6
  @@ -61,6 +61,8 @@
   import org.apache.tomcat.util.depend.*;
   
   import java.net.URL;
  +import java.util.ResourceBundle;
  +import java.util.Locale;
   
   /** General-purpose utility to provide backward-compatibility and JDK
   independence. This allow use of JDK1.2 ( or higher ) facilities if
  @@ -124,7 +126,11 @@
   }
   
   // Other methods, as needed
  -
  +
  +public java.util.ResourceBundle getBundle(String name, Locale loc, ClassLoader 
cl ) {
  + return ResourceBundle.getBundle(name, loc);
  +}
  +
   
   //  Factory  
   /** Get a compatibiliy helper class.
  
  
  
  1.4   +10 -0 
jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk12Support.java
  
  Index: Jdk12Support.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk12Support.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Jdk12Support.java 2001/06/17 18:09:13 1.3
  +++ Jdk12Support.java 2001/07/19 21:43:02 1.4
  @@ -118,6 +118,16 @@
   return null;
   }
   
  +public java.util.ResourceBundle getBundle(String name, Locale loc, ClassLoader 
cl ) {
  + if( cl==null )
  + cl=getContextClassLoader();
  + if( cl==null )
  + return ResourceBundle.getBundle(name, loc);
  + else
  + return ResourceBundle.getBundle(name, loc, cl);
  +}
  +
  +
   //  Support 
   static class PrivilegedProxy implements PrivilegedExceptionAction
   {
  
  
  
  1.35  +20 -1 
jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java
  
  Index: XmlMapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/xml/XmlMapper.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- XmlMapper.java2001/07/16 00:20:57 1.34
  +++ XmlMapper.java2001/07/19 21:43:02 1.35
  @@ -14,6 +14,7 @@
   import org.xml.sax.*;
   import org.xml.sax.helpers.*;
   
  +import org.apache.tomcat.util.compat.*;
   
   /**
* SAX Handler - it will read the XML and construct java objects
  @@ -75,7 +76,7 @@
throws SAXException
   {
try {
  - //  if( debug>0) log(sp + "<" + tag + " " + attributes + ">");
  + if( debug>5) log(sp + " <" + tag + " " + attributes + ">");
attributeStack[sp]=attributes;
tagStack[sp]=tag;
sp++;
  @@ -255,7 +256,14 @@
   public XmlMapper getMapper() {
return this;
   }
  +
  +boolean useLocalLoader=true;
   
  +public void useLocalLoader(boolean b ) {
  + useLocalLoader=b;
  +}
  +static final Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
  +
   /** read an XML file, construct and return the object hierarchy
*/
   public Object readXml(File xmlFile, Object root)
  @@ -266,12 +274,23 @@
this.pushObject( root );
}
try {
  + // reset the context loader, so we find the parser in the current dir
  + ClassLoader cl=null;
  + if( useLocalLoader ) {
  + cl=jdk11Compat.getContextClassLoader();
  + jdk11Compat.setContextClassLoader( this.getClass().getClassLoader());
  + }
  + 
SAXParser parser=null;
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(false);
factory.setValidating(validating);
parser = factory.newSAXParser();
parser.parse(xmlFile, this);
  +
  + if( useLocalLoader && cl!= null ) {
  + jdk11Compat.setContextClassLoader(cl);
  + }
   
return root;
// assume the stack is in the right position.
  
  
  



Re: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes

2001-07-19 Thread David Rees

(Sorry about the double-qoute, I missed the original message)

> > -Original Message-
> > From: Will England [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 19, 2001 10:49 AM
> > To: [EMAIL PROTECTED]
> > Subject: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes
> >
> >
> > Greetings!
> >
> > Over on tomcat-users, theres been a discussion on JSP's finding the
> > WEB-INF/classes directory when compiling.  They can't.  From searches, I
> > understand this issue has come up before in regards to the Coocon project.
> >
> > The root problem is that Jasper cannot find classes located in
> > WEB-INF/classes of the web application that the JSP's belong to.  This
> > occurs when a JSP is either first deployed or the TOMCAT_HOME/work
> > directory is cleared, requiring a recompile of the JSP's.
> >
> > The system is Tomcat 3.2 under Apache with mod_jk, running on SunOS 2.7
> > with JDK 1.2.

I have noticed the same problem while doing some development using
Tomcat 3.2.[23].  I worked around it by making sure that I unset the
classpath before calling startup.sh, then things seemed to work properly
and classes were found as expected.

It seems that certain combinations of classes in different ares
(CLASSPATH, WEB-INF/lib, or other) will break things, but I haven't
pinned it down, so it could simply be user stupidity.

-Dave



Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Jonathan Reichhold

> This hack definitely works.  As long as you're willing to pay the overhead
> for the method call, it's essentially equivalent to asking Log4J whether
> or not debugging output is enabled, which does something similar (but asks
> the instantiated logger object, instead of being a static method).

I'm not sure if Log4j has an accesible boolean like this (maybe it does, haven't used 
it yet), and if it was accessible it would
reduce the gc load at the expense of some readibility of the source.  The boolean 
check is relatively efficient in comparison to the
function calls typically used in log messages (usually concat a string with some 
computed value after unkown work).

I've run into problems with gc before and I tend to limit creation of extra objects.  
Ever run most log packages under a profiler
and seen how many strings are created/destroyed on a regular basis?  The code

log("my message that I think is import" + myVar.computeValue());

does unknown for myVar.computeValue() and then there is the creation of a 
StringBuffer, the concat, and the toString on the
StringBuffer.  All this for a line that may not be used except in high debug levels.  
Try doing that in a critical peice of code and
watch performance go to hell quickly. On time critical code this gc time hurts.  Don't 
even start me talking about fun in the gc
with largs Maps.  Can we say 90 second gc pauses every 2 minutes?

Does anyone know if Log4j has a boolean method to check whether debugging is on/off?

Jonathan





UnSubsribe

2001-07-19 Thread Ling Charles

UnSubsribe



Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Craig R. McClanahan



On Thu, 19 Jul 2001, Jonathan Reichhold wrote:

> Actually I've got a thought on how to add in debug messages without recompiling.  
>For a horrible hack say I've got a java class
> like:
> 
> //Constants.java
> public class Constants{
> public static boolean isDebug(){return true;}
> }
> 
> And in my main code I call:
> if(Constants.isDebug()) log(someNastyFunction());
> 
> Now I could keep to versions of a class file generated from
> Constants.java (one which returns true, one with returns false)
> Replacing the class file Constants.class based upon my needs would
> effectively turn debugging on/off.  There is an overhead of this
> approach for the lookup of the boolean, but it avoids the need to
> recompile to turn on debugging.  It isn't as nice as having a debug
> flag passed in, but it would be a quick hack for most classes.  It
> could even be used to debug code in "production" by replacing the
> class file and restarting.  I prefer flags/config files to turn stuff
> like this on/off, but it is a relatively quick hack...
> 

This hack definitely works.  As long as you're willing to pay the overhead
for the method call, it's essentially equivalent to asking Log4J whether
or not debugging output is enabled, which does something similar (but asks
the instantiated logger object, instead of being a static method).

> 
> Jonathan
> 

Craig


> - Original Message -
> From: "Pier P. Fumagalli" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 19, 2001 1:24 PM
> Subject: Re: [TC4.0] Disabling debug output...
> 
> 
> > Craig R. McClanahan at [EMAIL PROTECTED] wrote:
> > >
> > > - However, Pier's proposed approach doesn't deal with a need that I've
> > > experienced regularly -- the need to turn on debugging messages
> > > dynamically on an existing component, *without* recompiling it.  This
> > > is NOT simply aesthetics; either you can or you cannot change the level
> > > of debugging output at runtime.
> >
> > You didn't get it Craig... I'm simply proposing to use the if (DEBUG)
> > approach _instead_ of commenting out logs in the source file...
> >
> > Go and look at HttpConnector.java... There are TONS of // (comments) that
> > could be replaced with an if (DEBUG).
> >
> > If you remove the comments, you too have to recompile the sources...
> >
> > Pier
> >
> >
> 
> 




Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Jonathan Reichhold

Actually I've got a thought on how to add in debug messages without recompiling.  For 
a horrible hack say I've got a java class
like:

//Constants.java
public class Constants{
public static boolean isDebug(){return true;}
}

And in my main code I call:
if(Constants.isDebug()) log(someNastyFunction());

Now I could keep to versions of a class file generated from Constants.java (one which 
returns true, one with returns false)
Replacing the class file Constants.class based upon my needs would effectively turn 
debugging on/off.  There is an overhead of this
approach for the lookup of the boolean, but it avoids the need to recompile to turn on 
debugging.  It isn't as nice as having a
debug flag passed in, but it would be a quick hack for most classes.  It could even be 
used to debug code in "production" by
replacing the class file and restarting.  I prefer flags/config files to turn stuff 
like this on/off, but it is a relatively quick
hack...


Jonathan

- Original Message -
From: "Pier P. Fumagalli" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 1:24 PM
Subject: Re: [TC4.0] Disabling debug output...


> Craig R. McClanahan at [EMAIL PROTECTED] wrote:
> >
> > - However, Pier's proposed approach doesn't deal with a need that I've
> > experienced regularly -- the need to turn on debugging messages
> > dynamically on an existing component, *without* recompiling it.  This
> > is NOT simply aesthetics; either you can or you cannot change the level
> > of debugging output at runtime.
>
> You didn't get it Craig... I'm simply proposing to use the if (DEBUG)
> approach _instead_ of commenting out logs in the source file...
>
> Go and look at HttpConnector.java... There are TONS of // (comments) that
> could be replaced with an if (DEBUG).
>
> If you remove the comments, you too have to recompile the sources...
>
> Pier
>
>




UnSubsribe

2001-07-19 Thread Sri Thuraisamy

UnSubsribe



RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config JservConfig.java

2001-07-19 Thread Sri Thuraisamy

How do i unsubscribe form mailing list

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: July 19, 2001 1:24 PM
To: [EMAIL PROTECTED]
Subject: cvs commit:
jakarta-tomcat/src/share/org/apache/tomcat/modules/config
JservConfig.java


larryi  01/07/19 13:23:34

  Modified:src/share/org/apache/tomcat/modules/config JservConfig.java
  Log:
  Fix protocol name.  Remove incorrect comment.
  
  Revision  ChangesPath
  1.2   +2 -3
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java
  
  Index: JservConfig.java
  ===
  RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservCon
fig.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JservConfig.java  2001/07/03 23:29:32 1.1
  +++ JservConfig.java  2001/07/19 20:23:34 1.2
  @@ -102,7 +102,7 @@
   
   @author Costin Manolache
   @author Mel Martinez
  - @version $Revision: 1.1 $ $Date: 2001/07/03 23:29:32 $
  + @version $Revision: 1.2 $ $Date: 2001/07/19 20:23:34 $
*/
   public class JservConfig  extends BaseInterceptor { 
   
  @@ -110,7 +110,7 @@
   public static final String
APACHE_CONFIG="conf/jserv/tomcat-apache.conf";
   /** default location of mod_jserv Apache plug-in. */
   public static final String MOD_JSERV;
  -public static final String AJPV12="ajp12";
  +public static final String AJPV12="ajpv12";
   
   //set up some defaults based on OS type
   static{
  @@ -343,7 +343,6 @@
// Find Ajp1? connectors
int portInt=8007;
BaseInterceptor ci[]=cm.getContainer().getInterceptors();
  - // try to get jakarta-tomcat-connectors Ajp13 Interceptor class
for( int i=0; i


Re: AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?)

2001-07-19 Thread David Haraburda

Hi,

Thanks for responding.  As far as I can tell this is a problem with Tomcat...
AdaptiveClassLoader doesn't override findResources, which is causing the
problem.  I am digging through the source, and here is what happens when you
instantiate an InitialContext object:

InitialContext.init(null) is called, which calls
ResourceManager.getInitialEnvironment(null)

At this point, ResourceManager is going to load any JNDI properties it can
find.  After getInitialEnvironment checks the system properties, it then
attempts to load application resources, by calling

ResourceManager.getApplicationResources()

This method will load resources with a ClassLoader of course, and it gets the
class loader from the current thread by calling
VersionHelper12.getContextClassLoader().  Because I am using Jdk12Interceptor,
it will return AdaptiveClassLoader.  This is where the important stuff
happens.  It will look for the JNDI properties file by calling getResources().
This is a final method on java.lang.ClassLoader that calls findResources()...

The JavaDoc states that ClassLoader implementations should override this method
to load resources.  AdaptiveClassLoader doesn't.  Why not? :)

I can submit a patch, but it looks like someone else already did awhile back...
I wondered why it wasn't applied, and thought maybe I missed something?  If I
patch is needed, let me know, I can get one to this list tonight...

Thanks again,
David

"Rob S." wrote:

> If this is what I'm remembering, your ContextFactory class can't be found.
> This is cuz the JNDI code is broken in that it doesn't rely on its parent
> classloader (in our case, the one that knows about WEB-INF/classes and lib)
> to load the context factory.
>
> You have to implement your own InitialContextFactoryBuilder.  Check the Sun
> messages boards.  I ran into the same problem last month.
>
> - r
>
> > -Original Message-
> > From: David Haraburda [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, July 19, 2001 10:51 AM
> > To: [EMAIL PROTECTED]
> > Subject: AdaptiveClassLoader, getResources, jndi.properties (Tomcat
> > bug?)
> >
> >
> > Hi,
> >
> > I got no response to this message on the tomcat-user list, so I am
> > trying here.  I could find nothing in the archives except the message I
> > refer to below -- I apologize if this issue has been addressed and I
> > just couldn't find the info...
> >
> > I am having problems with jndi.properties being read from my
> > WEB-INF/classes directory.  I have seen this problem referenced once on
> > the tomcat-dev mailing list -- someone submitted a patch, but apparently
> >
> > it did not get committed.  (I couldn't find a reason why, so I am not
> > sure if that was the real solution to the problem or not).  The original
> >
> > message is here:
> > http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg06588.html
> >
> > I have verified that the same behaivor he refers to is going on with my
> > application -- InitialContext is using getResources(), which doesn't
> > return anything becuase AdaptiveClassLoader doesn't implement
> > findResource or findResources.
> >
> > Has anyone else having this problem found a solution/work-around?  Is
> > there a Tomcat guru/developer out there who can explain why
> > AdaptiveClassLoader doesn't implement findResources()?
> >
> > Thanks,
> >
> > David
> >
> >




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config JservConfig.java

2001-07-19 Thread larryi

larryi  01/07/19 13:23:34

  Modified:src/share/org/apache/tomcat/modules/config JservConfig.java
  Log:
  Fix protocol name.  Remove incorrect comment.
  
  Revision  ChangesPath
  1.2   +2 -3  
jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java
  
  Index: JservConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/JservConfig.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JservConfig.java  2001/07/03 23:29:32 1.1
  +++ JservConfig.java  2001/07/19 20:23:34 1.2
  @@ -102,7 +102,7 @@
   
   @author Costin Manolache
   @author Mel Martinez
  - @version $Revision: 1.1 $ $Date: 2001/07/03 23:29:32 $
  + @version $Revision: 1.2 $ $Date: 2001/07/19 20:23:34 $
*/
   public class JservConfig  extends BaseInterceptor { 
   
  @@ -110,7 +110,7 @@
   public static final String APACHE_CONFIG="conf/jserv/tomcat-apache.conf";
   /** default location of mod_jserv Apache plug-in. */
   public static final String MOD_JSERV;
  -public static final String AJPV12="ajp12";
  +public static final String AJPV12="ajpv12";
   
   //set up some defaults based on OS type
   static{
  @@ -343,7 +343,6 @@
// Find Ajp1? connectors
int portInt=8007;
BaseInterceptor ci[]=cm.getContainer().getInterceptors();
  - // try to get jakarta-tomcat-connectors Ajp13 Interceptor class
for( int i=0; i


Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Pier P. Fumagalli

Craig R. McClanahan at [EMAIL PROTECTED] wrote:
> 
> - However, Pier's proposed approach doesn't deal with a need that I've
> experienced regularly -- the need to turn on debugging messages
> dynamically on an existing component, *without* recompiling it.  This
> is NOT simply aesthetics; either you can or you cannot change the level
> of debugging output at runtime.

You didn't get it Craig... I'm simply proposing to use the if (DEBUG)
approach _instead_ of commenting out logs in the source file...

Go and look at HttpConnector.java... There are TONS of // (comments) that
could be replaced with an if (DEBUG).

If you remove the comments, you too have to recompile the sources...

Pier




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

2001-07-19 Thread larryi

larryi  01/07/19 13:20:50

  Modified:src/etc  modules.xml
  Log:
  Add JservConfig
  
  Revision  ChangesPath
  1.9   +2 -0  jakarta-tomcat/src/etc/modules.xml
  
  Index: modules.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/etc/modules.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modules.xml   2001/07/19 05:58:08 1.8
  +++ modules.xml   2001/07/19 20:20:50 1.9
  @@ -13,6 +13,8 @@
   
   
   
  +
  +
   
   
   
  
  
  



cvs commit: jakarta-tomcat/src/doc readme

2001-07-19 Thread larryi

larryi  01/07/19 13:20:10

  Modified:src/doc  readme
  Log:
  Some updates for beta-1
  
  Revision  ChangesPath
  1.16  +35 -37jakarta-tomcat/src/doc/readme
  
  Index: readme
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/doc/readme,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- readme2001/06/21 22:35:32 1.15
  +++ readme2001/07/19 20:20:10 1.16
  @@ -1,8 +1,8 @@
  -$Id: readme,v 1.15 2001/06/21 22:35:32 larryi Exp $
  +$Id: readme,v 1.16 2001/07/19 20:20:10 larryi Exp $
   
  Release Notes for:
  
  -   TOMCAT Version 3.3m4
  +   TOMCAT Version 3.3b1
  
   
   
  @@ -43,19 +43,19 @@
   file.
   
   IMPORTANT NOTE: Some important changes have been recently added to
  -Tomcat 3.3m4 which are not yet covered in the accompanying documentation.
  -These changes make Tomcat 3.3m4 quite different from Tomcat 3.2 in a number
  +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:
   
   - Class Loading:
   
  -  Tomcat 3.3m4 now uses a new hierarchy of class loaders. It provides for the
  +  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.3m4 are not provided an XML
  +  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
  @@ -65,7 +65,7 @@
   
 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.3m4. The conf/server.xml file
  +  (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.
   
  @@ -80,24 +80,38 @@
 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:
  +   module in the server.xml file.  The locations for their
  +  configuration files is also shown.
   
  -  Apache configs:  
  -  IIS config:  
  -  Netscape config: 
  +  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 old organization used in Tomcat 3.2 where all the configuration is
  -  placed in server.xml is still supported by Tomcat 3.3m4.
  +  placed in server.xml is still supported by Tomcat 3.3b1 for Apache.  However,
  +  you will need to set the appropriate parameters on the interceptor.
   
   - Tomcat Testing:
   
 The "test" web application along with the test-tomcat.xml and
  -  associated support files are not part of the binary Tomcat 3.3m4 distribution.
  +  associated support files are not part of the binary Tomcat 3.3b1 distribution.
 The "test" web application is supplied separately as "test.war".  This file
  -  may be downloaded from the "v3.3-m4/apps" directory of the Tomcat 3.3m4
  +  may be downloaded from the "v3.3-b1/apps" directory of the Tomcat 3.3b1
 release and placed in the "webapps" directory of your installation.  Running
 the test has been integrated into the Admin web application that is part of
  -  the Tomcat 3.3m4 distribution.  A preliminary step to running the test is to
  +  the Tomcat 3.3b1 distribution.  A preliminary step to running the test is to
 "trust" the Admi

Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Craig R. McClanahan



On Thu, 19 Jul 2001, Mark Abbott wrote:

> [snip]
> These are specifically the sort of problems the new java.util.logging 
> package in
> JDK 1.4 is addressing. I believe the philosophy there is to always leave the
> code in place, be liberal in writing tracing log calls and assume that 
> integer comparisons
> to decide whether to execute a particular logging call are so cheap that 
> there is essentially
> no performance penalty at runtime. I am not as familiar with log4j.

At least in this respect, the JSR047 API is similar in spirit to Log4J --
I'm not going to touch on the places where the philosphies differ!  :-)

However, there are some subtleties that are kind of important here:

- The typical approach with the JSR47 API or with Log4J is to let the
  logger decide whether to really output the message or not.  So, you
  would instrument your code with things like (conceptual, not real API):

  logger.log("The object is " + myObject, Logger.DEBUG);

  and let the logger configuration decide whether you care about debug
  messages or not.

- However, there is a performance problem with leaving this code in --
  you will be doing the string concatenation (and the method call)
  whether or not you want debug messages printed!  If you are liberal
  about debug messages, especially inside frequently executed methods,
  this can have adverse impacts on performance (and increased garbage
  collection).

- Log4J (and I imagine JSR047 does too, but haven't looked) has a way
  to ask the logger whether debug mode is enabled or not.  But it's
  pretty verbose, and a developer isn't going to want to think about
  it when in the middle of diagnosing a problem.  It also requires a
  method call, so it's still more expensive than the "integer compare"
  mechanism described below.

- As others have pointed out, you often want to enable/disable debug
  messages on a module-by-module level.  Therefore, if I were using
  Pier's proposed method, I'd put the static final global in each
  module independently.

- However, Pier's proposed approach doesn't deal with a need that I've
  experienced regularly -- the need to turn on debugging messages
  dynamically on an existing component, *without* recompiling it.  This
  is NOT simply aesthetics; either you can or you cannot change the level
  of debugging output at runtime.

  An example of this is the following scenario:  I'm developing an app
  in an environment that relies on webapp reloading when classes are
  changed (sound familiar, Jon?  :-), and the ability to save and restore
  session attributes across the reload.  I'm probably running a *binary*
  distribution of Tomcat, not the source.  If I have a problem with my
  attributes being saved and restored, it is crucially important to be
  able to just do this:


  


  in my server.xml file and restart, so I can see the verbose debugging
  info in the log files.  Not everybody will have the ability (or the
  inclination) to rebuild Tomcat from source to do this.

- My general approach has been to embed debugging output in an idiom
  like this:

if (debug >= 2)
log("The object is " + myObject);

  which has a small runtime cost (evaluating the conditional), but
  avoids the most expensive computations (string concatenation, method
  call, and subsequent garbage collection) in the usual case of debugging
  being turned off.

- Ideally, the compiler would be able to optimize this code out if
  debug were really set to zero.  However, because it's not "final static"
  (so that it can be changed at runtime), that wouldn't be legal.
  Therefore, I've tended to comment out the debug stuff in the most
  frequently executed parts of the code, to avoid even the minimal
  runtime overhead of the integer comparison and jump.  Commenting out
  instead of removing is my habit, and lets me easily re-introduce the
  debug stuff if I'm investigating a problem later.

- As you can see, there's a conflict between my primary goals (dynamically
  turn debugging on and off, and zero runtime overhead).  The compromise
  I'm currently using seems to be a fair balance between the two, but I'm
  certainly interested in how others deal with it.

On the general topic of using Log4J (or the JSR 47 API) inside Tomcat 4,
there is something of an "impedance mismatch" between the Tomcat approach
to hierarchical loggers and the logger approach to handling multiple log
output streams.  Ceki has posted some thoughts about how this might be
done (see the TOMCAT-DEV archives).  Maybe, now that we're almost done
with beta 6 (to be released tonight), we can start thinking about it some
more.


> 
>Cheers - Mark

Craig





RE: AdaptiveClassLoader, getResources, jndi.properties (Tomcat bug?)

2001-07-19 Thread Rob S.

If this is what I'm remembering, your ContextFactory class can't be found.
This is cuz the JNDI code is broken in that it doesn't rely on its parent
classloader (in our case, the one that knows about WEB-INF/classes and lib)
to load the context factory.

You have to implement your own InitialContextFactoryBuilder.  Check the Sun
messages boards.  I ran into the same problem last month.

- r

> -Original Message-
> From: David Haraburda [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: AdaptiveClassLoader, getResources, jndi.properties (Tomcat
> bug?)
>
>
> Hi,
>
> I got no response to this message on the tomcat-user list, so I am
> trying here.  I could find nothing in the archives except the message I
> refer to below -- I apologize if this issue has been addressed and I
> just couldn't find the info...
>
> I am having problems with jndi.properties being read from my
> WEB-INF/classes directory.  I have seen this problem referenced once on
> the tomcat-dev mailing list -- someone submitted a patch, but apparently
>
> it did not get committed.  (I couldn't find a reason why, so I am not
> sure if that was the real solution to the problem or not).  The original
>
> message is here:
> http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg06588.html
>
> I have verified that the same behaivor he refers to is going on with my
> application -- InitialContext is using getResources(), which doesn't
> return anything becuase AdaptiveClassLoader doesn't implement
> findResource or findResources.
>
> Has anyone else having this problem found a solution/work-around?  Is
> there a Tomcat guru/developer out there who can explain why
> AdaptiveClassLoader doesn't implement findResources()?
>
> Thanks,
>
> David
>
>




RE: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes

2001-07-19 Thread Rob S.

I guess I don't follow, cuz I use this functionality of Tomcat every single
day.

Whether or not its under Apache shouldn't matter.

- r

> -Original Message-
> From: Will England [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 10:49 AM
> To: [EMAIL PROTECTED]
> Subject: [3.2] JSP Compiling Classpath issues -- finding WEB-INF/classes
>
>
> Greetings!
>
> Over on tomcat-users, theres been a discussion on JSP's finding the
> WEB-INF/classes directory when compiling.  They can't.  From searches, I
> understand this issue has come up before in regards to the Coocon project.
>
> The root problem is that Jasper cannot find classes located in
> WEB-INF/classes of the web application that the JSP's belong to.  This
> occurs when a JSP is either first deployed or the TOMCAT_HOME/work
> directory is cleared, requiring a recompile of the JSP's.
>
> The system is Tomcat 3.2 under Apache with mod_jk, running on SunOS 2.7
> with JDK 1.2.
>
> The code in question is coming from a production Tomcat 3.1 system.
>
> I cannot add the WEB-INF/classes directory to my classpath.  This will
> break several other parts of the system.
>
> What is the problem with Jasper reading WEB-INF/classes?
>
> I understand the the Coocon users found some kind of workaround, but I
> have been unable to find it.
>
> Thank you for any pointers or tips!
>
> Will
>
>
> --
>   /~>'find `funny quote`': Command not found; humor not installed.
>   1986 Concours 72,xxx  1982 Maxim 12,xxx (For Sale!) CDA #00046
>   Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD
> http://will.mylanders.com/
>
>




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets InvokerHttpRequest.java InvokerServlet.java

2001-07-19 Thread craigmcc

craigmcc01/07/19 11:37:02

  Modified:catalina/src/share/org/apache/catalina/core
ApplicationDispatcher.java
   catalina/src/share/org/apache/catalina/servlets
InvokerHttpRequest.java InvokerServlet.java
  Log:
  Correct an bad interaction between request dispatching and the invoker
  servlet that was introduced in recent changes.  These changes were
  required by Servlet 2.3 PFD3 updates that disallowed the previous
  request dispatcher implementation technique of wrapping the outermost
  application request before calling the dispatched-to servlet.
  
  These changes also fix the JSP-Servlet-JSP example, which was broken by
  the earlier changes.
  
  PR: Bugzilla #2692
  Submitted by: Remy Maucherat
  
  Revision  ChangesPath
  1.22  +19 -5 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java
  
  Index: ApplicationDispatcher.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ApplicationDispatcher.java2001/07/17 04:21:12 1.21
  +++ ApplicationDispatcher.java2001/07/19 18:37:02 1.22
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
 1.21 2001/07/17 04:21:12 craigmcc Exp $
  - * $Revision: 1.21 $
  - * $Date: 2001/07/17 04:21:12 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
 1.22 2001/07/19 18:37:02 craigmcc Exp $
  + * $Revision: 1.22 $
  + * $Date: 2001/07/19 18:37:02 $
*
* 
*
  @@ -105,7 +105,7 @@
* javax.servlet.ServletResponseWrapper.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.21 $ $Date: 2001/07/17 04:21:12 $
  + * @version $Revision: 1.22 $ $Date: 2001/07/19 18:37:02 $
*/
   
   final class ApplicationDispatcher
  @@ -420,6 +420,8 @@
}
   
// Commit and close the response before we return
  +if (debug >= 1)
  +log(" Committing and closing response");
response.flushBuffer();
try {
PrintWriter writer = response.getWriter();
  @@ -609,7 +611,11 @@
// Allocate a servlet instance to process this request
try {
if (!unavailable) {
  +//if (debug >= 2)
  +//log("  Allocating servlet instance");
servlet = wrapper.allocate();
  +//if ((debug >= 2) && (servlet == null))
  +//log("No servlet instance returned!");
}
} catch (ServletException e) {
log(sm.getString("applicationDispatcher.allocateException",
  @@ -633,6 +639,8 @@
   else
   request.removeAttribute(Globals.JSP_FILE_ATTR);
if (servlet != null) {
  +//if (debug >= 2)
  +//log("  Calling service(), jspFile=" + 
jspFile);
   if ((hrequest != null) && (hresponse != null)) {
   servlet.service((HttpServletRequest) request,
   (HttpServletResponse) response);
  @@ -666,8 +674,11 @@
   
// Deallocate the allocated servlet instance
try {
  - if (servlet != null)
  + if (servlet != null) {
  +//if (debug >= 2)
  +//log("  Deallocating servlet instance");
wrapper.deallocate(servlet);
  +}
} catch (ServletException e) {
log(sm.getString("applicationDispatcher.deallocateException",
 wrapper.getName()), e);
  @@ -832,6 +843,9 @@
   ServletRequest previous = null;
   ServletRequest current = outerRequest;
   while (current != null) {
  +if ("org.apache.catalina.servlets.InvokerHttpRequest".
  +equals(current.getClass().getName()))
  +break; // KLUDGE - Make nested RD.forward() using invoker work
   if (!(current instanceof ServletRequestWrapper))
   break;
   if (current instanceof ApplicationHttpRequest)
  
  
  
  1.2   +7 -68 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/InvokerHttpRequest.java
  
  Index: InvokerHttpRequest.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/InvokerHttpRequest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  dif

cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade ServletHandler.java

2001-07-19 Thread costin

costin  01/07/19 11:03:15

  Modified:src/facade22/org/apache/tomcat/facade ServletHandler.java
  Log:
  Added the method from jasper34, is the only piece that prevents
  complete separation of runtime/compiler.
  
  Revision  ChangesPath
  1.15  +5 -0  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java
  
  Index: ServletHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletHandler.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ServletHandler.java   2001/06/24 22:33:14 1.14
  +++ ServletHandler.java   2001/07/19 18:03:15 1.15
  @@ -643,5 +643,10 @@
return false;
   }
   
  +/** The handler may return a set of classes it depends on
  + */
  +public String [] _getDepends() {
  + return null;
  +}
   
   }
  
  
  



cvs commit: jakarta-tomcat/src/admin/WEB-INF/classes/tadm AntProperty.java

2001-07-19 Thread costin

costin  01/07/19 11:00:39

  Modified:src/admin/WEB-INF/classes/tadm AntProperty.java
  Log:
  More meaningful message.
  
  Revision  ChangesPath
  1.3   +4 -0  jakarta-tomcat/src/admin/WEB-INF/classes/tadm/AntProperty.java
  
  Index: AntProperty.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/admin/WEB-INF/classes/tadm/AntProperty.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AntProperty.java  2001/05/18 04:46:36 1.2
  +++ AntProperty.java  2001/07/19 18:00:38 1.3
  @@ -40,6 +40,10 @@
getServletContext();
ServletContext targetCtx=(webapp==null) ? thisCtx:
thisCtx.getContext( webapp );
  + ServletContext rootCtx= thisCtx.getContext("/");
  + if( webapp!=null && !"/".equals( webapp) &&
  + ! "".equals(webapp ) && rootCtx == targetCtx )
  + throw new JspException( "Can't find context " + webapp );
value=targetCtx.getRealPath(location);
}
   
  
  
  



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

2001-07-19 Thread larryi

larryi  01/07/19 10:36:16

  Modified:src/etc  server.xml
  Log:
  Remove Ajp14Interceptor since it won't be part of the distribution and
  could become out of date with respect to development in
  jakarta-tomcat-connectors.  Also, some minor clean up.
  
  Revision  ChangesPath
  1.84  +4 -13 jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- server.xml2001/07/19 05:58:08 1.83
  +++ server.xml2001/07/19 17:36:15 1.84
  @@ -194,6 +194,7 @@
port="8443" 
secure="true" />
   -->
  +
   
   
   
  -
  -
  -
   
 

cvs commit: jakarta-tomcat build.xml

2001-07-19 Thread larryi

larryi  01/07/19 10:30:36

  Modified:.build.xml
  Log:
  Update javadoc build to not require jakarta-tomcat-connectors to be present.
  Plus a little clean up.
  
  Revision  ChangesPath
  1.146 +9 -11 jakarta-tomcat/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/build.xml,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- build.xml 2001/07/19 06:18:48 1.145
  +++ build.xml 2001/07/19 17:30:36 1.146
  @@ -45,8 +45,6 @@
 
 
  -  
  +  
   
 
   
   
   
 
   
 
   
 
   
 
   
 
   
 
   
 
   


Cookies, and things

2001-07-19 Thread Kedar Hirve

Problem solved. It had to do with me not setting the domain on my cookie
before clearing it. Sorry for the useless post.

-KSH



Re: cvs commit: jakarta-tomcat-connectors/webapp/lib pr_warp_config.c

2001-07-19 Thread jean-frederic clere

Thom Park wrote:
> 
> Wow!
> 
> I'm impressed - that looks pretty good for a default case but, what if I
> want
> tweak and tune my web app to use things like custom loggers or realms or
> even
> valves or listeners?
> 
> I guess in that case I need to edit the server.xml directly wouldn't you
> say?
> 
> What happens if my WebAppDeploy command matches an already defined webapp,
> will it
> override the existing one or just notice that it's already there and ignore
> the webappdeploy
> request.
> 
> What happens if they conflict, ie.
> WebAppDeploy says the following:
> 
> WebAppDeploy example.jar myConnection /servlet-examples/
> 
> but my server.xml entry is something like
> 
> 
> 
> 
> 
> 
> Now I have two jar/webapp folders referring to the same path name and am
> looking
> at a potentially nasty conflict.
> 
> Will the Warp handler object to this?

I have tried to deploy an existing application it seems it works. (As least I
think it does!).

> 
> -Thom
> 
> p.s. Damn good job though - it looks much simpler to manage that mod_jk -

mod_jk relies on the Tomcat server.xml, and mod_jk manage is improving a lot.

> now, how about
> load balancing ;-)
> 
> -Original Message-
> From: Pier P. Fumagalli [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 19, 2001 8:20 AM
> To: [EMAIL PROTECTED]
> Subject: Re: cvs commit: jakarta-tomcat-connectors/webapp/lib
> pr_warp_config.c
> 
> Thom Park at [EMAIL PROTECTED] wrote:
> 
> > Pier,
> >
> > I'm curious and appear to be too thick to understand exactly what the
> > WebAppDeploy step does with the webAppConnector, could you find some time
> in
> > your extremely busy schedule to jot down a few notes w.r.t. the what the
> > WebAppDeploy/configure step does exactly.
> >
> > I'm curious to know what information is passed between tomcat and apache
> in
> > that stage.
> 
> Oh, simple... In the web-server configuration file you have something like:
> 
> WebAppConnection myConnection warp localhost:8008
> WebAppDeploy example.jar myConnection /servlet-examples/
> 
> Basically you configure a warp connection between Apache and Tomcat (first
> line), and over that connection you "deploy" a web application:
> 
> Specifically what goes on, is that Apache tells to Tomcat that there should
> be a web application in its directories, in a file called "example.jar", and
> that should be deployed under the "/servlet-examples/" URL path (it's
> Context path). Tomcat finds the example.jar file, unpacks it, deploys it
> into the appropriate host (which is derived from Apache's VirtualHost
> directive), and is ready to process requests...
> 
> So you don't have to configure the same thing twice :)
> 
> Actually, my server.xml file for Tomcat is something like:
> 
> 
>   
> 
> 
>   
> 
> 
> SIX LINES :)
> 
> Pier



Re: cvscommit:jakarta-tomcat-connectors/webapp/javaConstants.java.in

2001-07-19 Thread Pier P. Fumagalli

jean-frederic clere at [EMAIL PROTECTED] wrote:

> "Pier P. Fumagalli" wrote:
>> 
>> jean-frederic clere at [EMAIL PROTECTED] wrote:
>> 
>>> "Pier P. Fumagalli" wrote:
 
 [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote:
 
> jfclere 01/07/19 07:17:18
> 
> Modified:webapp/java Constants.java.in
> Log:
> Add missing Constants.
> 
> Revision  ChangesPath
> 1.2   +8 -0
> jakarta-tomcat-connectors/webapp/java/Constants.java.in
> 
> Index: Constants.java.in
> ===
> RCS file:
> /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -r1.1 -r1.2
> --- Constants.java.in2001/07/15 08:42:361.1
> +++ Constants.java.in2001/07/19 14:17:181.2
> @@ -149,4 +149,12 @@
>   * No payload:
>   */
>  public static final int TYPE_CONF_DONE=0x06;
> +
> +/*
> + * Added by JFC (please check)
> + */
> +public static final int TYPE_DISCONNECT=0x07;
> +public static final int TYPE_CONF_DEPLOY=0x08;
> +public static final int TYPE_CONF_APPLIC=0x09;
> +public static final int TYPE_CONF_PROCEED=0x10;
>  }
 
 Those are wrong.. :) Me dumb for not updating the Constants.java.in file,
 but only my local copy :)
>>> 
>>> Well I have noted that these were wrong in lib/pr_warp.h we have:
>>> #define TYPE_DISCONNECT   0xfe
>>> #define TYPE_CONF_DEPLOY  0x02
>>> #define TYPE_CONF_APPLIC  0x03
>>> #define TYPE_CONF_DONE0x04
>>> #define TYPE_CONF_PROCEED 0x05
>>> 
>>> I think the WARP Protocol file needs an update...
>> 
>> Oh _SO_BADLY_... The packet structure changed, packet types changed,
>> multiplexing was dropped (you can't beat the Kernel) You won't believe
>> :) After the code is stable :)
> 
> That makes harder to help...
> 
> BTW what had happended with warp_handle(), could you commit it? (It says "Not
> yet implemented", would perfer a buggy code...).

Coming... Fixing some bugs due to the new protocol...

Pier




Re: cvs commit:jakarta-tomcat-connectors/webapp/javaConstants.java.in

2001-07-19 Thread jean-frederic clere

"Pier P. Fumagalli" wrote:
> 
> jean-frederic clere at [EMAIL PROTECTED] wrote:
> 
> > "Pier P. Fumagalli" wrote:
> >>
> >> [EMAIL PROTECTED] at [EMAIL PROTECTED] wrote:
> >>
> >>> jfclere 01/07/19 07:17:18
> >>>
> >>> Modified:webapp/java Constants.java.in
> >>> Log:
> >>> Add missing Constants.
> >>>
> >>> Revision  ChangesPath
> >>> 1.2   +8 -0  jakarta-tomcat-connectors/webapp/java/Constants.java.in
> >>>
> >>> Index: Constants.java.in
> >>> ===
> >>> RCS file:
> >>> /home/cvs/jakarta-tomcat-connectors/webapp/java/Constants.java.in,v
> >>> retrieving revision 1.1
> >>> retrieving revision 1.2
> >>> diff -u -r1.1 -r1.2
> >>> --- Constants.java.in2001/07/15 08:42:361.1
> >>> +++ Constants.java.in2001/07/19 14:17:181.2
> >>> @@ -149,4 +149,12 @@
> >>>   * No payload:
> >>>   */
> >>>  public static final int TYPE_CONF_DONE=0x06;
> >>> +
> >>> +/*
> >>> + * Added by JFC (please check)
> >>> + */
> >>> +public static final int TYPE_DISCONNECT=0x07;
> >>> +public static final int TYPE_CONF_DEPLOY=0x08;
> >>> +public static final int TYPE_CONF_APPLIC=0x09;
> >>> +public static final int TYPE_CONF_PROCEED=0x10;
> >>>  }
> >>
> >> Those are wrong.. :) Me dumb for not updating the Constants.java.in file,
> >> but only my local copy :)
> >
> > Well I have noted that these were wrong in lib/pr_warp.h we have:
> > #define TYPE_DISCONNECT   0xfe
> > #define TYPE_CONF_DEPLOY  0x02
> > #define TYPE_CONF_APPLIC  0x03
> > #define TYPE_CONF_DONE0x04
> > #define TYPE_CONF_PROCEED 0x05
> >
> > I think the WARP Protocol file needs an update...
> 
> Oh _SO_BADLY_... The packet structure changed, packet types changed,
> multiplexing was dropped (you can't beat the Kernel) You won't believe
> :) After the code is stable :)

That makes harder to help...

BTW what had happended with warp_handle(), could you commit it? (It says "Not
yet implemented", would perfer a buggy code...).

> 
> Pier



Re: John Gardner is out of the office.

2001-07-19 Thread Christopher Cain


"Pier P. Fumagalli" wrote:
> 
> John Gardner at [EMAIL PROTECTED] wrote:
> 
> > I will be out of the office starting  19/07/2001 and will not return
> > until 13/08/2001.
> >
> > Any general support queries should be emailed to: [EMAIL PROTECTED]
> >
> > Infoshop queries should be emailed to: [EMAIL PROTECTED]
> >
> > Technical Queries should be directed to Andy Armstrong ([EMAIL PROTECTED])
> >
> > Any other queries should be directed to Sarah Carter
> > ([EMAIL PROTECTED])
> 
> John Gardner has been kicked out of the mailing list.

I will be drop-kicked out of the mailing list starting 19/07/2001 and
will not return until I learn that Auto-Reply + Mailing List == Bad
Idea.

Any general support queries should be emailed to:
[EMAIL PROTECTED] ;-)



Re: [TC4.0] Disabling debug output...

2001-07-19 Thread Mark Abbott

I believe the Java Language Spec makes specific requirements on the
order of evaluation of static finals to facilitate this kind of usage. In 
the past I have
gone so far as to compile test programs and disassemble the byte code
and on every JVM I have ever tried, code wrapped in if statements that
evaluate a static final boolean doesn't even generate byte code for the 
contents
of the block if the boolean is false. So there is no performance or size 
penalty.

The real problem with this sort of thing is more subtle. How do you control 
the
value of the boolean? Should there be a single public static final in a 
class that
is referred to everywhere? More likely one wants to turn on and off 
debugging in
a single class, or package, or globally, depending on what is being tested.
Having to do search and replace on scattered variables is annoying at best.
How is the make system coerced into doing debug builds vs production
builds in a simple manner, in the absence of a preprocessor?

These are specifically the sort of problems the new java.util.logging 
package in
JDK 1.4 is addressing. I believe the philosophy there is to always leave the
code in place, be liberal in writing tracing log calls and assume that 
integer comparisons
to decide whether to execute a particular logging call are so cheap that 
there is essentially
no performance penalty at runtime. I am not as familiar with log4j.

   Cheers - Mark

At 08:56 AM 7/19/2001, Craig R. McClanahan wrote:


>On Wed, 18 Jul 2001, Justin Erenkrantz wrote:
>
> > On Thu, Jul 19, 2001 at 12:16:27AM +0100, Pier P. Fumagalli wrote:
> > > Checking out the source code, I see a lot of // (commented out lines) 
> when
> > > debug() is supposed to be called...
> > > Can't we have a global constant boolean called DEBUG and replace the 
> // with
> > > if (DEBUG), so that we can simply compile in and out the debugging
> > > information without touching the sources?
> > >
> > > Check out org.apache.catalina.connector.warp.Constants and 
> WarpLogger... Old
> > > trick we used in JServ. :)
> >
> > I *believe* most Java compilers do not have constant conditional
> > optimizations (they certainly could, but I don't think they did last
> > time I checked).  Without that optimization, you must check that
> > value each time you execute the statement.  That might hurt.  -- justin
> >
> >
>
>In trivial experiments a long while back, I seem to recall that this trick
>worked if your constant was "static final".  But I haven't looked lately.
>
>There are also some cases where you want to be able to set the debug level
>at runtime, without having to recompile.  In such cases, I typically am
>real liberal about debug statements when first creating a module, and then
>comment them out (versus removing them) in high-frequency-of-use portions
>of the code.  That way, you've got ready-made debug code to uncomment if
>you run into problems later.
>
>
>Craig






Re: John Gardner is out of the office.

2001-07-19 Thread Pier P. Fumagalli

John Gardner at [EMAIL PROTECTED] wrote:

> I will be out of the office starting  19/07/2001 and will not return
> until 13/08/2001.
> 
> Any general support queries should be emailed to: [EMAIL PROTECTED]
> 
> Infoshop queries should be emailed to: [EMAIL PROTECTED]
> 
> Technical Queries should be directed to Andy Armstrong ([EMAIL PROTECTED])
> 
> Any other queries should be directed to Sarah Carter
> ([EMAIL PROTECTED])

John Gardner has been kicked out of the mailing list.

Pier




  1   2   >