From 355aa0e44bab0cdec2c053f87bca828d46134162 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 14 Apr 2015 16:36:05 -0400 Subject: [PATCH] xio: check if connection is on list before erasing also removed the extra conditional put() in on_disconnect_event() Signed-off-by: Casey Bodley --- src/msg/xio/XioConnection.h | 2 -- src/msg/xio/XioMessenger.cc | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/msg/xio/XioConnection.h b/src/msg/xio/XioConnection.h index 6ab116dd306e..9a5f615893a5 100644 --- a/src/msg/xio/XioConnection.h +++ b/src/msg/xio/XioConnection.h @@ -228,8 +228,6 @@ private: connected.set(false); pthread_spin_lock(&sp); discard_input_queue(CState::OP_FLAG_LOCKED); - if (!conn) - this->put(); pthread_spin_unlock(&sp); return 0; } diff --git a/src/msg/xio/XioMessenger.cc b/src/msg/xio/XioMessenger.cc index 198fb00c4ad1..3cfe34aee9da 100644 --- a/src/msg/xio/XioMessenger.cc +++ b/src/msg/xio/XioMessenger.cc @@ -529,11 +529,13 @@ int XioMessenger::session_event(struct xio_session *session, conns_entity_map.erase(conn_iter); } } - /* now find xcon on conns_list, erase, and release sentinel ref */ - XioConnection::ConnList::iterator citer = - XioConnection::ConnList::s_iterator_to(*xcon); - /* XXX check if citer on conn_list? */ - conns_list.erase(citer); + /* check if citer on conn_list */ + if (xcon->conns_hook.is_linked()) { + /* now find xcon on conns_list and erase */ + XioConnection::ConnList::iterator citer = + XioConnection::ConnList::s_iterator_to(*xcon); + conns_list.erase(citer); + } xcon->on_disconnect_event(); } break; -- 2.47.3