Commit Graph

6 Commits

Author SHA1 Message Date
Duncan Overbruck
51b39002e5
Revert "Move all external code to lib/external."
This reverts commit 9effec0c4e.
2021-02-04 22:42:57 +01:00
Juan RP
9effec0c4e
Move all external code to lib/external. 2020-04-24 12:32:09 +02:00
Duncaen
9f52a7837f lib/fetch: add happy eyeballs connect algorithm (RFC6555/RFC8305)
Connect to the addresses from `getaddrinfo(3)`,
alternating between address family,
starting with ipv6 and wait `fetchConnDelay`
between each connection attempt.

If a connection is established within the attempts,
use this connection and close all others.

If `connect(3)` returns `ENETUNREACH`, don't attempt more
connections with the failing address family.

If there are no more addresses to attempt,
wait for `fetchConnTimeout` and return the first established
connection.

If no connection was established within the timeouts,
close all sockets and return -1 and set errno to
`ETIMEDOUT`.
2019-04-19 22:58:50 +02:00
Duncaen
30ace44394 lib/fetch: add socks5 support 2016-09-01 00:38:55 +02:00
Juan RP
90eb1d9433 libfetch: merge some features from FreeBSD:
- Supports HTTP/1.1 308 redirect.
- SSLv[23] HTTPS connections are forbidden by default.
- TLS client certificate validation thru OpenSSL.
- Fixes for user/password encoding, misc.
2015-10-24 07:52:30 +02:00
Juan RP
d419f8ac2a Move fetch.h to lib/fetch. 2013-06-19 11:03:03 +02:00