<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libfetch, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-02-21T01:18:18Z</updated>
<entry>
<title>libfetch: Gracefully skip unsupported protocols</title>
<updated>2026-02-21T01:18:18Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-21T01:18:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b5d570e711da1dad303312bebaf1bd2fb720f0dc'/>
<id>urn:sha1:b5d570e711da1dad303312bebaf1bd2fb720f0dc</id>
<content type='text'>
If socket() fails because the address family or protocol is unsupported,
just continue with the next address.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55407
</content>
</entry>
<entry>
<title>libfetch: Fail hard if interrupted while connecting</title>
<updated>2026-02-21T01:18:15Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-21T01:18:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=afbdcd402bb439bd3d487baaad63b68e95929265'/>
<id>urn:sha1:afbdcd402bb439bd3d487baaad63b68e95929265</id>
<content type='text'>
This fixes an issue where the first address that DNS returns is blocked
by a packet filter, so we hang for a while, then the user hits Ctrl-C,
interrupting connect(2), whereupon we move on to the next address, get
a connection, request the file, and return to fetch(1), which sees that
SIGINT was caught and bails.

Note that we make no attempt to enforce fetchTimeout in the connection
phase, and never have.  It's feasible, but non-trivial, so we'll leave
it as an exercise for future us.

PR:		293312
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55406
</content>
</entry>
<entry>
<title>libfetch: Clean up fetch_info usage</title>
<updated>2026-02-21T01:18:11Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-21T01:18:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1b7c4d29fdfc975facdc43f6da50947cf3bb8e4a'/>
<id>urn:sha1:1b7c4d29fdfc975facdc43f6da50947cf3bb8e4a</id>
<content type='text'>
* Provide a wrapper for the common if (verbose) fetch_info(...) idiom.

* Replace remaining instances of fprintf(stderr, ...) with fetch_info().

* Fix a few style nits.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55405
</content>
</entry>
<entry>
<title>libfetch: Restore timeout functionality</title>
<updated>2026-02-18T15:10:47Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-18T15:10:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=73b82d1b0a2f09224e6d0f7a13dd73c66d740207'/>
<id>urn:sha1:73b82d1b0a2f09224e6d0f7a13dd73c66d740207</id>
<content type='text'>
PR:		293124
MFC after:	1 week
Fixes:		792ef1ae7b94 ("Refactor fetch_connect() and fetch_bind() to improve readability and avoid repeating the same DNS lookups.")
Reverts:	8f8a7f6fffd7 ("libfetch: apply timeout to SSL_read()")
Reviewed by:	eugen, imp
Differential Revision:	https://reviews.freebsd.org/D55293
</content>
</entry>
<entry>
<title>libfetch: Check for failure to create SSL context</title>
<updated>2026-02-07T14:24:40Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-07T14:24:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4e160c6197f75fda3d5d5997ce893087058cf718'/>
<id>urn:sha1:4e160c6197f75fda3d5d5997ce893087058cf718</id>
<content type='text'>
* Drop the ssl_meth member, there is no reason to hang on to it.

* Replace deprecated SSLv23_client_method() with TLS_client_method().

* Check the return value from SSL_CTX_new().

MFC after:	1 week
PR:		292903
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D55098
</content>
</entry>
<entry>
<title>libfetch: allow disabling TLS v1.3 when the connection</title>
<updated>2026-01-22T14:37:54Z</updated>
<author>
<name>Eugene Grosbein</name>
<email>eugen@FreeBSD.org</email>
</author>
<published>2026-01-22T14:37:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=129aec72250266e60c07ff4643623188f7c27a9d'/>
<id>urn:sha1:129aec72250266e60c07ff4643623188f7c27a9d</id>
<content type='text'>
MFC after:	3 days
</content>
</entry>
<entry>
<title>libfetch: apply timeout to SSL_read()</title>
<updated>2026-01-22T08:40:35Z</updated>
<author>
<name>Eugene Grosbein</name>
<email>eugen@FreeBSD.org</email>
</author>
<published>2026-01-22T08:40:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8f8a7f6fffd7dca09013f7c4bfa075bc3825fb8e'/>
<id>urn:sha1:8f8a7f6fffd7dca09013f7c4bfa075bc3825fb8e</id>
<content type='text'>
Currently, fetchTimeout works for non-SSL connections only, so does fetch -T.
Fix it applying specified timeout to SSL_read().

MFC after:	3 days
</content>
</entry>
<entry>
<title>libfetch: Fix -Wunterminated-string-initialization</title>
<updated>2025-12-16T20:21:45Z</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2025-12-16T18:08:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=79f578531f21aa57307cbffd858a8a89e562aa5c'/>
<id>urn:sha1:79f578531f21aa57307cbffd858a8a89e562aa5c</id>
<content type='text'>
This defaults to an error in clang HEAD, use a char-by-char
initializer instead.

Reviewed by:	emaste, jhb
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52532
</content>
</entry>
<entry>
<title>lib: Fix calls that naively set F_SETFD.</title>
<updated>2025-07-17T17:00:32Z</updated>
<author>
<name>Ricardo Branco</name>
<email>rbranco@suse.de</email>
</author>
<published>2025-07-14T20:10:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8768b60de16a3d72a8783ec1241a711a782a36a9'/>
<id>urn:sha1:8768b60de16a3d72a8783ec1241a711a782a36a9</id>
<content type='text'>
With the recent inclusion of the FD_CLOFORK and FD_RESOLVE_BENEATH flags,
we must avoid clearing them when setting only FD_CLOEXEC.

Signed-off-by: Ricardo Branco &lt;rbranco@suse.de&gt;

Reviewed by:	kib, markj
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1766
</content>
</entry>
<entry>
<title>libfetch: don't include fragments in HTTP requests</title>
<updated>2024-08-21T12:35:27Z</updated>
<author>
<name>Pietro Cerutti</name>
<email>gahr@FreeBSD.org</email>
</author>
<published>2024-08-21T12:35:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1af7d5f389536a2f391153513d95d92ffdf360e4'/>
<id>urn:sha1:1af7d5f389536a2f391153513d95d92ffdf360e4</id>
<content type='text'>
Summary:
Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to receive HTTP requests with fragments.

```
$ fetch 'https://dropbox.com/a/b'
fetch: https://dropbox.com/a/b: Not Found

$ fetch 'https://dropbox.com/a/b#'
fetch: https://dropbox.com/a/b#: Bad Request
```

This is a real-world scenario, where some download link from dropbox
(eventually) redirects to an URL with a fragment:

```
$ fetch -v 'https://www.dropbox.com/sh/&lt;some&gt;/&lt;thing&gt;?dl=1' 2&gt;&amp;1 | grep requesting
requesting https://www.dropbox.com/sh/&lt;some&gt;/&lt;thing&gt;?dl=1
requesting https://www.dropbox.com/scl/fo/&lt;foo&gt;/&lt;bar&gt;?rlkey=&lt;baz&gt;&amp;dl=1
requesting https://&lt;boo&gt;.dl.dropboxusercontent.com/zip_download_get/&lt;some-long-strig&gt;#
```

See how the last redirect ends with a `#`.

Currently, libfetch includes the ending fragment and makes it impossible
to download the file.

Differential Revision:	https://reviews.freebsd.org/D46318
MFC after:		2 weeks
</content>
</entry>
</feed>
