nghttp2 / nghttp2-asio

MIT License
63 stars 24 forks source link

nghttp2-asio + server example compiling, but no data is coming in, connection is disconnected immediately after connection establishment #21

Open capiman opened 2 months ago

capiman commented 2 months ago

I was able to compile nghttp2-asio together with the server example.

With additional debug output I see that http2_handler::start is called, when I connect to the example server. All the callbacks are set and finally 0 is returned (so seems no error happened). The connection is then just disconnected. I can do it again and again, and above sequence happens again.

But then nothing more happens. The callback are never called.

What would be the next function/method, which would be called? Where do I find the code which disconnects my established connection, because, perhaps then, I can see what fails?

There was earlier some --enable-asio-lib (or similar, in nghttp2). I assume this is not more needed? Could it be dependency on Boost? Which Boost version is known to be working, so I can just try this version?

capiman commented 2 months ago

It is due to checking NGHTTP2_CLIENT_MAGIC. See here for checked string:

https://github.com/nghttp2/nghttp2/blob/d97bc7d8745ded136efa6e9e747f2310406893dd/lib/includes/nghttp2/nghttp2.h#L252

One need to use curl option --http2-prior-knowledge (and of course a curl which supports this).

(And I switched to latest master of nghttp2, but unsure if this is really needed. Before it was 1.61.0 or so)