Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
Until now parse and serialize operations apply or remove the chunked transfer coding as needed for message payloads whose size is not known ahead of time. For some domain specific niches, it is necessary to assume direct control over incoming or outgoing chunks in a chunk encoded message payload. For parsing this is achieved by setting hooks using the functions到目前为止,解析和序列化操作会根据需要自动对消息体应用或移除分块传输编码。但在某些特定领域,需要对分块编码的消息体中的传入或传出数据块进行直接控制。在解析端,可以通过设置钩子来实现:使用 [link beast.ref.boost__beast__http__parser.on_chunk_header `on_chunk_header`]and/or和/或 [link beast.ref.boost__beast__http__parser.on_chunk_body `on_chunk_body`]. For serializing callers may first emit the header, and then use these buffer sequence adapters to control the contents of each chunk including [@https://tools.ietf.org/html/rfc7230#section-4.1.1 ['chunk extensions]] and the [@https://tools.ietf.org/html/rfc7230#section-4.1.2 ['trailer-part]]:函数。在序列化端,调用方可以先发送消息头部,然后使用以下缓冲区序列适配器来控制每个数据块的内容,包括分块扩展和尾部部分:[link beast.ref.boost__beast__http__chunk_body `chunk_body`],、[link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`],、[link beast.ref.boost__beast__http__chunk_header `chunk_header`], and以及 [link beast.ref.boost__beast__http__chunk_last `chunk_last`].。