From e8b2508036bdd8a3b11f6e0713111698d725d376 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 8 Jan 2017 23:09:00 +0900 Subject: [PATCH] nghttpx: Rename confusing names in HttpDownstreamConnection --- src/shrpx_http_downstream_connection.cc | 38 ++++++++++++------------- src/shrpx_http_downstream_connection.h | 4 +-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index 28a3b167..3a073bd1 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -189,9 +189,9 @@ HttpDownstreamConnection::HttpDownstreamConnection( readcb, connect_timeoutcb, this, get_config()->tls.dyn_rec.warmup_threshold, get_config()->tls.dyn_rec.idle_timeout, PROTO_HTTP1), - do_read_(&HttpDownstreamConnection::noop), - do_write_(&HttpDownstreamConnection::noop), - do_signal_write_(&HttpDownstreamConnection::noop), + on_read_(&HttpDownstreamConnection::noop), + on_write_(&HttpDownstreamConnection::noop), + signal_write_(&HttpDownstreamConnection::noop), worker_(worker), ssl_ctx_(worker->get_cl_ssl_ctx()), group_(group), @@ -454,7 +454,7 @@ int HttpDownstreamConnection::initiate_connection() { ev_set_cb(&conn_.rev, readcb); - do_write_ = &HttpDownstreamConnection::write_reuse_first; + on_write_ = &HttpDownstreamConnection::write_reuse_first; reuse_first_write_done_ = false; } @@ -1096,9 +1096,9 @@ int HttpDownstreamConnection::write_reuse_first() { } if (conn_.tls.ssl) { - do_write_ = &HttpDownstreamConnection::write_tls; + on_write_ = &HttpDownstreamConnection::write_tls; } else { - do_write_ = &HttpDownstreamConnection::write_clear; + on_write_ = &HttpDownstreamConnection::write_clear; } reuse_first_write_done_ = true; @@ -1158,7 +1158,7 @@ int HttpDownstreamConnection::write_clear() { // part of response body. So keep reading. Invoke read event // to get read(2) error just in case. ev_feed_event(conn_.loop, &conn_.rev, EV_READ); - do_write_ = &HttpDownstreamConnection::noop; + on_write_ = &HttpDownstreamConnection::noop; reusable_ = false; break; } @@ -1216,15 +1216,15 @@ int HttpDownstreamConnection::tls_handshake() { auto &connect_blocker = addr_->connect_blocker; - do_signal_write_ = &HttpDownstreamConnection::actual_signal_write; + signal_write_ = &HttpDownstreamConnection::actual_signal_write; connect_blocker->on_success(); ev_set_cb(&conn_.rt, timeoutcb); ev_set_cb(&conn_.wt, timeoutcb); - do_read_ = &HttpDownstreamConnection::read_tls; - do_write_ = &HttpDownstreamConnection::write_tls; + on_read_ = &HttpDownstreamConnection::read_tls; + on_write_ = &HttpDownstreamConnection::write_tls; // TODO Check negotiated ALPN @@ -1287,7 +1287,7 @@ int HttpDownstreamConnection::write_tls() { // part of response body. So keep reading. Invoke read event // to get read(2) error just in case. ev_feed_event(conn_.loop, &conn_.rev, EV_READ); - do_write_ = &HttpDownstreamConnection::noop; + on_write_ = &HttpDownstreamConnection::noop; reusable_ = false; break; } @@ -1407,32 +1407,32 @@ int HttpDownstreamConnection::connected() { ev_set_cb(&conn_.wev, writecb); if (conn_.tls.ssl) { - do_read_ = &HttpDownstreamConnection::tls_handshake; - do_write_ = &HttpDownstreamConnection::tls_handshake; + on_read_ = &HttpDownstreamConnection::tls_handshake; + on_write_ = &HttpDownstreamConnection::tls_handshake; return 0; } - do_signal_write_ = &HttpDownstreamConnection::actual_signal_write; + signal_write_ = &HttpDownstreamConnection::actual_signal_write; connect_blocker->on_success(); ev_set_cb(&conn_.rt, timeoutcb); ev_set_cb(&conn_.wt, timeoutcb); - do_read_ = &HttpDownstreamConnection::read_clear; - do_write_ = &HttpDownstreamConnection::write_clear; + on_read_ = &HttpDownstreamConnection::read_clear; + on_write_ = &HttpDownstreamConnection::write_clear; return 0; } -int HttpDownstreamConnection::on_read() { return do_read_(*this); } +int HttpDownstreamConnection::on_read() { return on_read_(*this); } -int HttpDownstreamConnection::on_write() { return do_write_(*this); } +int HttpDownstreamConnection::on_write() { return on_write_(*this); } void HttpDownstreamConnection::on_upstream_change(Upstream *upstream) {} -void HttpDownstreamConnection::signal_write() { do_signal_write_(*this); } +void HttpDownstreamConnection::signal_write() { signal_write_(*this); } int HttpDownstreamConnection::actual_signal_write() { ev_feed_event(conn_.loop, &conn_.wev, EV_WRITE); diff --git a/src/shrpx_http_downstream_connection.h b/src/shrpx_http_downstream_connection.h index ac469bf4..94e1b964 100644 --- a/src/shrpx_http_downstream_connection.h +++ b/src/shrpx_http_downstream_connection.h @@ -91,8 +91,8 @@ public: private: Connection conn_; - std::function do_read_, do_write_, - do_signal_write_; + std::function on_read_, on_write_, + signal_write_; Worker *worker_; // nullptr if TLS is not used. SSL_CTX *ssl_ctx_;