On Thu, Jun 14, 2018 at 07:22:34PM +0200, Janusz Dziemidowicz wrote:
> 2018-06-14 18:56 GMT+02:00 Willy Tarreau <w...@1wt.eu>:
> 
> > If you'd like to run a test, I'm attaching the patch.
> 
> Sure, but you forgot to attach it :)

Ah, that's because I'm stupid :-)

Here it comes this time.

Willy
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 5f1da0d..4c3e2dd 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -3106,6 +3109,7 @@ static int h2s_frt_make_resp_headers(struct h2s *h2s, 
struct buffer *buf)
         */
        if (es_now) {
                // trim any possibly pending data (eg: inconsistent 
content-length)
+               ret += buf->o;
                bo_del(buf, buf->o);
 
                h1m->state = HTTP_MSG_DONE;
@@ -3359,6 +3363,7 @@ static int h2s_frt_make_resp_data(struct h2s *h2s, struct 
buffer *buf)
 
                if (!(h1m->flags & H1_MF_CHNK)) {
                        // trim any possibly pending data (eg: inconsistent 
content-length)
+                       total += buf->o;
                        bo_del(buf, buf->o);
 
                        h1m->state = HTTP_MSG_DONE;
@@ -3413,6 +3418,7 @@ static int h2_snd_buf(struct conn_stream *cs, struct 
buffer *buf, int flags)
                        bo_del(buf, count);
 
                        // trim any possibly pending data (eg: extra CR-LF, ...)
+                       total += buf->o;
                        bo_del(buf, buf->o);
 
                        h2s->res.state = HTTP_MSG_DONE;

Reply via email to