Fixes issue mentioned in #164: remote endpoint address and port was not correctly set. Request::remote_endpoint_address and Request::remote_endpoint_port are now functions instead of variables in order to reduce unnecessary instructions.
This commit is contained in:
parent
b9d4be229f
commit
6e0a1ec9e8
5 changed files with 35 additions and 19 deletions
|
|
@ -48,16 +48,18 @@ namespace SimpleWeb {
|
|||
asio::ssl::context context;
|
||||
|
||||
void accept() override {
|
||||
auto session = std::make_shared<Session>(config.max_request_streambuf_size, create_connection(*io_service, context));
|
||||
auto connection = create_connection(*io_service, context);
|
||||
|
||||
acceptor->async_accept(session->connection->socket->lowest_layer(), [this, session](const error_code &ec) {
|
||||
auto lock = session->connection->handler_runner->continue_lock();
|
||||
acceptor->async_accept(connection->socket->lowest_layer(), [this, connection](const error_code &ec) {
|
||||
auto lock = connection->handler_runner->continue_lock();
|
||||
if(!lock)
|
||||
return;
|
||||
|
||||
if(ec != asio::error::operation_aborted)
|
||||
this->accept();
|
||||
|
||||
auto session = std::make_shared<Session>(config.max_request_streambuf_size, connection);
|
||||
|
||||
if(!ec) {
|
||||
asio::ip::tcp::no_delay option(true);
|
||||
error_code ec;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue