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

HPACK: take sizing to 0 as clear existing

Apparently some peers set the HPACK size to zero and then try
to set HPACK dynamic elements.  Take it to mean keep the same
size but clear it down.
This commit is contained in:
Andy Green 2019-07-08 11:33:52 +01:00
parent 3b44a745c9
commit 79bb26b6bd

View file

@ -597,6 +597,11 @@ lws_hpack_dynamic_size(struct lws *wsi, int size)
(int)dyn->num_entries, size,
nwsi->vhost->h2.set.s[H2SET_HEADER_TABLE_SIZE]);
if (!size) {
size = dyn->num_entries * 8;
lws_hpack_destroy_dynamic_header(wsi);
}
if (size > (int)nwsi->vhost->h2.set.s[H2SET_HEADER_TABLE_SIZE]) {
lwsl_info("rejecting hpack dyn size %u vs %u\n", size,
nwsi->vhost->h2.set.s[H2SET_HEADER_TABLE_SIZE]);