-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
refactor(hyper): Split hyper into multiple crates #372
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/target | ||
/Cargo.lock | ||
/hypernet/target | ||
/hypernet/Cargo.lock | ||
/hyperprotocol/target | ||
/hyperprotocol/Cargo.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,4 +101,3 @@ fn bench_mock_hyper(b: &mut test::Bencher) { | |
.read_to_string(&mut s).unwrap() | ||
}); | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#![deny(warnings)] | ||
#![feature(test)] | ||
extern crate hyper; | ||
extern crate test; | ||
|
||
use test::Bencher; | ||
use std::io::{Read, Write}; | ||
|
||
use hyper::method::Method::Get; | ||
use hyper::server::{Request, Response}; | ||
|
||
static PHRASE: &'static [u8] = b"Benchmarking hyper vs others!"; | ||
|
||
fn request(url: hyper::Url) { | ||
let req = hyper::client::Request::new(Get, url).unwrap(); | ||
let mut s = String::new(); | ||
req.start().unwrap().send().unwrap().read_to_string(&mut s).unwrap(); | ||
} | ||
|
||
fn hyper_handle(_: Request, res: Response) { | ||
let mut res = res.start().unwrap(); | ||
res.write_all(PHRASE).unwrap(); | ||
res.end().unwrap(); | ||
} | ||
|
||
#[bench] | ||
fn bench_hyper(b: &mut Bencher) { | ||
let server = hyper::Server::http(hyper_handle); | ||
let mut listener = server.listen("127.0.0.1").unwrap(); | ||
|
||
let url = hyper::Url::parse(&*format!("http://{}", listener.socket)).unwrap(); | ||
b.iter(|| request(url.clone())); | ||
listener.close().unwrap(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
|
||
name = "hypernet" | ||
version = "0.0.1" | ||
authors = ["Sean McArthur <sean.monstar@gmail.com>", | ||
"Jonathan Reem <jonathan.reem@gmail.com>"] | ||
|
||
[dependencies] | ||
log = ">= 0.2.0" | ||
openssl = "*" | ||
|
||
[features] | ||
mock = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
|
||
name = "hyperprotocol" | ||
version = "0.0.1" | ||
authors = ["Sean McArthur <sean.monstar@gmail.com>", | ||
"Jonathan Reem <jonathan.reem@gmail.com>", | ||
"Pyfisch <pyfisch@gmail.com>"] | ||
|
||
[dependencies] | ||
cookie = "*" | ||
httparse = "*" | ||
log = ">= 0.2.0" | ||
mime = "*" | ||
rustc-serialize = "*" | ||
time = "*" | ||
unicase = "*" | ||
url = "*" |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...der/common/access_control/allow_origin.rs → ...der/common/access_control/allow_origin.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#![feature(core, box_syntax, unsafe_destructor, into_cow, convert)] | ||
#![cfg_attr(test, feature(test))] | ||
#![deny(missing_docs)] | ||
#![cfg_attr(test, deny(warnings))] | ||
|
||
//! # Hyperprotocol | ||
//! Hyperprotol contains the high-level semantics of HTTP. The provided code is used by both client | ||
//! and server. | ||
|
||
extern crate cookie; | ||
extern crate httparse; | ||
#[macro_use] | ||
extern crate log; | ||
extern crate mime as mime_crate; | ||
extern crate rustc_serialize as serialize; | ||
extern crate time; | ||
extern crate unicase; | ||
extern crate url; | ||
|
||
#[cfg(test)] | ||
extern crate test; | ||
|
||
pub use mime_crate as mime; | ||
|
||
pub mod error; | ||
pub mod header; | ||
pub mod method; | ||
pub mod status; | ||
pub mod version; |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cargo build | ||
cargo test | ||
cargo bench | ||
|
||
cd hypernet | ||
cargo test | ||
cargo bench | ||
|
||
cd ../hyperprotocol | ||
cargo test | ||
cargo bench |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly confident this will prevent uploading to crates.io. We will have to upload and depend on hypernet and hyperprotocol as normal dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably true.
If we split hyper consequently there will be no "hyper" crate only "hyperclient" and "hyperserver". I have no idea what the current crate will be useful for.