cURL / Mailing Lists / curl-library / Single Mail


Re: http2 with lying server

From: Tatsuhiro Tsujikawa <>
Date: Fri, 21 Nov 2014 21:34:56 +0900


On Fri, Nov 21, 2014 at 7:57 AM, Daniel Stenberg <> wrote:

> Hi Tatsuhiro,
> I just pushed some bytes that introduce basic http2 awareness in the curl
> test suite.
> The new test 1801 is a server responding a HTTP/2 upgrade request
> positively, but the response following the 101 switched is still HTTP 1.1.
> Right now, we don't detect this situation and I'm curious what you think
> is the best way to fix it. Curl_http2_switced() calls
> nghttp2_session_mem_recv() with the protocol data, but it seems to happily
> swallow it? I'd like nghttp2 to tell me there's a protocol error here so
> that we can return an error for this.
> (Using nghttp2 v0.6.6-25-gee65dea)
nghttp2_session_mem_recv()​ eats any data without problem, but it they
violates HTTP/2 protocol, nghttp2 library issues connection error (or
stream error) and gracefully shutdown the HTTP/2 session. I think this is
not so bad design choice, since the library watches HTTP/2 session.
The issue here is we don't see the error on abrupt session termination. In
nghttp command line client, we check that requests are done with
on_stream_close callback.
If it is not called and session terminated, it is not fully processed.
So in our case, perhaps, we might check that whether on_close_stream is

​Best regards,
Tatsuhiro Tsujikawa​

> --
> /

List admin:
Received on 2014-11-21