Fix connectionCopyEarly

This commit is contained in:
世界 2025-03-20 20:22:47 +08:00
parent 9aca54d039
commit db5ec3cdfc
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -2,6 +2,7 @@ package route
import ( import (
"context" "context"
"errors"
"io" "io"
"net" "net"
"net/netip" "net/netip"
@ -290,7 +291,7 @@ func (m *ConnectionManager) connectionCopyEarly(source net.Conn, destination io.
return err return err
} }
_, err = payload.ReadOnceFrom(source) _, err = payload.ReadOnceFrom(source)
if err != nil && !E.IsTimeout(err) { if err != nil && !(E.IsTimeout(err) || errors.Is(err, io.EOF)) {
return E.Cause(err, "read payload") return E.Cause(err, "read payload")
} }
_ = source.SetReadDeadline(time.Time{}) _ = source.SetReadDeadline(time.Time{})