a bit clean up
This commit is contained in:
@ -295,16 +295,15 @@ func (cc *ClientConn) resetTransport(closeTransport bool) error {
|
|||||||
start := time.Now()
|
start := time.Now()
|
||||||
for {
|
for {
|
||||||
cc.mu.Lock()
|
cc.mu.Lock()
|
||||||
cc.state = Connecting
|
|
||||||
cc.stateCV.Broadcast()
|
|
||||||
t := cc.transport
|
|
||||||
if cc.state == Shutdown {
|
if cc.state == Shutdown {
|
||||||
cc.mu.Unlock()
|
cc.mu.Unlock()
|
||||||
return ErrClientConnClosing
|
return ErrClientConnClosing
|
||||||
}
|
}
|
||||||
|
cc.state = Connecting
|
||||||
|
cc.stateCV.Broadcast()
|
||||||
cc.mu.Unlock()
|
cc.mu.Unlock()
|
||||||
if closeTransport {
|
if closeTransport {
|
||||||
t.Close()
|
cc.transport.Close()
|
||||||
}
|
}
|
||||||
// Adjust timeout for the current try.
|
// Adjust timeout for the current try.
|
||||||
copts := cc.dopts.copts
|
copts := cc.dopts.copts
|
||||||
|
Reference in New Issue
Block a user