forked from boostorg/beast
Improve performance of http::string_to_verb
`operator==` performs better than the hand-written comparison routine. fix #1636 Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
7 files changed
+218
-174
No files matched your search
@@ -47,11 +47,12 @@ make_sec_ws_accept(
|
||||
string_view key)
|
||||
{
|
||||
BOOST_ASSERT(key.size() <= sec_ws_key_type::max_size_n);
|
||||
auto const& guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
|
||||
using beast::detail::operator "" _sv;
|
||||
auto const guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"_sv;
|
||||
beast::detail::sha1_context ctx;
|
||||
beast::detail::init(ctx);
|
||||
beast::detail::update(ctx, key.data(), key.size());
|
||||
beast::detail::update(ctx, guid, sizeof(guid) - 1);
|
||||
beast::detail::update(ctx, guid.data(), guid.size());
|
||||
char digest[beast::detail::sha1_context::digest_size];
|
||||
beast::detail::finish(ctx, &digest[0]);
|
||||
accept.resize(accept.max_size());
|
||||
|
||||
Reference in new issue
Block a user