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

Simplify the http_loader code. #14362

Merged
merged 14 commits into from Nov 26, 2016
Next

Use more specific names for Hyper's Request/Response types in http_lo…

…ader.
  • Loading branch information
Ms2ger committed Nov 24, 2016
commit 6219105eed5c868cd1980806c61b2ad54f804da8
@@ -13,7 +13,7 @@ use flate2::read::{DeflateDecoder, GzDecoder};
use hsts::HstsList;
use hyper::Error as HttpError;
use hyper::LanguageTag;
use hyper::client::{Pool, Request, Response};
use hyper::client::{Pool, Request as HyperRequest, Response as HyperResponse};
use hyper::header::{AcceptEncoding, AcceptLanguage, Basic, ContentEncoding, ContentLength};
use hyper::header::{Encoding, Header, Headers, Quality, QualityItem, Referer};
use hyper::header::{SetCookie, qitem};
@@ -79,7 +79,7 @@ fn precise_time_ms() -> u64 {
}

pub struct WrappedHttpResponse {
pub response: Response
pub response: HyperResponse
}

impl Read for WrappedHttpResponse {
@@ -146,9 +146,9 @@ impl HttpRequestFactory for NetworkHttpRequestFactory {

fn create(&self, url: ServoUrl, method: Method, headers: Headers)
-> Result<WrappedHttpRequest, LoadError> {
let connection = Request::with_connector(method,
url.clone().into_url().unwrap(),
&*self.connector);
let connection = HyperRequest::with_connector(method,
url.clone().into_url().unwrap(),
&*self.connector);

if let Err(HttpError::Ssl(ref error)) = connection {
let error: &(Error + Send + 'static) = &**error;
@@ -191,7 +191,7 @@ pub trait HttpRequest {
}

pub struct WrappedHttpRequest {
request: Request<Fresh>
request: HyperRequest<Fresh>
}

impl HttpRequest for WrappedHttpRequest {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.