zyearn commented on a change in pull request #1156:
URL: https://github.com/apache/incubator-brpc/pull/1156#discussion_r451438135



##########
File path: src/butil/iobuf.cpp
##########
@@ -366,9 +366,13 @@ inline IOBuf::Block* share_tls_block() {
     }
     IOBuf::Block* new_block = NULL;
     if (b) {
-        new_block = b->portal_next;
-        b->dec_ref();
-        --tls_data.num_blocks;
+        new_block = b;
+        while (new_block && new_block->full()) {
+            IOBuf::Block* const saved_next = new_block->portal_next;
+            new_block->dec_ref();

Review comment:
       Block的构造函数会把ref初始化成1




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to