Subject: last example on 8.1.1 is faulty?

From: Salvatore Loreto <[email-masked]>
Date: Sat, 5 Oct 2013 18:31:45 +0300

The last example on 8.1.1 seems to be faulty

      HTTP/1.1 200 OK               HEADERS
      Content-Type: image/jpeg ===>   - END_STREAM
      Content-Length: 123             + END_HEADERS
      TE: trailers                      :status        = 200
      123                               content-type   = image/jpeg
      {binary data}                     content-length = 123
      0
      Foo: bar                      DATA
                                      - END_STREAM
                                        {binary data}

                                    HEADERS
                                      + END_STREAM
                                      + END_HEADERS
                                        foo: bar

The TE header is a request header. It should probably be 
Transfer-Encoding: chunked.
Also content-length and Transfer-Enconding are not use at the ame time.
It is a little bit unclear how indication of content length (closing the 
connection, content-length
or transfer encoding: chunked as in HTTP/1.0 and 1.1) relates to the 
END_STREAM and END_HEADERS flags.
For dynamically generated content, content-length is not always known, 
so can content-length be used
in this particular example?

cheers
Salvatore

www.sloreto.com

---

From: Martin Thomson <[email-masked]>
Date: Mon, 7 Oct 2013 15:00:57 -0700

On 5 October 2013 08:31, Salvatore Loreto <[email-masked]> wrote:
> The TE header is a request header. It should probably be Transfer-Encoding:
> chunked.

TE: trailers is used solely to signal the presence of trailers.

Transfer-Encoding is absent, yes.  That's an omission.

> Also content-length and Transfer-Enconding are not use at the ame time.

I'm not aware of a mutual exclusion clause, but I'm not looking very
hard right now.  Content-Length becomes merely metadata in both cases.

> END_STREAM and END_HEADERS flags.

The last DATA frame on a stream terminates the payload.

> For dynamically generated content, content-length is not always known, so
> can content-length be used

We could skip it, but what value does that provide?