2 Jul
2017
2 Jul
'17
1:56 p.m.
On Sun, Jul 2, 2017 at 6:52 AM, Bjorn Reese via Boost
Can I differentiate between headers and trailers, or are they mixed together?
They are mixed together. You can look at the "Trailer" field after receiving the header to know which trailers have been promised. And then when the message is complete, inspect the headers again looking for those specific fields. If you absolutely need to distinguish them, for example to perform more robust error checking, reject trailers which were not promised or which are disallowed as per rfc7230, then you can subclass basic_parser and provide a suitable implementation of on_field. In this case you could store them in a separate container if desired.