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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 1708009: Fix case where backup socket jobs ignored the socket limits.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.cc
===================================================================
--- net/socket/client_socket_pool_base.cc (revision 45589)
+++ net/socket/client_socket_pool_base.cc (working copy)
@@ -298,9 +298,12 @@
CHECK(group.backup_job);
- // If our backup job is waiting on DNS, just reset the timer.
+ // If our backup job is waiting on DNS, or if we can't create any sockets
+ // right now due to limits, just reset the timer.
CHECK(group.jobs.size());
- if ((*group.jobs.begin())->GetLoadState() == LOAD_STATE_RESOLVING_HOST) {
+ if (ReachedMaxSocketsLimit() ||
+ !group.HasAvailableSocketSlot(max_sockets_per_group_) ||
+ (*group.jobs.begin())->GetLoadState() == LOAD_STATE_RESOLVING_HOST) {
group.backup_job->net_log().EndEvent(
NetLog::TYPE_SOCKET_BACKUP_TIMER_EXTENDED);
StartBackupSocketTimer(group_name);
@@ -723,7 +726,10 @@
// Each connecting socket will eventually connect and be handed out.
int total = handed_out_socket_count_ + connecting_socket_count_;
DCHECK_LE(total, max_sockets_);
- return total == max_sockets_;
+ if (total < max_sockets_)
+ return false;
+ LOG(WARNING) << "ReachedMaxSocketsLimit: " << total << "/" << max_sockets_;
+ return true;
}
} // namespace internal
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698