mirror of https://github.com/cbeuw/Cloak
Explicit session.Close() call is indeed needed
This commit is contained in:
parent
be53fa37a0
commit
6b6b1b349f
|
|
@ -39,6 +39,9 @@ func RouteUDP(bindFunc func() (*net.UDPConn, error), streamTimeout time.Duration
|
||||||
|
|
||||||
stream, err = sesh.OpenStream()
|
stream, err = sesh.OpenStream()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if singleplex {
|
||||||
|
sesh.Close()
|
||||||
|
}
|
||||||
log.Errorf("Failed to open stream: %v", err)
|
log.Errorf("Failed to open stream: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
@ -106,6 +109,9 @@ func RouteTCP(listener net.Listener, streamTimeout time.Duration, singleplex boo
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Failed to open stream: %v", err)
|
log.Errorf("Failed to open stream: %v", err)
|
||||||
localConn.Close()
|
localConn.Close()
|
||||||
|
if singleplex {
|
||||||
|
sesh.Close()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue