The monitor does a create_anon_connection() to create a pseudo Connection
object for forwarded messages. If we try to call mark_down or similar
on one of these we should silently ignore the operation, not crash.
If we try to send a message, still crash (explicitly assert); the caller
should probably know better.
Fixes: #9062
Signed-off-by: Sage Weil <sage@redhat.com>
int PipeConnection::send_message(Message *m)
{
+ assert(msgr);
return static_cast<SimpleMessenger*>(msgr)->send_message(m, this);
}
void PipeConnection::mark_down()
{
- static_cast<SimpleMessenger*>(msgr)->mark_down(this);
+ if (msgr)
+ static_cast<SimpleMessenger*>(msgr)->mark_down(this);
}
void PipeConnection::mark_disposable()
{
- static_cast<SimpleMessenger*>(msgr)->mark_disposable(this);
+ if (msgr)
+ static_cast<SimpleMessenger*>(msgr)->mark_disposable(this);
}