From 9aee51835245cba5d14a158ece784ce6582b973f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 15 Mar 2017 00:07:57 +0900 Subject: [PATCH] nghttpx: Effectively revert ff64f64e1dc362aca52e04a42a4258598a43f30f --- src/shrpx_client_handler.cc | 8 -------- src/shrpx_client_handler.h | 2 -- src/shrpx_https_upstream.cc | 20 ++++++++++---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index cd4e405d..3f16097a 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -1231,14 +1231,6 @@ ClientHandler::ReadBuf *ClientHandler::get_rb() { return &rb_; } void ClientHandler::signal_write() { conn_.wlimit.startw(); } -void ClientHandler::signal_write_no_wait() { - // ev_feed_event works without starting watcher. But rate limiter - // requires active watcher. Without that, we might not send pending - // data. Also ClientHandler::write_tls requires it. - conn_.wlimit.startw(); - ev_feed_event(conn_.loop, &conn_.wev, EV_WRITE); -} - RateLimit *ClientHandler::get_rlimit() { return &conn_.rlimit; } RateLimit *ClientHandler::get_wlimit() { return &conn_.wlimit; } diff --git a/src/shrpx_client_handler.h b/src/shrpx_client_handler.h index 4617fcdc..bfe22024 100644 --- a/src/shrpx_client_handler.h +++ b/src/shrpx_client_handler.h @@ -133,8 +133,6 @@ public: RateLimit *get_wlimit(); void signal_write(); - // Use this for HTTP/1 frontend since it produces better result. - void signal_write_no_wait(); ev_io *get_wev(); void setup_upstream_io_callback(); diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index 97537204..fbb6cb7e 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -454,7 +454,7 @@ int htp_hdrs_completecb(http_parser *htp) { auto output = downstream->get_response_buf(); constexpr auto res = StringRef::from_lit("HTTP/1.1 100 Continue\r\n\r\n"); output->append(res); - handler->signal_write_no_wait(); + handler->signal_write(); } } @@ -500,7 +500,7 @@ int htp_msg_completecb(http_parser *htp) { // in request phase hook. We only delete and proceed to the // next request handling (if we don't close the connection). We // first pause parser here just as we normally do, and call - // signal_write_no_wait() to run on_write(). + // signal_write() to run on_write(). http_parser_pause(htp, 1); return 0; @@ -605,7 +605,7 @@ int HttpsUpstream::on_read() { if (downstream && downstream->get_request_state() == Downstream::MSG_COMPLETE && downstream->get_response_state() == Downstream::MSG_COMPLETE) { - handler_->signal_write_no_wait(); + handler_->signal_write(); } return 0; } @@ -619,7 +619,7 @@ int HttpsUpstream::on_read() { if (downstream && downstream->get_response_state() != Downstream::INITIAL) { handler_->set_should_close_after_write(true); - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; } @@ -645,7 +645,7 @@ int HttpsUpstream::on_read() { error_reply(status_code); - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; } @@ -772,7 +772,7 @@ int HttpsUpstream::downstream_read(DownstreamConnection *dconn) { } end: - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; } @@ -829,7 +829,7 @@ int HttpsUpstream::downstream_eof(DownstreamConnection *dconn) { // drop connection. return -1; end: - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; } @@ -857,7 +857,7 @@ int HttpsUpstream::downstream_error(DownstreamConnection *dconn, int events) { downstream->pop_downstream_connection(); - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; } @@ -1229,14 +1229,14 @@ int HttpsUpstream::on_downstream_body_complete(Downstream *downstream) { int HttpsUpstream::on_downstream_abort_request(Downstream *downstream, unsigned int status_code) { error_reply(status_code); - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; } int HttpsUpstream::on_downstream_abort_request_with_https_redirect( Downstream *downstream) { redirect_to_https(downstream); - handler_->signal_write_no_wait(); + handler_->signal_write(); return 0; }