mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-02-16 14:24:31 +00:00
Fix wireguard reconnect
This commit is contained in:
parent
1b091c9b07
commit
8f8437a88d
|
@ -275,6 +275,7 @@ func (c *wireClientBind) Open(port uint16) (fns []conn.ReceiveFunc, actualPort u
|
||||||
func (c *wireClientBind) receive(b []byte) (n int, ep conn.Endpoint, err error) {
|
func (c *wireClientBind) receive(b []byte) (n int, ep conn.Endpoint, err error) {
|
||||||
udpConn, err := c.connect()
|
udpConn, err := c.connect()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
err = &wireError{err}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
n, err = udpConn.Read(b)
|
n, err = udpConn.Read(b)
|
||||||
|
@ -332,10 +333,6 @@ func (w *wireError) Temporary() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *wireError) Unwrap() error {
|
|
||||||
return w.cause
|
|
||||||
}
|
|
||||||
|
|
||||||
type wireConn struct {
|
type wireConn struct {
|
||||||
net.Conn
|
net.Conn
|
||||||
access sync.Mutex
|
access sync.Mutex
|
||||||
|
|
Loading…
Reference in a new issue