Commit Graph

311 Commits

Author SHA1 Message Date
David Brodsky 5b802de3fd okhttp: properly verify IPv6 address hosts (#4292)
Address mismatch between IPv6 address hosts derived from URIs and X509 subjectAltName extensions
2018-04-02 17:43:50 -07:00
zpencer 7c37f1d32b
core,netty,okhttp,services: expose socket options to channelz (#4228)
For okhttp, expose the standard options from the Socket object.

For netty, expose all the `io.netty.channel.ChannelOption`s of the
`channel.config()`.
2018-03-30 08:48:37 -07:00
Eric Gribkoff 77e3b97f91 okhttp: add hpack test for max dynamic table size 2018-03-28 14:53:19 -07:00
Eric Gribkoff ecc36ac96d okhttp: include tests in third_party/okhttp 2018-03-28 14:53:19 -07:00
Eric Gribkoff 1efb695399 okhttp: rename ambiguous variables in Hpack reader 2018-03-28 14:53:19 -07:00
Eric Gribkoff b82366159b okhttp: fix HPACK reader bug 2018-03-28 14:53:19 -07:00
Eric Anderson 25f357699a
okhttp: Convert to internal ConnectionSpec eagerly
This allows ProGuard to remove OkHttp's ConnectionSpec in most cases,
saving about 40 methods. The savings won't be realized until
DEFAULT_CONNECTION_SPEC is removed.
2018-03-26 15:39:56 -07:00
zpencer a5b55bb24c
netty,okhttp,testing: always set TRANSPORT_ATTR_REMOTE_ADDR (#4217)
Always set the remote address, no reason why this should be a TLS-only
feature. This is needed for channelz, and is especially useful in unit
tests where we are using plaintext.

This PR adds the attr for plaintext.
2018-03-23 15:44:40 -07:00
Eric Gribkoff 5337728fa7
core,netty: client sends rst stream when server half-closes (#4222) 2018-03-22 12:38:42 -07:00
Eric Gribkoff 52fedb624d
okhttp: support JDK9 ALPN (#4136) 2018-03-20 17:29:24 -07:00
ZHANG Dapeng a83f67a706
core,netty,okhttp: Transparent retry
Changes:

- `ClientStreamListener.onClose(Status status, RpcProgress rpcProgress, Metadata trailers)` added.

- `AbstractClientStream.transportReportStatus(Status status, RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers)` added

- `ClientCallImpl.ClientStreamListenerImpl` will ignore the arg `rpcProgress` (non retry)

- `RetriableStream.SubListener` will handle `rpcProgress` and decide if transparent retry.

- `NettyClientHandler` and `OkHttpClientTransport` will pass `RpcProgress.REFUSED` to client stream listener for later stream ids when received GOAWAY, or for stream received a RST_STREAM frame with REFUSED code.

- All other files are just a result of refactoring.
2018-03-12 14:12:46 -07:00
zpencer 402c1740fa
core,okhttp,netty,alts,testing: Plumb proxy resolved addr to transports (#4137)
ProxyDetector is now responsible for resolving the proxy's
`InetSocketAddress`, and `ProxyParameters` asserts that the address is
resolved. The results are plumbed through using a `PairSocketAddress`,
which is a special `SocketAddress`.

If a proxy should be used but the proxy can not be resolved, we the
`DnsNameResolver` will re-attempt the resolution later.

Remove the unit test testing for unresolved proxy addresses, since
it's no longer applicable.
2018-03-12 11:15:40 -07:00
zpencer 921b668ad5
core,netty,okhttp,testing: separate local vs remote stream start times for channelz (#4194)
The channelz spec states that the two must be separate.
2018-03-08 16:57:12 -08:00
zpencer f0eb6d2102
core,netty,okhttp,testing: nest TransportStats inside SocketStats for channelz (#4190)
Transport ststistics should really be a child member of SocketStats.
While we're at it, let's add the local and remote SocketAddress to
SocketStats, with a test.
2018-03-08 14:56:04 -08:00
ZHANG Dapeng 3334a8a554
core: allow application to provide all threads - okhttp channel 2018-03-01 10:55:44 -08:00
Carl Mastrangelo 7af2373a03
core,netty,okhttp,alts,inprocess: deprecate usePlaintext(boolean) 2018-02-28 08:53:14 -08:00
zpencer f8c7f963ef
core,netty,okhttp: use ServiceProviders for ManagedChannelProvider, ServerProvider (#4047) 2018-02-08 08:57:52 -08:00
Eric Gribkoff 722d6f0bea
okhttp: support Conscrypt security provider 2018-01-31 10:45:27 -08:00
zpencer 199a5203c5
core: move ChannelStats and TransportStats to io.grpc.internal.Channelz (#4008) 2018-01-25 23:24:49 -08:00
zpencer b109595ad3
core: move Instrumented, LogId, WithLogId to io.grpc.internal as public (#3995) 2018-01-25 17:19:00 -08:00
Eric Anderson 4bc0c95d0b Update ErrorProne to 2.1.3 and fix failures
The fixes could have subtle side-effects, but I did take care when making them.
2018-01-09 12:40:55 -08:00
Eric Anderson 35a6bf863d Enable the Guava Beta Checker 2018-01-08 14:52:51 -08:00
zpencer f1151f91b9
core: InternalInstrumented<T> for instrumented classes (#3817)
Entities that report stats to channelz will implement this interface.
2017-12-13 12:56:25 -08:00
zpencer b6f556c088
core,okhttp: bump census to 0.10.0 which should fix GAE issue (#3833) 2017-12-08 11:30:52 -08:00
zpencer 2b3885bbc2
core,okhttp: add TransportTracer to okhttpclient (#3809) 2017-12-07 17:12:08 -08:00
Carl Mastrangelo c9b02db276
all: add Status messages to all statuses 2017-12-04 19:00:16 -08:00
zpencer 9e7a4c44be
core: move WithLog and LogId to io.grpc (#3813)
The channelz service must not live in io.grpc.internal, and channelz
needs to be able to get the identifier of the entities it
tracks. Since io.grpc can not refer to io.grpc.internal, the LogId
must be moved out of internal.
2017-11-30 15:04:40 -08:00
zpencer 25cd0be24c
core,netty,okhttp: move TransportTracer.Stats to io.grpc (#3812)
io.grpc can not refer to io.grpc.internal so this needs to be moved
out.
2017-11-30 13:01:58 -08:00
Eric Gribkoff 4d35ea05c4
core,okhttp: handle unresolved proxy addresses 2017-11-23 11:00:09 -08:00
kenji yoshida 4db323c5c4 all: fix grammar typos in javadocs 2017-11-22 18:00:51 -08:00
zpencer 51bbc1a4bd
okhttp: make outbound window size readable (#3727) 2017-11-13 14:31:15 -08:00
zpencer 12df89b062
okhttp: disable census when in GAE+JDK7 (#3696)
Disable census for now due to:
https://github.com/census-instrumentation/opencensus-java/issues/777
2017-11-13 10:16:06 -08:00
ramaraochavali 17e1ad9bb2 core: Add useTransportSecurity to ManagedChannelBuilder
This allows the consumer of a builder to swap back from plaintext.
2017-11-10 10:57:05 -08:00
Eric Anderson bbb98feb75 Fix broken method names in tests that include leading '/'
The method name passed to MethodDescriptor does not include the leading
'/'. If it does, on the wire it will actually cause two slashes. This
has been this way for a _long_ time, but in tests that ignore the method
name or use the same MethodDescriptor no client and server the extra /
"works fine." But it's misleading, so let's remove it.
2017-11-08 15:24:50 -08:00
zpencer a3c44fa7ca
core,netty,okhttp: add TransportTracer param to ClientStream and Http2ClientStreamTransportState (#3668)
This diff does not actually change any behaviors yet, that will come
in the next diff along with unit tests for those new behaviors. This
diff's goal is only to change the method signatures so future diffs
are cleaner.
2017-11-07 16:08:55 -08:00
zpencer a2e9a7f6dd
core,ntety,okhttp: Add getTransportStats method to ClientTransport (#3662)
This merely adds the method but does not do anything yet.
2017-11-06 13:24:20 -08:00
zpencer 9fac15d4f8
core,netty,okhttp: move transport tracer outbound counters to transport thread (#3661)
Counters are bumped when a message is completely written. If a
part of a message is still buffered and not yet flushed, we will
not increment the stats.
2017-11-06 12:46:17 -08:00
Eric Anderson f9f603570d Allow tests to run on IPv6-less machines
Our Travis-CI builds are failing with "Protocol family unavailable" due
to the usage of ::1. Although it's 2017 and we'd expect to have ipv6
_loopback_ anywhere that mattered, apparently that's not the case.

The tests now work equally well on IPv4-only and IPv6-only machines.
2017-11-02 13:32:34 -07:00
Eric Anderson 698ba803d5 Move ProxyDetectorImplTest to core.
It should never have been in okhttp.
2017-10-20 13:49:54 -07:00
zpencer 7df9ae9753 core,netty,okhttp: detect proxy via ProxySelector (#3021)
This lets us specify the proxy using `-Dhttps.proxyHost=host -Dhttps.proxyPort=port`
along with auth info like username and password.
2017-10-17 19:26:11 -07:00
Kun Zhang 8edead0851 core: make in-process transport support StreamTracer
This is needed for both completeness and stats/tracing contexts propagation.

Stats recording with Census is intentionally disabled (#2284), while the rest of the Census-related logic work the same as on the other transports.
2017-10-09 10:14:36 -07:00
Carl Mastrangelo 5e36a8deb5 all: upgrade to JUnit 4.12 2017-10-05 11:24:15 -07:00
Eric Anderson e92b72588d Promote keepalive to ManagedChannelBuilder; stabilize
Fixes #3493
2017-09-27 11:59:04 -07:00
Kun Zhang a9941a8bcf okhttp/test: add missing annotation. (#3476) 2017-09-18 15:35:18 -07:00
zpencer 2b1363d586 core,netty,okhttp,protobuf-lite: avoid @Beta guava classes (#3463) 2017-09-14 19:39:06 -07:00
zpencer bb203657cb okhttp: update caller of Headers.createRequestHeaders (#3465) 2017-09-14 17:19:36 -07:00
zpencer bda67784c0 core,netty,okhttp: strip outbound headers with reserved names (#3098)
These will be stripped:
CONTENT_TYPE, TE, USER_AGENT
2017-09-14 15:26:36 -07:00
Eric Gribkoff ec600feb87 okhttp: set GET method in headers (#3316) 2017-09-11 13:58:33 -07:00
Carl Mastrangelo c024f17429 netty,okhttp: include more detail about ALPN missing
Additionally: include info on why android classes are missing
2017-08-24 16:00:36 -07:00
Kun Zhang 41410345e6 core: pass status to ManagedClientTransport.shutdown() (#3351)
This aligns with shutdownNow(), which is already accepting a status.
The status will be propagated to application when RPCs failed because
of transport shutdown, which will become useful information for debug.
2017-08-16 10:23:07 -07:00