]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: delay bufferlist construction
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Fri, 5 Feb 2016 11:00:34 +0000 (12:00 +0100)
committerPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Fri, 12 Feb 2016 13:25:42 +0000 (14:25 +0100)
We're using this bl only when removing *some* of data in front of
outcoming_bl, so there's no need to construct it each time we empty
*entire* outcoming_bl.
Though something more efficient than tmp bufferlist and splice is
probably better solution.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
src/msg/async/AsyncConnection.cc

index fffb144d3de1c747de7e2966ecdb57c6bb131962..04e37018fbaf3a5d6304e665c860e30cd1bc1ab1 100644 (file)
@@ -398,8 +398,8 @@ ssize_t AsyncConnection::_try_send(bufferlist &send_bl, bool send, bool more)
 
   // trim already sent for outcoming_bl
   if (sent_bytes) {
-    bufferlist bl;
     if (sent_bytes < outcoming_bl.length()) {
+      bufferlist bl;
       outcoming_bl.splice(sent_bytes, outcoming_bl.length()-sent_bytes, &bl);
       bl.swap(outcoming_bl);
     } else {