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/jmeter/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-unsubscr...@jakarta.apache.org For additional commands, e-mail: jmeter-dev-h...@jakarta.apache.org