Commit Graph

2093 Commits

Author SHA1 Message Date
Sean McArthur
ec7b93c982 v0.12.20 2019-01-07 15:04:42 -08:00
Sean McArthur
e5135dd6f6 fix(dependencies): disable unneeded optional tokio features
Closes #1739
2019-01-07 15:03:20 -08:00
Sean McArthur
cf034e99fa fix(http2): don't consider an h2 send request error as canceled 2018-12-19 13:16:49 -08:00
Sean McArthur
5abbe59696 v0.12.19 2018-12-18 12:47:11 -08:00
Sean McArthur
1d253b4d47 fix(rt): prevent fallback reactor thread from being created accidentally
Switches from `Handle::current()` to `Handle::default()`.
2018-12-18 12:44:08 -08:00
Nico Burns
ce56ffb656 docs(readme): mention reqwest as a higher level client
Many people will find `hyper` when searching for a Rust HTTP crate. Reqwest is not nearly so easy to find unless you know what you are looking for, but is what a lot of people looking for a rust http library need. Let's point them in the right direction. I recently came across a new Rust user on Reddit who had found the hyper crate, but was trying to use libcurl bindings to make http requests because they hadn't managed to find reqwest.
2018-12-16 13:57:37 -08:00
Sean McArthur
720c068e56 v0.12.18 2018-12-11 16:14:13 -08:00
Sean McArthur
5fe2a47644 refactor(http2): fix Error::new_canceled call 2018-12-11 16:14:13 -08:00
Sean McArthur
9b69fa9740 refactor(http2): make several http2 errors more specific 2018-12-11 15:59:35 -08:00
Sean McArthur
f8f926c14c doc(client): document that http2_only needs Prior Knowledge or ALPN
configured.

Closes #1698
2018-12-11 15:41:01 -08:00
Sean McArthur
2d5eabdeed feat(server): add server::conn::AddrIncoming::bind constructor 2018-12-11 14:22:53 -08:00
Sean McArthur
3287a0cdab test(client): fix pool tests compilation errors 2018-12-06 16:55:24 -08:00
Sean McArthur
138b1f8a7c test(server): remove unneeded mutex for TestService 2018-12-06 11:06:45 -08:00
Sean McArthur
fdd0413418 v0.12.17 2018-12-05 17:01:07 -08:00
Sean McArthur
010a886516 refactor(client): remove dead exec function 2018-12-05 17:01:07 -08:00
Sean McArthur
4b3747110a refactor(client): clean up client config fields 2018-12-05 12:17:03 -08:00
Sean McArthur
155dc41e70 chore(CI): remove coveralls 2018-12-05 11:35:30 -08:00
Sean McArthur
65788fe7fe test(client): disable happy eyeballs tests except in CI 2018-12-05 10:57:37 -08:00
Sean McArthur
69a39f5a69 chore(README): remove AppVeyor badge 2018-12-05 10:56:51 -08:00
Sean McArthur
43ab541a57 chore(LICENSE): update license year 2018-12-05 10:56:20 -08:00
Sean McArthur
a522c3151a feat(service): export hyper::service::MakeServiceRef
It's sealed, and has a blanket implementation, and so should only be
used as bounds. Even still, its hidden from the docs.
2018-12-03 09:32:05 -08:00
Sean McArthur
01f6498355 feat(error): add Error::is_connect method
This allows inspecting errors to determine if they are from a client
trying to establish a connection (from the `Connect`).
2018-11-29 16:14:24 -08:00
Sean McArthur
fd25129dc0 perf(http1): implement an adaptive read buffer strategy
The default read strategy for HTTP/1 connections is now adaptive. It
increases or decreases the size of the read buffer depending on the
number of bytes that are received in a `read` call. If a transport
continuously fills the read buffer, it will continue to grow (up to the
`max_buf_size`), allowing for reading faster. If the transport
consistently only fills a portion of the read buffer, it will be shrunk.

This doesn't provide much benefit to small requests/responses, but
benchmarks show it to be a noticeable improvement to throughput when
streaming larger bodies.

Closes #1708
2018-11-28 12:54:17 -08:00
Johannes Weissmann
a6fff13a39 feat(server): add tcp_sleep_on_accept_errors builder method
This method allows to set the value of the `sleep_on_errors` option for
accepted connections using the builder.

Closes #1713
2018-11-27 16:25:15 -08:00
Sean McArthur
73345be65f feat(server): add http1_half_close(bool) option
This option determines whether a read EOF should close the connection
automatically. The behavior was to always allow read EOF while waiting
to respond, so this option has a default of `true`.

Setting this option to `false` will allow Service futures to be canceled
as soon as disconnect is noticed.

