From 1faac0b0fbed627e1841f21b17c3ea917f8eecbb Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 23 Oct 2017 06:03:44 -0700 Subject: [PATCH] Update stream write documentation for end of stream changes --- CHANGELOG.md | 1 + doc/qbk/04_http/03_streams.qbk | 9 +-------- test/doc/http_snippets.cpp | 3 +-- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09f7e5be..bfaa076e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 126: * Add CppCon2017 presentation link * Update README.md +* Update stream write documentation for end of stream changes -------------------------------------------------------------------------------- diff --git a/doc/qbk/04_http/03_streams.qbk b/doc/qbk/04_http/03_streams.qbk index f01771c6..fc4ed656 100644 --- a/doc/qbk/04_http/03_streams.qbk +++ b/doc/qbk/04_http/03_streams.qbk @@ -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] diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index ad930c4a..171488e5 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -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