Subject: CONTINUATION frames on half-closed streams?

From: Joe DeVivo <[email-masked]>
Date: Thu, 28 Jan 2016 20:40:32 +0000

Section 6.2 of RFC-7540 says:

A HEADERS frame carries the END_STREAM flag that signals the end
of a stream.  However, a HEADERS frame with the END_STREAM flag
set can be followed by CONTINUATION frames on the same stream.
Logically, the CONTINUATION frames are part of the HEADERS frame.

And Section 5.1 says under the idle stream state:

Sending or receiving a HEADERS frame causes the stream to
become "open".  The stream identifier is selected as described
in Section 5.1.1.  The same HEADERS frame can also cause a
stream to immediately become "half-closed".

Section 5.1 goes on to say under the half-closed (local) state:

A stream that is in the "half-closed (local)" state cannot be used
for sending frames other than WINDOW_UPDATE, PRIORITY, and
RST_STREAM.

But, the two statements above make me think that a half-closed stream could also send one or more CONTINUATION frames if it first sends a HEADERS frame with the END_STREAM flag set, but not the END_HEADERS flag set.

I can read the spec both ways, so I'd appreciate some clarification.

Thanks,

--joe

---

From: Martin Thomson <[email-masked]>
Date: Fri, 29 Jan 2016 09:12:04 +1100

On 29 January 2016 at 07:40, Joe DeVivo <[email-masked]> wrote:
> But, the two statements above make me think that a half-closed stream could
> also send one or more CONTINUATION frames if it first sends a HEADERS frame
> with the END_STREAM flag set, but not the END_HEADERS flag set.

Here's how to think of it (and this is in your first quote):  A
CONTINUATION frame is just part of the previous HEADERS frame.  The
stream is only half-closed AFTER the frame is completely sent, which
includes any CONTINUATION frames.

Note that Section 5.1 also says:

> In this regard, CONTINUATION frames do not result in state transitions; they are effectively part of the HEADERS or PUSH_PROMISE that they follow. For the purpose of state transitions, the END_STREAM flag is processed as a separate event to the frame that bears it; a HEADERS frame with the END_STREAM flag set can cause two state transitions.

---

From: Joe DeVivo <[email-masked]>
Date: Thu, 28 Jan 2016 22:14:00 +0000

That makes perfect sense, and means less work for me :D 

Thanks!

On Thu, Jan 28, 2016 at 3:12 PM, Martin Thomson <[email-masked] <mailto:[email-masked]>> wrote: