8011234: Performance regression with ftp protocol when uploading in image mode
authoralanb
Wed, 03 Apr 2013 13:15:39 +0100
changeset 16730 5f67810e08fb
parent 16729 3b26e313ad81
child 16731 c6f7eeb4acc0
8011234: Performance regression with ftp protocol when uploading in image mode Reviewed-by: chegar
jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java
--- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java	Tue Apr 02 16:26:54 2013 -0700
+++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java	Wed Apr 03 13:15:39 2013 +0100
@@ -1299,16 +1299,16 @@
      *         <code>null</code> 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);
     }
 
     /**