On Wed, Jan 03, 2018 at 09:31:47PM +0100, Willy Tarreau wrote:
> Oh I think you've just put your finger on it. I remember taking care
> of handling 0-sized frames, and facing certain difficulties with them
> (eg: sometimes returning size 0 just means nothing was done). I sounds
> very likely that we can still have a bug around this. It would also
> explain why your patch could get rid of it.
> 
> I'll have a look at the code in case I have an idea.

Could you please try the attached patch? I'm pretty sure it is *very*
related to your observations. In fact till now we would not update the
parser's state on an empty data frame, which explains why you had to
move the stuff around.

Thanks!
Willy
diff --git a/src/mux_h2.c b/src/mux_h2.c
index c6e15ec..6348826 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -2770,7 +2770,7 @@ static int h2_frt_transfer_data(struct h2s *h2s, struct 
buffer *buf, int count)
 
        flen = h2c->dfl - h2c->dpl;
        if (!flen)
-               return 0;
+               goto end_transfer;
 
        if (flen > h2c->dbuf->i) {
                flen = h2c->dbuf->i;
@@ -2817,6 +2817,7 @@ static int h2_frt_transfer_data(struct h2s *h2s, struct 
buffer *buf, int count)
                return flen;
        }
 
+end_transfer:
        /* here we're done with the frame, all the payload (except padding) was
         * transferred.
         */

Reply via email to