nghttpx: Use initial window size in config directly
This commit is contained in:
parent
58beaa371d
commit
0ba2883940
|
@ -628,11 +628,6 @@ int Http2Session::submit_window_update(Http2DownstreamConnection *dconn,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int32_t Http2Session::get_initial_window_size() const
|
||||
{
|
||||
return (1 << get_config()->http2_downstream_window_bits) - 1;
|
||||
}
|
||||
|
||||
nghttp2_session* Http2Session::get_session() const
|
||||
{
|
||||
return session_;
|
||||
|
@ -1169,7 +1164,7 @@ int Http2Session::on_connect()
|
|||
entry[1].value = get_config()->http2_max_concurrent_streams;
|
||||
|
||||
entry[2].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
|
||||
entry[2].value = get_initial_window_size();
|
||||
entry[2].value = (1 << get_config()->http2_downstream_window_bits) - 1;
|
||||
|
||||
rv = nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE, entry,
|
||||
sizeof(entry)/sizeof(nghttp2_settings_entry));
|
||||
|
|
|
@ -76,8 +76,6 @@ public:
|
|||
|
||||
int fail_session(nghttp2_error_code error_code);
|
||||
|
||||
int32_t get_initial_window_size() const;
|
||||
|
||||
nghttp2_session* get_session() const;
|
||||
|
||||
bool get_flow_control() const;
|
||||
|
|
|
@ -496,7 +496,6 @@ Http2Upstream::Http2Upstream(ClientHandler *handler)
|
|||
assert(rv == 0);
|
||||
|
||||
flow_control_ = true;
|
||||
initial_window_size_ = (1 << get_config()->http2_upstream_window_bits) - 1;
|
||||
|
||||
// TODO Maybe call from outside?
|
||||
nghttp2_settings_entry entry[2];
|
||||
|
@ -504,7 +503,7 @@ Http2Upstream::Http2Upstream(ClientHandler *handler)
|
|||
entry[0].value = get_config()->http2_max_concurrent_streams;
|
||||
|
||||
entry[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
|
||||
entry[1].value = initial_window_size_;
|
||||
entry[1].value = (1 << get_config()->http2_upstream_window_bits) - 1;
|
||||
|
||||
rv = nghttp2_submit_settings(session_, NGHTTP2_FLAG_NONE,
|
||||
entry,
|
||||
|
@ -1026,11 +1025,6 @@ bool Http2Upstream::get_flow_control() const
|
|||
return flow_control_;
|
||||
}
|
||||
|
||||
int32_t Http2Upstream::get_initial_window_size() const
|
||||
{
|
||||
return initial_window_size_;
|
||||
}
|
||||
|
||||
void Http2Upstream::pause_read(IOCtrlReason reason)
|
||||
{}
|
||||
|
||||
|
|
|
@ -73,7 +73,6 @@ public:
|
|||
virtual int on_downstream_body_complete(Downstream *downstream);
|
||||
|
||||
bool get_flow_control() const;
|
||||
int32_t get_initial_window_size() const;
|
||||
// Perform HTTP/2.0 upgrade from |upstream|. On success, this object
|
||||
// takes ownership of the |upstream|. This function returns 0 if it
|
||||
// succeeds, or -1.
|
||||
|
@ -84,7 +83,6 @@ private:
|
|||
ClientHandler *handler_;
|
||||
nghttp2_session *session_;
|
||||
bool flow_control_;
|
||||
int32_t initial_window_size_;
|
||||
DownstreamQueue downstream_queue_;
|
||||
std::unique_ptr<HttpsUpstream> pre_upstream_;
|
||||
event *settings_timerev_;
|
||||
|
|
|
@ -932,11 +932,6 @@ bool SpdyUpstream::get_flow_control() const
|
|||
return flow_control_;
|
||||
}
|
||||
|
||||
int32_t SpdyUpstream::get_initial_window_size() const
|
||||
{
|
||||
return initial_window_size_;
|
||||
}
|
||||
|
||||
void SpdyUpstream::pause_read(IOCtrlReason reason)
|
||||
{}
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ public:
|
|||
virtual int on_downstream_body_complete(Downstream *downstream);
|
||||
|
||||
bool get_flow_control() const;
|
||||
int32_t get_initial_window_size() const;
|
||||
private:
|
||||
ClientHandler *handler_;
|
||||
spdylay_session *session_;
|
||||
|
|
Loading…
Reference in New Issue