clang-format
This commit is contained in:
parent
6b0b8ea7d5
commit
eb05777d88
|
@ -258,8 +258,7 @@ static int on_data_chunk_recv_callback(nghttp2_session *session _U_,
|
|||
stream), if it is closed, we send GOAWAY and tear down the
|
||||
session */
|
||||
static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
||||
uint32_t error_code,
|
||||
void *user_data) {
|
||||
uint32_t error_code, void *user_data) {
|
||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||
int rv;
|
||||
|
||||
|
|
|
@ -156,15 +156,9 @@ void server::start_accept(tcp::acceptor &acceptor, serve_mux &mux) {
|
|||
});
|
||||
}
|
||||
|
||||
void server::stop()
|
||||
{
|
||||
io_service_pool_.stop();
|
||||
}
|
||||
void server::stop() { io_service_pool_.stop(); }
|
||||
|
||||
void server::join()
|
||||
{
|
||||
io_service_pool_.join();
|
||||
}
|
||||
void server::join() { io_service_pool_.join(); }
|
||||
|
||||
} // namespace server
|
||||
} // namespace asio_http2
|
||||
|
|
|
@ -59,11 +59,9 @@ boost::system::error_code http2::listen_and_serve(boost::system::error_code &ec,
|
|||
return impl_->listen_and_serve(ec, nullptr, address, port, asynchronous);
|
||||
}
|
||||
|
||||
boost::system::error_code
|
||||
http2::listen_and_serve(boost::system::error_code &ec,
|
||||
boost::asio::ssl::context &tls_context,
|
||||
const std::string &address, const std::string &port,
|
||||
bool asynchronous) {
|
||||
boost::system::error_code http2::listen_and_serve(
|
||||
boost::system::error_code &ec, boost::asio::ssl::context &tls_context,
|
||||
const std::string &address, const std::string &port, bool asynchronous) {
|
||||
return impl_->listen_and_serve(ec, &tls_context, address, port, asynchronous);
|
||||
}
|
||||
|
||||
|
@ -75,15 +73,9 @@ bool http2::handle(std::string pattern, request_cb cb) {
|
|||
return impl_->handle(std::move(pattern), std::move(cb));
|
||||
}
|
||||
|
||||
void http2::stop()
|
||||
{
|
||||
impl_->stop();
|
||||
}
|
||||
void http2::stop() { impl_->stop(); }
|
||||
|
||||
void http2::join()
|
||||
{
|
||||
return impl_->join();
|
||||
}
|
||||
void http2::join() { return impl_->join(); }
|
||||
|
||||
} // namespace server
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ boost::system::error_code http2_impl::listen_and_serve(
|
|||
boost::system::error_code &ec, boost::asio::ssl::context *tls_context,
|
||||
const std::string &address, const std::string &port, bool asynchronous) {
|
||||
server_.reset(new server(num_threads_));
|
||||
return server_->listen_and_serve(ec, tls_context, address, port, backlog_, mux_, asynchronous);
|
||||
return server_->listen_and_serve(ec, tls_context, address, port, backlog_,
|
||||
mux_, asynchronous);
|
||||
}
|
||||
|
||||
void http2_impl::num_threads(size_t num_threads) { num_threads_ = num_threads; }
|
||||
|
@ -54,14 +55,9 @@ bool http2_impl::handle(std::string pattern, request_cb cb) {
|
|||
return mux_.handle(std::move(pattern), std::move(cb));
|
||||
}
|
||||
|
||||
void http2_impl::stop() {
|
||||
return server_->stop();
|
||||
}
|
||||
void http2_impl::stop() { return server_->stop(); }
|
||||
|
||||
void http2_impl::join()
|
||||
{
|
||||
return server_->join();
|
||||
}
|
||||
void http2_impl::join() { return server_->join(); }
|
||||
|
||||
} // namespace server
|
||||
|
||||
|
|
|
@ -42,11 +42,9 @@ class server;
|
|||
class http2_impl {
|
||||
public:
|
||||
http2_impl();
|
||||
boost::system::error_code
|
||||
listen_and_serve(boost::system::error_code &ec,
|
||||
boost::asio::ssl::context *tls_context,
|
||||
const std::string &address, const std::string &port,
|
||||
bool asynchronous);
|
||||
boost::system::error_code listen_and_serve(
|
||||
boost::system::error_code &ec, boost::asio::ssl::context *tls_context,
|
||||
const std::string &address, const std::string &port, bool asynchronous);
|
||||
void num_threads(size_t num_threads);
|
||||
void backlog(int backlog);
|
||||
bool handle(std::string pattern, request_cb cb);
|
||||
|
|
Loading…
Reference in New Issue