Releases: sagebind/isahc
Releases · sagebind/isahc
Latest futures-preview upgrade
Changed
- Upgrade futures-preview dependencies to the latest and greatest of 0.3.0-alpha.18.
HttpClient::new()
will now block fully until the client is actually initialized. Previously it would block on some things being initialized, and then return once the agent thread has started. This proved to be a bit too unusual, and had a tendency to cause extra delays for the first few requests being sent. This new behavior should feel much more predictable.
Fixed
- Benchmarking sub-crate once again compiles and runs.
HttpClient instantiation and drop
Breaking Changes
HttpClient::new()
now returns aResult<HttpClient, Error>
since creating a client is fallible. Previously this method would panic if instantiation failed, which was not a very API.- The
Default
implementation forHttpClient
has been removed, since instantiating it is fallible.
Fixed
- Dropping an
HttpClient
previously would cause any active transfers created by the client to return EOF after emptying the response body buffer. Now the curl multi handle will be kept alive until all transfers are completed or cancelled. In addition, reading from the response body will return aConnectionAborted
error if for some reason the transfer was stopped without finishing. (#65)
Changed
- Use the latest GitHub Actions beta features for CI. (#56)
New project name
Changed
- The project has been renamed from cHTTP to Isahc! This also includes an adorable new project mascot... (#36, #54)
- The length property for
Body
has changed from anusize
to anu64
.usize
is too small to fit large file sizes on machines that have less than 64 bit pointer size. (#52) - The
Error::Internal
variant has been removed, as a panic is more suitable for the one situation that previously returned this error. - The
Error::TooManyConnections
variant has been removed, as it is an artifact from old cHTTP versions. Isahc has no artificial limit on the number of connections that can be used simultaneously outside of system limits.
Add project rename notice
Put a notice on the old crate of the new project name.
POST body handling fixes
Dependency fixes
Fixed
- Fix dependency issues with
futures-util-preview
where not includingfutures-preview
downstream would result in theio
feature being missing and causing a compile error. - Replace an unnecessary use of unsafe with the
pin_mut!
macro fromfutures-util-preview
.
More dependency trimming
Changed
- Remove
futures-executor-preview
from list of dependencies. This was only being used forblock_on
in one place, which now has been replaced with a tinyjoin()
method that does effectively the same thing.
Minor polish
0.5: All the Async!
This is a huge release for cHTTP that delivers on first-class async
/.await
and big API ergonomic improvements! Read @sagebind's blog post if you want to learn even more about the release and the project's direction!
Breaking Changes
- Rename
Client
toHttpClient
andClientBuilder
toHttpClientBuilder
. For usability it helps to include the client type in our prelude, but the nameClient
is just a little too generic to do that. Using the nameHttpClient
is much less ambiguous as to what kind of client is in question. It's also a very common type name for HTTP clients and adds to familiarity. (#46) - The
Options
struct has been removed. Instead, request execution options can be set by using extension methods provided forhttp::request::Builder
, or by setting default configuration using methods available onHttpClientBuilder
. This greatly improves the ergonomics of setting various options, as well as allows you to override specific options piecemeal instead of overriding everything. (#35) Body
is now asynchronous internally. It still implementsRead
for ease of use, but you can no longer create a body from a synchronous reader. This fixes latency issues inside the agent thread, where previously sending and receiving bodies might block the entire event loop and prevent other parallel requests from making progress for a short time.
This also means that you can optionally read from a responseBody
within an asynchronous application without blocking. (#27)- The
json
feature no longer uses the json crate, and instead uses serde to automatically deserialize a JSON response to the target type. - Rename the
options
module toconfig
, and make several other redundant modules private. - Removed
Request
andResponse
Added
- Add a new
chttp::prelude
module that can be glob-imported to pull in the core types and traits you'll likely need to work with cHTTP. - In addition to the existing synchronous
send
,get
,post
(etc) methods, asynchronous versions of these methods are now available, suffixed with_async
. These methods do the exact same things as the synchronous versions, except entirely asynchronously and return aFuture
. (#27) - When creating a request body from a reader, you can now provide a length hint if you know the size of the body ahead of time. When providing a length hint, the hint will be used as the value of the
Content-Length
request header and be sent directly, instead of using a streaming encoding. - Add convenience methods
copy_to
andcopy_to_file
for downloading a response body to a file or an arbitrary writer.
Improvements
- The background agent thread that manages active requests has received many changes and improvements and is now fully asynchronous This offers less latency when multiple parallel requests are active and increased overall performance.
- Response buffers now use sluice which greatly increases the efficiency of reading from the HTTP response stream.
- Trim the dependency tree of crates that we don't really need, greatly improving both compile times and binary footprint. (#43) @sagebind
- Improve how we handle the Public Suffix List by bundling a copy via Git and refreshing it periodically during run time. This also removes the
psl
crate, which has been to compile very slowly. (#40)
Fixed
- Fix a bug where sending a HEAD request might hang waiting on the response until the server closes the connection.
- Fix various potential bugs in how certain HTTP verbs are handled by using explicit curl options for a verb if one exists.
- Fix some warning emitted by Clippy.
Changed
- Dropping a
Client
will now block until the associated agent thread shuts down. If the agent thread errors, it will propagate back to the main thread. - Replace usages of Rouille with Mockito in integration tests, as it has a lot of nice convenience methods and is a little lighter on the dependencies.
0.5 Alpha 3
Breaking Changes
- Rename
Client
toHttpClient
andClientBuilder
toHttpClientBuilder
. For usability it helps to include the client type in our prelude, but the nameClient
is just a little too generic to do that. Using the nameHttpClient
is much less ambiguous as to what kind of client is in question. It's also a very common type name for HTTP clients and adds to familiarity. (#46)
Added
- Make
ResponseFuture
part of public API. - Add convenience method for downloading to a file.
Fixed
- Fix a bug where sending a HEAD request might hang waiting on the response until the server closes the connection.
- Fix various potential bugs in how certain HTTP verbs are handled by using explicit curl options for a verb if one exists.
- Fix some warning emitted by Clippy.
Changed
- Update
parking_lot
requirement from 0.8 to 0.9 (#45) @dependabot-preview - Replace usages of rouille with mockito in integration tests, as it has a lot of nice convenience methods and is a little lighter on the dependencies.