[Libwebsockets] Missing LWS_CALLBACK_HTTP_BODY_COMPLETION when using H2 https

Søren Holm sgh at sgh.dk
Wed Nov 17 21:29:33 CET 2021


No :)

onsdag den 17. november 2021 15.16.25 CET skrev Andy Green:
> On 11/17/21 12:28, Søren Holm wrote:
> > Sweet - I'll kill HTTP2 for now them.
> > 
> > Should I reporte hte HTTP2 in a bugreport ?
> 
> Does this solve it for you?
> 
> diff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c
> index a791081176..989cb5b95e 100644
> --- a/lib/roles/h2/ops-h2.c
> +++ b/lib/roles/h2/ops-h2.c
> @@ -837,6 +837,9 @@ lws_h2_bind_for_post_before_action(struct lws *wsi)
> 
>                  if (hit->protocol)
>                          name = hit->protocol;
> +               else
> +                       if (hit->origin_protocol == LWSMPRO_FILE)
> +                               return 0;
> 
>                  pp = lws_vhost_name_to_protocol(wsi->a.vhost, name);
>                  if (!pp) {
> 
> > onsdag den 17. november 2021 12.44.27 CET skrev Andy Green:
> >> On 11/17/21 10:45, Søren Holm wrote:
> >>> Hi
> >>> 
> >>> I get no LWS_CALLBACK_HTTP_BODY_COMPLETION on posts over https - I do
> >>> however get that callback if I disable the ssl key and cert. Thereby
> >>> running the server in http mode.
> >>> 
> >>> I use commandline curl for the post.
> >>> 
> >>> The difference as I can see is that curl somehow end up using HTTP2 on
> >>> https, but HTTP1.1 on regular http. Forcing curl to use HTTP1.1 on the
> >>> https brings the callback back.
> >>> 
> >>> So, is something fweird going on on H2?
> >> 
> >> It looks like some problem with how it is closed...
> >> 
> >>   >> curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the
> >> 
> >> underlying stream
> >> 
> >>> Can I disable H2 completely without recompiling libwebsocket?
> >> 
> >> You can disable it for build at cmake with -DLWS_WITH_HTTP2=0.
> >> 
> >> To do it at runtime, at vhost creation time (or context creation time if
> >> you just use the default vhost), you can tell the vhost what alpn
> >> services it should offer with info->alpn.  If you leave it NULL, then it
> >> figures out what to offer based on what roles are enabled in the build.
> >> 
> >> In this case if you set it to "http/1.1" it will only advertise h1 to
> >> clients at tls level, even if h2 is actually available.
> >> 
> >> -Andy


-- 
Søren Holm




More information about the Libwebsockets mailing list