tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1356505 - /tomcat/trunk/java/org/apache/catalina/connector/Request.java
Date Mon, 02 Jul 2012 22:15:52 GMT
Author: kkolinko
Date: Mon Jul  2 22:15:50 2012
New Revision: 1356505

URL: http://svn.apache.org/viewvc?rev=1356505&view=rev
Log:
Automatically delete temporary files created by Servlet 3.0 file upload when request is recycled.

Modified:
    tomcat/trunk/java/org/apache/catalina/connector/Request.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1356505&r1=1356504&r2=1356505&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Mon Jul  2 22:15:50 2012
@@ -463,7 +463,16 @@ public class Request
         userPrincipal = null;
         subject = null;
         parametersParsed = false;
-        parts = null;
+        if (parts != null) {
+            for (Part part: parts) {
+                try {
+                    part.delete();
+                } catch (IOException ignored) {
+                    // ApplicationPart.delete() never throws an IOEx
+                }
+            }
+            parts = null;
+        }
         partsParseException = null;
         cookiesParsed = false;
         locales.clear();



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


Mime
View raw message