Commit Graph

898 Commits

Author SHA1 Message Date
Eric Anderson 1cfba96d17 Enforce sending headers before messages on server
ServerCall already had "headers must be sent before any messages, which
must be sent before closing," but the implementation did not enforce it
and our async server handler didn't obey.

The benefit of forcing sending headers first is that it removes the only
implicit call in our API and interceptors dealing just with metadata
don't need to override sendMessage. The implicit behavior was bug-prone
since it wasn't obvious you were forgetting that headers may not be
sent.
2015-09-11 17:39:40 -07:00
Eric Anderson 701f9cd7ee Remove stray request() in server-sending path 2015-09-11 17:37:22 -07:00
Eric Anderson f894339923 request() is thread-safe
It is typically used for receiving, but is on the sending object. It
would be a pain for users to coordinate, and the implementation is
already thread-safe because we always thought it would be thread-safe.
So make it part of the documentation.
2015-09-11 17:36:23 -07:00
Kun Zhang ff3dbf7b0a Deprecate OkHttpChannelBuilder#overrideHostForAuthority
It is a duplication of overrideAuthority().
2015-09-11 16:22:36 -07:00
Carl Mastrangelo 49bb24c25f Make Interop Server block until shutdown 2015-09-11 16:01:34 -07:00
Eric Anderson abe5b8e551 Start 1.0.0 development cycle 2015-09-11 11:17:55 -07:00
Eric Anderson 9cb36c6e20 Mark some APIs codegen uses experimental to allow for optimizations
Fixes #975
2015-09-11 11:13:27 -07:00
nmittler 4ff431450a Recommend OpenSSL in SECURITY.md
Fixes #547
2015-09-11 11:00:17 -07:00
Carl Mastrangelo eab74b5053 Update Client Examples to use ManagedChannelBuilder 2015-09-11 10:30:33 -07:00
Carl Mastrangelo f6582d822d Add a hook to set TLS 2015-09-11 10:03:30 -07:00
Eric Anderson 538cf215f0 Add usePlaintext to ManagedChannelBuilder 2015-09-11 09:57:42 -07:00
Carl Mastrangelo 41d93cfd59 Use Providers in examples 2015-09-11 09:46:08 -07:00
Eric Anderson bccaf07497 Use real authority parsing in ClientAuthInterceptor 2015-09-11 09:37:50 -07:00
Eric Anderson 5b2a03a02e Add overrideAuthority to ManagedChannelBuilder
We want to allow overriding authority in the ManagedChannelBuilder for
testing. In doing that, we basically require that all Channels support
authority. In reality, this simplifies things and is already being done
by the C implementation, as their unix domain socket support uses
"localhost" just like our in-process transport now does.

We can debate some whether "localhost" is really the most appropriate
authority for the in-process transport, but that should probably happen
later since "localhost" is "good enough" for now.
2015-09-11 09:37:49 -07:00
Eric Anderson de32e29592 Add overrideAuthority to OkHttpChannelBuilder 2015-09-11 09:37:48 -07:00
Eric Anderson 3ae18eaef1 Add overrideAuthority to NettyChannelBuilder
Although the functionality is currently available by passing a
manually-created InetAddress, that requires that the user do I/O before
calling our API and does not work with naming in the future.
2015-09-11 09:37:43 -07:00
Eric Anderson a6621daca2 Private ServerMethodDefinition constructor; avoid create() in codegen
There is no need to use ServerMethodDefinition in codegen. The create()
method itself could be helpful to a dynamic HandlerRegistry
implementation, so we won't remove it.
2015-09-11 09:25:24 -07:00
Nathan Mittler e045fd6a5e Merge pull request #1003 from nmittler/interop_tcnative
Make tcnative available to the interop scripts.
2015-09-11 07:39:22 -07:00
nmittler a0f0790cc7 Make tcnative available to the interop scripts. 2015-09-10 16:13:32 -07:00
Eric Anderson d966163bbb Mark classes in testing as ExperimentalApi
We've not done any real work to make sure they have reasonable APIs.
2015-09-10 15:56:58 -07:00
Carl Mastrangelo 416b745d8d Add a Server Provider 2015-09-10 12:23:17 -07:00
nmittler 0cd28dd32b Fixing okhttp hang when tls nego fails.
Negotiation failure results in a RuntimeException, which is not properly  handled by the okhttp code, resulting in the client hanging.

