<< dendl;
msgr->lock.Lock();
+ if (msgr->dispatch_queue.stop)
+ goto shutting_down;
// note peer's type, flags
set_peer_type(connect.host_type);
goto reply;
}
msgr->lock.Lock();
+ if (msgr->dispatch_queue.stop)
+ goto shutting_down;
+
// existing?
if (msgr->rank_pipe.count(peer_addr)) {
ldout(msgr->cct,10) << "accept features " << connection_state->get_features() << dendl;
// ok!
+ if (msgr->dispatch_queue.stop)
+ goto shutting_down;
register_pipe();
msgr->lock.Unlock();
fail_unlocked:
pipe_lock.Lock();
- bool queued = is_queued();
- if (queued)
- state = STATE_CONNECTING;
- else
- state = STATE_CLOSED;
- fault();
- if (queued)
- start_writer();
+ {
+ bool queued = is_queued();
+ if (queued && state != STATE_CLOSED)
+ state = STATE_CONNECTING;
+ else
+ state = STATE_CLOSED;
+ fault();
+ if (queued)
+ start_writer();
+ }
pipe_lock.Unlock();
return -1;
+
+ shutting_down:
+ msgr->lock.Unlock();
+ state = STATE_CLOSED;
+ fault();
+ msgr->lock.Unlock();
+ return -1;
}
int SimpleMessenger::Pipe::connect()