mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-10-04 06:56:39 +08:00
refactor: refactor code (#373)
This commit is contained in:
@@ -263,10 +263,7 @@ func copyStream(ctx context.Context, local net.Conn, remote net.Conn) {
|
||||
if err != nil && !errors.Is(err, net.ErrClosed) && !errors.Is(err, io.EOF) {
|
||||
log.Debugf("Failed to copy remote -> local: %s", err)
|
||||
}
|
||||
select {
|
||||
case chDone <- true:
|
||||
default:
|
||||
}
|
||||
pkgutil.SafeWrite(chDone, true)
|
||||
}()
|
||||
|
||||
// start local -> remote data transfer
|
||||
@@ -277,10 +274,7 @@ func copyStream(ctx context.Context, local net.Conn, remote net.Conn) {
|
||||
if err != nil && !errors.Is(err, net.ErrClosed) && !errors.Is(err, io.EOF) {
|
||||
log.Debugf("Failed to copy local -> remote: %s", err)
|
||||
}
|
||||
select {
|
||||
case chDone <- true:
|
||||
default:
|
||||
}
|
||||
pkgutil.SafeWrite(chDone, true)
|
||||
}()
|
||||
|
||||
select {
|
||||
|
Reference in New Issue
Block a user