mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Don't log errors from callng close on OR conns
Snowflake copies data between the OR connection and the KCP stream, meaning that in most cases the copy loops will only terminate once the OR connection times out. In this case the OR connection is already closed and so calls to CloseRead and CloseWrite will generate errors.
This commit is contained in:
parent
720d2b8eb7
commit
c0b6e082f2
1 changed files with 2 additions and 6 deletions
|
@ -76,9 +76,7 @@ func proxy(local *net.TCPConn, conn net.Conn) {
|
|||
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 {
|
||||
log.Printf("error closing read after copying ORPort to WebSocket %v", err)
|
||||
}
|
||||
local.CloseRead()
|
||||
conn.Close()
|
||||
wg.Done()
|
||||
}()
|
||||
|
@ -86,9 +84,7 @@ func proxy(local *net.TCPConn, conn net.Conn) {
|
|||
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 {
|
||||
log.Printf("error closing write after copying WebSocket to ORPort %v", err)
|
||||
}
|
||||
local.CloseWrite()
|
||||
conn.Close()
|
||||
wg.Done()
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue