| 2924 | } |
| 2925 | |
| 2926 | Http2ErrorCode |
| 2927 | Http2ConnectionState::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 | |
| 2943 | Http2ErrorCode |
| 2944 | Http2ConnectionState::decrement_peer_rwnd(size_t amount) |
no test coverage detected