Subject: HTTP/2 plaintext upgrade

From: Cory Benfield <[email-masked]>
Date: Thu, 26 Jan 2017 10:13:30 +0000

I’ve got a question about HTTP/2 plaintext upgrade. RFC 7540 Section 3.2.1 says about the HTTP2-Settings header field:

> The content of the HTTP2-Settings header field is the payload of a SETTINGS frame

My initial implementation provided an entire SETTINGS frame in the HTTP2-Settings field, but a contributor has pointed out that the word “payload” may mean that only the body of the SETTINGS frame should be provided. It’s not really entirely clear to me in the text which I should do, and there are no textual examples either, so I’m genuinely not sure.

Can I get an idea of what other implementers have done here?

Cory

---

From: Loïc Hoguin <[email-masked]>
Date: Thu, 26 Jan 2017 11:35:14 +0100

Hello,

> Can I get an idea of what other implementers have done here?

I understood "payload" as the frame payload defined in section 4.1:

    All frames begin with a fixed 9-octet header followed by a variable-
    length payload.

     +-----------------------------------------------+
     |                 Length (24)                   |
     +---------------+---------------+---------------+
     |   Type (8)    |   Flags (8)   |
     +-+-------------+---------------+-------------------------------+
     |R|                 Stream Identifier (31)                      |
     +=+=============================================================+
     |                   Frame Payload (0...)                      ...
     +---------------------------------------------------------------+

I have however only used this with a client I implemented myself.

-- 
Loïc Hoguin
https://ninenines.eu

---

From: Daniel Stenberg <[email-masked]>
Date: Thu, 26 Jan 2017 15:28:56 +0100 (CET)

> Can I get an idea of what other implementers have done here?

A suppose many do like curl and use nghttp2_frame_pack_settings_payload() [1] 
for this. It is just a number of settings and their values encoded as section 
6.5.1 [2] describes

Right now I can't really remember exactly what sort of interop we have with 
this. I suspect we don't have too many users actually using h2 plaintext.

[1] = https://nghttp2.org/documentation/nghttp2_pack_settings_payload.html
[2] = http://httpwg.org/specs/rfc7540.html#SettingFormat

-- 

  / daniel.haxx.se

---

From: Kazuho Oku <[email-masked]>
Date: Fri, 27 Jan 2017 11:09:22 +0900

> Can I get an idea of what other implementers have done here?

I think the most direct answer to the quession would be the following
sentence in section 6.5.1.

   The payload of a SETTINGS frame consists of zero or more parameters,
   each consisting of an unsigned 16-bit setting identifier and an
   unsigned 32-bit value.

-- 
Kazuho Oku