remm        2003/06/15 01:17:37

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Using a thread local doesn't seem worthwhile, as corectness requires the
    resource info be recycled at the end of processing (otherwise, the context
    cannot be garbage collected when undeploying).
  
  Revision  Changes    Path
  1.11      +6 -27     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultServlet.java       1 May 2003 11:29:16 -0000       1.10
  +++ DefaultServlet.java       15 Jun 2003 08:17:37 -0000      1.11
  @@ -193,12 +193,6 @@
       protected static URLEncoder urlEncoder;
   
   
  -    /**
  -     * Thread local resource info.
  -     */
  -    protected ThreadLocal localResourceInfo = new ThreadLocal();
  -
  -
       // ----------------------------------------------------- Static Initializer
   
   
  @@ -247,9 +241,6 @@
        * Finalize this servlet.
        */
       public void destroy() {
  -
  -        ;       // No actions necessary
  -
       }
   
   
  @@ -590,13 +581,7 @@
           // Input stream for temp. content file used to support partial PUT
           FileInputStream contentFileInStream = null;
   
  -        ResourceInfo resourceInfo = (ResourceInfo) localResourceInfo.get();
  -        if (resourceInfo == null) {
  -            resourceInfo = new ResourceInfo(path, resources);
  -            localResourceInfo.set(resourceInfo);
  -        } else {
  -            resourceInfo.set(path, resources);
  -        }
  +        ResourceInfo resourceInfo = new ResourceInfo(path, resources);
           Range range = parseContentRange(req, resp);
   
           InputStream resourceInputStream = null;
  @@ -920,13 +905,7 @@
   
           // Retrieve the Catalina context and Resources implementation
           DirContext resources = getResources();
  -        ResourceInfo resourceInfo = (ResourceInfo) localResourceInfo.get();
  -        if (resourceInfo == null) {
  -            resourceInfo = new ResourceInfo(path, resources);
  -            localResourceInfo.set(resourceInfo);
  -        } else {
  -            resourceInfo.set(path, resources);
  -        }
  +        ResourceInfo resourceInfo = new ResourceInfo(path, resources);
   
           if (!resourceInfo.exists) {
               response.sendError(HttpServletResponse.SC_NOT_FOUND, 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to