tunnel deletion on shutdown fix

This commit is contained in:
Muaz Ahmad 2023-09-23 20:44:20 +05:00
parent fb39b051db
commit abe6337dc2

View file

@ -24,6 +24,11 @@ func (tunnel *Tunnel) Start() {
// central tunnel loop, read incoming, process and generate response // central tunnel loop, read incoming, process and generate response
// write response if any // write response if any
for { for {
// force check since no new packets after shutdown
if tunnel.state.state == 3 {
tunnel.broken = true
break
}
packet, err := tunnel.ReadPacket() packet, err := tunnel.ReadPacket()
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)