Boost logo

Boost :

Subject: Re: [boost] [beast] Chunking example
From: Bjorn Reese (breese_at_[hidden])
Date: 2017-07-06 19:41:50

On 07/04/2017 08:18 PM, Vinnie Falco via Boost wrote:

> With respect to detecting chunk boundaries on input, this is possible,
> but... I can't guarantee it on output. In fact I'm not even sure how

Why not? When the user passes a buffer to Beast in chunked-mode, then
serialization can convert it directly into a chunk. That ought to be
very easy to do.

> you would convince Beast to keep a message in "perpetually sending"
> mode since that is a use-case not anticipated by rfc7230.

Are you implying that Beast has an upper limit for persistent
connections? If not, what are you trying to tell me?

The use cases I have mentioned are way older than RFC 7230 (and RFC 6455
to answer your "why not WebSocket?" question.)

> I suppose I could easily add an optional user-facing callback to
> beast::http::parser with the signature <void(std::uint64_t,
> string_view, error_code&> to allow users to easily detect chunk
> boundaries during parsing. It would be a handful of lines of code

A simpler model is to send a buffer when it is passed to Beast, and
likewise pass a chunk to the application as it is parsed. This preserves
the chunk boundaries without any special facilities.

> I think if users demand control over outgoing chunks, its reasonable
> to ask that they manually output the chunked message body; Beast will
> take care of the header.

Does this mean that the user has to manually insert chunk-size etc?

Boost list run by bdawes at, gregod at, cpdaniel at, john at