* copy_meta_data() also copied the size of the buffer, which wasn't such a good
idea. Splitting large buffers no longer causes KDL. * merge_buffer() now maintains the size of the source buffer while removing its nodes. * The paranoia checks run through again now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35073 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bedf29cacd
commit
7108ab1ff9
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2006-2010, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@ -7,6 +7,7 @@
|
||||
* Ingo Weinhold, ingo_weinhold@gmx.de
|
||||
*/
|
||||
|
||||
|
||||
#include "utility.h"
|
||||
|
||||
#include <net_buffer.h>
|
||||
@ -1028,7 +1029,6 @@ copy_metadata(net_buffer* destination, const net_buffer* source)
|
||||
destination->flags = source->flags;
|
||||
destination->interface = source->interface;
|
||||
destination->offset = source->offset;
|
||||
destination->size = source->size;
|
||||
destination->protocol = source->protocol;
|
||||
destination->type = source->type;
|
||||
}
|
||||
@ -1151,6 +1151,7 @@ duplicate_buffer(net_buffer* _buffer)
|
||||
|
||||
copy_metadata(duplicate, buffer);
|
||||
|
||||
ASSERT(duplicate->size == buffer->size);
|
||||
CHECK_BUFFER(buffer);
|
||||
CHECK_BUFFER(duplicate);
|
||||
RUN_PARANOIA_CHECKS(duplicate);
|
||||
@ -1189,6 +1190,7 @@ clone_buffer(net_buffer* _buffer, bool shareFreeSpace)
|
||||
}
|
||||
|
||||
copy_metadata(clone, buffer);
|
||||
ASSERT(clone->size == buffer->size);
|
||||
|
||||
return clone;
|
||||
|
||||
@ -1259,6 +1261,7 @@ clone_buffer(net_buffer* _buffer, bool shareFreeSpace)
|
||||
|
||||
copy_metadata(clone, buffer);
|
||||
|
||||
ASSERT(clone->size == buffer->size);
|
||||
CREATE_PARANOIA_CHECK_SET(clone, "net_buffer");
|
||||
SET_PARANOIA_CHECK(PARANOIA_SUSPICIOUS, clone, &clone->size,
|
||||
sizeof(clone->size));
|
||||
@ -1363,6 +1366,7 @@ merge_buffer(net_buffer* _buffer, net_buffer* _with, bool after)
|
||||
// The node is already in the buffer, we can just move it
|
||||
// over to the new owner
|
||||
list_remove_item(&with->buffers, node);
|
||||
with->size -= node->used;
|
||||
} else {
|
||||
// we need a new place for this node
|
||||
data_node* newNode = add_data_node(buffer, node->header);
|
||||
|
Loading…
Reference in New Issue
Block a user