-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Rollup of 9 pull requests #34720
Merged
Merged
Rollup of 9 pull requests #34720
Conversation
This file contains 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
The term "thread-local" has a widely-accepted meaning which is not the meaning it's used for here.
If not, the error `does not have these features: foo` confused. r? @steveklabnik
- minor pronoun fix We -> You - PATH troubleshooting - dir output is vertical (but did not include timestamps) - executables not in %PATH% require .\
When resolving a hostname, pass a hints struct where ai_socktype is set to SOCK_STREAM in order to eliminate repeated results for each protocol family.
Revise wording in Rc documentation. The term "thread-local" has a widely accepted meaning which is not the meaning it's used for here.
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ p=10 |
📌 Commit fe7dc33 has been approved by |
bors
added a commit
that referenced
this pull request
Jul 8, 2016
💔 Test failed - auto-win-gnu-64-opt |
@bors r+ |
📌 Commit 5389ccc has been approved by |
doc: make the conditional-compilation example work If not, the error `does not have these features: foo` confused. r? @steveklabnik
…, r=steveklabnik Add doc examples for `io::Error::from_raw_os_error`. None
…eveklabnik Fix `std::path::Path::file_name()` doc Fixes rust-lang#34632 r? @steveklabnik
…r, r=steveklabnik Improve DoubleEndedIterator examples Fixes rust-lang#34065. r? @steveklabnik
…uct_checks, r=nrc parser: Remove outdated checks for empty braced struct expressions (`S {}`) This is a pure refactoring. r? @nrc
enhancewindows documentation in getting-started - minor pronoun fix We -> You - PATH troubleshooting - dir output is vertical (but did not include timestamps) - executables not in %PATH% require .\ r? @steveklabnik
Use hints with getaddrinfo() in std::net::lookup_host() As noted in rust-lang#24250, `std::net::lookup_host()` repeats each IPv[46] address in the result set. The number of repetitions is OS-dependent; e.g., Linux and FreeBSD give three copies, OpenBSD gives two. Filtering the duplicates can be done by the user if `lookup_host()` is used explicitly, but not with functions like `TcpStream::connect()`. What happens with the latter is that any unsuccessful connection attempt will be repeated as many times as there are duplicates of the address. The program: ```rust use std::net::TcpStream; fn main() { let _stream = TcpStream::connect("localhost:4444").unwrap(); } ``` results in the following capture: [capture-before.txt](https://github.com/rust-lang/rust/files/352004/capture-before.txt) assuming that "localhost" resolves both to ::1 and 127.0.0.1, and that the listening program opens just an IPv4 socket (e.g., `nc -l 127.0.0.1 4444`.) The reason for this behavior is explained in [this comment](rust-lang#24250 (comment)): `getaddrinfo()` is not constrained. Various OSS projects (I checked out Postfix, OpenLDAP, Apache HTTPD and BIND) which use `getaddrinfo()` generally constrain the result set by using a non-NULL `hints` parameter and setting at least `ai_socktype` to `SOCK_STREAM`. `SOCK_DGRAM` would also work. Other parameters are unnecessary for pure name resolution. The patch in this PR initializes a `hints` struct and passes it to `getaddrinfo()`, which eliminates the duplicates. The same test program as above with this change produces: [capture-after.txt](https://github.com/rust-lang/rust/files/352042/capture-after.txt) All `libstd` tests pass with this patch.
bors
added a commit
that referenced
this pull request
Jul 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ptr::{null, null_mut}
instead of0 as *{const, mut}
#34456, doc: make the conditional-compilation example work #34610, Add doc examples forio::Error::from_raw_os_error
. #34612, Fixstd::path::Path::file_name()
doc #34659, Improve DoubleEndedIterator examples #34688, parser: Remove outdated checks for empty braced struct expressions (S {}
) #34691, enhancewindows documentation in getting-started #34699, Use hints with getaddrinfo() in std::net::lookup_host() #34700