]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: allow users to mark_down a NULL Connection*
authorGreg Farnum <greg@inktank.com>
Fri, 29 Mar 2013 17:39:56 +0000 (10:39 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 29 Mar 2013 17:42:04 +0000 (10:42 -0700)
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
src/msg/Messenger.h
src/msg/SimpleMessenger.cc

index ec2e33ffdee0c3eb2da9b3c4d5555faf41a1743d..7205940c118e44c9e5f3d931c5f6918ab2221bed 100644 (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.
index b244e16579edb79e9f72a1349114686c85358aa6..46e51dcf9f271addd213fbdb12f4ecd428d9b435 100644 (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) {