Closes #1716
2018-11-27 12:31:50 -08:00
Sean McArthur
c35bdca8fa chore(dependencies): update http to 0.1.14 for Uri::port_part 2018-11-27 11:55:02 -08:00
Jeff Labonte
69368f433f refactor(client): update from deprecated Uri::port to port_part (#1722) 2018-11-26 10:06:40 -08:00
Sean McArthur
7fb6e3a3ff v0.12.16 2018-11-21 16:43:12 -08:00
Sean McArthur
e455fa2452 fix(client): fix connection leak when Response finishes before Request body
If the Response was received and the body finished while the Request
body was still streaming, the connection could get into a state where it
was never polled again, thus never re-inserting into the connection pool
or being dropped.

Closes #1717
2018-11-21 16:39:47 -08:00
Rick Richardson
2e7250b669 feat(client): add http1_read_buf_exact_size Builder option
This changes the read buffer strategy from being adaptive to always
using an exact size for the buffer.
2018-11-21 14:07:21 -08:00
Sean McArthur
92a8aba610 v0.12.15 2018-11-20 12:55:08 -08:00
Sean McArthur
95446cc338 feat(client): add client::conn::Builder::executor method 2018-11-16 16:32:09 -08:00
Sean McArthur
30870029b9 feat(server): change NewService to MakeService with connection context
This adjusts the way `Service`s are created for a `hyper::Server`. The
`MakeService` trait allows receiving an argument when creating a
`Service`. The implementation for `hyper::Server` expects to pass a
reference to the accepted transport (so, `&Incoming::Item`). The user
can inspect the transport before making a `Service`.

In practice, this allows for things like getting the remote socket
address, or the TLS certification, or similar.

To prevent a breaking change, there is a blanket implementation of
`MakeService` for any `NewService`. Besides implementing `MakeService`
directly, there is also added `hyper::service::make_service_fn`.

Closes #1650
2018-11-16 13:18:09 -08:00
Sean McArthur
1158bd20b3 v0.12.14 2018-11-07 11:01:47 -08:00
Sean McArthur
9245e9409a fix(header): fix panic when parsing header names larger than 64kb 2018-11-06 14:37:13 -08:00
Sean McArthur
976a77a673 feat(client): add ALPN h2 support for client connectors
- Adds `Connected::negotiated_h2()` method to signal the connection must
  use HTTP2. `Connect` implementations should set this if using ALPN.

If a connection to a host is detected to have been upgraded via ALPN,
any other oustanding connect futures will be canceled, and the waiting
requests will make use of the single HTTP2 connection.

The `http2_only` builder configuration still works the same, not
requiring ALPN at all, and always using only a single connection.
2018-10-31 14:51:29 -07:00
Sean McArthur
bf188b28fe test(drain): add tests for futures drain utility 2018-10-26 13:59:58 -07:00
Sean McArthur
3af6aa80af v0.12.13 2018-10-26 13:04:03 -07:00
Sean McArthur
5ca2905c84 test(server): server test cleanup 2018-10-26 12:50:27 -07:00
Sean McArthur
576addd531 test(benches): don't concat chunks, just drop them 2018-10-25 17:22:01 -07:00
Sean McArthur
79f970c7ff test(benches): clean up end_to_end benchmark configuration 2018-10-25 17:15:06 -07:00
Sean McArthur
b20971cb4e perf(http2): less eager server polls since it hurts parallel flushing 2018-10-24 15:35:11 -07:00
Sean McArthur
6005827c3e refactor(http2): set content-length even when full_data is available 2018-10-24 15:20:21 -07:00
Sean McArthur
94e02ac276 perf(http2): eagerly poll some futures in h2 dispatchers before allocating in executor 2018-10-24 15:04:30 -07:00
Sean McArthur
dcf0347151 test(benches): add http1 pipeline bench target 2018-10-23 16:01:16 -07:00
Sean McArthur
4843364b5a test(benches): uses current_thread runtime in server benchmarks 2018-10-23 15:38:06 -07:00
Sean McArthur
deaa5d1aa9 chore(client): fix infinite recursion in TokioThreadpoolGaiResolver::new 2018-10-23 13:34:47 -07:00
Sean McArthur
34d780acd0 feat(dns): export client::connect::dns module, and
`TokioThreadpoolGaiResolver` type.
2018-10-23 12:49:56 -07:00
Steven Fackler
1e8d6439cf feat(dns): tokio_threadpool::blocking resolver
Unlike the default resolver, this avoids spawning extra dedicated
threads but only works on the multi-threaded Tokio runtime.

Closes #1676
2018-10-23 09:57:04 -07:00
Sean McArthur
6fe532da4c feat(client): allow Connected::extra to be chained to connectors can be composed 2018-10-18 15:51:19 -07:00