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:
Shawn O. Pearce
2009-08-24 13:05:11 -07:00
parent 55c3b08ebf
commit bad5e09ae5

View File

@@ -138,6 +138,14 @@ final class ScpCommand extends BaseCommand {
throw new IOException("Unsupported mode");
}
} 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 {
out.write(2);
out.write(e.getMessage().getBytes());