mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
MINOR: htx: make htx_from_buf() adjust the size only on new buffers
This one is used a lot during transfers, let's avoid resetting its size when there are already data in the buffer since it implies the size is correct.
This commit is contained in:
parent
8706c81316
commit
8ae4235f94
1 changed files with 3 additions and 2 deletions
|
|
@ -532,9 +532,10 @@ static inline struct htx *htx_from_buf(struct buffer *buf)
|
|||
if (b_is_null(buf))
|
||||
return &htx_empty;
|
||||
htx = (struct htx *)(buf->area);
|
||||
htx->size = buf->size - sizeof(*htx);
|
||||
if (!b_data(buf))
|
||||
if (!b_data(buf)) {
|
||||
htx->size = buf->size - sizeof(*htx);
|
||||
htx_reset(htx);
|
||||
}
|
||||
return htx;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue