mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-08 21:39:56 +00:00
chore: use local var for info
This commit is contained in:
parent
0a77ce4d64
commit
faeef50fc0
@ -12,7 +12,6 @@ import (
|
|||||||
type reconnectableClientImpl struct {
|
type reconnectableClientImpl struct {
|
||||||
config *Config
|
config *Config
|
||||||
client Client
|
client Client
|
||||||
info *HandshakeInfo
|
|
||||||
count int
|
count int
|
||||||
connectedFunc func(Client, *HandshakeInfo, int) // called when successfully connected
|
connectedFunc func(Client, *HandshakeInfo, int) // called when successfully connected
|
||||||
m sync.Mutex
|
m sync.Mutex
|
||||||
@ -43,13 +42,14 @@ func (rc *reconnectableClientImpl) reconnect() error {
|
|||||||
_ = rc.client.Close()
|
_ = rc.client.Close()
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
rc.client, rc.info, err = NewClient(rc.config)
|
var info *HandshakeInfo
|
||||||
|
rc.client, info, err = NewClient(rc.config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
rc.count++
|
rc.count++
|
||||||
if rc.connectedFunc != nil {
|
if rc.connectedFunc != nil {
|
||||||
rc.connectedFunc(rc, rc.info, rc.count)
|
rc.connectedFunc(rc, info, rc.count)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user