msgr: allow users to mark_down a NULL Connection*

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
This commit is contained in:
Greg Farnum 2013-03-29 10:39:56 -07:00
parent f8682cb8a7
commit 4f8ba0e775
2 changed files with 3 additions and 0 deletions

View File

@ -476,6 +476,7 @@ public:
* discard its outgoing queue, and if the endpoint tries
* to reconnect they will discard their queue when we
* inform them of the session reset.
* If the Connection* is NULL, this is a no-op.
* It does not generate any notifications to the Dispatcher.
*
* @param con The Connection to mark down.

View File

@ -585,6 +585,8 @@ void SimpleMessenger::mark_down(const entity_addr_t& addr)
void SimpleMessenger::mark_down(Connection *con)
{
if (con == NULL)
return;
lock.Lock();
Pipe *p = static_cast<Pipe *>(con->get_pipe());
if (p) {