msgid ""
msgstr ""
"Project-Id-Version: English (Boost Beast Translation (zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-06 22:36+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: English <https://insights.cppalliance.org/weblate/projects/"
"boost-beast-documentation-zh_Hans/doc-qbk-04-http-08-chunked-encoding-qbk/"
"en/>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2026.5\n"

#. type: section title
#: 10
#, read-only
msgid "Chunked Encoding"
msgstr "Chunked Encoding"

#. type: paragraph
#: 12
#, read-only
msgid ""
"For message payloads whose size is not known ahead of time, HTTP version 1.1 "
"defines the [@https://tools.ietf.org/html/rfc7230#section-4.1 ['chunked]] "
"transfer coding. This coding consists of zero or more [@https://"
"tools.ietf.org/html/rfc7230#section-4.1 ['chunked bodies]], followed by a "
"[@https://tools.ietf.org/html/rfc7230#section-4.1 ['last chunk]]. Each "
"chunked body may contain optional application-defined, connection-specific "
"[@https://tools.ietf.org/html/rfc7230#section-4.1.1 ['chunk-extensions]]. "
"The last chunk may contain additional HTTP field values in a section of the "
"last chunk called a [@https://tools.ietf.org/html/rfc7230#section-4.1.2 "
"['chunk-trailer]]. The field values are \"promised\" in the header as a "
"comma delimited list of field names in the [@https://tools.ietf.org/html/"
"rfc7230#section-4.4 [*Trailer]] field value. Clients indicate their "
"willingness to accept trailers by including the \"trailers\" token in the "
"[@https://tools.ietf.org/html/rfc7230#section-4.3 [*TE]] field value."
msgstr ""
"For message payloads whose size is not known ahead of time, HTTP version 1.1 "
"defines the [@https://tools.ietf.org/html/rfc7230#section-4.1 ['chunked]] "
"transfer coding. This coding consists of zero or more [@https://"
"tools.ietf.org/html/rfc7230#section-4.1 ['chunked bodies]], followed by a "
"[@https://tools.ietf.org/html/rfc7230#section-4.1 ['last chunk]]. Each "
"chunked body may contain optional application-defined, connection-specific "
"[@https://tools.ietf.org/html/rfc7230#section-4.1.1 ['chunk-extensions]]. "
"The last chunk may contain additional HTTP field values in a section of the "
"last chunk called a [@https://tools.ietf.org/html/rfc7230#section-4.1.2 "
"['chunk-trailer]]. The field values are \"promised\" in the header as a "
"comma delimited list of field names in the [@https://tools.ietf.org/html/"
"rfc7230#section-4.4 [*Trailer]] field value. Clients indicate their "
"willingness to accept trailers by including the \"trailers\" token in the "
"[@https://tools.ietf.org/html/rfc7230#section-4.3 [*TE]] field value."

#. type: heading
#: 32
#, read-only
msgid "Serializing Chunks"
msgstr "Serializing Chunks"

#. type: paragraph
#: 34
#, read-only
msgid ""
"The __serializer__ automatically applies the chunked transfer encoding when "
"a message returns `true` from [link "
"beast.ref.boost__beast__http__message.chunked.overload1 `message::chunked`]. "
"The boundaries between chunks emitted by the serializer are implementation "
"defined. Chunk extensions and trailers are omitted. Applications which need "
"precise control over the chunk boundaries, extensions, and trailers may use "
"a set of helper classes which enable manual emission of message payloads "
"using chunk encoding."
msgstr ""
"The __serializer__ automatically applies the chunked transfer encoding when "
"a message returns `true` from [link "
"beast.ref.boost__beast__http__message.chunked.overload1 `message::chunked`]. "
"The boundaries between chunks emitted by the serializer are implementation "
"defined. Chunk extensions and trailers are omitted. Applications which need "
"precise control over the chunk boundaries, extensions, and trailers may use "
"a set of helper classes which enable manual emission of message payloads "
"using chunk encoding."

