CLEANUP: mux-h2: remove the unused "full" variable in h2_frt_transfer_data()

During 11th and 12th iteration of the development cycle for the H2 auto
rx window, several approaches were attempted to figure if another buffer
could be allocated or not. One of them consisted in looping back to the
beginning of the function requesting a new buffer slot and getting one
if the buffer was either apparently or confirmed full. The latest one
consisted in directly allocating the next buffer from the two places
where it's found to be proven full, instead of checking with the now
defunct h2s_may_get_rxbuf() if we were allowed to get once an loop.
That approach was retained. In this case the "full" variabled is no
longer needed, so let's get rid of it because the construct looks bogus
and confuses coverity (and possibly code readers as the intent is unclear
compared to the code).
This commit is contained in:
Willy Tarreau 2024-10-24 14:11:06 +02:00
parent f163cbfb7f
commit db76949cff
1 changed files with 1 additions and 6 deletions

View File

@ -5982,7 +5982,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
struct htx *htx = NULL;
struct buffer *scbuf = NULL;
unsigned int sent;
int full = 0;
TRACE_ENTER(H2_EV_RX_FRAME|H2_EV_RX_DATA, h2c->conn, h2s);
@ -5993,7 +5992,7 @@ static int h2_frt_transfer_data(struct h2s *h2s)
* allocating an rxbuf if possible. If we fail we'll more aggressively
* retry.
*/
if ((!h2s_rxbuf_tail(h2s) || (full || !h2s_may_append_to_rxbuf(h2s))) && !h2s_get_rxbuf(h2s)) {
if ((!h2s_rxbuf_tail(h2s) || !h2s_may_append_to_rxbuf(h2s)) && !h2s_get_rxbuf(h2s)) {
h2c->flags |= H2_CF_DEM_RXBUF;
TRACE_STATE("waiting for an h2s rxbuf slot", H2_EV_RX_FRAME|H2_EV_RX_DATA|H2_EV_H2S_BLK, h2c->conn, h2s);
goto fail;
@ -6010,7 +6009,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
htx = htx_from_buf(scbuf);
try_again:
full = 0;
flen = h2c->dfl - h2c->dpl;
if (!flen)
goto end_transfer;
@ -6023,7 +6021,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
block = htx_free_data_space(htx);
if (!block) {
full = 1;
if (h2s_get_rxbuf(h2s))
goto next_buffer;
@ -6053,8 +6050,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
}
if (sent < flen) {
if (!sent)
full = 1;
if (h2s_get_rxbuf(h2s))
goto next_buffer;