<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sys/net/connection/socket, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-29T19:42:41+00:00</updated>
<entry>
<title>Rollup merge of #146937 - joboet:gethostname, r=Mark-Simulacrum</title>
<updated>2025-09-29T19:42:41+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-29T19:42:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8223831942e7668d890955a1a67a69e49c286e3d'/>
<id>urn:sha1:8223831942e7668d890955a1a67a69e49c286e3d</id>
<content type='text'>
std: implement `hostname`

Resolves https://github.com/rust-lang/libs-team/issues/330
Tracking issue: https://github.com/rust-lang/rust/issues/135142

This is based on rust-lang/rust#135141, but I've reimplemented the UNIX version, which now:
* uses `sysconf(_SC_HOST_NAME_MAX)` as an initial buffer length
* returns `OutOfMemory` if the `Vec` allocation fails
* retries the operation if it detects that the name returned by `gethostname` was truncated

Additionally, as part of the rebase, I had to move some WinSock abstractions (initialisation and error access) to `sys::pal` so that they can be accessed from `sys::net::hostname`.

CC ``@orowith2os`` (and thank you for your work!)
</content>
</entry>
<entry>
<title>Rollup merge of #140482 - devnexen:tcp_deferaccept_toduration, r=joboet</title>
<updated>2025-09-28T16:13:10+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-28T16:13:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=322dca8551ba2e395268ddff9bcf58e0d0479813'/>
<id>urn:sha1:322dca8551ba2e395268ddff9bcf58e0d0479813</id>
<content type='text'>
std::net: update tcp deferaccept delay type to Duration.

See comment [here](https://github.com/rust-lang/rust/issues/119639#issuecomment-2839330337).
</content>
</entry>
<entry>
<title>std::net: update tcp deferaccept delay type to Duration.</title>
<updated>2025-09-26T17:39:29+00:00</updated>
<author>
<name>David Carlier</name>
<email>devnexen@gmail.com</email>
</author>
<published>2025-04-29T18:01:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c0de794949f652b368fa107c3b52d0515f1f3859'/>
<id>urn:sha1:c0de794949f652b368fa107c3b52d0515f1f3859</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: move WinSock abstractions to `sys::pal`</title>
<updated>2025-09-23T15:13:35+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-09-23T15:13:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=af1b14bb9b1b3d301c1e8e0a989d814deaf054c9'/>
<id>urn:sha1:af1b14bb9b1b3d301c1e8e0a989d814deaf054c9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>std: simplify host lookup</title>
<updated>2025-09-19T09:30:27+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-09-14T13:30:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=09d3120a99fee8d839e502bdb54f8117c0623c5d'/>
<id>urn:sha1:09d3120a99fee8d839e502bdb54f8117c0623c5d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Implement `Socket::take_error` for Hermit</title>
<updated>2025-09-11T07:05:17+00:00</updated>
<author>
<name>Martin Kröning</name>
<email>martin.kroening@eonerc.rwth-aachen.de</email>
</author>
<published>2025-09-10T13:26:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=af5355cc91fb48ed3d1bf31200b4311f801d24a6'/>
<id>urn:sha1:af5355cc91fb48ed3d1bf31200b4311f801d24a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #145327 - joboet:net-addr-sgx-hack, r=tgross35</title>
<updated>2025-09-10T18:29:04+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-10T18:29:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e79630da0b16a4514f34f6283bbfc17f2e239605'/>
<id>urn:sha1:e79630da0b16a4514f34f6283bbfc17f2e239605</id>
<content type='text'>
std: make address resolution weirdness local to SGX

Currently, the implementations of `TcpStream::connect` and its cousins take an `io::Result&lt;&amp;SocketAddr&gt;` as argument, which is very weird, as most of them then `?`-try the result immediately to access the actual address. This weirdness is however necessitated by a peculiarity of the SGX networking implementation:

SGX doesn't support DNS resolution but rather accepts hostnames in the same place as socket addresses. So, to make e.g.
```rust
TcpStream::connect("example.com:80")`
```
work, the DNS lookup returns a special error (`NonIpSockAddr`) instead, which contains the hostname being looked up. When `.to_socket_addrs()` fails, the `each_addr` function used to select an address will pass the error to the inner `TcpStream::connect` implementation, which in SGX's case will inspect the error and try recover the hostname from it. If
that succeeds, it continues with the found hostname.

This is pretty obviously a terrible hack and leads to buggy code (for instance, when users use the result of `.to_socket_addrs()` in their own `ToSocketAddrs` implementation to select from a list of possible URLs, the only URL used will be that of the last item tried). Still, without changes to the SGX usercall ABI, it cannot be avoided.

Therefore, this PR aims to minimise the impact of that weirdness and remove it from all non-SGX platforms. The inner `TcpStream::connect`, et al. functions now receive the `ToSocketAddrs` type directly and call `each_addr` (which is moved to `sys::net::connection`) themselves. On SGX, the implementation uses a special `each_addr` which contains the whole pass-hostname-through-error hack.

As well as making the code cleaner, this also opens up the possibility of reusing newly created sockets even if a connection request fails – but I've left that for another PR.

CC `@raoulstrackx`
</content>
</entry>
<entry>
<title>std: make address resolution weirdness local to SGX</title>
<updated>2025-09-08T14:58:43+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-08-12T16:37:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=207a01e88f05f028f7a6c0db0d324fbedb8178a4'/>
<id>urn:sha1:207a01e88f05f028f7a6c0db0d324fbedb8178a4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #139524 - Berrysoft:cygwin-socket-ext, r=tgross35</title>
<updated>2025-09-06T18:39:04+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>t.gross35@gmail.com</email>
</author>
<published>2025-09-06T18:39:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=31d7cbc3710148e6eb3cd9854c5dfdfa7e76b783'/>
<id>urn:sha1:31d7cbc3710148e6eb3cd9854c5dfdfa7e76b783</id>
<content type='text'>
Add socket extensions for cygwin

r? `@joboet`

* Abstract name uds addr
* quickack
* passcred
</content>
</entry>
<entry>
<title>Add socket extensions for cygwin</title>
<updated>2025-09-06T12:23:37+00:00</updated>
<author>
<name>Berrysoft</name>
<email>Strawberry_Str@hotmail.com</email>
</author>
<published>2025-04-08T10:07:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=26b157572280d058c8a800e4888f4b37062eb533'/>
<id>urn:sha1:26b157572280d058c8a800e4888f4b37062eb533</id>
<content type='text'>
</content>
</entry>
</feed>
