-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
|
Thanks for doing this. I would like to hold off on this for a little bit. Ideally, these libs would not depend on I should be able to get that work shipped pretty quickly (ideally this week). |
|
No, rush at all. Just one of these changes that are just as easy to send a PR for as they are to open an issue. |
|
Since the last update on tokio, it would be awesome if this would work with the current tokio version. |
00278c8 to
9e4d99a
Compare
|
@ufobat Partially moved the code over to use tokio and futures 0.2-alpha. There are parts of |
|
thank you! |
|
Thanks for updating the PR! Let me take a look at this now. |
|
@Marwes Would it be possible to add an Basically, follow the pattern that |
Sure. I will look into it tomorrow. |
fbd7bfa to
131c301
Compare
|
@carllerche It should be good now I think but I may have accidentally messed up something as I were restoring the old impls. |
|
ping @carllerche |
|
@Marwes Thanks for doing this. Sorry for the delay. I did a quick pass but I will have to focus on it more tomorrow. I will try to leave some quick inline notes. The first thing that stands out is that there are a number of unrelated changes that make the PR harder to review. I will try to point them out inline. Would it be possible to revert those for this PR? |
carllerche
left a comment
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.
Thanks for doing this!
This isn't a comprehensive review as it is quite big, but it looks like it is going in the right direction.
It looks like rustfmt or something was run and it makes the diff a bit hard to review.
Would it be possible to revert formatting changes? Those can be addressed in a separate PR.
Cargo.toml
Outdated
| tokio-io = "0.1" | ||
| [package] | ||
| name = "tokio-uds" | ||
| version = "0.1.7" |
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 will be a breaking change, so this should be bumped to v0.2.0.
| use std::path::PathBuf; | ||
|
|
||
| use futures::{Async, Poll, Stream, Sink, StartSend, AsyncSink}; | ||
| use futures::{Async, AsyncSink, Poll, Sink, StartSend, Stream}; |
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 does not seem related to the PR?
| /// should be directed, which will be returned as a `SocketAddr`. | ||
| fn encode(&mut self, msg: Self::Out, buf: &mut Vec<u8>) | ||
| -> io::Result<PathBuf>; | ||
| fn encode(&mut self, msg: Self::Out, buf: &mut Vec<u8>) -> io::Result<PathBuf>; |
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 does not seem related to the PR?
|
|
||
| if self.wr.is_empty() { | ||
| return Ok(Async::Ready(())) | ||
| return Ok(Async::Ready(())); |
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 does not seem related to the PR?
| } else { | ||
| Err(io::Error::new(io::ErrorKind::Other, | ||
| "failed to write entire datagram to socket")) | ||
| Err(io::Error::new( |
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 does not seem related to the PR?
| /// more easily. | ||
| pub fn framed<C>(self, codec: C) -> UnixDatagramFramed<C> | ||
| where C: UnixDatagramCodec, | ||
| where |
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 does not seem related to the PR?
| impl<T, P> Future for SendDgram<T, P> | ||
| where T: AsRef<[u8]>, | ||
| P: AsRef<Path> | ||
| where |
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 does not seem related to the PR?
| @@ -1,4 +1,4 @@ | |||
| use libc::{uid_t, gid_t}; | |||
| use libc::{gid_t, uid_t}; | |||
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 does not seem related to the PR?
| #[cfg(any(target_os = "linux", target_os = "android"))] | ||
| pub mod impl_linux { | ||
| use libc::{getsockopt, SOL_SOCKET, SO_PEERCRED, c_void, socklen_t}; | ||
| use libc::{c_void, getsockopt, socklen_t, SOL_SOCKET, SO_PEERCRED}; |
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 does not seem related to the PR?
| let raw_fd = sock.as_raw_fd(); | ||
|
|
||
| let mut ucred = ucred { pid: 0, uid: 0, gid: 0 }; | ||
| let mut ucred = ucred { |
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 does not seem related to the PR?
b148842 to
14e9c08
Compare
|
@carllerche Sorry about the rustfmting, I broke it out to a separate PR #32 . Diff without that commit at https://github.com/tokio-rs/tokio-uds/pull/29/files/c6826ec86c5b6f6f831516ba044521ac52190900..14e9c084691cd6ece741ecc8d0adc676a23b3c3e . |
|
The Also the |
978731b to
3c86d22
Compare
|
Broke out the tokio 0.1 support into #36. |
|
I'm going to close this as most of the important work has been landed via other PRs. Thanks again! |
tokio-rs/tokio-rfcs#2
BREAKING CHANGE
The
needs_*methods has been removed asPollEventeddo not have them anymoreThe crate now uses the tokio-reactor crate instead of tokio_core
Implementation of the (depreceated)
tokio_core::io::Iotrait has been removed.