Skip to content

Commit

Permalink
Merge pull request #7970 from Yan-waller/yj-wip-async
Browse files Browse the repository at this point in the history
msg/async: _try_send trim already sent for outcoming_bl more efficient

Reviewed-by: Haomai Wang <haomai@xsky.com>
  • Loading branch information
liewegas committed Mar 18, 2016
2 parents 053b15c + 40f7e6e commit be94eca
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 be94eca

Please sign in to comment.