MCPcopy Create free account
hub / github.com/apache/trafficserver / increment_peer_rwnd

Method increment_peer_rwnd

src/proxy/http2/Http2ConnectionState.cc:2926–2941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2924}
2925
2926Http2ErrorCode
2927Http2ConnectionState::increment_peer_rwnd(size_t amount)
2928{
2929 this->_peer_rwnd += amount;
2930
2931 this->_recent_rwnd_increment[this->_recent_rwnd_increment_index] = amount;
2932 ++this->_recent_rwnd_increment_index;
2933 this->_recent_rwnd_increment_index %= this->_recent_rwnd_increment.size();
2934 double sum = std::accumulate(this->_recent_rwnd_increment.begin(), this->_recent_rwnd_increment.end(), 0.0);
2935 double avg = sum / this->_recent_rwnd_increment.size();
2936 if (avg < Http2::min_avg_window_update) {
2937 Metrics::Counter::increment(http2_rsb.insufficient_avg_window_update);
2938 return Http2ErrorCode::HTTP2_ERROR_ENHANCE_YOUR_CALM;
2939 }
2940 return Http2ErrorCode::HTTP2_ERROR_NO_ERROR;
2941}
2942
2943Http2ErrorCode
2944Http2ConnectionState::decrement_peer_rwnd(size_t amount)

Callers 1

Calls 4

incrementFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected