permessage-deflate is a compile-time feature (API Change):

fix #849

This adds an additional `bool` template parameter to
`websocket::stream`:

* When deflateSupported is `true`, the stream will be capable
  of negotiating the permessage-deflate websocket extension per
  the configured run-time settings.

* When deflateSupported is `false`, the stream will never negotiate
  the permessage-deflate websocket extension. Furthermore, all of the
  code necessary for implementing the permessage-deflate extension
  will be excluded from function instantiations. The resulting emitted
  object code should be smaller.
This commit is contained in:
Vinnie Falco
2017-11-18 16:52:18 -08:00
parent 65d92f62fb
commit 841ab8474b
20 changed files with 1315 additions and 721 deletions
+11 -1
View File
@@ -57,7 +57,7 @@ boost::asio::ip::tcp::socket sock{ioc};
{
//[ws_snippet_6
std::string const host = "mywebapp.com";
std::string const host = "example.com";
boost::asio::ip::tcp::resolver r{ioc};
stream<boost::asio::ip::tcp::socket> ws{ioc};
auto const results = r.resolve(host, "ws");
@@ -310,6 +310,16 @@ struct custom_wrapper
//]
//[ws_snippet_26
// A WebSocket stream
template<
class NextLayer,
bool deflateSupported = true>
class stream;
//]
} // doc_ws_snippets
//------------------------------------------------------------------------------