clang-format
This commit is contained in:
parent
298808f276
commit
8f888b29bd
|
@ -73,7 +73,7 @@ void session_impl::start_resolve(const std::string &host,
|
||||||
|
|
||||||
resolver_.async_resolve({host, service},
|
resolver_.async_resolve({host, service},
|
||||||
[self](const boost::system::error_code &ec,
|
[self](const boost::system::error_code &ec,
|
||||||
tcp::resolver::iterator endpoint_it) {
|
tcp::resolver::iterator endpoint_it) {
|
||||||
if (ec) {
|
if (ec) {
|
||||||
self->not_connected(ec);
|
self->not_connected(ec);
|
||||||
return;
|
return;
|
||||||
|
@ -598,7 +598,7 @@ void session_impl::do_read() {
|
||||||
auto self = this->shared_from_this();
|
auto self = this->shared_from_this();
|
||||||
|
|
||||||
read_socket([self](const boost::system::error_code &ec,
|
read_socket([self](const boost::system::error_code &ec,
|
||||||
std::size_t bytes_transferred) {
|
std::size_t bytes_transferred) {
|
||||||
if (ec) {
|
if (ec) {
|
||||||
if (!self->should_stop()) {
|
if (!self->should_stop()) {
|
||||||
self->call_error_cb(ec);
|
self->call_error_cb(ec);
|
||||||
|
@ -610,8 +610,8 @@ void session_impl::do_read() {
|
||||||
{
|
{
|
||||||
callback_guard cg(*self);
|
callback_guard cg(*self);
|
||||||
|
|
||||||
auto rv =
|
auto rv = nghttp2_session_mem_recv(self->session_, self->rb_.data(),
|
||||||
nghttp2_session_mem_recv(self->session_, self->rb_.data(), bytes_transferred);
|
bytes_transferred);
|
||||||
|
|
||||||
if (rv != static_cast<ssize_t>(bytes_transferred)) {
|
if (rv != static_cast<ssize_t>(bytes_transferred)) {
|
||||||
self->call_error_cb(make_error_code(
|
self->call_error_cb(make_error_code(
|
||||||
|
@ -694,19 +694,18 @@ void session_impl::do_write() {
|
||||||
|
|
||||||
auto self = this->shared_from_this();
|
auto self = this->shared_from_this();
|
||||||
|
|
||||||
write_socket(
|
write_socket([self](const boost::system::error_code &ec, std::size_t n) {
|
||||||
[self](const boost::system::error_code &ec, std::size_t n) {
|
if (ec) {
|
||||||
if (ec) {
|
self->call_error_cb(ec);
|
||||||
self->call_error_cb(ec);
|
self->stop();
|
||||||
self->stop();
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
self->wblen_ = 0;
|
self->wblen_ = 0;
|
||||||
self->writing_ = false;
|
self->writing_ = false;
|
||||||
|
|
||||||
self->do_write();
|
self->do_write();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void session_impl::stop() {
|
void session_impl::stop() {
|
||||||
|
|
|
@ -56,7 +56,7 @@ void session_tls_impl::start_connect(tcp::resolver::iterator endpoint_it) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->socket_.async_handshake(
|
self->socket_.async_handshake(
|
||||||
boost::asio::ssl::stream_base::client,
|
boost::asio::ssl::stream_base::client,
|
||||||
[self, endpoint_it](const boost::system::error_code &ec) {
|
[self, endpoint_it](const boost::system::error_code &ec) {
|
||||||
if (self->stopped()) {
|
if (self->stopped()) {
|
||||||
|
|
Loading…
Reference in New Issue