Refactored the code to shutdown the transport when TLS negotiation fails.
2015-09-10 11:51:14 -07:00
Eric Anderson df7bf44687 Enable license header checking in checkstyle 2015-09-10 11:29:00 -07:00
Eric Anderson 033cdd0993 Discourage users from running the codegen for the example 2015-09-10 10:29:14 -07:00
Eric Anderson be0d7e911a Prevent construction of container classes and reduce API 2015-09-10 10:09:13 -07:00
Carl Mastrangelo e969a900a0 Add proper generics to ManagedChannelProvider 2015-09-10 09:52:13 -07:00
Eric Anderson 23e6318156 Reduce API surface of AbstractStub 2015-09-10 08:36:08 -07:00
Eric Anderson ec965ca1cc Enable warnings for rawtypes
This would have prevented the missing generics in 31394aa
2015-09-10 08:26:04 -07:00
Carl Mastrangelo 399be9ac73 Use stub call options for compression 2015-09-09 13:21:04 -07:00
nmittler f80ca40fb9 Add client-side logging for TLS negotiation. 2015-09-09 13:16:24 -07:00
nmittler ccf328f367 Fixing erroneous server log when TLS nego fails
Only adding the server HTTP/2 handler after the TLS negotiation is successful.

Fixes #974
2015-09-09 11:42:41 -07:00
Eric Anderson 31394aa9df Let transports be channel service providers for generic usage
This provides an API for applications to use gRPC without using
ExperimentalApis. It also allows swapping out a transport implementation
in the future.
2015-09-09 11:06:35 -07:00
Louis Ryan 540b4d3521 Revert "Draft of Android specific Channe builder"
This reverts commit d6dc790f05.
2015-09-09 10:18:45 -07:00
nmittler 9466eb5014 Adding tc_native to interop test scripts
Also adding better server error log
2015-09-09 07:16:49 -07:00
Carl Mastrangelo f06c7ebd37 Update server to await termination in the main thread 2015-09-08 15:40:37 -07:00
Carl Mastrangelo 091749e4ca Add an example compressing client 2015-09-08 13:06:25 -07:00
Carl Mastrangelo 3cf76326a2 Move decompressor setting to Server Impl 2015-09-08 13:03:27 -07:00
Carl Mastrangelo 950fe1d108 Use ReqT and RespT for generics 2015-09-08 12:51:03 -07:00
Kun Zhang ae4ee40711 Fix flow-control documentation on Stream 2015-09-08 10:20:07 -07:00
Xiao Hang 264dc09cfd Port test cases in AbstractTransportTest to android interop test
The test scenarios all remain the same. The changes are just in proto to nanoproto conversion and removing mocktio
2015-09-04 17:14:50 -07:00
Xiao Hang 86b10fd7d6 Remove uncessary javaee_api dependency as it causes trouble on android build.
Seems no one actually depends on it. Please correct me if I was wrong.
2015-09-04 15:35:37 -07:00
Carl Mastrangelo 1ad2bf9eda Add a way to distinguish between advertised message encodings, and add tests 2015-09-04 14:42:45 -07:00
Xudong Ma bdaf7b3236 okhttp: Skip trash data for finished stream. 2015-09-03 23:44:43 -07:00
Eric Anderson 2a3ae36bd3 Only release event loops when unused
Resolves #926. Transports can still be alive when the Server shuts down,
but they are using the worker event loops. Only release the worker event
loops when all transport's channels are closed.
2015-09-03 18:29:34 -07:00
Eric Anderson d42559c6af Swap nano from Parser to message factory
This reduces the amount of logic built into the generated code. If we
swap to an alternative form of decoding we should have greater ability
to adapt the existing API to make use of the new one. Previously most
changes would require duplicating all the nano marshalling code.
2015-09-03 17:31:16 -07:00
Eric Anderson 47a7ccf0cb Avoid Parser for normal protobuf
Eventually, this could avoid allocating Parser, since we can use
newBuilderForType().mergeFrom(). This would primarily benefit Lite
proto.
2015-09-03 17:31:16 -07:00
Eric Anderson d52a7a2696 Update auth library to fix jwt_token_creds interop test 2015-09-03 16:44:48 -07:00
Eric Anderson 0336a701eb Revert "Merge pull request #940 from nmittler/interop_openssl"
This reverts commit 2aecb6f02b, reversing
changes made to 5d34599390.

The change broke OkHttp's tests
2015-09-03 16:32:01 -07:00
Carl Mastrangelo ebe8a0d703 Remove Metadata.Headers and Metadata.Trailers 2015-09-03 15:22:45 -07:00
Carl Mastrangelo f612746b97 Update comment in MethodDescriptor.Marshaller 2015-09-03 15:10:18 -07:00