Commit 720d2b8e authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Don't log io.ErrClosedPipe in server

These errors are triggered in three places when the OR connection times
out. They don't tell us anything useful and are filling up our logs.
parent 850d2f06
......@@ -73,7 +73,7 @@ func proxy(local *net.TCPConn, conn net.Conn) {
wg.Add(2)
go func() {
if _, err := io.Copy(conn, local); err != nil {
if _, err := io.Copy(conn, local); err != nil && err != io.ErrClosedPipe {
log.Printf("error copying ORPort to WebSocket %v", err)
}
if err := local.CloseRead(); err != nil {
......@@ -83,7 +83,7 @@ func proxy(local *net.TCPConn, conn net.Conn) {
wg.Done()
}()
go func() {
if _, err := io.Copy(local, conn); err != nil {
if _, err := io.Copy(local, conn); err != nil && err != io.ErrClosedPipe {
log.Printf("error copying WebSocket to ORPort %v", err)
}
if err := local.CloseWrite(); err != nil {
......@@ -352,7 +352,7 @@ func acceptSessions(ln *kcp.Listener) error {
go func() {
defer conn.Close()
err := acceptStreams(conn)
if err != nil {
if err != nil && err != io.ErrClosedPipe {
log.Printf("acceptStreams: %v", err)
}
}()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment