mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-02 03:17:37 +03:00
udpnat: Fix read deadline not initialized
This commit is contained in:
parent
afd8993773
commit
26511a251f
1 changed files with 4 additions and 3 deletions
|
@ -70,9 +70,10 @@ func (s *Service[T]) NewPacket(ctx context.Context, key T, buffer *buf.Buffer, m
|
|||
func (s *Service[T]) NewContextPacket(ctx context.Context, key T, buffer *buf.Buffer, metadata M.Metadata, init func(natConn N.PacketConn) (context.Context, N.PacketWriter)) {
|
||||
c, loaded := s.nat.LoadOrStore(key, func() *conn {
|
||||
c := &conn{
|
||||
data: make(chan packet, 64),
|
||||
localAddr: metadata.Source,
|
||||
remoteAddr: metadata.Destination,
|
||||
data: make(chan packet, 64),
|
||||
localAddr: metadata.Source,
|
||||
remoteAddr: metadata.Destination,
|
||||
readDeadline: pipe.MakeDeadline(),
|
||||
}
|
||||
c.ctx, c.cancel = common.ContextWithCancelCause(ctx)
|
||||
return c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue