about summary refs log tree commit diff
path: root/src/libstd/net
AgeCommit message (Collapse)AuthorLines
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-37/+37
2019-03-26Auto merge of #59136 - jethrogb:jb/sgx-std-test, r=sanxiynbors-19/+61
SGX target: fix std unit tests This fixes some tests and some code in the SGX sys implementation to make the `std` unit test suite pass. #59009 must be merged first.
2019-03-25SGX target: fix std unit testsJethro Beekman-19/+61
2019-03-16Fix test names regarding ip versionLinus Unnebäck-2/+2
2019-03-16Add test for UdpSocket peer_addrLinus Unnebäck-0/+10
2019-03-16Document UdpSocket peer_addr NotConnected errorLinus Unnebäck-0/+13
2019-03-16Mark UdpSocket peer_addr unstable w/ tracking issueLinus Unnebäck-1/+2
2019-03-16Add peer_addr function to UdpSocketLinus Unnebäck-0/+17
2019-03-08std: Delete a by-definition spuriously failing testAlex Crichton-15/+0
This commit deletes the `connect_timeout_unbound` test from the standard library which, unfortunately, is by definition eventually going to be a spuriously failing test. There's no way to reserve a port as unbound so we can rely on ecosystem testing for this feature for now. Closes #52590
2019-02-28libstd => 2018Taiki Endo-59/+59
2019-02-26Auto merge of #58357 - sfackler:vectored-io, r=alexcrichtonbors-2/+67
Add vectored read and write support This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies. r? @alexcrichton
2019-02-20Rollup merge of #58553 - scottmcm:more-ihle, r=Centrilkennytm-4/+4
Use more impl header lifetime elision Inspired by seeing explicit lifetimes on these two: - https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator - https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore. Most of the changes in here fall into two big categories: - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm). I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-20Rollup merge of #58551 - ssomers:master, r=oli-obkkennytm-2/+6
Explain a panic in test case net::tcp::tests::double_bind Those who try to build libstd on the Windows Subsystem for Linux experience a single failing test, where the point of failure is an explicit but anonymous panic, as reported in https://github.com/rust-lang/rust/issues/49367 This commit somewhat explains why and allows diagnosing a little.
2019-02-20Rollup merge of #58392 - scottmcm:less-shifting-in-net-ip, r=oli-obkkennytm-25/+58
Use less explicit shifting in std::net::ip Now that we have `{to|from}_be_bytes` the code can be simpler. (Inspired by PR #57740)
2019-02-17Use more impl header lifetime elisionScott McMurray-4/+4
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-18Merge remote-tracking branch 'upstream/master'Stein Somers-19/+18
2019-02-18Explain a panic in test case net::tcp::tests::double_bindStein Somers-2/+6
2019-02-13Add vectored read and write supportSteven Fackler-2/+67
This functionality has lived for a while in the tokio ecosystem, where it can improve performance by minimizing copies.
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-17/+17
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11Use less explicit shifting in std::net::ipScott McMurray-25/+58
Now that we have {to|from}_be_bytes the code can be simpler. (Inspired by PR #57740)
2019-02-10libs: doc commentsAlexander Regueiro-16/+16
2019-02-10tests: doc commentsAlexander Regueiro-1/+1
2019-02-10Rollup merge of #57740 - JakubOnderka:ipv4addr-to_ne_bytes, r=scottmcmGuillaume Gomez-2/+1
Use `to_ne_bytes` for converting IPv4Addr to octets It is easier and it should be also faster, because [`to_ne_bytes`](https://doc.rust-lang.org/std/primitive.u32.html#method.to_ne_bytes) just calls `mem::transmute`.
2019-01-26Bump bootstrap compiler to 1.33 betaMark Rousskov-1/+0
2019-01-18Use `to_ne_bytes` for converting IPv4Address to octetsJakub Onderka-2/+1
It is easier and it should be also faster, because `to_ne_bytes` just calls `mem::transmute`.
2019-01-14Remove the `connect_timeout_unroutable` test.Nicholas Nethercote-11/+0
It requires an unreachable IP address, but there is no such thing, and this has caused it to fail for multiple people. Fixes #44698, fixes #50065.
2018-12-31const-stabilize Ipv4Addr::newMazdak Farrokhzad-1/+1
2018-12-25Remove licensesMark Rousskov-70/+0
2018-12-11Address unused variables warning with TcpStreamvarkor-0/+3
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
2018-12-06Refactor net::each_addr/lookup_host to forward error from resolveJethro Beekman-24/+14
2018-11-30Deal with EINTR in net timeout testsJosh Stone-8/+22
We've seen sporadic QE failures in the timeout tests on this assertion: assert!(kind == ErrorKind::WouldBlock || kind == ErrorKind::TimedOut); So there's an error, but not either of the expected kinds. Adding a format to show the kind revealed `ErrorKind::Interrupted` (`EINTR`). For the cases that were using `read`, we can just use `read_exact` to keep trying after interruption. For those using `recv_from`, we have to manually loop until we get a non-interrupted result.
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-10reduce list to functions callable in const ctx.Mazdak Farrokhzad-3/+3
2018-11-10constify parts of libstd.Mazdak Farrokhzad-6/+5
2018-10-11Small changes to fix documentation auto compile issuesCharles Hathaway-1/+2
2018-10-10update tcp stream documentationCharles Hathaway-4/+3
2018-09-18Rollup merge of #53522 - phungleson:fix-impl-from-for-addr, r=TimNNGuillaume Gomez-0/+8
Add doc for impl From for Addr As part of issue #51430 (cc @skade). The impl is very simple, let me know if we need to go into any details. Additionally, I added `#[inline]` for the conversion method, let me know if it is un-necessary or might break something.
2018-08-21Add doc for impl From for AddrSon-0/+8
2018-08-21Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAuskennytm-20/+5
Stabilize IP associated constants Fixes #44582
2018-08-14Stabilize IP associated constantsThayne McCombs-20/+5
Fixes #44582
2018-08-10Replace _.. with just .. in slice patternLinus Färnstrand-4/+4
2018-08-10Make use of match ergonomics in ip methodsLinus Färnstrand-36/+36
2018-08-10Use slice patterns to check IP octetsLinus Färnstrand-11/+14
2018-08-08Simplify Ipv6Addr::from(octets) to not use unsafeLinus Färnstrand-3/+1
2018-08-08Simplify is_broadcastLinus Färnstrand-2/+1
2018-08-08Add Ipv4Addr BROADCAST assoc constLinus Färnstrand-0/+18
2018-08-08Move IPs to assoc constsLinus Färnstrand-28/+20
2018-08-08Make Ipv{4,6}Addr::new const fnsLinus Färnstrand-20/+28