Ignore harmless "Pipe closed" in scp command
A pipe closed inside of the command means the client has disconnected while we were trying to read from them. We don't really care about such a condition, its the user's desire to disconnect and the server admin doesn't need to know about it in the logs. Change-Id: I011a7c25ddd78621c71176447718c4e76fcf005f Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -138,6 +138,14 @@ final class ScpCommand extends BaseCommand {
|
|||||||
throw new IOException("Unsupported mode");
|
throw new IOException("Unsupported mode");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
if (e.getClass() == IOException.class
|
||||||
|
&& "Pipe closed".equals(e.getMessage())) {
|
||||||
|
// Ignore a pipe closed error, its the user disconnecting from us
|
||||||
|
// while we are waiting for them to stalk.
|
||||||
|
//
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
out.write(2);
|
out.write(2);
|
||||||
out.write(e.getMessage().getBytes());
|
out.write(e.getMessage().getBytes());
|
||||||
|
|||||||
Reference in New Issue
Block a user