<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sys/net/connection/socket, branch beta</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=beta</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=beta'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-11T07:05:17+00:00</updated>
<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>
<entry>
<title>library: Migrate from `cfg_if` to `cfg_select`</title>
<updated>2025-08-16T12:28:31+00:00</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2025-08-10T21:25:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1ae4a0cc3487f28b29f36afe8056535afad21e7b'/>
<id>urn:sha1:1ae4a0cc3487f28b29f36afe8056535afad21e7b</id>
<content type='text'>
Migrate the standard library from using the external `cfg_if` crate to
using the now-built-in `cfg_select` macro.

This does not yet eliminate the dependency from
`library/std/Cargo.toml`, because while the standard library itself no
longer uses `cfg_if`, it also incorporates the `backtrace` crate, which
does.

Migration assisted by the following vim command (after selecting the
full `cfg_if!` invocation):

```
'&lt;,'&gt;s/\(cfg_if::\)\?cfg_if/cfg_select/ | '&lt;,'&gt;s/^\( *\)} else {/\1}\r\1_ =&gt; {/c | '&lt;,'&gt;s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 =&gt; /e | '&lt;,'&gt;s/if #\[cfg(\(.*\))\] {/\1 =&gt; {/e
```

This is imperfect, but substantially accelerated the process. This
prompts for confirmation on the `} else {` since that can also appear
inside one of the arms. This also requires manual intervention to handle
any multi-line conditions.
</content>
</entry>
<entry>
<title>Don't call WSACleanup on process exit</title>
<updated>2025-07-14T14:27:49+00:00</updated>
<author>
<name>Chris Denton</name>
<email>chris@chrisdenton.dev</email>
</author>
<published>2025-05-31T10:39:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c8fb37a521b1f8cf13ddf1ffb81b0a30b05e0706'/>
<id>urn:sha1:c8fb37a521b1f8cf13ddf1ffb81b0a30b05e0706</id>
<content type='text'>
</content>
</entry>
<entry>
<title>setup CI and tidy to use typos for spellchecking and fix few typos</title>
<updated>2025-07-03T07:51:06+00:00</updated>
<author>
<name>klensy</name>
<email>klensy@users.noreply.github.com</email>
</author>
<published>2024-12-07T10:51:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c76d032f0144b650a438ee1efba89c475e0b115b'/>
<id>urn:sha1:c76d032f0144b650a438ee1efba89c475e0b115b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #123476 - devnexen:std_net_solaris_exclbind, r=Mark-Simulacrum</title>
<updated>2025-06-28T20:05:27+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-06-28T20:05:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7394bd5fc220c5bbf7b7dfde573c2e45d7825333'/>
<id>urn:sha1:7394bd5fc220c5bbf7b7dfde573c2e45d7825333</id>
<content type='text'>
std::net: adding `unix_socket_exclbind` feature for solaris/illumos.

allows to have a tigher control over the binding exclusivness of the socket.

ACP: https://github.com/rust-lang/libs-team/issues/366
</content>
</entry>
<entry>
<title>Set MSG_NOSIGNAL for UnixSteam</title>
<updated>2025-06-16T07:15:17+00:00</updated>
<author>
<name>Michał Łowicki</name>
<email>mlowicki@gmail.com</email>
</author>
<published>2025-04-18T08:38:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=426ab142507fca8704d934da556f1c96b0fd61b2'/>
<id>urn:sha1:426ab142507fca8704d934da556f1c96b0fd61b2</id>
<content type='text'>
https://github.com/rust-lang/rust/issues/139956

fix
</content>
</entry>
</feed>
