From 190ec03b839e34a5628a88138d550bf266eb73f8 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Sun, 12 Apr 2015 15:01:50 +0800 Subject: [PATCH] AsyncConnection: Discard all prefetch buffer when replacing Signed-off-by: Haomai Wang --- src/msg/async/AsyncConnection.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index fdc94a06d395..06a2d9a03bba 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -1752,7 +1752,9 @@ int AsyncConnection::handle_connect_msg(ceph_msg_connect &connect, bufferlist &a existing->replacing = true; existing->state_offset = 0; existing->state = STATE_ACCEPTING_WAIT_CONNECT_MSG; - // there should exist any buffer + // Discard existing prefetch buffer in `recv_buf` + existing->recv_start = existing->recv_end = 0; + // there shouldn't exist any buffer assert(recv_start == recv_end); if (existing->_reply_accept(CEPH_MSGR_TAG_RETRY_GLOBAL, connect, reply, authorizer_reply) < 0) { -- 2.47.3