eat header space in each iteration in prepend_size().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20641 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
491124c2aa
commit
914c48cad7
@ -651,14 +651,14 @@ prepend_size(net_buffer *_buffer, size_t size, void **_contiguousBuffer)
|
|||||||
header->first_node = node;
|
header->first_node = node;
|
||||||
|
|
||||||
list_insert_item_before(&buffer->buffers, previous, node);
|
list_insert_item_before(&buffer->buffers, previous, node);
|
||||||
} else {
|
|
||||||
size_t willConsume = min_c(size, node->header_space);
|
|
||||||
|
|
||||||
node->header_space -= willConsume;
|
|
||||||
node->start -= willConsume;
|
|
||||||
node->used += willConsume;
|
|
||||||
bytesLeft -= willConsume;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t willConsume = min_c(bytesLeft, node->header_space);
|
||||||
|
|
||||||
|
node->header_space -= willConsume;
|
||||||
|
node->start -= willConsume;
|
||||||
|
node->used += willConsume;
|
||||||
|
bytesLeft -= willConsume;
|
||||||
} while (bytesLeft > 0);
|
} while (bytesLeft > 0);
|
||||||
|
|
||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user