[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jmeter-dev
Subject:    svn commit: r759944 -
From:       sebb () apache ! org
Date:       2009-03-30 12:39:08
Message-ID: 20090330123909.0909923888AF () eris ! apache ! org
[Download RAW message or body]

Author: sebb
Date: Mon Mar 30 12:39:08 2009
New Revision: 759944

URL: http://svn.apache.org/viewvc?rev=759944&view=rev
Log:
Logout from server before disconnecting
Guard against possible NPE

Modified:
    jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java


Modified: jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
                
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jme \
ter/protocol/ftp/sampler/FTPSampler.java?rev=759944&r1=759943&r2=759944&view=diff \
                ==============================================================================
                
--- jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java \
                (original)
+++ jakarta/jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java \
Mon Mar 30 12:39:08 2009 @@ -201,7 +201,7 @@
                         } else {
                             long bytes = IOUtils.copy(input,target);
                             ftpOK = bytes > 0;
-                            if (saveResponse){
+                            if (saveResponse && baos != null){
                                 res.setResponseData(baos.toByteArray());
                                 if (!binaryTransfer) {
                                     res.setDataType(SampleResult.TEXT);
@@ -236,6 +236,10 @@
         } finally {
             if (ftp.isConnected()) {
                 try {
+                    ftp.logout();
+                } catch (IOException ignored) {
+                }
+                try {
                     ftp.disconnect();
                 } catch (IOException ignored) {
                 }



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic