Commit Graph
304 Commits
Author SHA1 Message Date
Dirkjan OchtmanandGitHub ef6e245180 fix: Return error on non https uri instead of panic (#838) 2022-02-15 15:11:36 -05:00
Alex PearsonandGitHub bf44940f9b fix: Handle interceptor errors as responses (#840) (#842) 2022-02-15 15:10:35 -05:00
Anthony GreenandGitHub dee2ab52ff feat(transport): add unix socket support in server (#861) 2022-02-14 15:00:58 -05:00
Theodore ZilistandGitHub 468e4221f0 Add identity to from_encoding_header (#880) 2022-01-31 23:29:33 +01:00
Andrew HickmanandGitHub d574cfda3a fix(codec): Remove Default bound on Codec (#894) 2022-01-24 13:34:54 -05:00
tottotoandGitHub 65eceb1a6f chore(tonic): Update intra doc links lint name (#877) 2022-01-12 16:35:27 -05:00
Robin LambertzandGitHub a33e15a387 fix(tonic): Expose h2 error instead of reason (#883) 2022-01-12 16:33:24 -05:00
tottotoandGitHub 366d888a4b chore: Fix clippy lints (#881) 2022-01-12 16:32:40 -05:00
Dirkjan OchtmanandGitHub 4548997080 feat(tls): upgrade to tokio-rustls 0.23 (rustls 0.20) (#859) 2022-01-12 15:09:30 -05:00
David PedersenandGitHub e78a2d832f chore: Prepare 0.6.2 (#860)
- Contains the revert to [rust 2018](https://github.com/hyperium/tonic/pull/847).
- Bumps both tonic and tonic-build.
- tonic-build goes from 0.6.0 to 0.6.2 since there was no 0.6.1. I
  believe we want tonic and tonic-build versions to follow each other.
2021-12-08 17:42:16 +01:00
Dirkjan OchtmanandGitHub 5a88e11887 chore: fix warnings around unused TLS code (#858) 2021-12-07 10:18:19 +01:00
David PedersenandGitHub 101f2f76d4 chore: revert to 2018 edition (#847)
Fixes https://github.com/hyperium/tonic/issues/843
2021-12-07 09:49:07 +01:00
Thomas de ZeeuwandGitHub 7ea854b695 chore: Point to Request::set_timeout in Endpoint::timeout docs (#817) 2021-10-28 10:24:07 -04:00
Lucio FrancoandGitHub a6c77d1f77 chore: Prepare 0.6.1 (#814) 2021-10-26 20:29:35 -04:00
Lucio FrancoandGitHub 2a3e9b2f6f fix(transport): Bump hyper to 0.14.14 (#813) 2021-10-26 20:14:08 -04:00
Lucio FrancoandGitHub 2fe7131a23 chore: Prepare 0.6.0 release (#811) 2021-10-25 10:25:56 -04:00
Lucio FrancoandGitHub 23c1392fb7 fix(tonic): Remove Sync requirement for streams (#804) 2021-10-24 21:48:05 -04:00
Lucio FrancoandGitHub 1f3df8db9e chore: Upgrade to 2021 edition (#808) 2021-10-24 21:12:20 -04:00
Lucio FrancoandGitHub 3ab00f304d fix(transport): AddOrigin panic on invalid uri (#801) 2021-10-22 08:45:04 -04:00
4947b076f5 fix(transport): Correctly map hyper errors (#629)
Co-authored-by: Lucio Franco <[email protected]>
2021-10-20 11:05:27 -04:00
2e471548d8 fix(tonic): change connect_lazy to be infallible (#712)
Co-authored-by: Lucio Franco <[email protected]>
2021-10-20 10:47:17 -04:00
88008191fc compression: handle compression flag but no header (#763)
Co-authored-by: Quentin Perez <[email protected]>
Co-authored-by: Lucio Franco <[email protected]>
2021-10-20 10:02:52 -04:00
Lucio FrancoandGitHub 4054d61e14 fix(tonic): Status code to set correct source on unkown error (#799) 2021-10-19 11:52:59 -04:00
Eliza WeismanandGitHub 09805ece45 feat: Update prost and friends to 0.9 (#791) 2021-10-19 10:59:28 -04:00
Mihai Claudiu ToaderandGitHub 5c1bb90ce8 fix(tonic): fix extensions disappearing during streaming requests
Fixes #770
2021-09-30 12:56:12 +02:00
Sönke HahnandGitHub a7f9cf2afa Fix typo in docs (#753) 2021-09-01 08:29:08 +02:00
David PedersenandGitHub 65df87ad6c chore: Prepare tonic v0.5.2 (#738)
So as highlighted by
https://github.com/hyperium/tonic/issues/730#issuecomment-895635088 it
turns out the new `Interceptor` trait required changes to tonic-build as
well, which I forgot to publish yesterday. Didn't see it because it wasn't
clear from the commit message.

So this bumps tonic _and_ tonic-build to 0.5.2 so we can release both.
There are no code changes.
2021-08-10 15:35:36 +02:00
David PedersenandGitHub efe0865d26 chore: Prepare tonic v0.5.1 and tonic-health 0.4.1 (#737) 2021-08-09 17:20:36 +02:00
Yotam OfekandGitHub 8c8f4d1251 feat(tonic): add Interceptor trait (#713)
* Expose `Interceptor` trait.

* Revert changes to public API surface.

* Rename types, add deprecated alias for old names.
2021-07-27 11:11:51 -04:00
Lucio FrancoandGitHub 0e33a0241e feat(transport): Add Connected impl for DuplexStream (#722) 2021-07-13 15:39:42 -04:00
Conner BryanandGitHub 0a06603659 derive Clone for RouterService (#714) 2021-07-11 15:37:07 +02:00
David PedersenandGitHub 4b0ece6d28 chore: fix clippy lints (#707) 2021-07-09 18:23:55 +02:00
040e3a4811 chore: Prepare v0.5 release (#706)
* bump tonic version to 0.5

* Update changelog for 0.5

* Update CHANGELOG.md

Co-authored-by: David Pedersen <[email protected]>

* address comments

Co-authored-by: David Pedersen <[email protected]>
2021-07-08 15:53:14 -04:00
David PedersenandGitHub acdb3273bb chore: update prost, and related crates, to 0.8 (#703)
* chore: update prost, and related crates, to 0.8

Updates prost, prost-derive, prost-build, and prost-types to 0.8.

* Update the last few places
2021-07-08 15:02:02 -04:00
David PedersenandGitHub 89df3380dd doc(tonic): mention tower-http's tracing middleware (#705)
Fixes https://github.com/hyperium/tonic/issues/654
2021-07-08 17:50:27 +02:00
David PedersenandGitHub 6711b80674 fix(tonic): don't remove reserved headers in interceptor (#701)
`InterceptedService` would previously use `tonic::Request::into_http`
which removes reserved headers. That mean inner middleware in the stack
wouldn't be able to see those headers, which could result in errors.

Fixes https://github.com/hyperium/tonic/issues/700
2021-07-08 10:30:46 -04:00
David PedersenandGitHub 0583cff80f feat(codec): compression support (#692)
* Initial compression support

* Support configuring compression on `Server`

* Minor clean up

* Test that compression is actually happening

* Clean up some todos

* channels compressing requests

* Move compression to be on the codecs

* Test sending compressed request to server that doesn't support it

* Clean up a bit

* Compress server streams

* Compress client streams

* Bidirectional streaming compression

* Handle receiving unsupported encoding

* Clean up

* Add note to future self

* Support disabling compression for individual responses

* Add docs

* Add compression examples

* Disable compression behind feature flag

* Add some docs

* Make flate2 optional dependency

* Fix docs wording

* Format

* Reply with which encodings are supported

* Convert tests to use mocked io

* Fix lints

* Use separate counters

* Don't make a long stream

* Address review feedback
2021-07-02 11:25:03 -04:00
Lucio Franco 7677ad6476 Fix connect with connector lazy 2021-07-01 18:31:39 +00:00
Lucio FrancoandGitHub 2a46ff5c96 feat(transport): Add connect_with_connector_lazy (#696)
Closes #695
2021-07-01 14:13:41 -04:00
Lucio FrancoandGitHub 737ace393d fix(codec): Fix streaming reponses w/ many status (#689)
Closes #681
2021-07-01 10:25:43 -04:00
2b60a00614 feat(transport): add connect timeout to Endpoint (#662)
Pulls in [hyper-timeout] which has a connector that can have a timeout
applied. I did consider vendoring hyper-timeout since its a fairly small
crate. I guess we can always do that later since its not exposed
publicly.

I would also like to add a test but I'm not sure about the best way of
testing this.

Fixes https://github.com/hyperium/tonic/issues/498

[hyper-timeout]: https://github.com/hjr3/hyper-timeout

Co-authored-by: Lucio Franco <[email protected]>
2021-07-01 10:23:22 -04:00
Tom DyasandGitHub b90bb7bbc0 feat(tonic): add h2::Error as a source for Status (#612)
## Motivation

A gRPC server may send a HTTP/2 GOAWAY frame with NO_ERROR status to gracefully shutdown a connection. This appears to Tonic users as a `tonic::Status` with `Code::Internal` and the message set to `h2 protocol error: protocol error: not a result of an error`.

The only way to currently detect this case and differentiate it from other internal errors (e.g., an application-level internal error) is to match on the message. A client may want to differentiate these cases because it may only want to alert on the application-level internal error and not on the transient transport-level issue. (Indeed, this is the use case for which I'm envisioning using this change.)

Matching on a message is not as robust, however, as matching on an `h2::Error` and its reason code. (The message could change for example if a future version of Tonic decided to vary the message. This would break any users that matched on the previous version of the message.)

## Solution

Store the `h2::Error` used when creating a `tonic::Status` from a `h2::Error` and provide it as the `source` for purposes of `std::error::Error`. This will allow users to downcast it and match on the original `h2::Reason`.
2021-06-23 08:34:07 +02:00
David PedersenandGitHub 12815d0a1d feat(tonic): expose setting for http2_adaptive_window (#657)
Fixes https://github.com/hyperium/tonic/issues/358
2021-06-21 12:42:52 -04:00
Szymon GibałaandGitHub 2ba0889553 tonic: propagate call to poll_ready in InterceptedService (#685)
Fixes: #678
2021-06-19 16:51:20 +02:00
gmorerandGitHub e1993877c4 fix(web): fix compilation (#670)
Make tonic::body::empty_body public and use it instead of the old and non existant anymore BoxBody::empty()
2021-06-02 13:59:11 +02:00
David PedersenandGitHub 9cc14b79fb fix(codec): improve error message for invalid compression flag (#663)
* fix(codec): improve error message for invalid compression flag

Fixes https://github.com/hyperium/tonic/issues/492

* Update tonic/src/codec/decode.rs
2021-05-28 13:28:02 +02:00
David PedersenandGitHub e5e311853b feat(transport): provide generic access to connect info (#647) 2021-05-28 13:27:37 +02:00
David PedersenandGitHub 31a34681c7 fix(tonic): don't include error's cause in Display impl (#633)
At Embark we have a little helper function that converts a `&dyn
std::error::Error` into a `String` by walking the full chain of sources
(with `std::error::Error::source`) and joining them into a `String`.

We use that where we log errors to get as much information as possible
about whats causing an error. Works particularly well with anyhow's
`.context()` method.

However since `tonic::transport::Error` include its cause in their
`Display` impl we get the sources more than once.

As the cause can already be obtained through `std::error::Error::source`
no information should be lost by doing this.

Fixes https://github.com/hyperium/tonic/issues/632
2021-05-27 22:53:43 +02:00
Josh TriplettandGitHub 32173dc7f6 feat(transport): Add a tls-webpki-roots feature to add trust roots from webpki-roots (#660) 2021-05-24 10:35:05 -04:00
David PedersenandGitHub 4d2667d1cb feat(tonic): make it easier to add tower middleware to servers (#651) 2021-05-19 09:19:58 +02:00