tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardContext.java
Date Mon, 26 Aug 2002 12:15:59 GMT
glenn       2002/08/26 05:15:59

  Modified:    catalina/src/share/org/apache/catalina/connector
                        RequestBase.java
               catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  Fix for BUG 11947.  Change where startCapture/stopCapture is invoked to
  prevent memory leaks from the SystemLogHandler.
  
  Revision  Changes    Path
  1.21      +4 -10     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java
  
  Index: RequestBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/RequestBase.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- RequestBase.java	27 May 2002 13:34:34 -0000	1.20
  +++ RequestBase.java	26 Aug 2002 12:15:58 -0000	1.21
  @@ -91,7 +91,6 @@
   import org.apache.catalina.util.Enumerator;
   import org.apache.catalina.util.RequestUtil;
   import org.apache.catalina.util.StringManager;
  -import org.apache.tomcat.util.log.SystemLogHandler;
   
   
   /**
  @@ -340,7 +339,6 @@
   
           this.context = context;
   
  -        SystemLogHandler.startCapture();
       }
   
   
  @@ -559,10 +557,6 @@
        */
       public void recycle() {
   
  -        String log = SystemLogHandler.stopCapture();
  -        if (log != null && log.length() > 0) {
  -            context.getServletContext().log(log);
  -        }
           attributes.clear();
           authorization = null;
           characterEncoding = null;
  
  
  
  1.110     +15 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- StandardContext.java	28 Jun 2002 16:09:57 -0000	1.109
  +++ StandardContext.java	26 Aug 2002 12:15:59 -0000	1.110
  @@ -138,6 +138,7 @@
   import org.apache.catalina.session.StandardManager;
   import org.apache.catalina.util.CharsetMapper;
   import org.apache.catalina.util.RequestUtil;
  +import org.apache.tomcat.util.log.SystemLogHandler;
   
   
   /**
  @@ -2347,7 +2348,16 @@
           }
   
           // Normal request processing
  -        super.invoke(request, response);
  +        try {
  +            SystemLogHandler.startCapture();
  +            super.invoke(request, response);
  +        } finally {
  +            String log = SystemLogHandler.stopCapture();
  +            if (log != null && log.length() > 0) {
  +                log(log);
  +        }
  +
  +        }
   
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message