From: Haomai Wang Date: Sun, 12 Apr 2015 07:01:50 +0000 (+0800) Subject: AsyncConnection: Discard all prefetch buffer when replacing X-Git-Tag: v9.0.1~121^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4311%2Fhead;p=ceph.git AsyncConnection: Discard all prefetch buffer when replacing Signed-off-by: Haomai Wang --- 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) {