1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

h2: ignore unknown frame types a bit earlier

Chrome has started being able to issue frame type 0x42, we drop the connection
before we realize we wanted to ignore it.

This explicitly ignores it a bit earlier.
This commit is contained in:
Andy Green 2020-11-24 17:02:36 +00:00
parent e815ad2920
commit 10714c58e9

View file

@ -1005,7 +1005,11 @@ lws_h2_parse_frame_header(struct lws *wsi)
}
}
if (h2n->swsi && h2n->sid &&
if (h2n->type >= LWS_H2_FRAME_TYPE_COUNT)
/* we MUST ignore frames we don't understand */
h2n->type = LWS_H2_FRAME_TYPE_COUNT;
if (h2n->swsi && h2n->sid && h2n->type != LWS_H2_FRAME_TYPE_COUNT &&
!(http2_rx_validity[h2n->swsi->h2.h2_state] & (1 << h2n->type))) {
lwsl_info("%s: wsi %p, State: %s, ILLEGAL cmdrx %d (OK 0x%x)\n",
__func__, h2n->swsi,