listen fe1
bind "fd@${fe1}" proto h2
- http-request return status 200 hdr x-glitches %[fc_glitches]
+ tcp-request session track-sc0 src
+ http-request return status 200 hdr x-glitches %[fc_glitches] hdr x-glitch-cnt %[sc0_glitch_cnt] hdr x-glitch-rate %[sc0_glitch_rate]
+ stick-table type ip size 10 store glitch_cnt,glitch_rate(1m)
} -start
# valid request: no glitch
rxresp
expect resp.status == 200
expect resp.http.x-glitches == 1
+ expect resp.http.x-glitch-cnt == 1
+ expect resp.http.x-glitch-rate == 1
} -run
} -run
rxresp
expect resp.status == 200
expect resp.http.x-glitches == 0
+ expect resp.http.x-glitch-cnt == 1
+ expect resp.http.x-glitch-rate == 1
} -run
} -run
if (!(h2c->flags & H2_CF_DEM_BLOCK_ANY) &&
(b_data(&h2c->dbuf) || (h2c->flags & H2_CF_RCVD_SHUT))) {
+ int prev_glitches = h2c->glitches;
+
h2_process_demux(h2c);
+ if (h2c->glitches != prev_glitches && !(h2c->flags & H2_CF_IS_BACK))
+ session_add_glitch_ctr(h2c->conn->owner, h2c->glitches - prev_glitches);
+
if (h2c->st0 >= H2_CS_ERROR || (h2c->flags & H2_CF_ERROR))
b_reset(&h2c->dbuf);