#. type: paragraph
#: 43
#, read-only
msgid ""
"To use these helper classes, first serialize the header portion of the "
"message using the standard interface. Then prepare the buffers, chunk "
"extensions, and desired trailers, and use them with these helpers:"
msgstr ""
"To use these helper classes, first serialize the header portion of the "
"message using the standard interface. Then prepare the buffers, chunk "
"extensions, and desired trailers, and use them with these helpers:"

#. type: table title
#: 47
#, read-only
msgid "Chunking Helpers"
msgstr "Chunking Helpers"

#. type: table cell
#: 47
#, read-only
msgctxt "47"
msgid "Name"
msgstr "Name"

#. type: table cell
#: 47
#, read-only
msgctxt "47"
msgid "Description"
msgstr "Description"

#. type: table cell
#: 47
#, read-only
msgid "[link beast.ref.boost__beast__http__chunk_body `chunk_body`]"
msgstr "[link beast.ref.boost__beast__http__chunk_body `chunk_body`]"

#. type: table cell
#: 47
#, read-only
msgid "A buffer sequence representing a complete chunk body."
msgstr "A buffer sequence representing a complete chunk body."

#. type: table cell
#: 47
#, read-only
msgid "[link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`]"
msgstr "[link beast.ref.boost__beast__http__chunk_crlf `chunk_crlf`]"

#. type: table cell
#: 47
#, read-only
msgid ""
"A buffer sequence representing the CRLF (`\"\\r\\n\"`) delimiter. This class "
"is used when the caller desires to emit the chunk body in two or more "
"individual stream operations."
msgstr ""
"A buffer sequence representing the CRLF (`\"\\r\\n\"`) delimiter. This class "
"is used when the caller desires to emit the chunk body in two or more "
"individual stream operations."

#. type: table cell
#: 47
#, read-only
msgid ""
"[link beast.ref.boost__beast__http__chunk_extensions `chunk_extensions`]\n"
"\n"
"[link beast.ref.boost__beast__http__basic_chunk_extensions "
"`basic_chunk_extensions`]"
msgstr ""
"[link beast.ref.boost__beast__http__chunk_extensions `chunk_extensions`]\n"
"\n"
"[link beast.ref.boost__beast__http__basic_chunk_extensions "
"`basic_chunk_extensions`]"

#. type: table cell
#: 47
#, read-only
msgid ""
"This is a simple, allocating container which lets callers easily build up a "
"set of chunk extensions."
msgstr ""
"This is a simple, allocating container which lets callers easily build up a "
"set of chunk extensions."

#. type: table cell
#: 47
#, read-only
msgid "[link beast.ref.boost__beast__http__chunk_header `chunk_header`]"
msgstr "[link beast.ref.boost__beast__http__chunk_header `chunk_header`]"

#. type: table cell
#: 47
#, read-only
msgid ""
"A buffer sequence representing a hex-encoded chunk size, followed by an "
"optional set of chunk extensions, including the terminating CRLF (`\"\\r\\"
"n\"`) delimiter which precedes the chunk body. This class is used when the "
"caller desires to emit the chunk body in two or more individual stream "
"operations."
msgstr ""
"A buffer sequence representing a hex-encoded chunk size, followed by an "
"optional set of chunk extensions, including the terminating CRLF (`\"\\r\\"
"n\"`) delimiter which precedes the chunk body. This class is used when the "
"caller desires to emit the chunk body in two or more individual stream "
"operations."

#. type: table cell
#: 47
#, read-only
msgid "[link beast.ref.boost__beast__http__chunk_last `chunk_last`]"
msgstr "[link beast.ref.boost__beast__http__chunk_last `chunk_last`]"

#. type: table cell
#: 47
#, read-only
msgid ""
"A buffer sequence representing a last chunk. The last chunk indicates the "
"end of the chunked message payload, and may contain optional trailer fields."
msgstr ""
"A buffer sequence representing a last chunk. The last chunk indicates the "
"end of the chunked message payload, and may contain optional trailer fields."

