Skip to content

Commit

Permalink
fix build errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
na-trium-144 committed Dec 16, 2024
1 parent bdc1e6d commit f563217
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/crow/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ namespace crow // NOTE: Already documented in "crow/app.h"
void handle_upgrade(const request& req, response&, UnixSocketAdaptor&& adaptor) override
{
max_payload_ = max_payload_override_ ? max_payload_ : app_->websocket_max_payload();
new crow::websocket::Connection<UnixSocketAdaptor, App>(req, std::move(adaptor), app_, max_payload_, open_handler_, message_handler_, close_handler_, error_handler_, accept_handler_);
new crow::websocket::Connection<UnixSocketAdaptor, App>(req, std::move(adaptor), app_, max_payload_, subprotocols_, open_handler_, message_handler_, close_handler_, error_handler_, accept_handler_);
}
#ifdef CROW_ENABLE_SSL
void handle_upgrade(const request& req, response&, SSLAdaptor&& adaptor) override
Expand Down
16 changes: 12 additions & 4 deletions include/crow/socket_acceptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace crow
{
using endpoint = tcp::endpoint;
tcp::acceptor acceptor_;
TCPAcceptor(asio::io_service& io_service, const endpoint& endpoint):
acceptor_(io_service, endpoint) {}
TCPAcceptor(asio::io_service& io_service, const endpoint& endpoint_):
acceptor_(io_service, endpoint_) {}

int16_t port() const
{
Expand All @@ -28,14 +28,18 @@ namespace crow
{
return acceptor_;
}
endpoint local_endpoint() const
{
return acceptor_.local_endpoint();
}
};

struct UnixSocketAcceptor
{
using endpoint = stream_protocol::endpoint;
stream_protocol::acceptor acceptor_;
UnixSocketAcceptor(asio::io_service& io_service, const endpoint& endpoint):
acceptor_(io_service, endpoint, false) {}
UnixSocketAcceptor(asio::io_service& io_service, const endpoint& endpoint_):
acceptor_(io_service, endpoint_, false) {}
// reuse addr must be false (https://github.com/chriskohlhoff/asio/issues/622)

int16_t port() const
Expand All @@ -50,5 +54,9 @@ namespace crow
{
return acceptor_;
}
endpoint local_endpoint() const
{
return acceptor_.local_endpoint();
}
};
} // namespace crow

0 comments on commit f563217

Please sign in to comment.