From 922b93952195b1e5fb93a85d4cb061bbc90ffd7b Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 18 Nov 2020 06:34:16 +0000 Subject: [PATCH] h1only: fix assumption about h2 and add sai Fix an assumption about h2 being around if h1 is that crept in. Add a sai scenario to catch this kind of problem, only needs one build since testing lws' own consistency... add WITH_MINIMAL_EXAMPLES as well --- .sai.json | 4 ++++ lib/core-net/network.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.sai.json b/.sai.json index c8b5937d8..0f2054c6f 100644 --- a/.sai.json +++ b/.sai.json @@ -119,6 +119,10 @@ "cmake": "-DLWS_WITH_MINIMAL_EXAMPLES=1", "platforms": "windows-10/x86_64-amd/msvc, windows-10/x86_64-amd/noptmsvc, linux-ubuntu-2004/aarch64-a72-bcm2711-rpi4/gcc" }, + "h1only-examples": { + "cmake": "cmake .. -DLWS_WITH_HTTP2=0 -DLWS_WITH_MINIMAL_EXAMPLES=1", + "platforms": "none,linux-fedora-32/x86_64-amd/gcc" + }, "unix-domain": { "cmake": "-DUNIX_SOCK=1", "platforms": "windows-10/x86_64-amd/msvc, windows-10/x86_64-amd/noptmsvc" diff --git a/lib/core-net/network.c b/lib/core-net/network.c index d95e7aedc..1a26f2d55 100644 --- a/lib/core-net/network.c +++ b/lib/core-net/network.c @@ -442,7 +442,17 @@ lws_retry_sul_schedule_retry_wsi(struct lws *wsi, lws_sorted_usec_list_t *sul, return 1; #if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2) - if (wsi->role_ops == &role_ops_h1 || wsi->role_ops == &role_ops_h2) + if ( +#if defined(LWS_ROLE_H1) + wsi->role_ops == &role_ops_h1 +#endif +#if defined(LWS_ROLE_H1) && defined(LWS_ROLE_H2) + || +#endif +#if defined(LWS_ROLE_H2) + wsi->role_ops == &role_ops_h2 +#endif + ) /* * Since we're doing it by wsi, we're in a position to check for * http retry-after, it will increase us accordingly if found