mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-21 18:23:30 +02:00
MINOR: buffers: Swap buffers of same size only
In b_xfer(), we now take care to swap buffers of the same size only. For now, it is always the case. But that will change.
This commit is contained in:
@@ -348,7 +348,7 @@ size_t b_xfer(struct buffer *dst, struct buffer *src, size_t count)
|
||||
|
||||
if (ret > count)
|
||||
ret = count;
|
||||
else if (!b_data(dst)) {
|
||||
else if (!b_data(dst) && b_size(dst) == b_size(src)) {
|
||||
/* zero copy is possible by just swapping buffers */
|
||||
struct buffer tmp = *dst;
|
||||
*dst = *src;
|
||||
|
||||
Reference in New Issue
Block a user