recv_max_prefetch(MIN(msgr->cct->_conf->ms_tcp_prefetch_max_size, TCP_PREFETCH_MIN_SIZE)),
recv_start(0), recv_end(0), stop_lock("AsyncConnection::stop_lock"),
got_bad_auth(false), authorizer(NULL), replacing(false), once_session_reset(false),
- state_buffer(NULL), state_offset(0), net(cct), center(c)
+ is_reset_from_peer(false), state_buffer(NULL), state_offset(0), net(cct), center(c)
{
read_handler.reset(new C_handle_read(this));
write_handler.reset(new C_handle_write(this));
int r = 0;
ceph_msg_connect_reply reply;
bufferlist reply_bl;
- bool is_reset_from_peer = false;
memset(&reply, 0, sizeof(reply));
reply.protocol_version = async_msgr->get_proto_version(peer_type, false);
// reset the in_seq if this is a hard reset from peer,
// otherwise we respect our original connection's value
- if (is_reset_from_peer)
- existing->in_seq = 0;
+ if (is_reset_from_peer) {
+ existing->is_reset_from_peer = true;
+ }
// Now existing connection will be alive and the current connection will
// exchange socket with existing connection because we want to maintain
int next_state;
- // if it is a hard reset from peer(in_seq == 0), we don't need a round-trip to negotiate in/out sequence
- if ((connect.features & CEPH_FEATURE_RECONNECT_SEQ) && in_seq) {
+ // if it is a hard reset from peer, we don't need a round-trip to negotiate in/out sequence
+ if ((connect.features & CEPH_FEATURE_RECONNECT_SEQ) && !is_reset_from_peer) {
reply.tag = CEPH_MSGR_TAG_SEQ;
next_state = STATE_ACCEPTING_WAIT_SEQ;
} else {
reply.tag = CEPH_MSGR_TAG_READY;
next_state = STATE_ACCEPTING_READY;
discard_requeued_up_to(0);
+ is_reset_from_peer = false;
+ in_seq = 0;
}
// send READY reply