Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse the http connector pool between fetches #14741

Merged
merged 1 commit into from Dec 27, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Reuse the http connector pool between fetches

  • Loading branch information
mattnenterprise authored and Matt McCoy committed Dec 27, 2016
commit ed075ab552f0b64eacf96ba79c908ada09beb11f
@@ -72,6 +72,7 @@ pub struct HttpState {
pub cookie_jar: Arc<RwLock<CookieStorage>>,
pub auth_cache: Arc<RwLock<AuthCache>>,
pub blocked_content: Arc<Option<RuleList>>,
pub connector_pool: Arc<Pool<Connector>>,
}

impl HttpState {
@@ -81,6 +82,7 @@ impl HttpState {
cookie_jar: Arc::new(RwLock::new(CookieStorage::new(150))),
auth_cache: Arc::new(RwLock::new(AuthCache::new())),
blocked_content: Arc::new(None),
connector_pool: create_http_connector(),
}
}
}
@@ -1021,15 +1023,15 @@ fn http_network_fetch(request: Rc<Request>,

// Step 2
// TODO be able to create connection using current url's origin and credentials
let connection = create_http_connector();

// Step 3
// TODO be able to tell if the connection is a failure

// Step 4
let factory = NetworkHttpRequestFactory {
connector: connection,
connector: context.state.connector_pool.clone(),
};

let url = request.current_url();

let request_id = context.devtools_chan.as_ref().map(|_| {
@@ -325,6 +325,7 @@ impl CoreResourceManager {
cookie_jar: group.cookie_jar.clone(),
auth_cache: group.auth_cache.clone(),
blocked_content: BLOCKED_CONTENT_RULES.clone(),
connector_pool: group.connector.clone(),
};
let ua = self.user_agent.clone();
let dc = self.devtools_chan.clone();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.