From 0fe1864f7db556f99f3a715a8a383902ed36bfae Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 11 Jun 2021 15:55:56 +0200 Subject: [PATCH] CLEANUP: l7-retries: do not test the buffer before calling b_alloc() The return value is enough now to know if the allocation succeeded or failed. This cleanup was already pushed by Willy (f499f50) but a revert crushed it. It may be backported to the 2.4 because the original patch was done on this version. --- src/stream_interface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index cd01840..4400123 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -740,9 +740,7 @@ int si_cs_send(struct conn_stream *cs) if (!s->txn || (s->txn->req.msg_state != HTTP_MSG_DONE)) si->flags &= ~SI_FL_L7_RETRY; else { - if (b_is_null(&si->l7_buffer)) - b_alloc(&si->l7_buffer); - if (b_is_null(&si->l7_buffer)) + if (b_alloc(&si->l7_buffer) == NULL) si->flags &= ~SI_FL_L7_RETRY; else { memcpy(b_orig(&si->l7_buffer), -- 1.7.10.4