#. type: table cell
#: 47
#, read-only
msgid ""
"[link beast.ref.boost__beast__http__make_chunk `make_chunk`]\n"
"\n"
"[link beast.ref.boost__beast__http__make_chunk_last `make_chunk_last`]"
msgstr ""
"[link beast.ref.boost__beast__http__make_chunk `make_chunk`]\n"
"\n"
"[link beast.ref.boost__beast__http__make_chunk_last `make_chunk_last`]"

#. type: table cell
#: 47
#, read-only
msgid ""
"These helper functions are used to construct a chunk or last chunk directly "
"at call sites."
msgstr ""
"These helper functions are used to construct a chunk or last chunk directly "
"at call sites."

#. type: paragraph
#: 101
#, read-only
msgid ""
"We demonstrate the use of these objects first by declaring a function which "
"returns the next buffer sequence to use as a chunk body:"
msgstr ""
"We demonstrate the use of these objects first by declaring a function which "
"returns the next buffer sequence to use as a chunk body:"

#. type: paragraph
#: 106
#, read-only
msgid ""
"This example demonstrates sending a complete chunked message payload "
"manually. No chunk extensions or trailers are emitted:"
msgstr ""
"This example demonstrates sending a complete chunked message payload "
"manually. No chunk extensions or trailers are emitted:"

#. type: paragraph
#: 111
#, read-only
msgid ""
"The following code sends additional chunks, and sets chunk extensions using "
"the helper container. The container automatically quotes values in the "
"serialized output when necessary:"
msgstr ""
"The following code sends additional chunks, and sets chunk extensions using "
"the helper container. The container automatically quotes values in the "
"serialized output when necessary:"

#. type: paragraph
#: 117
#, read-only
msgid ""
"Callers can take over the generation and management of the extensions buffer "
"by passing a non-owning string. Note that this requires the string contents "
"to adhere to the correct syntax for chunk extensions, including the needed "
"double quotes for values which contain spaces:"
msgstr ""
"Callers can take over the generation and management of the extensions buffer "
"by passing a non-owning string. Note that this requires the string contents "
"to adhere to the correct syntax for chunk extensions, including the needed "
"double quotes for values which contain spaces:"

#. type: paragraph
#: 124
#, read-only
msgid ""
"The next code sample emits a chunked response which promises two trailer "
"fields and delivers them in the last chunk. The implementation allocates "
"memory using the default or a passed-in allocator to hold the state "
"information required to serialize the trailer:"
msgstr ""
"The next code sample emits a chunked response which promises two trailer "
"fields and delivers them in the last chunk. The implementation allocates "
"memory using the default or a passed-in allocator to hold the state "
"information required to serialize the trailer:"

#. type: paragraph
#: 131
#, read-only
msgid "Using a custom allocator to serialize the last chunk:"
msgstr "Using a custom allocator to serialize the last chunk:"

#. type: paragraph
#: 135
#, read-only
msgid ""
"Alternatively, callers can take over the generation and lifetime management "
"of the serialized trailer fields by passing in a non-owning string:"
msgstr ""
"Alternatively, callers can take over the generation and lifetime management "
"of the serialized trailer fields by passing in a non-owning string:"

#. type: paragraph
#: 141
#, read-only
msgid ""
"For the ultimate level of control, a caller can manually compose the chunk "
"itself by first emitting a header with the correct chunk body size, and then "
"by emitting the chunk body in multiple calls to the stream write function. "
"In this case the caller is responsible for also emitting the terminating "
"CRLF (`\"\\r\\n\"`):"
msgstr ""
"For the ultimate level of control, a caller can manually compose the chunk "
"itself by first emitting a header with the correct chunk body size, and then "
"by emitting the chunk body in multiple calls to the stream write function. "
"In this case the caller is responsible for also emitting the terminating "
"CRLF (`\"\\r\\n\"`):"

#. type: heading
#: 149
#, read-only
msgid "Parsing Chunks"
msgstr "Parsing Chunks"

