Upgrade to rustc ba2f13ef0 2015-02-04

This commit is contained in:
Simon Sapin 2015-01-31 14:36:05 +01:00 committed by Matt Brubeck
parent bc6882bdef
commit d5dd1d658e
136 changed files with 1091 additions and 878 deletions

View file

@ -15,11 +15,7 @@ git = "https://github.com/servo/rust-geom"
[dependencies.hyper]
git = "https://github.com/servo/hyper"
branch = "old_servo_new_cookies"
[dependencies.cookie]
git = "https://github.com/servo/cookie-rs"
branch = "lenientparse_backport"
branch = "servo"
[dependencies.png]
git = "https://github.com/servo/rust-png"
@ -30,4 +26,6 @@ git = "https://github.com/servo/rust-stb-image"
[dependencies]
url = "0.2.16"
time = "0.1.12"
openssl="0.2.15"
openssl="0.3.1"
rustc-serialize = "0.2"
cookie="*"

View file

@ -10,8 +10,8 @@ use url::Url;
use hyper::http::RawStatus;
use util::resource_files::resources_dir_path;
use std::borrow::ToOwned;
use std::io::fs::PathExtensions;
use std::borrow::IntoCow;
use std::old_io::fs::PathExtensions;
use std::sync::mpsc::Sender;
pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
@ -26,7 +26,7 @@ pub fn factory(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>
content_type: Some(("text".to_string(), "html".to_string())),
charset: Some("utf-8".to_string()),
headers: None,
status: Some(RawStatus(200, "OK".to_owned())),
status: Some(RawStatus(200, "OK".into_cow())),
});
chan.send(Done(Ok(()))).unwrap();
return

View file

@ -13,13 +13,13 @@ use time::{Tm, now, at, Timespec};
use url::Url;
use std::borrow::ToOwned;
use std::i64;
use std::io::net::ip::IpAddr;
use std::old_io::net::ip::IpAddr;
use std::time::Duration;
/// A stored cookie that wraps the definition in cookie-rs. This is used to implement
/// various behaviours defined in the spec that rely on an associated request URL,
/// which cookie-rs and hyper's header parsing do not support.
#[derive(Clone, Show)]
#[derive(Clone, Debug)]
pub struct Cookie {
pub cookie: cookie_rs::Cookie,
pub host_only: bool,
@ -121,7 +121,7 @@ impl Cookie {
}
if string.ends_with(domain_string)
&& string.char_at(string.len()-domain_string.len()-1) == '.'
&& string.parse::<IpAddr>().is_none() {
&& string.parse::<IpAddr>().is_err() {
return true;
}
false

View file

@ -5,7 +5,7 @@
use resource_task::{Metadata, LoadData, TargetedLoadResponse, start_sending, ResponseSenders};
use resource_task::ProgressMsg::{Payload, Done};
use rustc_serialize::base64::FromBase64;
use serialize::base64::FromBase64;
use hyper::mime::Mime;
use url::{percent_decode, SchemeData};
@ -60,7 +60,7 @@ fn load(load_data: LoadData, start_chan: Sender<TargetedLoadResponse>) {
// Parse the content type using rust-http.
// FIXME: this can go into an infinite loop! (rust-http #25)
let content_type: Option<Mime> = ct_str.parse();
let content_type: Option<Mime> = ct_str.parse().ok();
metadata.set_content_type(content_type.as_ref());
let progress_chan = start_sending(senders, metadata);

View file

@ -6,7 +6,7 @@ use url::Url;
use hyper::method::Method;
use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
use hyper::header::Headers;
use hyper::header::common::ContentType;
use hyper::header::ContentType;
use fetch::cors_cache::CORSCache;
use fetch::response::Response;

View file

@ -6,8 +6,8 @@ use resource_task::{ProgressMsg, Metadata, LoadData, start_sending, TargetedLoad
use resource_task::ProgressMsg::{Payload, Done};
use std::borrow::ToOwned;
use std::io;
use std::io::File;
use std::old_io as io;
use std::old_io::File;
use std::sync::mpsc::Sender;
use util::task::spawn_named;

View file

@ -11,14 +11,14 @@ use log;
use std::collections::HashSet;
use file_loader;
use hyper::client::Request;
use hyper::header::common::{ContentLength, ContentType, Host, Location};
use hyper::header::{ContentLength, ContentType, Host, Location};
use hyper::HttpError;
use hyper::method::Method;
use hyper::net::HttpConnector;
use hyper::status::{StatusCode, StatusClass};
use std::error::Error;
use openssl::ssl::{SslContext, SslVerifyMode};
use std::io::{IoError, IoErrorKind, Reader};
use std::old_io::{IoError, IoErrorKind, Reader};
use std::sync::mpsc::{Sender, channel};
use std::thunk::Invoke;
use util::task::spawn_named;
@ -29,7 +29,7 @@ use std::borrow::ToOwned;
pub fn factory(cookies_chan: Sender<ControlMsg>)
-> Box<Invoke<(LoadData, Sender<TargetedLoadResponse>)> + Send> {
box move |:(load_data, start_chan)| {
box move |(load_data, start_chan)| {
spawn_named("http_loader".to_owned(), move || load(load_data, start_chan, cookies_chan))
}
}

View file

@ -17,7 +17,7 @@ extern crate png;
#[macro_use]
extern crate log;
extern crate openssl;
extern crate "rustc-serialize" as rustc_serialize;
extern crate "rustc-serialize" as serialize;
extern crate util;
extern crate stb_image;
extern crate time;

View file

@ -15,25 +15,25 @@ use cookie;
use util::task::spawn_named;
use hyper::header::common::UserAgent;
use hyper::header::UserAgent;
use hyper::header::{Headers, Header, SetCookie};
use hyper::http::RawStatus;
use hyper::method::Method;
use hyper::mime::{Mime, Attr};
use url::Url;
use std::borrow::ToOwned;
use std::borrow::{ToOwned, IntoCow};
use std::sync::mpsc::{channel, Receiver, Sender};
use std::thunk::Invoke;
use std::collections::HashMap;
use std::io::{BufferedReader, File};
use std::old_io::{BufferedReader, File};
use std::mem;
use std::os;
#[cfg(test)]
use std::io::{Listener, Acceptor, TimedOut};
use std::old_io::{Listener, Acceptor, TimedOut};
#[cfg(test)]
use std::io::net::tcp::TcpListener;
use std::old_io::net::tcp::TcpListener;
static mut HOST_TABLE: Option<*mut HashMap<String, String>> = None;
@ -97,7 +97,7 @@ pub struct ResourceCORSData {
}
/// Metadata about a loaded resource, such as is obtained from HTTP headers.
#[deriving(Clone)]
#[derive(Clone)]
pub struct Metadata {
/// Final URL after redirects.
pub final_url: Url,
@ -124,7 +124,7 @@ impl Metadata {
charset: None,
headers: None,
// http://fetch.spec.whatwg.org/#concept-response-status-message
status: Some(RawStatus(200, "OK".to_owned())),
status: Some(RawStatus(200, "OK".into_cow())),
}
}
@ -168,7 +168,7 @@ pub struct ResponseSenders {
}
/// Messages sent in response to a `Load` message
#[derive(PartialEq,Show)]
#[derive(PartialEq,Debug)]
pub enum ProgressMsg {
/// Binary data - there may be multiple of these
Payload(Vec<u8>),