Skip to content

Commit

Permalink
Merge pull request #557 from hyperium/http-versions
Browse files Browse the repository at this point in the history
refactor(http): move h1 and h2 into http module
  • Loading branch information
seanmonstar committed Jun 4, 2015
2 parents e2611b4 + 71ac65d commit 7637461
Show file tree
Hide file tree
Showing 12 changed files with 351 additions and 350 deletions.
4 changes: 2 additions & 2 deletions examples/client_http2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::io;

use hyper::Client;
use hyper::header::Connection;
use hyper::http2;
use hyper::http::h2;

fn main() {
env_logger::init().unwrap();
Expand All @@ -21,7 +21,7 @@ fn main() {
}
};

let mut client = Client::with_protocol(http2::new_protocol());
let mut client = Client::with_protocol(h2::new_protocol());

// `Connection: Close` is not a valid header for HTTP/2, but the client handles it gracefully.
let mut res = client.get(&*url)
Expand Down
4 changes: 2 additions & 2 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ pub mod pool;
pub mod request;
pub mod response;

use message::Protocol;
use http11::Http11Protocol;
use http::Protocol;
use http::h1::Http11Protocol;

/// A Client to use additional features with Requests.
///
Expand Down
6 changes: 3 additions & 3 deletions src/client/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use net::{NetworkStream, NetworkConnector, HttpConnector, Fresh, Streaming};
use version;
use client::{Response, get_host_and_port};

use message::{HttpMessage, RequestHead};
use http11::Http11Message;
use http::{HttpMessage, RequestHead};
use http::h1::Http11Message;


/// A client request to a remote server.
Expand Down Expand Up @@ -136,7 +136,7 @@ mod tests {
use header::{ContentLength,TransferEncoding,Encoding};
use url::form_urlencoded;
use super::Request;
use http11::Http11Message;
use http::h1::Http11Message;

fn run_request(req: Request<Fresh>) -> Vec<u8> {
let req = req.start().unwrap();
Expand Down
7 changes: 3 additions & 4 deletions src/client/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ use std::io::{self, Read};

use header;
use net::NetworkStream;
use http::{self, RawStatus};
use http::{self, RawStatus, ResponseHead, HttpMessage};
use status;
use version;
use message::{ResponseHead, HttpMessage};
use http11::Http11Message;
use http::h1::Http11Message;

/// A response for a client request to a remote server.
#[derive(Debug)]
Expand Down Expand Up @@ -82,7 +81,7 @@ mod tests {
use mock::MockStream;
use status;
use version;
use http11::Http11Message;
use http::h1::Http11Message;

use super::Response;

Expand Down
Loading

0 comments on commit 7637461

Please sign in to comment.