-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(hyper): switch to std::io, std::net, and std::path. #354
Conversation
Needs a rebase already. |
@@ -21,3 +21,6 @@ time = "*" | |||
unicase = "*" | |||
unsafe-any = "*" | |||
url = "*" | |||
|
|||
[profile.bench] | |||
opt-level = 0 |
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.
??
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.
Oh dangit. I had set that when I was fixing the bench marks, to compile faster.
6bbfb0d
to
2ce4385
Compare
@reem rebased. Interesting to note: speed improvements with the
|
match *self { | ||
SizedReader(ref mut body, ref mut remaining) => { | ||
debug!("Sized read, remaining={:?}", remaining); | ||
if *remaining == 0 { | ||
Err(old_io::standard_error(old_io::EndOfFile)) | ||
Ok(0) |
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 think Ok(0)
is still bad behavior, unless the recent RFC changed that.
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.
My understanding is that Ok(0) is EOF. There no longer is an EOF error kind...
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.
Asked about this and you're right. (deleted the other comment on this same thing)
If there's no real problems, I'd like to merge so we can unbreak people on crates.io... |
Hey, I am not sure if this is a blocker, but with the current build the example client does not build for me. Here's the exception:
|
@akoskaaa read_to_string() was changed in the new io module. Looks like the example needs to be updated. Here is how I modified my code to make it compile:
|
All instances of `old_io` and `old_path` were switched to use the new shiny `std::io`, `std::net`, and `std::path` modules. This means that `Request` and `Response` implement `Read` and `Write` now. Because of the changes to `TcpListener`, this also takes the opportunity to correct the method usage of `Server`. As with other languages/frameworks, the server is first created with a handler, and then a host/port is passed to a `listen` method. This reverses what `Server` used to do. Closes #347 BREAKING CHANGE: Check the docs. Everything was touched.
Alright, I updated the REAME to work, and renamed that odd function. Once travis hits green, I'll merge. (sorry those using git rev's, I probably broke you because of my force-push) |
feat(hyper): switch to std::io, std::net, and std::path.
All instances of
old_io
andold_path
were switched to use the newshiny
std::io
,std::net
, andstd::path
modules. This means thatRequest
andResponse
implementRead
andWrite
now.Because of the changes to
TcpListener
, this also takes the opportunityto correct the method usage of
Server
. As with otherlanguages/frameworks, the server is first created with a handler, and
then a host/port is passed to a
listen
method. This reverses whatServer
used to do.Closes #347
BREAKING CHANGE: Check the docs. Everything was touched.