Upgrade to rustc 1.3.0-dev (fddfd089b 2015-07-10)

This commit is contained in:
Simon Sapin 2015-07-10 22:48:05 +02:00
parent 64751b8eef
commit 83d2a11d86
21 changed files with 260 additions and 152 deletions

View file

@ -28,7 +28,7 @@ rustc-serialize = "0.3"
cookie="*"
regex = "0.1.14"
regex_macros = "0.1.8"
hyper = "0.5"
hyper = "0.6"
flate2 = "0.2.0"
uuid = "0.1.16"
euclid = "0.1"

View file

@ -7,7 +7,7 @@ use hyper::method::Method;
use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
use hyper::header::{Header, Headers, ContentType, IfModifiedSince, IfNoneMatch};
use hyper::header::{Accept, IfUnmodifiedSince, IfMatch, IfRange, Location};
use hyper::header::{HeaderView, AcceptLanguage, ContentLanguage, Language};
use hyper::header::{HeaderView, AcceptLanguage, ContentLanguage};
use hyper::header::{QualityItem, qitem, q};
use hyper::status::StatusCode;
use fetch::cors_cache::{CORSCache, CacheRequestDetails};

View file

@ -17,10 +17,10 @@ use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host, Lo
use hyper::Error as HttpError;
use hyper::method::Method;
use hyper::mime::{Mime, TopLevel, SubLevel};
use hyper::net::HttpConnector;
use hyper::net::{HttpConnector, HttpsConnector, Openssl};
use hyper::status::{StatusCode, StatusClass};
use std::error::Error;
use openssl::ssl::{SslContext, SSL_VERIFY_PEER};
use openssl::ssl::{SslContext, SslMethod, SSL_VERIFY_PEER};
use std::io::{self, Read, Write};
use std::sync::Arc;
use std::sync::mpsc::{Sender, channel};
@ -117,24 +117,20 @@ fn load(mut load_data: LoadData, start_chan: LoadConsumer, classifier: Arc<MIMEC
info!("requesting {}", url.serialize());
fn verifier(ssl: &mut SslContext) {
ssl.set_verify(SSL_VERIFY_PEER, None);
let mut certs = resources_dir_path();
certs.push("certs");
ssl.set_CA_file(&certs).unwrap();
};
let ssl_err_string = "Some(OpenSslErrors([UnknownError { library: \"SSL routines\", \
function: \"SSL3_GET_SERVER_CERTIFICATE\", \
reason: \"certificate verify failed\" }]))";
let mut connector = if opts::get().nossl {
HttpConnector(None)
let req = if opts::get().nossl {
Request::with_connector(load_data.method.clone(), url.clone(), &HttpConnector)
} else {
HttpConnector(Some(box verifier as Box<Fn(&mut SslContext) + Send>))
let mut context = SslContext::new(SslMethod::Sslv23).unwrap();
context.set_verify(SSL_VERIFY_PEER, None);
context.set_CA_file(&resources_dir_path().join("certs")).unwrap();
Request::with_connector(load_data.method.clone(), url.clone(),
&HttpsConnector::new(Openssl { context: Arc::new(context) }))
};
let mut req = match Request::with_connector(load_data.method.clone(), url.clone(), &mut connector) {
let mut req = match req {
Ok(req) => req,
Err(HttpError::Io(ref io_error)) if (
io_error.kind() == io::ErrorKind::Other &&

View file

@ -233,7 +233,7 @@ impl ResourceManager {
}
ControlMsg::SetCookiesForUrl(request, cookie_list, source) => {
let header = Header::parse_header(&[cookie_list.into_bytes()]);
if let Some(SetCookie(cookies)) = header {
if let Ok(SetCookie(cookies)) = header {
for bare_cookie in cookies.into_iter() {
if let Some(cookie) = cookie::Cookie::new_wrapped(bare_cookie, &request, source) {
self.cookie_storage.push(cookie, source);