You need to sign in or sign up before continuing.
提交 d9f971bf 编写于 作者: J jccollet

6919185: test/closed/sun/net/ftp/FtpTests fails to compile

Summary: Fixed a couple of regressions in FtpClient and updated the test.
Reviewed-by: chegar
上级 6962cc06
......@@ -671,6 +671,10 @@ public class FtpClient extends sun.net.ftp.FtpClient {
}
if (!issueCommand(cmd)) {
s.close();
if (getLastReplyCode() == FtpReplyCode.FILE_UNAVAILABLE) {
// Ensure backward compatibility
throw new FileNotFoundException(cmd);
}
throw new sun.net.ftp.FtpProtocolException(cmd + ":" + getResponseString(), getLastReplyCode());
}
return s;
......@@ -688,7 +692,16 @@ public class FtpClient extends sun.net.ftp.FtpClient {
Socket clientSocket;
if (passiveMode) {
return openPassiveDataConnection(cmd);
try {
return openPassiveDataConnection(cmd);
} catch (sun.net.ftp.FtpProtocolException e) {
// If Passive mode failed, fall back on PORT
// Otherwise throw exception
String errmsg = e.getMessage();
if (!errmsg.startsWith("PASV") && !errmsg.startsWith("EPSV")) {
throw e;
}
}
}
ServerSocket portSocket;
InetAddress myAddress;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册