mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 07:40:55 +03:00
In SCP, warning means error...
This commit is contained in:
@@ -123,9 +123,6 @@ public final class SCPDownloadClient
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case (char) 1:
|
case (char) 1:
|
||||||
addWarning(msg.substring(1));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case (char) 2:
|
case (char) 2:
|
||||||
throw new SCPException("Remote SCP command returned error: " + msg.substring(1));
|
throw new SCPException("Remote SCP command returned error: " + msg.substring(1));
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ abstract class SCPEngine {
|
|||||||
|
|
||||||
final SessionFactory host;
|
final SessionFactory host;
|
||||||
final TransferListener listener;
|
final TransferListener listener;
|
||||||
final Queue<String> warnings = new LinkedList<String>();
|
|
||||||
|
|
||||||
Command scp;
|
Command scp;
|
||||||
int exitStatus;
|
int exitStatus;
|
||||||
@@ -86,19 +85,6 @@ abstract class SCPEngine {
|
|||||||
return exitStatus;
|
return exitStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Queue<String> getWarnings() {
|
|
||||||
return warnings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hadWarnings() {
|
|
||||||
return !warnings.isEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void addWarning(String warning) {
|
|
||||||
log.warn(warning);
|
|
||||||
warnings.add(warning);
|
|
||||||
}
|
|
||||||
|
|
||||||
void check(String what)
|
void check(String what)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
int code = scp.getInputStream().read();
|
int code = scp.getInputStream().read();
|
||||||
@@ -111,9 +97,7 @@ abstract class SCPEngine {
|
|||||||
case 0: // OK
|
case 0: // OK
|
||||||
log.debug(what);
|
log.debug(what);
|
||||||
return;
|
return;
|
||||||
case 1:
|
case 1: // Warning? not
|
||||||
addWarning(readMessage());
|
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
throw new SCPException("Remote SCP command had error: " + readMessage());
|
throw new SCPException("Remote SCP command had error: " + readMessage());
|
||||||
default:
|
default:
|
||||||
@@ -123,7 +107,6 @@ abstract class SCPEngine {
|
|||||||
|
|
||||||
void cleanSlate() {
|
void cleanSlate() {
|
||||||
exitStatus = -1;
|
exitStatus = -1;
|
||||||
warnings.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void execSCPWith(List<Arg> args, String path)
|
void execSCPWith(List<Arg> args, String path)
|
||||||
|
|||||||
Reference in New Issue
Block a user