mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-03 20:07:36 +03:00
Fix connectionCopyEarly
This commit is contained in:
parent
9aca54d039
commit
db5ec3cdfc
1 changed files with 2 additions and 1 deletions
|
@ -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{})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue