nghttpx: Remove recv data length calculation in HTTP/2 code

This commit is contained in:
Tatsuhiro Tsujikawa 2013-10-30 00:10:28 +09:00
parent 6c23c34d77
commit b75455dd96
4 changed files with 1 additions and 26 deletions

View File

@ -307,9 +307,6 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
upstream->rst_stream(downstream, NGHTTP2_INTERNAL_ERROR); upstream->rst_stream(downstream, NGHTTP2_INTERNAL_ERROR);
return 0; return 0;
} }
if(upstream->get_flow_control()) {
downstream->inc_recv_window_size(len);
}
} }
return 0; return 0;
} }
@ -730,7 +727,6 @@ int Http2Upstream::window_update(Downstream *downstream,
rv = nghttp2_submit_window_update(session_, NGHTTP2_FLAG_NONE, rv = nghttp2_submit_window_update(session_, NGHTTP2_FLAG_NONE,
downstream->get_stream_id(), downstream->get_stream_id(),
window_size_increment); window_size_increment);
downstream->set_recv_window_size(0);
if(rv < NGHTTP2_ERR_FATAL) { if(rv < NGHTTP2_ERR_FATAL) {
ULOG(FATAL, this) << "nghttp2_submit_window_update() failed: " ULOG(FATAL, this) << "nghttp2_submit_window_update() failed: "
<< nghttp2_strerror(rv); << nghttp2_strerror(rv);

View File

@ -51,8 +51,7 @@ SpdyDownstreamConnection::SpdyDownstreamConnection
: DownstreamConnection(client_handler), : DownstreamConnection(client_handler),
spdy_(client_handler->get_spdy_session()), spdy_(client_handler->get_spdy_session()),
request_body_buf_(0), request_body_buf_(0),
sd_(0), sd_(0)
recv_window_size_(0)
{} {}
SpdyDownstreamConnection::~SpdyDownstreamConnection() SpdyDownstreamConnection::~SpdyDownstreamConnection()
@ -112,7 +111,6 @@ int SpdyDownstreamConnection::attach_downstream(Downstream *downstream)
} }
downstream->set_downstream_connection(this); downstream->set_downstream_connection(this);
downstream_ = downstream; downstream_ = downstream;
recv_window_size_ = 0;
return 0; return 0;
} }
@ -454,7 +452,6 @@ int SpdyDownstreamConnection::resume_read(IOCtrlReason reason)
return -1; return -1;
} }
spdy_->notify(); spdy_->notify();
recv_window_size_ = 0;
} }
} }
return 0; return 0;
@ -509,14 +506,4 @@ bool SpdyDownstreamConnection::get_output_buffer_full()
} }
} }
int32_t SpdyDownstreamConnection::get_recv_window_size() const
{
return recv_window_size_;
}
void SpdyDownstreamConnection::inc_recv_window_size(int32_t amount)
{
recv_window_size_ += amount;
}
} // namespace shrpx } // namespace shrpx

View File

@ -69,14 +69,10 @@ public:
StreamData* detach_stream_data(); StreamData* detach_stream_data();
int submit_rst_stream(Downstream *downstream); int submit_rst_stream(Downstream *downstream);
int32_t get_recv_window_size() const;
void inc_recv_window_size(int32_t amount);
private: private:
SpdySession *spdy_; SpdySession *spdy_;
evbuffer *request_body_buf_; evbuffer *request_body_buf_;
StreamData *sd_; StreamData *sd_;
int32_t recv_window_size_;
}; };
} // namespace shrpx } // namespace shrpx

View File

@ -935,10 +935,6 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
return 0; return 0;
} }
if(spdy->get_flow_control()) {
sd->dconn->inc_recv_window_size(len);
}
auto upstream = downstream->get_upstream(); auto upstream = downstream->get_upstream();
rv = upstream->on_downstream_body(downstream, data, len); rv = upstream->on_downstream_body(downstream, data, len);
if(rv != 0) { if(rv != 0) {