summaryrefslogtreecommitdiffstats
path: root/net/base/host_resolver_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/host_resolver_impl.cc')
-rw-r--r--net/base/host_resolver_impl.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index 65f0b53..c359ff8 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -759,6 +759,10 @@ class HostResolverImpl::JobPool {
num_outstanding_jobs_ += offset;
}
+ void ResetNumOutstandingJobs() {
+ num_outstanding_jobs_ = 0;
+ }
+
// Returns true if a new job can be created for this pool.
bool CanCreateJob() const {
return num_outstanding_jobs_ + 1u <= max_outstanding_jobs_;
@@ -1223,8 +1227,8 @@ void HostResolverImpl::OnIPAddressChanged() {
additional_resolver_flags_ &= ~HOST_RESOLVER_LOOPBACK_ONLY;
}
#endif
- AbortAllJobs();
- // |this| may be deleted inside AbortAllJobs().
+ AbortAllInProgressJobs();
+ // |this| may be deleted inside AbortAllInProgressJobs().
}
void HostResolverImpl::DiscardIPv6ProbeJob() {
@@ -1348,7 +1352,9 @@ void HostResolverImpl::CancelAllJobs() {
it->second->Cancel();
}
-void HostResolverImpl::AbortAllJobs() {
+void HostResolverImpl::AbortAllInProgressJobs() {
+ for (size_t i = 0; i < arraysize(job_pools_); ++i)
+ job_pools_[i]->ResetNumOutstandingJobs();
JobMap jobs;
jobs.swap(jobs_);
for (JobMap::iterator it = jobs.begin(); it != jobs.end(); ++it) {