#. type: paragraph
#: 151
#, read-only
msgid ""
"The __parser__ automatically removes the chunked transfer coding when it is "
"the last encoding in the list. However, it also discards the chunk "
"extensions and does not provide a way to determine the boundaries between "
"chunks. Advanced applications which need to access the chunk extensions or "
"read complete individual chunks may use a callback interface provided by "
"__parser__:"
msgstr ""
"The __parser__ automatically removes the chunked transfer coding when it is "
"the last encoding in the list. However, it also discards the chunk "
"extensions and does not provide a way to determine the boundaries between "
"chunks. Advanced applications which need to access the chunk extensions or "
"read complete individual chunks may use a callback interface provided by "
"__parser__:"

#. type: table title
#: 158
#, read-only
msgid "Chunking Parse Callbacks"
msgstr "Chunking Parse Callbacks"

#. type: table cell
#: 158
#, read-only
msgctxt "158"
msgid "Name"
msgstr "Name"

#. type: table cell
#: 158
#, read-only
msgctxt "158"
msgid "Description"
msgstr "Description"

#. type: table cell
#: 158
#, read-only
msgid ""
"[link beast.ref.boost__beast__http__parser.on_chunk_header `on_chunk_header`]"
msgstr ""
"[link beast.ref.boost__beast__http__parser.on_chunk_header `on_chunk_header`]"

#. type: table cell
#: 158
#, read-only
msgid ""
"Set a callback to be invoked on each chunk header.\n"
"\n"
"The callback will be invoked once for every chunk in the message payload, as "
"well as once for the last chunk. The invocation happens after the chunk "
"header is available but before any body octets have been parsed.\n"
"\n"
"The extensions are provided in raw, validated form, use [link "
"beast.ref.boost__beast__http__basic_chunk_extensions.parse "
"`chunk_extensions::parse`] to parse the extensions into a structured "
"container for easier access. The implementation type-erases the callback "
"without requiring a dynamic allocation. For this reason, the callback object "
"is passed by a non-constant reference.\n"
"\n"
"The function object will be called with this equivalent signature:"
msgstr ""
"Set a callback to be invoked on each chunk header.\n"
"\n"
"The callback will be invoked once for every chunk in the message payload, as "
"well as once for the last chunk. The invocation happens after the chunk "
"header is available but before any body octets have been parsed.\n"
"\n"
"The extensions are provided in raw, validated form, use [link "
"beast.ref.boost__beast__http__basic_chunk_extensions.parse "
"`chunk_extensions::parse`] to parse the extensions into a structured "
"container for easier access. The implementation type-erases the callback "
"without requiring a dynamic allocation. For this reason, the callback object "
"is passed by a non-constant reference.\n"
"\n"
"The function object will be called with this equivalent signature:"

#. type: table cell
#: 158
#, read-only
msgid ""
"[link beast.ref.boost__beast__http__parser.on_chunk_body `on_chunk_body`]"
msgstr ""
"[link beast.ref.boost__beast__http__parser.on_chunk_body `on_chunk_body`]"

#. type: table cell
#: 158
#, read-only
msgid ""
"Set a callback to be invoked on chunk body data.\n"
"\n"
"The callback will be invoked one or more times to provide buffers "
"corresponding to the chunk body for the current chunk. The callback receives "
"the number of octets remaining in this chunk body including the octets in "
"the buffer provided.\n"
"\n"
"The callback must return the number of octets actually consumed. Any octets "
"not consumed will be presented again in a subsequent invocation of the "
"callback. The implementation type-erases the callback without requiring a "
"dynamic allocation. For this reason, the callback object is passed by a non-"
"constant reference.\n"
"\n"
"The function object will be called with this equivalent signature:"
msgstr ""
"Set a callback to be invoked on chunk body data.\n"
"\n"
"The callback will be invoked one or more times to provide buffers "
"corresponding to the chunk body for the current chunk. The callback receives "
"the number of octets remaining in this chunk body including the octets in "
"the buffer provided.\n"
"\n"
"The callback must return the number of octets actually consumed. Any octets "
"not consumed will be presented again in a subsequent invocation of the "
"callback. The implementation type-erases the callback without requiring a "
"dynamic allocation. For this reason, the callback object is passed by a non-"
"constant reference.\n"
"\n"
"The function object will be called with this equivalent signature:"

#. type: paragraph
#: 214
#, read-only
msgid ""
"This example will read a message header from the stream, and then manually "
"read each chunk. It recognizes the chunk boundaries and outputs the contents "
"of each chunk as it comes in. Any chunk extensions are printed, each "
"extension on its own line. Finally, any trailers promised in the header are "
"printed."
msgstr ""
"This example will read a message header from the stream, and then manually "
"read each chunk. It recognizes the chunk boundaries and outputs the contents "
"of each chunk as it comes in. Any chunk extensions are printed, each "
"extension on its own line. Finally, any trailers promised in the header are "
"printed."

#. type: paragraph
#: 221
#, read-only
msgid ""
"Given the HTTP response as input on the left, the output of the function "
"shown above is shown on the right:"
msgstr ""
"Given the HTTP response as input on the left, the output of the function "
"shown above is shown on the right:"

#. type: table title
#: 224
#, read-only
msgid "Chunk Parsing Example Output"
msgstr "Chunk Parsing Example Output"

#. type: table cell
#: 224
#, read-only
msgid "Input"
msgstr "Input"

#. type: table cell
#: 224
#, read-only
msgid "Output"
msgstr "Output"

#. type: table code
#: 224
#, read-only
msgid ""
"HTTP/1.1 200 OK\\r\\n\n"
"Server: test\\r\\n\n"
"Trailer: Expires, Content-MD5\\r\\n\n"
"Transfer-Encoding: chunked\\r\\n\n"
"\\r\\n\n"
"5\\r\\n\n"
"First\\r\\n\n"
"d;quality=1.0\\r\\n\n"
"Hello, world!\\r\\n\n"
"e;file=abc.txt;quality=0.7\\r\\n\n"
"The Next Chunk\\r\\n\n"
"8;last\\r\\n\n"
"Last one\\r\\n\n"
"0\\r\\n\n"
"Expires: never\\r\\n\n"
"Content-MD5: f4a5c16584f03d90\\r\\n\n"
"\\r\\n"
msgstr ""
"HTTP/1.1 200 OK\\r\\n\n"
"Server: test\\r\\n\n"
"Trailer: Expires, Content-MD5\\r\\n\n"
"Transfer-Encoding: chunked\\r\\n\n"
"\\r\\n\n"
"5\\r\\n\n"
"First\\r\\n\n"
"d;quality=1.0\\r\\n\n"
"Hello, world!\\r\\n\n"
"e;file=abc.txt;quality=0.7\\r\\n\n"
"The Next Chunk\\r\\n\n"
"8;last\\r\\n\n"
"Last one\\r\\n\n"
"0\\r\\n\n"
"Expires: never\\r\\n\n"
"Content-MD5: f4a5c16584f03d90\\r\\n\n"
"\\r\\n"

#. type: table code
#: 224
#, read-only
msgid ""
"Chunk Body: First\n"
"Extension: quality = 1.0\n"
"Chunk Body: Hello, world!\n"
"Extension: file = abc.txt\n"
"Extension: quality = 0.7\n"
"Chunk Body: The Next Chunk\n"
"Extension: last\n"
"Chunk Body: Last one\n"
"Expires: never\n"
"Content-MD5: f4a5c16584f03d90"
msgstr ""
"Chunk Body: First\n"
"Extension: quality = 1.0\n"
"Chunk Body: Hello, world!\n"
"Extension: file = abc.txt\n"
"Extension: quality = 0.7\n"
"Chunk Body: The Next Chunk\n"
"Extension: last\n"
"Chunk Body: Last one\n"
"Expires: never\n"
"Content-MD5: f4a5c16584f03d90"
