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:
parent
f163cbfb7f
commit
db76949cff
|
@ -5982,7 +5982,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
|
||||||
struct htx *htx = NULL;
|
struct htx *htx = NULL;
|
||||||
struct buffer *scbuf = NULL;
|
struct buffer *scbuf = NULL;
|
||||||
unsigned int sent;
|
unsigned int sent;
|
||||||
int full = 0;
|
|
||||||
|
|
||||||
TRACE_ENTER(H2_EV_RX_FRAME|H2_EV_RX_DATA, h2c->conn, h2s);
|
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
|
* allocating an rxbuf if possible. If we fail we'll more aggressively
|
||||||
* retry.
|
* 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;
|
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);
|
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;
|
goto fail;
|
||||||
|
@ -6010,7 +6009,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
|
||||||
htx = htx_from_buf(scbuf);
|
htx = htx_from_buf(scbuf);
|
||||||
|
|
||||||
try_again:
|
try_again:
|
||||||
full = 0;
|
|
||||||
flen = h2c->dfl - h2c->dpl;
|
flen = h2c->dfl - h2c->dpl;
|
||||||
if (!flen)
|
if (!flen)
|
||||||
goto end_transfer;
|
goto end_transfer;
|
||||||
|
@ -6023,7 +6021,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
|
||||||
|
|
||||||
block = htx_free_data_space(htx);
|
block = htx_free_data_space(htx);
|
||||||
if (!block) {
|
if (!block) {
|
||||||
full = 1;
|
|
||||||
if (h2s_get_rxbuf(h2s))
|
if (h2s_get_rxbuf(h2s))
|
||||||
goto next_buffer;
|
goto next_buffer;
|
||||||
|
|
||||||
|
@ -6053,8 +6050,6 @@ static int h2_frt_transfer_data(struct h2s *h2s)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sent < flen) {
|
if (sent < flen) {
|
||||||
if (!sent)
|
|
||||||
full = 1;
|
|
||||||
if (h2s_get_rxbuf(h2s))
|
if (h2s_get_rxbuf(h2s))
|
||||||
goto next_buffer;
|
goto next_buffer;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue