jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1424442 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java xdocs/changes.xml
Date Thu, 20 Dec 2012 12:55:00 GMT
Author: pmouawad
Date: Thu Dec 20 12:55:00 2012
New Revision: 1424442

URL: http://svn.apache.org/viewvc?rev=1424442&view=rev
Log:
Bug 54326 - AjpSampler send file in post throws FileNotFoundException
Fix also file leak
Bugzilla Id: 54326

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java?rev=1424442&r1=1424441&r2=1424442&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AjpSampler.java
Thu Dec 20 12:55:00 2012
@@ -126,6 +126,8 @@ public class AjpSampler extends HTTPSamp
             return errorResult(iex, res);
         } finally {
             activeChannel = null;
+            JOrphanUtils.closeQuietly(body);
+            body = null;
         }
     }
 
@@ -260,9 +262,13 @@ public class AjpSampler extends HTTPSamp
             HTTPFileArg[] hfa = getHTTPFiles();
             if(hfa.length > 0) {
                 HTTPFileArg fa = hfa[0];
-                String fn = fa.getName();
+                String fn = fa.getPath();
                 File input = new File(fn);
                 cl = (int)input.length();
+                if(body != null) {
+                    JOrphanUtils.closeQuietly(body);
+                    body = null;
+                }
                 body = new BufferedInputStream(new FileInputStream(input));
                 setString(HTTPConstants.HEADER_CONTENT_DISPOSITION);
                 setString("form-data; name=\""+encode(fa.getParamName())+

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1424442&r1=1424441&r2=1424442&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu Dec 20 12:55:00 2012
@@ -122,6 +122,7 @@ It has been removed so now size of these
 and right angle bracket (&gt;) in search filter tag in XML response data</li>
 <li><bugzilla>53995</bugzilla> - AbstractJDBCTestElement shares PreparedStatement
between multi-threads</li>
 <li><bugzilla>54119</bugzilla> - HTTP 307 response is not redirected</li>
+<li><bugzilla>54326</bugzilla> - AjpSampler send file in post throws FileNotFoundException</li>
 </ul>
 
 <h3>Controllers</h3>



Mime
View raw message