From 84e09062c09f2bafa8749d9b97125b64b2572bcd Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Wed, 3 Apr 2013 13:15:39 +0100 Subject: [PATCH] 8011234: Performance regression with ftp protocol when uploading in image mode Reviewed-by: chegar --- jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java index 1d1b26d873b..babb9f599da 100644 --- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java +++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java @@ -1299,16 +1299,16 @@ public class FtpClient extends sun.net.ftp.FtpClient { * null if the command was unsuccessful. * @throws IOException if an error occured during the transmission. */ - public OutputStream putFileStream(String name, boolean unique) throws sun.net.ftp.FtpProtocolException, IOException { + public OutputStream putFileStream(String name, boolean unique) + throws sun.net.ftp.FtpProtocolException, IOException + { String cmd = unique ? "STOU " : "STOR "; Socket s = openDataConnection(cmd + name); if (s == null) { return null; } - if (type == TransferType.BINARY) { - return s.getOutputStream(); - } - return new sun.net.TelnetOutputStream(s.getOutputStream(), false); + boolean bm = (type == TransferType.BINARY); + return new sun.net.TelnetOutputStream(s.getOutputStream(), bm); } /**