Skip to content
Snippets Groups Projects
Commit 77cb607f authored by cyberta's avatar cyberta
Browse files

use cancellableSleep also for error handling in readUDPWriteTCP, so that we...

use cancellableSleep also for error handling in readUDPWriteTCP, so that we avoid trying to establish a obfs4 connection while obfsvpn is already about to shutdown
parent f190c4f0
Branches
Tags
1 merge request!80fix nilpointer dereference
......@@ -417,9 +417,11 @@ func (c *Client) readUDPWriteTCP() {
_, err = conn.Write(tcpBuffer)
if err != nil {
c.error("readUDPWriteTCP: Write err from %v to %v: %v", conn.LocalAddr(), conn.RemoteAddr(), err)
time.Sleep(reconnectTime)
config := c.obfs4Conns[0].config
c.connectObfs4(&config, 20)
cancelled := cancellableSleep(c.ctx, reconnectTime)
if !cancelled {
config := c.obfs4Conns[0].config
c.connectObfs4(&config, 20)
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment