Skip to content

Commit

Permalink
msg: async: trim already sent for outcoming_bl more efficiently
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
  • Loading branch information
Yan-waller committed Mar 14, 2016
1 parent e530ade commit 40f7e6e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/msg/async/AsyncConnection.cc
Expand Up @@ -395,9 +395,7 @@ ssize_t AsyncConnection::_try_send(bool send, bool more)
// trim already sent for outcoming_bl
if (sent_bytes) {
if (sent_bytes < outcoming_bl.length()) {
bufferlist bl;
outcoming_bl.splice(sent_bytes, outcoming_bl.length()-sent_bytes, &bl);
bl.swap(outcoming_bl);
outcoming_bl.splice(0, sent_bytes);
} else {
outcoming_bl.clear();
}
Expand Down

0 comments on commit 40f7e6e

Please sign in to comment.