[Libwebsockets] Missing LWS_CALLBACK_HTTP_BODY_COMPLETION when using H2 https

Søren Holm sgh at sgh.dk
Wed Nov 17 11:57:21 CET 2021


It can be recreated with lws-minimal-http-server-form-post

I issue the request like this:  
curl -v  --insecure --data-raw "blah blah" http(s)://localhost:7681/form1

Without "-s"  the server outputs and curl exits correctly.
[2021/11/17 11:55:22:3243] N:  ++ [wsisrv|1|adopted] (1)
[2021/11/17 11:55:22:3244] U: LWS_CALLBACK_HTTP_BODY_COMPLETION
[2021/11/17 11:55:22:3244] U: text1: undefined
[2021/11/17 11:55:22:3244] U: send: undefined
[2021/11/17 11:55:22:3248] N:  -- [wsisrv|1|adopted] (0) 480μs


With "-s" the server outputs:
[2021/11/17 11:55:53:8927] N:  ++ [wsisrv|0|adopted] (1)
[2021/11/17 11:55:53:8927] N: lws_gate_accepts: on = 0
[2021/11/17 11:55:53:9074] N: lws_gate_accepts: on = 0
[2021/11/17 11:55:53:9077] N:  ++ [mux|0|h2_sid1_(wsisrv|0|adopted])] (1)
[2021/11/17 11:55:53:9078] N:  -- [mux|0|h2_sid1_(wsisrv|0|adopted])] (0) 
109μs
[2021/11/17 11:55:53:9079] N: lws_gate_accepts: on = 0
[2021/11/17 11:55:53:9079] N:  -- [wsisrv|0|adopted] (0) 15.269ms

And curl respons.
curl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying 
stream


However if I do the query using :
curl --http1.1  --insecure --data-raw "blah blah" https://localhost:7681/form1

the server outputs:
[2021/11/17 11:57:08:5562] N:  ++ [wsisrv|4|adopted] (1)
[2021/11/17 11:57:08:5562] N: lws_gate_accepts: on = 0
[2021/11/17 11:57:08:5696] N: lws_gate_accepts: on = 0
[2021/11/17 11:57:08:5698] U: LWS_CALLBACK_HTTP_BODY_COMPLETION
[2021/11/17 11:57:08:5698] U: text1: undefined
[2021/11/17 11:57:08:5698] U: send: undefined
[2021/11/17 11:57:08:5701] N: lws_gate_accepts: on = 0
[2021/11/17 11:57:08:5702] N:  -- [wsisrv|4|adopted] (0) 14.016ms


onsdag den 17. november 2021 11.45.06 CET skrev Søren Holm:
> 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?
> Can I disable H2 completely without recompiling libwebsocket?


-- 
Søren Holm




More information about the Libwebsockets mailing list