Commit Graph
513 Commits
Author SHA1 Message Date
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 cc2b1634e2 chore: Update intra doc link lint name (#805) 2021-10-22 11:31:36 -04:00
Lucio FrancoandGitHub bbcacd0625 chore: Fix routeguide example warning (#807) 2021-10-22 11:17:04 -04:00
Lucio FrancoandGitHub 3ab00f304d fix(transport): AddOrigin panic on invalid uri (#801) 2021-10-22 08:45:04 -04:00
Tom DyasandGitHub ff6a690cec fix(build): Correctly convert Empty to () (#734) 2021-10-22 08:44:27 -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
LOU XunandGitHub 53ecc1f85e fix(build): split path types in compile (#721)
BREAKING: Build paths now accept two different types
2021-10-20 10:46:28 -04:00
Ofek LevandGitHub 7d024e292b Fix link (#732) 2021-10-20 10:33:01 -04:00
Derek StricklandandGitHub 3f9ab801f7 feat(build): Support prost's include_file option (#774) 2021-10-20 10:11:01 -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
c1fe31c1a3 health, reflection: make rustfmt dependency optional (#785)
Co-authored-by: Lucio Franco <[email protected]>
2021-10-19 11:22:34 -04:00
Eliza WeismanandGitHub 09805ece45 feat: Update prost and friends to 0.9 (#791) 2021-10-19 10:59:28 -04:00
Lucio FrancoandGitHub 4604042934 Add streaming example w/ client disconnect (#782) 2021-10-07 17:04:26 -04:00
Mihai Claudiu ToaderandGitHub 5c1bb90ce8 fix(tonic): fix extensions disappearing during streaming requests
Fixes #770
2021-09-30 12:56:12 +02:00
Jerboas86andGitHub ddab65ede9 docs: fix typo (#760)
in in <--> in
2021-09-08 18:43:10 +02:00
Nicholas ConnorandGitHub b30b1a1e25 Fix README.md links (#756) 2021-09-02 21:23:18 +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
David PedersenandGitHub 4e578b5046 doc(tonic): add more interceptor examples (#736)
Some have asked how to use the new `Interceptor` trait to create named
interceptors. This updates the client example to show how to do that.
2021-08-09 16:42:15 +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
Blake WilloughbyandGitHub 6ee638d940 feat(health): Expose grpc_health_v1 file descriptor set (#620) 2021-07-13 15:35:35 -04:00
David PedersenandGitHub 99fdc98d41 chore: Prepare tonic-build v0.5.1 (#720) 2021-07-13 20:17:58 +02:00
David PedersenandGitHub 380d81dd86 fix(build): allow services to be named Service (#709)
Fixes https://github.com/hyperium/tonic/issues/676
2021-07-12 16:47:45 +02:00
David PedersenandGitHub 167e8cb5b2 fix(build): remove unnecessary Debug constraint for client streams (#719)
This was accidentally committed as part of
https://github.com/hyperium/tonic/pull/692.

Fixes https://github.com/hyperium/tonic/issues/718
2021-07-12 16:41:09 +02: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
David PedersenandGitHub 5aa8ae1fec feat(examples): add grpc-web example (#710)
Creates a server using tonic-web and a client that uses a regular
`hyper::Client` and issues a regular HTTP/1.1 request.
2021-07-09 18:02:43 +02:00
Lucio Franco 5bb1a029a1 Fix tonic-types and health versions 2021-07-08 15:57:25 -04: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
Conner BryanandGitHub a948a8f884 feat(build): support adding attributes to clients and servers (#684) 2021-07-08 15:01:28 -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
Lucio FrancoandGitHub 2346d99f6e example: Add mocked io example (#677)
* example: Add mocked io example

* fix mock example

* Remove uniex bound for mock impl
2021-07-08 10:45:04 -04: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
Juan AlvarezandGitHub 4e0d2fc598 chore(tonic-web): add crate metadata and README (#675) 2021-06-04 16:26:15 -05:00