delete unnecessary
This commit is contained in:
parent
0ad4fb1e5a
commit
16ca6ebf08
@ -18,7 +18,7 @@ void ServeHttp(net::io_context& ioc,
|
|||||||
const tcp::endpoint& endpoint,
|
const tcp::endpoint& endpoint,
|
||||||
RequestHandler&& handler)
|
RequestHandler&& handler)
|
||||||
{
|
{
|
||||||
using MyListener = Listener<std::decay_t < RequestHandler>>;
|
using MyListener = Listener<std::decay_t<RequestHandler>>;
|
||||||
|
|
||||||
std::make_shared<MyListener>(ioc,
|
std::make_shared<MyListener>(ioc,
|
||||||
endpoint,
|
endpoint,
|
||||||
|
@ -45,8 +45,8 @@ class SessionBase
|
|||||||
void Write(http::response<Body, Fields>&& response)
|
void Write(http::response<Body, Fields>&& response)
|
||||||
{
|
{
|
||||||
// Запись выполняется асинхронно, поэтому response перемещаем в область кучи
|
// Запись выполняется асинхронно, поэтому response перемещаем в область кучи
|
||||||
auto safe_response = std::make_shared < http::response
|
auto safe_response = std::make_shared<http::response
|
||||||
< Body, Fields>>(std::move(response));
|
<Body, Fields>>(std::move(response));
|
||||||
|
|
||||||
auto self = GetSharedThis();
|
auto self = GetSharedThis();
|
||||||
http::async_write(stream_, *safe_response,
|
http::async_write(stream_, *safe_response,
|
||||||
@ -60,9 +60,9 @@ class SessionBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
beast::tcp_stream stream_;
|
beast::tcp_stream stream_;
|
||||||
beast::flat_buffer buffer_;
|
beast::flat_buffer buffer_;
|
||||||
HttpRequest request_;
|
HttpRequest request_;
|
||||||
|
|
||||||
void OnRead(beast::error_code ec, [[maybe_unused]] size_t bytes_read);
|
void OnRead(beast::error_code ec, [[maybe_unused]] size_t bytes_read);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user