mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
MINOR: htx: Optimize htx_drain() when all data are drained
Instead of looping on the HTX message to drain all data, the message is now reset..
This commit is contained in:
parent
ee847d45d0
commit
0f6d6a9ab6
1 changed files with 6 additions and 0 deletions
|
|
@ -309,6 +309,12 @@ struct htx_ret htx_drain(struct htx *htx, uint32_t count)
|
|||
struct htx_blk *blk;
|
||||
struct htx_ret htxret = { .blk = NULL, .ret = 0 };
|
||||
|
||||
if (count == htx->data) {
|
||||
htx_reset(htx);
|
||||
htxret.ret = count;
|
||||
return htxret;
|
||||
}
|
||||
|
||||
blk = htx_get_head_blk(htx);
|
||||
while (count && blk) {
|
||||
uint32_t sz = htx_get_blksz(blk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue