curl-library
Re: Inclusion of Connection-Specific Headers in h2c
Date: Sat, 15 Nov 2014 11:29:25 +0900
Hi,
On Sat, Nov 15, 2014 at 2:01 AM, Samuel Hurst <samuelh_at_rd.bbc.co.uk> wrote:
> Hi Tatsuhiro,
>
> On 14/11/2014 15:42, Tatsuhiro Tsujikawa wrote:
> > I found the bug that curl unconditionally sends Upgrade headers
> > to server even after the connection was upgraded to HTTP/2. The
> > attached patch fixes this bug.
>
> Thanks for the patch, it does solve the initial issue but similarly to
> my own fix I've been working on today it seems to expose a different
> issue. It seems that the client is sending two HEADERS frames for two
> resources in very short order, and when the server attempts to respond
> the client is sending RST_STREAM with a flagged protocol error.
>
> The below is a paraphrased wireshark log showing the issue (sadly
> can't attach the full trace as it contains sensitive information):
>
> E.g.
> Source | Destination | Protocol | Info (Stream IDs)
> 10.0.2.15 | 172.29.1.10 | HTTP | GET /1/IS.mp4 HTTP/1.1
> 172.29.1.10 | 10.0.2.15 | HTTP | HTTP/1.1 101 Switching Protocols
> 10.0.2.15 | 172.29.1.10 | HTTP2 | Magic
> 172.29.1.10 | 10.0.2.15 | HTTP2 | HEADERS (1) [Status200], DATA
> (1), DATA (1)
> 10.0.2.15 | 172.29.1.10 | HTTP2 | SETTINGS
> 172.29.1.10 | 10.0.2.15 | HTTP2 | SETTINGS [ACK above]
> 10.0.2.15 | 172.29.1.10 | HTTP2 | HEADERS (3) [GET /1/V1.mp4]
> 10.0.2.15 | 172.29.1.10 | HTTP2 | HEADERS (5) [GET /1/A1.mp4]
> 172.29.1.10 | 10.0.2.15 | HTTP2 | HEADERS (3) [Status200], DATA (3)
> 10.0.2.15 | 172.29.1.10 | HTTP2 | RST_STREAM (3)
> 172.29.1.10 | 10.0.2.15 | HTTP2 | HEADERS (5) [Status200], DATA (5)
> ...
>
> I only see the behaviour when I see two HEADERS frames sent before the
> server could respond. Otherwise transmission is fine. I'm also not so
> sure whether the second 0x1-flagged DATA frame shows up, my version of
> Wireshark is having some issues with HTTP2 packets with long
> content-lengths.
>
> Settings are whatever nghttp2 uses as defaults as I am not explicitly
> setting them. (This seems to be max number of concurrent streams as
> 100 and window size 65535)
>
> I'm actually on holiday next week so any further discussion on this
> will probably come from my colleague Lucas Pardue.
>
>
As far as I know, libcurl HTTP/2 code does not handle concurrent request
handling yet.
So appearing more than 1 concurrent requests in same HTTP/2 connection is
unexpected, but you see this happening.
I'm wandering how to reproduce this issue. It seems curl tool does not do
this.
It may be due to curl multi interface, so I just experimented with
multi-app.c example program (attached in this mail). But I could not see
this issue in there.
I'm totally new to curl multi interface, so could you send me your code (or
something stripped version to delete confidential parts, but enough to make
reproduce this issue)?
Best regards,
Tatsuhiro Tsujikawa
>
>
> Best Regards,
> Sam
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/x-csrc attachment: multi-app.c