cURL / Mailing Lists / curl-library / Single Mail


Re: left for http2

From: Tatsuhiro Tsujikawa <>
Date: Sun, 2 Feb 2014 23:25:58 +0900

On Sat, Feb 1, 2014 at 1:15 AM, Tatsuhiro Tsujikawa

> On Fri, Jan 31, 2014 at 8:14 PM, Fabian Frank <>wrote:
>> On Jan 30, 2014, at 2:50 PM, Daniel Stenberg <> wrote:
>> > 1 - send the request using plain HTTP2 HEADERS when connecting over
>> https://
>> > (and when using re-used http2)
>> I have worked on this today and the current progress is attached. Unless
>> someone wants to build on top of it, no need to merge, I plan to continue
>> cleaning it up and handle stopping the HTTP1 logic correctly as well as
>> swapping the send/receive callbacks correctly for SSL connections.
> Good progress. client header and SETTINGS submissions look good.
> Coincidentally, I did same approach. Patch is attached below.
> The idea is mostly the same, I add some extra code such as converting HTTP
> header from curl to HTTP2 format and calls underlying recv/send callback
> including TLS and non-TLS.
> I send client header and request in http2_send, but this is because I have
> no idea where http_conn is initialized. As I commented in the code, it is
> cleaner to add dedicated function for HTTP2 request, since http2_send is
> also used upload.
> Anyway, with this patch, one can transfer contents from
> and from nghttp2 test server in plain HTTP as well, which is pretty good.
> The code still has rough edges. The notable one is I could not
> figure out how to call nghttp2_session_send() when underlying
> socket is writable.
I took the liberty of going forward and made additional improvements.
The patch attached.

This addresses the (5) in
I reused Curl_send_buffer struct to save the line of code, but the idea is
we just need buffers to store incoming header blocks and search for :status
header to correctly construct status line in HTTP/1 format.

This is basically nghttp2 specific patch. Currently, we only care about a
single stream. But the callbacks are called for the rest of the stream.
This patch ensures that we process incoming frame for stream we care about.

We moved inbuf from http2_recv to http_conn struct so that we can handle
the data in on_data_chunk_recv than remaining buffer.

Feel free to pick one or some hunks from my patch. I'm also willing to

Best regards,
Tatsuhiro Tsujikawa

List admin:

Received on 2014-02-02