From 72b245ea38fa6e5d13c44aa55c169db822626241 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 22 Aug 2020 18:52:13 +0100 Subject: [PATCH] h2: fix breakage with LWS_WITH_HTTP2=0 --- lib/roles/h1/ops-h1.c | 4 ++-- lib/roles/h2/ops-h2.c | 4 ++-- lib/roles/http/server/access-log.c | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/roles/h1/ops-h1.c b/lib/roles/h1/ops-h1.c index 9073652e9..a6be76031 100644 --- a/lib/roles/h1/ops-h1.c +++ b/lib/roles/h1/ops-h1.c @@ -1149,8 +1149,8 @@ rops_pt_init_destroy_h1(struct lws_context *context, pt->sul_ah_lifecheck.cb = lws_sul_http_ah_lifecheck; - __lws_sul_insert(&pt->pt_sul_owner, &pt->sul_ah_lifecheck, - 30 * LWS_US_PER_SEC); + __lws_sul_insert_us(&pt->pt_sul_owner[LWSSULLI_MISS_IF_SUSPENDED], + &pt->sul_ah_lifecheck, 30 * LWS_US_PER_SEC); } else lws_dll2_remove(&pt->sul_ah_lifecheck.list); #endif diff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c index 9812cc09e..8cc1b88cc 100644 --- a/lib/roles/h2/ops-h2.c +++ b/lib/roles/h2/ops-h2.c @@ -560,8 +560,8 @@ rops_pt_init_destroy_h2(struct lws_context *context, pt->sul_ah_lifecheck.cb = lws_sul_http_ah_lifecheck; - __lws_sul_insert(&pt->pt_sul_owner, &pt->sul_ah_lifecheck, - 30 * LWS_US_PER_SEC); + __lws_sul_insert_us(&pt->pt_sul_owner[LWSSULLI_MISS_IF_SUSPENDED], + &pt->sul_ah_lifecheck, 30 * LWS_US_PER_SEC); } else lws_dll2_remove(&pt->sul_ah_lifecheck.list); #endif diff --git a/lib/roles/http/server/access-log.c b/lib/roles/http/server/access-log.c index 12aebde11..06f441d34 100644 --- a/lib/roles/http/server/access-log.c +++ b/lib/roles/http/server/access-log.c @@ -70,10 +70,13 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int uri_len, int met else strcpy(da, "01/Jan/1970:00:00:00 +0000"); +#if defined(LWS_ROLE_H2) if (wsi->mux_substream) me = lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_COLON_METHOD); else +#endif me = method_names[meth]; + if (!me) me = "(null)";