From e2454ee2cc317c61af2bc2084d3c788e6d2126f3 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Wed, 8 Jul 2015 11:32:29 +0800 Subject: [PATCH] AsyncConnection: Only prepare message when it support fast dispatch Not all messages support reencode now, we just avoid them prepare firstly when call "send_message" Signed-off-by: Haomai Wang --- src/msg/async/AsyncConnection.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index a142e5848025..bb47b3ea3ae2 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1939,7 +1939,10 @@ int AsyncConnection::send_message(Message *m) if (!m->get_priority()) m->set_priority(async_msgr->get_default_send_priority()); - prepare_send_message(f, m, bl); + // TODO: Currently not all messages supports reencode like MOSDMap, so here + // only let fast dispatch support messages prepare message + if (async_msgr->ms_can_fast_dispatch(m)) + prepare_send_message(f, m, bl); Mutex::Locker l(write_lock); // "features" changes will change the payload encoding -- 2.47.3