| 4348 | } |
| 4349 | |
| 4350 | void Monitor::send_reply(MonOpRequestRef op, Message *reply) |
| 4351 | { |
| 4352 | op->mark_event(__func__); |
| 4353 | |
| 4354 | MonSession *session = op->get_session(); |
| 4355 | ceph_assert(session); |
| 4356 | Message *req = op->get_req(); |
| 4357 | ConnectionRef con = op->get_connection(); |
| 4358 | |
| 4359 | reply->set_cct(g_ceph_context); |
| 4360 | dout(2) << __func__ << " " << op << " " << reply << " " << *reply << dendl; |
| 4361 | |
| 4362 | if (!con) { |
| 4363 | dout(2) << "send_reply no connection, dropping reply " << *reply |
| 4364 | << " to " << req << " " << *req << dendl; |
| 4365 | reply->put(); |
| 4366 | op->mark_event("reply: no connection"); |
| 4367 | return; |
| 4368 | } |
| 4369 | |
| 4370 | if (!session->con && !session->proxy_con) { |
| 4371 | dout(2) << "send_reply no connection, dropping reply " << *reply |
| 4372 | << " to " << req << " " << *req << dendl; |
| 4373 | reply->put(); |
| 4374 | op->mark_event("reply: no connection"); |
| 4375 | return; |
| 4376 | } |
| 4377 | |
| 4378 | if (session->proxy_con) { |
| 4379 | dout(15) << "send_reply routing reply to " << con->get_peer_addr() |
| 4380 | << " via " << session->proxy_con->get_peer_addr() |
| 4381 | << " for request " << *req << dendl; |
| 4382 | session->proxy_con->send_message(new MRoute(session->proxy_tid, reply)); |
| 4383 | op->mark_event("reply: send routed request"); |
| 4384 | } else { |
| 4385 | session->con->send_message(reply); |
| 4386 | op->mark_event("reply: send"); |
| 4387 | } |
| 4388 | } |
| 4389 | |
| 4390 | void Monitor::no_reply(MonOpRequestRef op) |
| 4391 | { |
no test coverage detected