nghttpx: Effectively revert ff64f64e1d

This commit is contained in:
Tatsuhiro Tsujikawa 2017-03-15 00:07:57 +09:00
parent 6ca515ea70
commit 9aee518352
3 changed files with 10 additions and 20 deletions

View File

@ -1231,14 +1231,6 @@ ClientHandler::ReadBuf *ClientHandler::get_rb() { return &rb_; }
void ClientHandler::signal_write() { conn_.wlimit.startw(); } 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_rlimit() { return &conn_.rlimit; }
RateLimit *ClientHandler::get_wlimit() { return &conn_.wlimit; } RateLimit *ClientHandler::get_wlimit() { return &conn_.wlimit; }

View File

@ -133,8 +133,6 @@ public:
RateLimit *get_wlimit(); RateLimit *get_wlimit();
void signal_write(); void signal_write();
// Use this for HTTP/1 frontend since it produces better result.
void signal_write_no_wait();
ev_io *get_wev(); ev_io *get_wev();
void setup_upstream_io_callback(); void setup_upstream_io_callback();

View File

@ -454,7 +454,7 @@ int htp_hdrs_completecb(http_parser *htp) {
auto output = downstream->get_response_buf(); auto output = downstream->get_response_buf();
constexpr auto res = StringRef::from_lit("HTTP/1.1 100 Continue\r\n\r\n"); constexpr auto res = StringRef::from_lit("HTTP/1.1 100 Continue\r\n\r\n");
output->append(res); 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 // in request phase hook. We only delete and proceed to the
// next request handling (if we don't close the connection). We // next request handling (if we don't close the connection). We
// first pause parser here just as we normally do, and call // 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); http_parser_pause(htp, 1);
return 0; return 0;
@ -605,7 +605,7 @@ int HttpsUpstream::on_read() {
if (downstream && if (downstream &&
downstream->get_request_state() == Downstream::MSG_COMPLETE && downstream->get_request_state() == Downstream::MSG_COMPLETE &&
downstream->get_response_state() == Downstream::MSG_COMPLETE) { downstream->get_response_state() == Downstream::MSG_COMPLETE) {
handler_->signal_write_no_wait(); handler_->signal_write();
} }
return 0; return 0;
} }
@ -619,7 +619,7 @@ int HttpsUpstream::on_read() {
if (downstream && downstream->get_response_state() != Downstream::INITIAL) { if (downstream && downstream->get_response_state() != Downstream::INITIAL) {
handler_->set_should_close_after_write(true); handler_->set_should_close_after_write(true);
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }
@ -645,7 +645,7 @@ int HttpsUpstream::on_read() {
error_reply(status_code); error_reply(status_code);
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }
@ -772,7 +772,7 @@ int HttpsUpstream::downstream_read(DownstreamConnection *dconn) {
} }
end: end:
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }
@ -829,7 +829,7 @@ int HttpsUpstream::downstream_eof(DownstreamConnection *dconn) {
// drop connection. // drop connection.
return -1; return -1;
end: end:
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }
@ -857,7 +857,7 @@ int HttpsUpstream::downstream_error(DownstreamConnection *dconn, int events) {
downstream->pop_downstream_connection(); downstream->pop_downstream_connection();
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }
@ -1229,14 +1229,14 @@ int HttpsUpstream::on_downstream_body_complete(Downstream *downstream) {
int HttpsUpstream::on_downstream_abort_request(Downstream *downstream, int HttpsUpstream::on_downstream_abort_request(Downstream *downstream,
unsigned int status_code) { unsigned int status_code) {
error_reply(status_code); error_reply(status_code);
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }
int HttpsUpstream::on_downstream_abort_request_with_https_redirect( int HttpsUpstream::on_downstream_abort_request_with_https_redirect(
Downstream *downstream) { Downstream *downstream) {
redirect_to_https(downstream); redirect_to_https(downstream);
handler_->signal_write_no_wait(); handler_->signal_write();
return 0; return 0;
} }