Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: net/spdy/spdy_session.cc

Issue 1611703003: Fix max_concurrent_streams == 0 behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 79acd53bc66a0fcba479045853ccb991391ea318..97b5837cde2b012c94e4286122e727c71ed3ae78 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -884,8 +884,7 @@ int SpdySession::TryCreateStream(
if (err != OK)
return err;
- if (!max_concurrent_streams_ ||
- (active_streams_.size() + created_streams_.size() - num_pushed_streams_ <
+ if ((active_streams_.size() + created_streams_.size() - num_pushed_streams_ <
max_concurrent_streams_)) {
return CreateStream(*request, stream);
}
@@ -992,16 +991,10 @@ base::WeakPtr<SpdyStreamRequest> SpdySession::GetNextPendingStreamRequest() {
}
void SpdySession::ProcessPendingStreamRequests() {
- // Like |max_concurrent_streams_|, 0 means infinite for
- // |max_requests_to_process|.
- size_t max_requests_to_process = 0;
- if (max_concurrent_streams_ != 0) {
- max_requests_to_process =
- max_concurrent_streams_ -
- (active_streams_.size() + created_streams_.size());
- }
- for (size_t i = 0;
- max_requests_to_process == 0 || i < max_requests_to_process; ++i) {
+ size_t max_requests_to_process =
+ max_concurrent_streams_ -
+ (active_streams_.size() + created_streams_.size());
+ for (size_t i = 0; i < max_requests_to_process; ++i) {
base::WeakPtr<SpdyStreamRequest> pending_request =
GetNextPendingStreamRequest();
if (!pending_request)
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698