]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: properly set H2_SF_ES_SENT when sending the final frame
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 13:39:09 +0000 (14:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 13:47:04 +0000 (14:47 +0100)
When sending DATA+ES, it's important to set H2_SF_ES_SENT as we don't
want to emit is several times nor to send an RST afterwards.

src/mux_h2.c

index e1c995516c6e2d422bff65f737cad6e85c74afb4..fad28b695e507fcbeadd85abdce16509cc985b95 100644 (file)
@@ -891,16 +891,17 @@ static int h2_send_empty_data_es(struct h2s *h2s)
        memcpy(str, "\x00\x00\x00\x00\x01", 5);
        write_n32(str + 5, h2s->id);
        ret = bo_istput(res, ist2(str, 9));
-       if (unlikely(ret <= 0)) {
-               if (!ret) {
-                       h2c->flags |= H2_CF_MUX_MFULL;
-                       h2s->flags |= H2_SF_BLK_MROOM;
-                       return 0;
-               }
-               else {
-                       h2c_error(h2c, H2_ERR_INTERNAL_ERROR);
-                       return 0;
-               }
+       if (likely(ret > 0)) {
+               h2s->flags |= H2_SF_ES_SENT;
+       }
+       else if (!ret) {
+               h2c->flags |= H2_CF_MUX_MFULL;
+               h2s->flags |= H2_SF_BLK_MROOM;
+               return 0;
+       }
+       else {
+               h2c_error(h2c, H2_ERR_INTERNAL_ERROR);
+               return 0;
        }
        return ret;
 }