cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: left for http2

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 3 Feb 2014 22:43:58 +0100 (CET)

On Sat, 1 Feb 2014, Tatsuhiro Tsujikawa wrote:

Thanks for taking this forward!

> Currently, we copy the header name/value pair emitted by nghttp2 to fixed
> buffer and pass it to the upper layer. We special case ":status" header
> field to produce HTTP/1 status line. The thing is that ":status" header
> field is not always emitted first.

Yeah, that was a bit of a silly shortcut in this first implementation of mine.

> I don't have good idea other than buffering up whole header set and detect
> :status and produce status line. Maybe we can do a hack to leave room for
> status line ("HTTP/2.0 "+3 digits +"\r\n") to reduce copying. But it seems
> to me buffering up all header block is inevitable. What do you think about
> this issue?

I don't think we have much choice. We at least need to buffer until :status
has been received, and I'm not sure it makes sense to do the extra logic it
would take to stop the buffering at the receival of that header. Let's buffer
the whole thing until end of headers.

Of course we'll have to set a maximum size we allow the headers to use before
we consider it bad, to avoid a plain DOS or just memory over-use.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-03