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:
Christopher Faulet 2019-05-23 11:11:52 +02:00 committed by Willy Tarreau
parent ee847d45d0
commit 0f6d6a9ab6

View file

@ -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);