Commit 9d15f9b0 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpd: Start SETTINGS timer after it is written to output buffer

parent 3e72711e
......@@ -577,6 +577,10 @@ Http2Handler::WriteBuf *Http2Handler::get_wb() { return &wb_; }
int Http2Handler::setup_bev() { return 0; }
void Http2Handler::start_settings_timer() {
ev_timer_start(sessions_->get_loop(), &settings_timerev_);
}
int Http2Handler::fill_wb() {
if (data_pending_) {
auto n = std::min(wb_.wleft(), data_pendinglen_);
......@@ -870,8 +874,6 @@ int Http2Handler::connection_made() {
}
}
ev_timer_start(sessions_->get_loop(), &settings_timerev_);
if (ssl_ && !nghttp2::ssl::check_http2_requirement(ssl_)) {
terminate_session(NGHTTP2_INADEQUATE_SECURITY);
}
......@@ -1538,6 +1540,15 @@ int hd_on_frame_send_callback(nghttp2_session *session,
break;
}
case NGHTTP2_SETTINGS: {
if (frame->hd.flags & NGHTTP2_FLAG_ACK) {
return 0;
}
hd->start_settings_timer();
break;
}
case NGHTTP2_PUSH_PROMISE: {
auto promised_stream_id = frame->push_promise.promised_stream_id;
auto promised_stream = hd->get_stream(promised_stream_id);
......
......@@ -138,6 +138,7 @@ public:
void remove_self();
int setup_bev();
void start_settings_timer();
int on_read();
int on_write();
int connection_made();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment