fix: tuic pool client should only cache the system's UDPConn
This commit is contained in:
parent
9afcb7071f
commit
4d12ed491c
1 changed files with 7 additions and 4 deletions
|
@ -67,11 +67,14 @@ func (t *PoolClient) dial(ctx context.Context, dialer C.Dialer, dialFn DialFunc)
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
dr.pc, dr.addr, dr.err = pc, addr, err
|
||||
if _, ok := pc.(*net.UDPConn); ok { // only cache the system's UDPConn
|
||||
dr.pc, dr.addr, dr.err = pc, addr, err
|
||||
|
||||
t.dialResultMutex.Lock()
|
||||
t.dialResultMap[dialer] = dr
|
||||
t.dialResultMutex.Unlock()
|
||||
}
|
||||
|
||||
t.dialResultMutex.Lock()
|
||||
t.dialResultMap[dialer] = dr
|
||||
t.dialResultMutex.Unlock()
|
||||
return pc, addr, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue