8011234: Performance regression with ftp protocol when uploading in image mode
Reviewed-by: chegar
--- 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);
}
/**