The code used to decide what to tell to the upper layer and when to free
the rxbuf is a bit convoluted and difficult to adapt to dynamic rxbufs.
We first need to deal with memory management (b_free) and only then to
decide what to report upwards. Right now it does it the other way around.
This should not change anything.
ret -= h2s_htx->data;
end:
+ /* release the rxbuf if it's not used anymore */
+ if (!b_data(&h2s->rxbuf) && b_size(&h2s->rxbuf)) {
+ b_free(&h2s->rxbuf);
+ offer_buffers(NULL, 1);
+ }
+
+ /* tell the stream layer whether there are data left or not */
if (b_data(&h2s->rxbuf))
se_fl_set(h2s->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
else {
se_fl_clr(h2s->sd, SE_FL_RCV_MORE | SE_FL_WANT_ROOM);
h2s_propagate_term_flags(h2c, h2s);
- if (b_size(&h2s->rxbuf)) {
- b_free(&h2s->rxbuf);
- offer_buffers(NULL, 1);
- }
}
if (ret && h2c->dsi == h2s->id) {