Commit Graph

190 Commits

Author SHA1 Message Date
Sean McArthur
cb3f39c2dc feat(lib): update Tokio, bytes, http, h2, and http-body 2019-12-04 10:56:34 -08:00
Daniel Johnson
71d088d3d0 chore(dependencies): update futures to 0.3.1 2019-11-14 10:04:16 -08:00
Sean McArthur
039281b89c fix(client): fix polling dispatch channel after it has closed 2019-10-30 14:34:19 -07:00
Sean McArthur
10cda4beff refactor(http2): replace server Unpin impl with pin_project 2019-10-22 18:33:05 -07:00
Sean McArthur
4f2743991c feat(service): rename Service to HttpService, re-export tower::Service`
The only important trait for a user is the `tower::Service` trait, which
is now available also at `hyper::service::Service`. The other "trait
aliases" are no longer publicly exported, as people thought they had to
implement them.

Also removes dependency on `tower-make`, which is trivial but otherwise
shouldn't affect anyone.

Closes #1959
2019-10-21 11:01:28 -07:00
Sean McArthur
ca5836f1ec fix(server): ignore expect-continue with no body in debug mode
Closes #1843
2019-10-18 15:44:01 -07:00
Sean McArthur
a1fe383c9d refactor(http1): notice eof in the try_keep_alive method 2019-10-18 15:16:07 -07:00
Sean McArthur
7e31fd88a8 feat(server): change http1_half_close option default to disabled
Detecting a read hangup is a useful way to determine that a connection
has closed. It's also possible that a client shuts down its read half
without closing the connection, but this is rarer. Thus, by default,
hyper will now assume a read EOF means the connection has closed.

BREAKING CHANGE: The server's behavior will now by default close
  connections when receiving a read EOF. To allow for clients to close
  the read half, call `http1_half_close(true)` when configuring a
  server.
2019-10-18 13:34:23 -07:00
Taiki Endo
bcb66736fb chore(dependencies): update pin-project to 0.4 2019-10-01 06:40:41 -07:00
Sean McArthur
cea3589ef7 test(lib): deny warnings 2019-09-11 15:44:26 -07:00
Sean McArthur
6842c44a43 test(h1): re-enable h1 decoder tests 2019-09-11 14:49:14 -07:00
Sean McArthur
463982cda5 test(h1): re-enable h1 dispatch tests 2019-09-11 13:56:14 -07:00
Sean McArthur
0867ad5c15 fix(client): allow client GET requests with explicit body headers
Closes #1925
2019-09-04 15:22:30 -07:00
Aaron Hill
4c552a4960 refactor(lib): Use pin-project crate to perform pin projections
Remove all pin-related `unsafe` code from Hyper, as well as the
now-unused 'pin-utils' dependency.
2019-09-03 12:31:35 -07:00
Sean McArthur
946275dd1f perf(body): re-enable optimization for full-data Bodies 2019-08-30 16:44:10 -07:00
Sean McArthur
3c6f7999cd wip: body typeid full data 2019-08-30 16:23:28 -07:00
Sean McArthur
62a96c077b feat(body): change Sender::send_data to an async fn.
The previous version is renamed to `try_send_data`.

BREAKING CHANGE: Usage of `send_data` should either be changed to
  async/await or use `try_send_data`.
2019-08-30 16:04:07 -07:00
Lucio Franco
79c32f8953 feat(body): Update Payload to be a trait alias of http_body::Body (#1908) 2019-08-22 14:13:27 -07:00
Sean McArthur
49b12c415d refactor(lib): fix remaining lint warnings (besides tests) 2019-08-22 13:57:50 -07:00
Sean McArthur
7b1d6d71b7 refactor(lib): fix many lint warnings 2019-08-21 11:58:02 -07:00
lzutao
fc7f81b67c style(lib): use rust 2018 edition idioms (#1910) 2019-08-21 11:22:07 -07:00
Sean McArthur
fc784913a3 chore(dependencies): update to newer h2 2019-08-20 16:24:34 -07:00
Lucio Franco
ec520d5602 feat(service): use tower_service::Service for hyper::service 2019-08-20 12:01:06 -07:00
Sean McArthur
41f4173615 refactor(http2): re-enable http2 client and server support 2019-08-19 15:55:49 -07:00
Sean McArthur
1f6575279e test(h1): re-enable the proto::h1::io tests 2019-07-16 14:22:17 -07:00
Sean McArthur
5da17df97f chore(lib): individually disable tests and examples that aren't updated 2019-07-12 13:44:03 -07:00
Sean McArthur
8f4b05ae78 feat(lib): update to std::future::Future
BREAKING CHANGE: All usage of async traits (`Future`, `Stream`,
`AsyncRead`, `AsyncWrite`, etc) are updated to newer versions.
2019-07-09 15:55:22 -07:00
Sean McArthur
da9b0319ef refactor(lib): update to 2018 edition 2019-07-09 15:16:01 -07:00
Sean McArthur
3e2f19e5bb chore(lib): allow deprecated mem::uninitialized 2019-07-08 16:17:03 -07:00
Sean McArthur
3446af020b refactor(http1): detect whether a Token parse error is for method or uri 2019-07-03 15:06:44 -07:00
Sean McArthur
8316f96d80 fix(http1): force always-ready connections to yield after a few spins 2019-06-14 13:35:54 -07:00
Sean McArthur
50198851a2 fix(http2): correctly propagate HTTP2 request cancellation 2019-06-03 14:39:35 -07:00
Sean McArthur
01c03db7ea chore(lib): add dyn keyword to trait objects (#1820)
Requires Rust 1.27.
2019-06-03 13:08:13 -07:00
João Oliveira
b342c38f08 fix(server): skip automatic Content-Length header for HTTP 304 responses
Closes #1797
2019-05-07 12:53:25 -07:00
Sean McArthur
e0ec5cad9a fix(client): detect HTTP2 connection closures sooner 2019-04-29 16:17:11 -07:00
Sean McArthur
271bba1667 refactor(error): improve organization of Error kinds
- Placed all cases of "unexpected bytes" errors into the
  `UnexpectedMessage` variant.
- Placed all cases of "unexpected EOF" errors into the
  `IncompleteMessage` variant. Description is now generic about
  "connection closed before message completed", instead of mentioning
  "request" or "response.
- Added `Error::is_incomplete_message()` accessor to help checking for
  unexpected closures.
- Renamed some variants to be clearer when viewing the `Debug` format.
- Collected all "user" errors into an internal `User` enum, to prevent
  forgetting to update the `is_user()` method.
2019-04-26 10:44:40 -07:00
bishtpawan
0c1e1823f8 refactor(http1): apply a few clippy suggestions
use is_empty() instead of .len()
use if let instead of match
2019-04-23 12:56:30 -07:00
Sean McArthur
f5885f3d5d chore(lib): fix unused_mut warnings from newest nightly 2019-04-23 12:45:19 -07:00
Sean McArthur
5680d94419 fix(http2): fix import of h2::Reason to work on 1.26 2019-04-09 14:06:33 -07:00
Sean McArthur
42c5efc085 fix(http2): send a GOAWAY when the user's Service::poll_ready errors
The `Error::source()` is searched for an `h2::Error` to allow sending
different error codes in the GOAWAY. If none is found, it defaults to
`INTERNAL_ERROR`.
2019-04-09 12:49:43 -07:00
Sean McArthur
c7a046c518 refactor(http1): fix redundant imports 2019-04-01 18:33:38 -07:00
Sean McArthur
fc18b680a5 feat(http2): check Error::source() for an HTTP2 error code to send in reset 2019-03-25 13:10:41 -07:00
Yusuke Sasaki
d1501a0fd3 fix(server): prohibit the length headers on successful CONNECT
Closes #1783
2019-03-20 10:06:34 -07:00
Kevin Leimkuhler
7dcd4618c0 feat(http2): Add window size config options for Client and Server
Add `fn http2_initial_stream_window_size` and `fn
http2_initial_connection_window_size` for client and server.

Closes #1771
2019-03-01 14:44:38 -08:00
Sean McArthur
cbae4294c4 feat(server): add http2_max_concurrent_streams builder option
Closes #1772
2019-02-28 16:19:12 -08:00
Sean McArthur
8f926a0dae fix(http2): send INTERNAL_ERROR when user's Service errors 2019-02-28 16:04:53 -08:00
Sean McArthur
3a6080b14a fix(client): coerce HTTP_2 requests to HTTP_11
Closes #1770
2019-02-27 17:00:25 -08:00
Yusuke Sasaki
0bf30ccc68 feat(service): add poll_ready to Service and MakeService (#1767) 2019-02-27 09:30:52 -08:00
Sean McArthur
1e6603353e perf(http2): don't register callback with main h2 client task 2019-02-25 17:27:51 -08:00
Sean McArthur
c0e08a41cc refactor(lib): improve client and h1 logs 2019-02-15 15:58:35 -08:00