mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-19 02:29:31 -05: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:
parent
6bf450b7fe
commit
fae478dae5
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue