Update stream write documentation for end of stream changes

This commit is contained in:
Vinnie Falco
2017-10-23 06:03:44 -07:00
parent 4337804f5d
commit 1faac0b0fb
3 changed files with 3 additions and 10 deletions

View File

@ -2,6 +2,7 @@ Version 126:
* Add CppCon2017 presentation link
* Update README.md
* Update stream write documentation for end of stream changes
--------------------------------------------------------------------------------

View File

@ -94,14 +94,7 @@ overflow attacks. The following code will print the error message:
[heading Writing]
A set of free functions allow serialization of an entire HTTP message to
a stream. If a response has no declared content length and no chunked
transfer encoding, then the end of the message is indicated by the server
closing the connection. When sending such a response, Beast will return the
[link beast.ref.boost__beast__http__error `error::end_of_stream`]
from the write algorithm to indicate
to the caller that the connection should be closed. This example
constructs and sends a response whose body length is determined by
the number of octets received prior to the server closing the connection:
a stream. This example constructs and sends an HTTP response:
[http_snippet_7]

View File

@ -116,11 +116,10 @@ void fxx() {
res.result(status::ok);
res.set(field::server, "Beast");
res.body() = "Hello, world!";
res.prepare_payload();
error_code ec;
write(sock, res, ec);
if(ec == error::end_of_stream)
sock.close();
//]
//[http_snippet_8