Commit Graph

169 Commits

Author SHA1 Message Date
Yosh c776e32a5e
Merge pull request #100 from jakubadamw/upgrade_async-tls_and_rustls
Upgrade `rustls` to 0.19 and `async-tls` to 0.11
2022-07-21 14:24:29 +02:00
Jeremiah Senkpiel 453262fec3
Merge pull request #105 from kjvalencik/main
safety: Use send_wrapper in WASM instead of unsafe
2022-06-20 13:36:05 -07:00
Jeremiah Senkpiel 0a54b06696 6.5.3
### Deps
- `h1-client` now uses `dashmap` at version `5.x >`, fixing an unsoundness issue.
2022-06-20 13:33:16 -07:00
Jeremiah Senkpiel 16e21f889e
Merge pull request #106 from adlerjohn/adlerjohn/update-dashmap-v5.3.4
Bump `dashmap` to v5.3.4.
2022-06-20 13:27:14 -07:00
John Adler b25f87699e
Bump `dashmap` to v5.3.4. 2022-06-18 15:58:46 -04:00
K.J. Valencik e62818f068
safety: Use send_wrapper in WASM instead of unsafe
Resolves https://github.com/http-rs/http-client/issues/40
2022-06-14 17:18:16 -04:00
Jeremiah Senkpiel 88e93dffca 6.5.2
### Deps
- Now only uses `dashmap` for `h1-client`.
2022-05-10 11:39:16 -07:00
Jeremiah Senkpiel 439675dfb6 doc: fix changelog for 6.5.1
This was missed from
3c0ed9a2f3
2022-05-10 11:37:20 -07:00
Jeremiah Senkpiel a67fc47b12
Merge pull request #101 from Zwo1in/dashmap-only-in-h1-client
Move dashmap to h1-client dependencies
2022-05-10 11:34:52 -07:00
Maciej Zwoliński 7948213bc3 Move dashmap to h1-client dependencies 2022-02-23 22:10:23 +01:00
Jakub Wieczorek 059b23e5d6
Upgrade the `async-tls` dependency to 0.11. 2022-02-19 12:55:24 +01:00
Jakub Wieczorek 71ff91b4d1
Upgrade the `rustls` dependency to 0.19. 2022-02-19 12:55:05 +01:00
Jeremiah Senkpiel 3c0ed9a2f3 6.5.1
Same as 6.5.0 with one change:

`Config::max_connections_per_host()` is now properly named `Config::set_max_connections_per_host()`.

### Added
- `Config` has been stabilized and is now available by default!
- `wasm_client` support for `Config` (only timeouts).
- `Config::max_connections_per_host` (Supported on `h1_client` and `curl_client`.)

### Deprecated
- `H1Client::with_max_connections()` was been superseded by `Config::max_connections_per_host`.
2021-08-19 10:43:35 -07:00
Jeremiah Senkpiel 80e4fc5daa 6.5.0
- `Config` has been stabilized and is now available by default!
- `wasm_client` support for `Config` (only timeouts).
- `Config::max_connections_per_host` (Supported on `h1_client` and `curl_client`.)

- `H1Client::with_max_connections()` was been superseded by `Config::max_connections_per_host`.
2021-08-19 10:22:08 -07:00
Jeremiah Senkpiel 14dd1bb460 change: deprecate with_max_connections
Follow-up for stabilising Config.
2021-08-10 15:52:20 -07:00
Jeremiah Senkpiel cd300ac656 feat: stabilize Config
I've been using this in projects for a couple months now, and would like to land support in Surf directly, for which this should be stabilized.

Refs: https://github.com/http-rs/surf/pull/310
Refs: https://github.com/http-rs/http-client/pull/86
Closes: https://github.com/http-rs/http-client/issues/93
2021-08-10 15:52:20 -07:00
Jeremiah Senkpiel 772154ea38 feat: Config support for wasm_client
Only supports `timeout`, unfortunately, and requires async-std...
2021-08-10 10:52:02 -07:00
Jeremiah Senkpiel cdb4972b5f
Merge pull request #91 from Fishrock123/fix-wasm-tests
tests: fix wasm tests by setting a getrandom feature
2021-06-29 17:36:03 -07:00
Jeremiah Senkpiel 41f2507d2e tests: fix wasm tests by setting a getrandom feature 2021-06-29 17:25:19 -07:00
Jeremiah Senkpiel d9af4d1cc6 6.4.1
### Docs
- Added `"unstable-config"` to the docs builds.
2021-05-19 12:21:06 -07:00
Jeremiah Senkpiel 3993050157
Merge pull request #88 from Fishrock123/doc-unstable-config
docs: add "unstable-config" feature
2021-05-19 11:44:23 -07:00
Jeremiah Senkpiel 2ad0d6de27 docs: add "unstable-config" feature
Some of the spots don't actually highlight the feature correctly in the docs, notably the functions on the trait.
2021-05-19 11:32:17 -07:00
Jeremiah Senkpiel 32001a2765 6.4.0
### Added
- Added a new `unstable-config` feature, which exposes runtime configuration via a new `Config` struct.
2021-05-17 17:02:17 -07:00
Jeremiah Senkpiel 7d8db8a4e4
Merge pull request #86 from Fishrock123/configuration
feat: unstable HttpClient Config
2021-05-17 16:44:27 -07:00
Jeremiah Senkpiel a268be7cfd refactor: share the H1Client Config via an Arc 2021-05-05 17:40:21 -07:00
Jeremiah Senkpiel 2740e2641c feat: add `tls_config` to Config
Only supports the h1 client, but has two different options, one each for native-tls and rustls.
2021-05-05 17:40:21 -07:00
Jeremiah Senkpiel 06249b8016 feat: add `http_keep_alive` to Config
Also renamed `no_delay` to `tcp_no_delay`.

the options for configuring this in Isahc and Hyper are unfortunately not super clear.
2021-05-05 13:51:46 -07:00
Jeremiah Senkpiel 6508f13644 feat: unstable HttpClient Config
This adds an `unstable-config` feature, with a new `Config` struct, which can be used to configure any `HttpClient` which implements support for it.

Currently it supports two features - the most important and most generally supported:
- `timeout` (`Duration`)
- `no_delay` (`bool`)

Implementations are provided for async-h1, isahc, and hyper (partial, no `no_delay` support due to the tls connector).

No serious attempt has been made to add this to the wasm client at this point, since I don't understand well how to even build the wasm client or if it even works anymore with the state of rust wasm web build tools.
2021-05-05 11:45:30 -07:00
Jeremiah Senkpiel 6ba80b3ce3 6.3.5
### Fixed
- Multiple headers of the same name are now present with any client backend and not just `h1_client`.
- Connection when multiple IPs are present for a hostname not function with the `h1_client` backend.
2021-03-12 15:48:40 -08:00
Jeremiah Senkpiel bcbc2b2138
Merge pull request #80 from OSSystems/issue-79
h1: Fix connection with multiple IPs for a hostname
2021-03-12 14:54:28 -08:00
Jeremiah Senkpiel e7375aff47
Merge pull request #83 from jacobmischka/fix-multiple-headers
Use append_header, not insert_header
2021-03-12 14:46:56 -08:00
Jacob Mischka b23a4e72d6
Use append_header, not insert_header
Fixes https://github.com/http-rs/surf/issues/297
2021-03-12 16:01:26 -06:00
Otavio Salvador e5bbc272d1 h1: Fix connection with multiple IPs for a hostname
When trying to connect to multiple IPs for a hostname (e.g. IPv4 and
IPv6) we ought to try all prior returning error.

Running a wget to the running mockito server has this output:

,----
| $ wget -O- http://localhost:1234/report
| --2021-03-08 16:13:12--  http://localhost:1234/report
| Resolving localhost (localhost)... ::1, 127.0.0.1
| Connecting to localhost (localhost)|::1|:1234... failed: Connection refused.
| Connecting to localhost (localhost)|127.0.0.1|:1234... connected.
| HTTP request sent, awaiting response... 200 OK
`----

Fixes: #79.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2021-03-10 15:13:35 -03:00
Jeremiah Senkpiel db0025ddff 6.3.4
### Fixed
- `h1_client` connection pools now properly check if connections are still alive before recycling them.
     - Like, actually properly this time.
     - There is a test now to ensure closed connections don't cause errors.
2021-03-06 20:17:49 -08:00
Jeremiah Senkpiel cab5441fa3
Merge pull request #77 from Fishrock123/fix-h1-connection-pooling
fix: properly check if connections can be recycled
2021-03-06 12:15:27 -08:00
Jeremiah Senkpiel 70d180552d refactor: improve the code for connection recycling
This avoids unnecessarily registering with the waker when we aren't going to poll until Ready.

Thanks to Kestrer on discord.
2021-03-06 19:56:25 -08:00
Jeremiah Senkpiel d129f07ca4 fix: properly check if connections can be recycled
Checks `poll_read`'s status directly, so that we can ensure
a socket read actually  happens, and then immediately continue
if we get `Poll::Pending`.

Related to https://github.com/http-rs/http-client/issues/75
2021-03-06 19:23:23 -08:00
Jeremiah Senkpiel e62f1efe60 ci: relax errors on warnings
missing_doc_code_examples was renamed to rustdoc::missing_doc_code_examples on nightly but the rustdoc lint tool namespace doesn't exist on stable.
2021-03-06 18:32:09 -08:00
Jeremiah Senkpiel 2abe14982e 6.3.3
### Fixed
- `h1_client` connection pools now properly check if connections are still alive before recycling them.
2021-03-01 15:26:07 -08:00
Jeremiah Senkpiel bd846e3af6 docs: note the erronous 6.3.2 in changelog
(6.3.2 was the same thing as 6.3.1 released by git accident.)
2021-03-01 15:25:08 -08:00
Jeremiah Senkpiel c81a00d7f2
Merge pull request #72 from Fishrock123/h1-pooling-fix-recycle
fix: only recycle if conn is still open
2021-03-01 15:11:21 -08:00
Jeremiah Senkpiel 977178e411 fix: only recycle if conn is still open
Should fix https://github.com/http-rs/http-client/issues/71
2021-03-01 12:29:20 -08:00
Jeremiah Senkpiel faf1b4a0dd 6.3.1
### Fixed
- Allow http-client to build & run properly when `h1_client` is enabled without either tls option.
- Prefer `rustls` if both tls features are enabled.

### Internal
- More exhaustive CI for feature combinations.
2021-02-15 10:17:05 -08:00
Jeremiah Senkpiel 40e188e056
Merge pull request #69 from taiki-e/feature
Fix h1_client feature
2021-02-15 10:09:23 -08:00
Taiki Endo 023768c03f Fix h1_client feature
* When both "native-tls" and "rustls" features are disabled, disable https.
* When both "native-tls" and "rustls" features are enabled, prefer "rustls".
  This is the same behavior as http-client 6.2.0.
  Ideally, it would be nice if this behavior could be controlled by
  environment variables or some other way.

This also adds a CI task to check all feature combinations work properly.
2021-02-14 17:08:25 +09:00
Jeremiah Senkpiel 0f57f867aa 6.3.0
### Added
- Connection pooling (HTTP/1.1 `keep-alive`) for `h1_client` (default).
- `native-tls` (default) and `rustls` feature flags.
    - Only works with `h1_client`.
- Isahc metrics as a response extension for `curl_client`.

### Fixed
- `Box<dyn HttpClient>` no longer infinitely recurses.
- `curl_client` now always correctly reads the response body.
- `hyper_client` should now build correctly.
- `WasmClient` fetch from worker scope now works correctly.

### Internal
- Improved CI
2021-02-12 15:13:14 -08:00
Jeremiah Senkpiel 7b6e3d9018
Merge pull request #68 from Fishrock123/h1-client-debug-struct
feat: better debug struct for H1Client
2021-02-12 13:21:49 -08:00
Jeremiah Senkpiel 7726816a3d
Merge pull request #67 from Fishrock123/rework-tls-features
change: separate out tls feature flags
2021-02-12 13:20:19 -08:00
Jeremiah Senkpiel 3c7593f669 change: separate out tls feature flags
A successor to https://github.com/http-rs/http-client/pull/53, this separates out the tls feature flags, which should be nicer.

Fixes: https://github.com/http-rs/http-client/issues/54
2021-02-12 13:00:17 -08:00
Jeremiah Senkpiel 492f72c2e1 example: debug print client "any" client
Doesn't actually play nice with hyper and wasm, oh well.
2021-02-12 12:56:02 -08:00