mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Don't log io.ErrClosedPipe in proxy.
We expect one of these at the end of just about every proxy session, as the Conns in both directions are closed as soon as the copy loop finishes in one direction. Closes #40016.
This commit is contained in:
parent
6baa3c4d5f
commit
912bcae24e
1 changed files with 3 additions and 1 deletions
|
@ -300,7 +300,9 @@ func CopyLoop(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) {
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
copyer := func(dst io.ReadWriteCloser, src io.ReadWriteCloser) {
|
copyer := func(dst io.ReadWriteCloser, src io.ReadWriteCloser) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
if _, err := io.Copy(dst, src); err != nil {
|
// Ignore io.ErrClosedPipe because it is likely caused by the
|
||||||
|
// termination of copyer in the other direction.
|
||||||
|
if _, err := io.Copy(dst, src); err != nil && err != io.ErrClosedPipe {
|
||||||
log.Printf("io.Copy inside CopyLoop generated an error: %v", err)
|
log.Printf("io.Copy inside CopyLoop generated an error: %v", err)
|
||||||
}
|
}
|
||||||
dst.Close()
|
dst.Close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue