mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 20:07:40 +03:00
Fix HandshakeFailure usages
This commit is contained in:
parent
b4300eaa6a
commit
b8b3759826
4 changed files with 11 additions and 10 deletions
|
@ -102,13 +102,13 @@ func (w *UDPBackWriter) HandshakeSuccess() error {
|
|||
func (w *UDPBackWriter) HandshakeFailure(err error) error {
|
||||
w.access.Lock()
|
||||
defer w.access.Unlock()
|
||||
if w.packet != nil {
|
||||
wErr := gWriteUnreachable(w.stack, w.packet)
|
||||
w.packet.DecRef()
|
||||
w.packet = nil
|
||||
return wErr
|
||||
if w.packet == nil {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return nil
|
||||
wErr := gWriteUnreachable(w.stack, w.packet)
|
||||
w.packet.DecRef()
|
||||
w.packet = nil
|
||||
return wErr
|
||||
}
|
||||
|
||||
func (w *UDPBackWriter) WritePacket(packetBuffer *buf.Buffer, destination M.Socksaddr) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue