mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-03 11:57:39 +03:00
Fix canceler.PacketConn
This commit is contained in:
parent
5bfc326913
commit
8b68fc4d7a
1 changed files with 2 additions and 2 deletions
|
@ -21,13 +21,13 @@ type TimerPacketConn struct {
|
|||
instance *Instance
|
||||
}
|
||||
|
||||
func NewPacketConn(ctx context.Context, conn N.PacketConn, timeout time.Duration) (context.Context, PacketConn) {
|
||||
func NewPacketConn(ctx context.Context, conn N.PacketConn, timeout time.Duration) (context.Context, N.PacketConn) {
|
||||
if timeoutConn, isTimeoutConn := common.Cast[PacketConn](conn); isTimeoutConn {
|
||||
oldTimeout := timeoutConn.Timeout()
|
||||
if timeout < oldTimeout {
|
||||
timeoutConn.SetTimeout(timeout)
|
||||
}
|
||||
return ctx, timeoutConn
|
||||
return ctx, conn
|
||||
}
|
||||
err := conn.SetReadDeadline(time.Time{})
|
||||
if err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue