count_iovecs() and get_iovecs() now only take nodes into account that contain data.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19426 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1059,9 +1059,11 @@ get_iovecs(net_buffer *_buffer, struct iovec *iovecs, uint32 vecCount)
|
||||
uint32 count = 0;
|
||||
|
||||
while (count < vecCount) {
|
||||
iovecs[count].iov_base = node->start;
|
||||
iovecs[count].iov_len = node->used;
|
||||
count++;
|
||||
if (node->used > 0) {
|
||||
iovecs[count].iov_base = node->start;
|
||||
iovecs[count].iov_len = node->used;
|
||||
count++;
|
||||
}
|
||||
|
||||
node = (data_node *)list_get_next_item(&buffer->buffers, node);
|
||||
if (node == NULL)
|
||||
@@ -1080,7 +1082,8 @@ count_iovecs(net_buffer *_buffer)
|
||||
uint32 count = 0;
|
||||
|
||||
while (true) {
|
||||
count++;
|
||||
if (node->used > 0)
|
||||
count++;
|
||||
|
||||
node = (data_node *)list_get_next_item(&buffer->buffers, node);
|
||||
if (node == NULL)
|
||||
|
||||
Reference in New Issue
Block a user