提交 de16f0c3 编写于 作者: A alanb

8011234: Performance regression with ftp protocol when uploading in image mode

Reviewed-by: chegar
上级 e4b8584e
...@@ -1299,16 +1299,16 @@ public class FtpClient extends sun.net.ftp.FtpClient { ...@@ -1299,16 +1299,16 @@ public class FtpClient extends sun.net.ftp.FtpClient {
* <code>null</code> if the command was unsuccessful. * <code>null</code> if the command was unsuccessful.
* @throws IOException if an error occured during the transmission. * @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 "; String cmd = unique ? "STOU " : "STOR ";
Socket s = openDataConnection(cmd + name); Socket s = openDataConnection(cmd + name);
if (s == null) { if (s == null) {
return null; return null;
} }
if (type == TransferType.BINARY) { boolean bm = (type == TransferType.BINARY);
return s.getOutputStream(); return new sun.net.TelnetOutputStream(s.getOutputStream(), bm);
}
return new sun.net.TelnetOutputStream(s.getOutputStream(), false);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册