|
|
|
@ -2425,21 +2425,29 @@ func pipe(ctx context.Context, c1, c2 net.Conn) { |
|
|
|
defer wg.Done() |
|
|
|
defer cancel() |
|
|
|
if _, err := io.Copy(c1, c2); err != nil { |
|
|
|
log.Printf("pipe: c1<-c2 copy error: %v", err) |
|
|
|
if isDebug { |
|
|
|
log.Printf("pipe: c1<-c2 copy error: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
}() |
|
|
|
go func() { |
|
|
|
defer wg.Done() |
|
|
|
defer cancel() |
|
|
|
if _, err := io.Copy(c2, c1); err != nil { |
|
|
|
log.Printf("pipe: c2<-c1 copy error: %v", err) |
|
|
|
if isDebug { |
|
|
|
log.Printf("pipe: c2<-c1 copy error: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
}() |
|
|
|
wg.Wait() |
|
|
|
if err := c1.SetDeadline(time.Time{}); err != nil { |
|
|
|
log.Printf("pipe: failed to reset deadline c1: %v", err) |
|
|
|
if isDebug { |
|
|
|
log.Printf("pipe: failed to reset deadline c1: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
if err := c2.SetDeadline(time.Time{}); err != nil { |
|
|
|
log.Printf("pipe: failed to reset deadline c2: %v", err) |
|
|
|
if isDebug { |
|
|
|
log.Printf("pipe: failed to reset deadline c2: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|