Commit 1344fa28 authored by zhujiashun's avatar zhujiashun

fix_share_tls_block

parent 846f7998
...@@ -366,9 +366,13 @@ inline IOBuf::Block* share_tls_block() { ...@@ -366,9 +366,13 @@ inline IOBuf::Block* share_tls_block() {
} }
IOBuf::Block* new_block = NULL; IOBuf::Block* new_block = NULL;
if (b) { if (b) {
new_block = b->portal_next; new_block = b;
b->dec_ref(); while (new_block && new_block->full()) {
IOBuf::Block* const saved_next = new_block->portal_next;
new_block->dec_ref();
--tls_data.num_blocks; --tls_data.num_blocks;
new_block = saved_next;
}
} else if (!tls_data.registered) { } else if (!tls_data.registered) {
tls_data.registered = true; tls_data.registered = true;
// Only register atexit at the first time // Only register atexit at the first time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment