refactor: add additional [2]byte for packet length (#554)

This commit is contained in:
naison
2025-04-21 21:51:01 +08:00
committed by GitHub
parent dd80717d8d
commit a3556a263d
10 changed files with 56 additions and 75 deletions

View File

@@ -262,7 +262,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) {
plog.G(ctx).Debugf("Failed to copy remote -> local: %s", err)
}
pkgutil.SafeWrite(chDone, true)
chDone <- true
}()
// start local -> remote data transfer
@@ -273,7 +273,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) {
plog.G(ctx).Debugf("Failed to copy local -> remote: %s", err)
}
pkgutil.SafeWrite(chDone, true)
chDone <- true
}()
select {