Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

HTTP over UDP friendly #81

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davbo
Copy link

@davbo davbo commented Apr 25, 2014

I'm working on a library in Rust for use with the UPnP discovery protocol SSDP. This uses HTTP-ish over UDP.

No longer requires a specific TcpStream in the BufferedStream so it's possible to use your MemReaderFakeStream.

FYI - these changes are working here: https://github.com/davbo/rust-ssdp/blob/master/src/lib.rs#L36

@davbo
Copy link
Author

davbo commented Apr 25, 2014

ps. Not sure how this fits with Teepee & thanks for your work on the lib.

@@ -202,7 +202,6 @@ fn test_read_request_line() {
/// An HTTP request sent to the server.
pub struct Request {
/// The originating IP address of the request.
pub remote_addr: Option<SocketAddr>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the removal of remote_addr intentional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, I removed it to get my code working. The current way to access the remote_addr isn't really generic:

buffer.stream.wrapped.peer_name().ok()

Not sure how remote_addr is being used on the Request but perhaps it could be passed separately to fn load?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I never realised it was an Option, I guess there is a smarter way for me to handle this... I'll take another look.

davbo added 3 commits June 3, 2014 22:34
Also remove remote_addr which doesn't exist on UdpSockets
Also keep memstream for tests
@davbo
Copy link
Author

davbo commented Jun 3, 2014

Rebased

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants