a bit clean up

This commit is contained in:
iamqizhao
2015-09-22 19:01:33 -07:00
parent de3c0d2fde
commit e6b603d375

View File

@ -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