hyper: drop support

lib : remove all hyper code
configure: stop detecting hyper
docs: no more mention of hyper
tests: mo more special-handling of hyper builds
CI: no jobs using hyper

Closes #15120
This commit is contained in:
Daniel Stenberg 2024-12-21 11:33:05 +01:00
parent 46093d9e0e
commit fc3e1cbc50
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
93 changed files with 118 additions and 2546 deletions

View file

@ -23,36 +23,6 @@ and use TLS 1.3, or else it is not good enough.
As of May 2024, the libraries that need to get fixed to remain supported after
May 2025 are: BearSSL and Secure Transport.
## Hyper
Hyper is an alternative HTTP backend for curl. It uses the hyper library and
could in theory be used for HTTP/1, HTTP/2 and even HTTP/3 in the future with
curl.
The original plan and goal was that we would add this HTTP alternative (using
a memory-safe library) and that users could eventually build and use libcurl
exactly as previously but with parts of the core being more memory-safe.
The hyper implementation ran into some snags and 10-15 tests and HTTP/2
support have remained disabled with hyper. For these reasons, hyper support
has remained tagged EXPERIMENTAL.
It is undoubtedly hard work to fix these remaining problems, as they typically
require both rust and C knowledge in addition to deep HTTP familiarity. There
does not seem to be that many persons interested or available for this
challenge. Meanwhile, there is little if any demand for hyper from existing
(lib)curl users.
Finally: having support for hyper in curl has a significant cost: we need to
maintain and develop a lot of functionality and tests twice to make sure
libcurl works identically using either HTTP backend.
The only way to keep hyper support in curl is to give it a good polish by
someone with time, skill and energy to spend on this task.
Unless a significant overhaul has proven to be in progress, hyper support is
removed from curl in January 2025.
## Past removals
- Pipelining
@ -65,3 +35,4 @@ removed from curl in January 2025.
- MinGW v1
- NTLM_WB
- space-separated `NOPROXY` patterns
- hyper

View file

@ -34,14 +34,6 @@ Experimental support in curl means:
## Experimental features right now
### The Hyper HTTP backend
Graduation requirements:
- HTTP/1 and HTTP/2 support, including multiplexing
(Hyper is marked for deprecation. It cannot graduate.)
### HTTP/3 support (non-ngtcp2 backends)
Graduation requirements:

View file

@ -50,7 +50,6 @@ INTERNALDOCS = \
internals/CONNECTION-FILTERS.md \
internals/DYNBUF.md \
internals/HASH.md \
internals/HYPER.md \
internals/LLIST.md \
internals/MQTT.md \
internals/NEW-PROTOCOL.md \

View file

@ -15,11 +15,9 @@ Example:
# `--ignore-content-length`
For HTTP, Ignore the Content-Length header. This is particularly useful for
servers running Apache 1.x, which reports incorrect Content-Length for
files larger than 2 gigabytes.
For HTTP, ignore the Content-Length header. This is particularly useful for
servers running Apache 1.x, which reports incorrect Content-Length for files
larger than 2 gigabytes.
For FTP, this makes curl skip the SIZE command to figure out the size before
downloading a file (added in 7.46.0).
This option does not work for HTTP if libcurl was built to use hyper.

View file

@ -1,78 +0,0 @@
<!--
Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
-->
# Hyper
Hyper is a separate HTTP library written in Rust. curl can be told to use this
library as a backend to deal with HTTP.
## EXPERIMENTAL
Hyper support in curl is considered **EXPERIMENTAL** until further notice. It
needs to be explicitly enabled at build-time.
Further development and tweaking of the Hyper backend support in curl happens
in the master branch using pull-requests, just like ordinary changes.
## Hyper version
The C API for Hyper is brand new and is still under development.
## Build curl with hyper
Using Rust 1.64.0 or later, build hyper and enable its C API like this:
% git clone https://github.com/hyperium/hyper
% cd hyper
% RUSTFLAGS="--cfg hyper_unstable_ffi" cargo rustc --features client,http1,http2,ffi --crate-type cdylib
Also, `--release` can be added for a release (optimized) build.
Build curl to use hyper's C API:
% git clone https://github.com/curl/curl
% cd curl
% autoreconf -fi
% ./configure LDFLAGS="-Wl,-rpath,<hyper-dir>/target/debug -Wl,-rpath,<hyper-dir>/target/release" --with-openssl --with-hyper=<hyper-dir>
% make
# Using Hyper internally
Hyper is a low level HTTP transport library. curl itself provides all HTTP
headers and Hyper provides all received headers back to curl.
Therefore, most of the "header logic" in curl as in responding to and acting
on specific input and output headers are done the same way in curl code.
The API in Hyper delivers received HTTP headers as (cleaned up) name=value
pairs, making it impossible for curl to know the exact byte representation
over the wire with Hyper.
## Limitations
The hyper backend does not support
- `CURLOPT_IGNORE_CONTENT_LENGTH`
- `--raw` and disabling `CURLOPT_HTTP_TRANSFER_DECODING`
- RTSP
- hyper is much stricter about what HTTP header contents it allows
- leading whitespace in first HTTP/1 response header
- HTTP/0.9
- HTTP/2 upgrade using HTTP:// URLs. Aka 'h2c'
- HTTP/2 in general. Hyper has support for HTTP/2 but the curl side
needs changes so that a `hyper_clientconn` can last for the duration
of a connection. Probably this means turning the Hyper HTTP/2 backend
into a connection filter.
## Remaining issues
This backend is still not feature complete with the native backend. Areas that
still need attention and verification include:
- multiplexed HTTP/2
- h2 Upgrade:
- receiving HTTP/1 trailers
- sending HTTP/1 trailers

View file

@ -99,7 +99,6 @@ Ideas:
- Verify the Sec-WebSocket-Accept response. It requires a sha-1 function.
- Verify Sec-WebSocket-Extensions and Sec-WebSocket-Protocol in the response
- Make WebSocket work with hyper
- Consider a `curl_ws_poll()`
- Make sure WebSocket code paths are fuzzed
- Add client-side PING interval

View file

@ -31,11 +31,6 @@ Pass a long to tell libcurl how to act on transfer decoding. If set to zero,
transfer decoding is disabled, if set to 1 it is enabled (default). libcurl
does chunked transfer decoding by default unless this option is set to zero.
# NOTES
This option does not work with the hyper backend as that always has transfer
decoding enabled.
# DEFAULT
1

View file

@ -69,11 +69,6 @@ int main(void)
Support for FTP added in 7.46.0.
# NOTES
This option is not working for HTTP when libcurl is built to use the hyper
backend.
# %AVAILABILITY%
# RETURN VALUE