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