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

Method update_initial_local_rwnd

src/proxy/http2/Http2ConnectionState.cc:2133–2152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2131}
2132
2133void
2134Http2ConnectionState::update_initial_local_rwnd(Http2WindowSize new_size)
2135{
2136 // Update stream level window sizes
2137 for (Http2Stream *s = stream_list.head; s; s = static_cast<Http2Stream *>(s->link.next)) {
2138 SCOPED_MUTEX_LOCK(lock, s->mutex, this_ethread());
2139 // Set the new window size, but take into account the already adjusted
2140 // window based on previously sent bytes.
2141 //
2142 // For example:
2143 // 1. ATS initializes the stream window to 10K bytes.
2144 // 2. ATS receives 3K bytes from the client. The stream window is now 7K bytes.
2145 // 3. ATS sends a SETTINGS frame to the client to update the initial window size to 20K bytes.
2146 // 4. The stream window should be updated to 17K bytes: 20K - (10K - 7K).
2147 //
2148 // Note that if ATS reduces the stream window, this may result in negative
2149 // receive window values.
2150 s->set_local_rwnd(new_size - (acknowledged_local_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE) - s->get_local_rwnd()));
2151 }
2152}
2153
2154void
2155Http2ConnectionState::schedule_stream_to_send_priority_frames(Http2Stream *stream)

Calls 4

this_ethreadFunction · 0.85
set_local_rwndMethod · 0.80
getMethod · 0.45
get_local_rwndMethod · 0.45

Tested by

no test coverage detected