| 2110 | } |
| 2111 | |
| 2112 | void |
| 2113 | Http2ConnectionState::update_initial_peer_rwnd(Http2WindowSize new_size) |
| 2114 | { |
| 2115 | // Update stream level window sizes |
| 2116 | for (Http2Stream *s = stream_list.head; s; s = static_cast<Http2Stream *>(s->link.next)) { |
| 2117 | SCOPED_MUTEX_LOCK(lock, s->mutex, this_ethread()); |
| 2118 | // Set the new window size, but take into account the already adjusted |
| 2119 | // window based on previously sent bytes. |
| 2120 | // |
| 2121 | // For example: |
| 2122 | // 1. Client initializes the stream window to 10K bytes. |
| 2123 | // 2. ATS sends 3K bytes to the client. The stream window is now 7K bytes. |
| 2124 | // 3. The client sends a SETTINGS frame to update the initial window size to 20K bytes. |
| 2125 | // 4. ATS should update the stream window to 17K bytes: 20K - (10K - 7K). |
| 2126 | // |
| 2127 | // Note that if the client reduces the stream window, this may result in |
| 2128 | // negative receive window values. |
| 2129 | s->set_peer_rwnd(new_size - (peer_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE) - s->get_peer_rwnd())); |
| 2130 | } |
| 2131 | } |
| 2132 | |
| 2133 | void |
| 2134 | Http2ConnectionState::update_initial_local_rwnd(Http2WindowSize new_size) |
no test coverage detected