Skip to content

Releases: sagebind/isahc

Latest futures-preview upgrade

23 Aug 01:15
8e05ed1
Compare
Choose a tag to compare

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

20 Aug 01:26
f5bc45a
Compare
Choose a tag to compare

Breaking Changes

  • HttpClient::new() now returns a Result<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 for HttpClient 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 a ConnectionAborted 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

03 Aug 22:53
2b2d427
Compare
Choose a tag to compare

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 an usize to an u64. 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

03 Aug 23:08
dbd85d9
Compare
Choose a tag to compare

Put a notice on the old crate of the new project name.

POST body handling fixes

03 Aug 03:44
82220dd
Compare
Choose a tag to compare

Fixed

  • Use CURLOPT_POSTFIELDSIZE for POST body (#53)

Changed

  • Update mockito requirement from 0.19 to 0.20 (#50)

Dependency fixes

26 Jul 17:09
Compare
Choose a tag to compare

Fixed

  • Fix dependency issues with futures-util-preview where not including futures-preview downstream would result in the io feature being missing and causing a compile error.
  • Replace an unnecessary use of unsafe with the pin_mut! macro from futures-util-preview.

More dependency trimming

24 Jul 00:11
Compare
Choose a tag to compare

Changed

  • Remove futures-executor-preview from list of dependencies. This was only being used for block_on in one place, which now has been replaced with a tiny join() method that does effectively the same thing.

Minor polish

23 Jul 06:56
85f9b09
Compare
Choose a tag to compare

Added

  • Add ResponseExt::json to mirror Body::json.

Improvements

  • Implement synchronous API without using block_on. (#49)
  • Remove a few futures-related dependencies we no longer need. (#49)
  • Also include extension traits in the library root module.
  • Various documentation cleanup with more examples.

0.5: All the Async!

22 Jul 04:38
0cb856e
Compare
Choose a tag to compare

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 to HttpClient and ClientBuilder to HttpClientBuilder. For usability it helps to include the client type in our prelude, but the name Client is just a little too generic to do that. Using the name HttpClient 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 for http::request::Builder, or by setting default configuration using methods available on HttpClientBuilder. 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 implements Read 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 response Body 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 to config, and make several other redundant modules private.
  • Removed Request and Response

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 a Future. (#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 and copy_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

20 Jul 20:28
c21be73
Compare
Choose a tag to compare
0.5 Alpha 3 Pre-release
Pre-release

Breaking Changes

  • Rename Client to HttpClient and ClientBuilder to HttpClientBuilder. For usability it helps to include the client type in our prelude, but the name Client is just a little too generic to do that. Using the name HttpClient 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.