commit 720d2b8eb7be9e2a41126624083054a66017d452
Author: Cecylia Bocovich <cohosh(a)torproject.org>
Date: Mon Mar 8 21:50:42 2021 -0500
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.
---
server/server.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/server.go b/server/server.go
index 3b263d0..b3fa04a 100644
--- a/server/server.go
+++ b/server/server.go
@@ -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)
}
}()