mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
enable server initiated s2c_no_context_takeover
This commit is contained in:
@@ -114,3 +114,13 @@ BOOST_AUTO_TEST_CASE( negotiate_s2c_no_context_takeover ) {
|
||||
BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() );
|
||||
BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; s2c_no_context_takeover");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( negotiate_s2c_no_context_takeover_server_initiated ) {
|
||||
ext_vars v;
|
||||
|
||||
v.exts.enable_s2c_no_context_takeover();
|
||||
v.esp = v.exts.negotiate(v.attr);
|
||||
BOOST_CHECK( v.exts.is_enabled() );
|
||||
BOOST_CHECK_EQUAL( v.esp.first, websocketpp::lib::error_code() );
|
||||
BOOST_CHECK_EQUAL( v.esp.second, "permessage-deflate; s2c_no_context_takeover");
|
||||
}
|
||||
|
||||
@@ -198,6 +198,32 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Reset server's outgoing LZ77 sliding window for each new message
|
||||
/**
|
||||
* Enabling this setting will cause the server's compressor to reset the
|
||||
* compression state (the LZ77 sliding window) for every message. This
|
||||
* means that the compressor will not look back to patterns in previous
|
||||
* messages to improve compression. This will reduce the compression
|
||||
* efficiency for large messages somewhat and small messages drastically.
|
||||
*
|
||||
* This option may reduce server compressor memory usage and client
|
||||
* decompressor memory usage.
|
||||
* @todo Document to what extent memory usage will be reduced
|
||||
*
|
||||
* For clients, this option is dependent on server support. Enabling it
|
||||
* via this method does not guarantee that it will be successfully
|
||||
* negotiated, only that it will be requested.
|
||||
*
|
||||
* For servers, no client support is required. Enabling this option on a
|
||||
* server will result in its use. The server will signal to clients that
|
||||
* the option will be in use so they can optimize resource usage if they
|
||||
* are able.
|
||||
*/
|
||||
void enable_s2c_no_context_takeover() {
|
||||
m_s2c_no_context_takeover = true;
|
||||
}
|
||||
|
||||
|
||||
/// Generate extension offer
|
||||
/**
|
||||
* Creates an offer string to include in the Sec-WebSocket-Extensions
|
||||
|
||||
Reference in New Issue
Block a user