changeset 5858:838c5b329903

8011234: Performance regression with ftp protocol when uploading in image mode Reviewed-by: chegar
author alanb
date Wed, 03 Apr 2013 13:15:39 +0100
parents 552ab255158d
children da56a559556a
files src/share/classes/sun/net/ftp/impl/FtpClient.java
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/net/ftp/impl/FtpClient.java	Thu Apr 04 19:18:24 2013 +0400
+++ b/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);
     }
 
     /**