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

h2: overflow quirk

Some servers set the tx credit to the absolute max and then add to it... this is illegal
(and checked for in h2spec).  Add a quirk flag that works around it by reducing the
initial tx credit size by a factor of 16.
This commit is contained in:
Andy Green 2019-10-03 07:58:24 -07:00
parent 54573924ef
commit 07495c20c8
2 changed files with 9 additions and 3 deletions

View file

@ -41,6 +41,7 @@ enum lws_client_connect_ssl_connection_flags {
LCCSCF_ALLOW_EXPIRED = (1 << 3),
LCCSCF_ALLOW_INSECURE = (1 << 4),
LCCSCF_H2_QUIRK_NGHTTP2_END_STREAM = (1 << 5),
LCCSCF_H2_QUIRK_OVERFLOWS_TXCR = (1 << 6),
LCCSCF_PIPELINE = (1 << 16),
/**< Serialize / pipeline multiple client connections

View file

@ -456,10 +456,15 @@ lws_h2_settings(struct lws *wsi, struct http2_settings *settings,
return 1;
}
#if defined(LWS_WITH_CLIENT)
#if defined(LWS_AMAZON_RTOS) || defined(LWS_AMAZON_LINUX)
if (b == 0x7fffffff) {
b = 65535;
lwsl_info("init window size 0x7fffffff\n");
if (
#else
if (wsi->flags & LCCSCF_H2_QUIRK_OVERFLOWS_TXCR &&
#endif
b == 0x7fffffff) {
b >>= 4;
break;
}
#endif