/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/ |
D | GrpcUtilTest.java | 35 import io.grpc.internal.GrpcUtil.Http2Error; 81 GrpcUtil.TimeoutMarshaller marshaller = in timeoutTest() 82 new GrpcUtil.TimeoutMarshaller(); in timeoutTest() 130 assertTrue(GrpcUtil.getGrpcUserAgent("netty", null).startsWith("grpc-java-netty/")); in grpcUserAgent() 131 assertTrue(GrpcUtil.getGrpcUserAgent("okhttp", "libfoo/1.0") in grpcUserAgent() 137 assertTrue(GrpcUtil.isGrpcContentType(GrpcUtil.CONTENT_TYPE_GRPC)); in contentTypeShouldBeValid() 138 assertTrue(GrpcUtil.isGrpcContentType(GrpcUtil.CONTENT_TYPE_GRPC + "+blaa")); in contentTypeShouldBeValid() 139 assertTrue(GrpcUtil.isGrpcContentType(GrpcUtil.CONTENT_TYPE_GRPC + ";blaa")); in contentTypeShouldBeValid() 144 assertFalse(GrpcUtil.isGrpcContentType("application/bad")); in contentTypeShouldNotBeValid() 151 GrpcUtil.checkAuthority(null); in checkAuthority_failsOnNull() [all …]
|
D | ClientCallImplTest.java | 20 import static io.grpc.internal.GrpcUtil.ACCEPT_ENCODING_SPLITTER; 292 new String(actual.get(GrpcUtil.MESSAGE_ACCEPT_ENCODING_KEY), GrpcUtil.US_ASCII)); in advertisedEncodingsAreSent() 351 m.put(GrpcUtil.USER_AGENT_KEY, "batmobile"); in prepareHeaders_userAgentIgnored() 355 assertThat(m.get(GrpcUtil.USER_AGENT_KEY)).isNotNull(); in prepareHeaders_userAgentIgnored() 363 assertNull(m.get(GrpcUtil.MESSAGE_ENCODING_KEY)); in prepareHeaders_ignoreIdentityEncoding() 407 new String(m.get(GrpcUtil.MESSAGE_ACCEPT_ENCODING_KEY), GrpcUtil.US_ASCII)); in prepareHeaders_acceptedMessageEncodingsAdded() 418 assertNull(m.get(GrpcUtil.CONTENT_ACCEPT_ENCODING_KEY)); in prepareHeaders_noAcceptedContentEncodingsWithoutFullStreamDecompressionEnabled() 470 new String(m.get(GrpcUtil.MESSAGE_ACCEPT_ENCODING_KEY), GrpcUtil.US_ASCII)); in prepareHeaders_acceptedMessageAndContentEncodingsAdded() 476 new String(m.get(GrpcUtil.CONTENT_ACCEPT_ENCODING_KEY), GrpcUtil.US_ASCII)); in prepareHeaders_acceptedMessageAndContentEncodingsAdded() 484 m.put(GrpcUtil.MESSAGE_ENCODING_KEY, "gzip"); in prepareHeaders_removeReservedHeaders() [all …]
|
D | AbstractClientStreamTest.java | 21 import static io.grpc.internal.GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; 211 headers.put(GrpcUtil.CONTENT_ENCODING_KEY, "gzip"); in inboundHeadersReceived_acceptsGzipContentEncoding() 226 headers.put(GrpcUtil.CONTENT_ENCODING_KEY, "gZIp"); in inboundHeadersReceived_contentEncodingIsCaseInsensitive() 240 headers.put(GrpcUtil.CONTENT_ENCODING_KEY, "not-a-real-compression-method"); in inboundHeadersReceived_failsOnUnrecognizedContentEncoding() 261 headers.put(GrpcUtil.CONTENT_ENCODING_KEY, "gzip"); in inboundHeadersReceived_disallowsContentAndMessageEncoding() 262 headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, new Codec.Gzip().getMessageEncoding()); in inboundHeadersReceived_disallowsContentAndMessageEncoding() 283 headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, new Codec.Gzip().getMessageEncoding()); in inboundHeadersReceived_acceptsGzipMessageEncoding() 295 headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, Codec.Identity.NONE.getMessageEncoding()); in inboundHeadersReceived_acceptsIdentityMessageEncoding() 307 headers.put(GrpcUtil.MESSAGE_ENCODING_KEY, "not-a-real-compression-method"); in inboundHeadersReceived_failsOnUnrecognizedMessageEncoding() 440 assertTrue(headers.containsKey(GrpcUtil.TIMEOUT_KEY)); in deadlineTimeoutPopulatedToHeaders() [all …]
|
/external/grpc-grpc-java/okhttp/src/main/java/io/grpc/okhttp/ |
D | Headers.java | 19 import static io.grpc.internal.GrpcUtil.CONTENT_TYPE_KEY; 20 import static io.grpc.internal.GrpcUtil.USER_AGENT_KEY; 25 import io.grpc.internal.GrpcUtil; 38 public static final Header METHOD_HEADER = new Header(Header.TARGET_METHOD, GrpcUtil.HTTP_METHOD); 41 new Header(CONTENT_TYPE_KEY.name(), GrpcUtil.CONTENT_TYPE_GRPC); 42 public static final Header TE_HEADER = new Header("te", GrpcUtil.TE_TRAILERS); 56 headers.discardAll(GrpcUtil.CONTENT_TYPE_KEY); in createRequestHeaders() 57 headers.discardAll(GrpcUtil.TE_HEADER); in createRequestHeaders() 58 headers.discardAll(GrpcUtil.USER_AGENT_KEY); in createRequestHeaders() 75 okhttpHeaders.add(new Header(GrpcUtil.USER_AGENT_KEY.name(), userAgent)); in createRequestHeaders()
|
D | OkHttpChannelBuilder.java | 20 import static io.grpc.internal.GrpcUtil.DEFAULT_KEEPALIVE_TIMEOUT_NANOS; 21 import static io.grpc.internal.GrpcUtil.DEFAULT_KEEPALIVE_TIME_NANOS; 22 import static io.grpc.internal.GrpcUtil.KEEPALIVE_TIME_NANOS_DISABLED; 34 import io.grpc.internal.GrpcUtil; 129 return Executors.newCachedThreadPool(GrpcUtil.getThreadFactory("grpc-okhttp-%d", true)); 163 this(GrpcUtil.authorityFromHostAndPort(host, port)); in OkHttpChannelBuilder() 410 defaultPort = GrpcUtil.DEFAULT_PORT_PLAINTEXT; in getNameResolverParams() 413 defaultPort = GrpcUtil.DEFAULT_PORT_SSL; in getNameResolverParams() 430 if (GrpcUtil.IS_RESTRICTED_APPENGINE) { in createSocketFactory() 496 ? SharedResourceHolder.get(GrpcUtil.TIMER_SERVICE) : timeoutService; in OkHttpTransportFactory() [all …]
|
D | OkHttpChannelProvider.java | 22 import io.grpc.internal.GrpcUtil; 37 return (GrpcUtil.IS_RESTRICTED_APPENGINE in priority()
|
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/ |
D | UtilsTest.java | 29 import io.grpc.internal.GrpcUtil; 73 metaData.put(GrpcUtil.CONTENT_TYPE_KEY, "to-be-removed"); in convertClientHeaders_sanitizes() 74 metaData.put(GrpcUtil.USER_AGENT_KEY, "to-be-removed"); in convertClientHeaders_sanitizes() 75 metaData.put(GrpcUtil.TE_HEADER, "to-be-removed"); in convertClientHeaders_sanitizes() 101 assertEquals(GrpcUtil.CONTENT_TYPE_GRPC, in convertClientHeaders_sanitizes() 102 headers.get(GrpcUtil.CONTENT_TYPE_KEY.name()).toString()); in convertClientHeaders_sanitizes() 103 assertEquals(userAgent, headers.get(GrpcUtil.USER_AGENT_KEY.name()).toString()); in convertClientHeaders_sanitizes() 104 assertEquals(GrpcUtil.TE_TRAILERS, headers.get(GrpcUtil.TE_HEADER.name()).toString()); in convertClientHeaders_sanitizes() 115 metaData.put(GrpcUtil.CONTENT_TYPE_KEY, "to-be-removed"); in convertServerHeaders_sanitizes() 116 metaData.put(GrpcUtil.TE_HEADER, "to-be-removed"); in convertServerHeaders_sanitizes() [all …]
|
D | NettyClientTransportTest.java | 21 import static io.grpc.internal.GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; 22 import static io.grpc.internal.GrpcUtil.DEFAULT_SERVER_KEEPALIVE_TIMEOUT_NANOS; 23 import static io.grpc.internal.GrpcUtil.DEFAULT_SERVER_KEEPALIVE_TIME_NANOS; 24 import static io.grpc.internal.GrpcUtil.KEEPALIVE_TIME_NANOS_DISABLED; 25 import static io.grpc.internal.GrpcUtil.USER_AGENT_KEY; 55 import io.grpc.internal.GrpcUtil; 144 authority = GrpcUtil.authorityFromHostAndPort(address.getHostString(), address.getPort()); in testToString() 164 assertEquals(GrpcUtil.getGrpcUserAgent("netty", null), headers.get(USER_AGENT_KEY)); in addDefaultUserAgent() 176 DEFAULT_WINDOW_SIZE, DEFAULT_MAX_MESSAGE_SIZE, GrpcUtil.DEFAULT_MAX_HEADER_LIST_SIZE, in setSoLingerChannelOption() 192 DEFAULT_MAX_MESSAGE_SIZE, GrpcUtil.DEFAULT_MAX_HEADER_LIST_SIZE, "testUserAgent", true); in overrideDefaultUserAgent() [all …]
|
/external/grpc-grpc-java/okhttp/src/test/java/io/grpc/okhttp/ |
D | HeadersTest.java | 23 import io.grpc.internal.GrpcUtil; 38 metaData.put(GrpcUtil.CONTENT_TYPE_KEY, "to-be-removed"); in createRequestHeaders_sanitizes() 39 metaData.put(GrpcUtil.USER_AGENT_KEY, "to-be-removed"); in createRequestHeaders_sanitizes() 40 metaData.put(GrpcUtil.TE_HEADER, "to-be-removed"); in createRequestHeaders_sanitizes() 63 assertThat(headers).contains(new Header(GrpcUtil.USER_AGENT_KEY.name(), userAgent)); in createRequestHeaders_sanitizes() 64 assertThat(headers).contains(new Header(GrpcUtil.TE_HEADER.name(), GrpcUtil.TE_TRAILERS)); in createRequestHeaders_sanitizes()
|
D | OkHttpClientStreamTest.java | 34 import io.grpc.internal.GrpcUtil; 149 metaData.put(GrpcUtil.USER_AGENT_KEY, "misbehaving-application"); in start_userAgentRemoved() 158 .contains(new Header(GrpcUtil.USER_AGENT_KEY.name(), "good-application")); in start_userAgentRemoved() 164 metaData.put(GrpcUtil.USER_AGENT_KEY, "misbehaving-application"); in start_headerFieldOrder() 177 new Header(GrpcUtil.USER_AGENT_KEY.name(), "good-application"), in start_headerFieldOrder()
|
D | OkHttpChannelBuilderTest.java | 19 import static io.grpc.internal.GrpcUtil.TIMER_SERVICE; 29 import io.grpc.internal.GrpcUtil; 123 assertEquals(GrpcUtil.DEFAULT_PORT_PLAINTEXT, in usePlaintextDefaultPort()
|
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/ |
D | Utils.java | 19 import static io.grpc.internal.GrpcUtil.CONTENT_TYPE_KEY; 32 import io.grpc.internal.GrpcUtil; 59 public static final AsciiString HTTP_METHOD = AsciiString.of(GrpcUtil.HTTP_METHOD); 64 public static final AsciiString CONTENT_TYPE_GRPC = AsciiString.of(GrpcUtil.CONTENT_TYPE_GRPC); 65 public static final AsciiString TE_HEADER = AsciiString.of(GrpcUtil.TE_HEADER.name()); 66 public static final AsciiString TE_TRAILERS = AsciiString.of(GrpcUtil.TE_TRAILERS); 67 public static final AsciiString USER_AGENT = AsciiString.of(GrpcUtil.USER_AGENT_KEY.name()); 120 headers.discardAll(GrpcUtil.TE_HEADER); in convertClientHeaders() 121 headers.discardAll(GrpcUtil.USER_AGENT_KEY); in convertClientHeaders() 135 headers.discardAll(GrpcUtil.TE_HEADER); in convertServerHeaders() [all …]
|
D | NettyChannelBuilder.java | 22 import static io.grpc.internal.GrpcUtil.DEFAULT_KEEPALIVE_TIMEOUT_NANOS; 23 import static io.grpc.internal.GrpcUtil.DEFAULT_KEEPALIVE_TIME_NANOS; 24 import static io.grpc.internal.GrpcUtil.KEEPALIVE_TIME_NANOS_DISABLED; 37 import io.grpc.internal.GrpcUtil; 79 private int maxHeaderListSize = GrpcUtil.DEFAULT_MAX_HEADER_LIST_SIZE; 115 this(GrpcUtil.authorityFromHostAndPort(host, port)); in NettyChannelBuilder() 132 return GrpcUtil.authorityFromHostAndPort(inetAddress.getHostString(), inetAddress.getPort()); in getAuthorityFromAddress() 364 defaultPort = GrpcUtil.DEFAULT_PORT_PLAINTEXT; in getNameResolverParams() 367 defaultPort = GrpcUtil.DEFAULT_PORT_SSL; in getNameResolverParams()
|
D | NettyServerBuilder.java | 20 import static io.grpc.internal.GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; 21 import static io.grpc.internal.GrpcUtil.DEFAULT_SERVER_KEEPALIVE_TIMEOUT_NANOS; 22 import static io.grpc.internal.GrpcUtil.DEFAULT_SERVER_KEEPALIVE_TIME_NANOS; 23 import static io.grpc.internal.GrpcUtil.SERVER_KEEPALIVE_TIME_NANOS_DISABLED; 32 import io.grpc.internal.GrpcUtil; 83 private int maxHeaderListSize = GrpcUtil.DEFAULT_MAX_HEADER_LIST_SIZE;
|
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/ |
D | ServerCallImpl.java | 22 import static io.grpc.internal.GrpcUtil.ACCEPT_ENCODING_SPLITTER; 23 import static io.grpc.internal.GrpcUtil.MESSAGE_ACCEPT_ENCODING_KEY; 24 import static io.grpc.internal.GrpcUtil.MESSAGE_ENCODING_KEY; 97 if (!GrpcUtil.iterableContains( in sendHeaders() 98 ACCEPT_ENCODING_SPLITTER.split(new String(messageAcceptEncoding, GrpcUtil.US_ASCII)), in sendHeaders() 255 GrpcUtil.closeQuietly(producer); in messagesAvailable() 265 GrpcUtil.closeQuietly(message); in messagesAvailable() 271 GrpcUtil.closeQuietly(producer); in messagesAvailable()
|
D | Http2ClientStreamTransportState.java | 195 status = GrpcUtil.httpStatusToGrpcStatus(httpStatus); in statusFromTrailers() 215 String contentType = headers.get(GrpcUtil.CONTENT_TYPE_KEY); in validateInitialMetadata() 216 if (!GrpcUtil.isGrpcContentType(contentType)) { in validateInitialMetadata() 217 return GrpcUtil.httpStatusToGrpcStatus(httpStatus) in validateInitialMetadata() 227 String contentType = headers.get(GrpcUtil.CONTENT_TYPE_KEY); in extractCharset()
|
D | AbstractManagedChannelImplBuilder.java | 84 SharedResourcePool.forResource(GrpcUtil.SHARED_CHANNEL_EXECUTOR); 143 private int maxInboundMessageSize = GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; 399 return GrpcUtil.checkAuthority(authority); in checkAuthority() 409 SharedResourcePool.forResource(GrpcUtil.SHARED_CHANNEL_EXECUTOR), in build() 410 GrpcUtil.STOPWATCH_SUPPLIER, in build() 427 censusStats = new CensusStatsModule(GrpcUtil.STOPWATCH_SUPPLIER, true); in getEffectiveInterceptors()
|
D | GrpcUtil.java | 68 public final class GrpcUtil { class 70 private static final Logger log = Logger.getLogger(GrpcUtil.class.getName()); 84 Metadata.Key.of(GrpcUtil.TIMEOUT, new TimeoutMarshaller()); 90 Metadata.Key.of(GrpcUtil.MESSAGE_ENCODING, Metadata.ASCII_STRING_MARSHALLER); 96 InternalMetadata.keyOf(GrpcUtil.MESSAGE_ACCEPT_ENCODING, new AcceptEncodingMarshaller()); 102 Metadata.Key.of(GrpcUtil.CONTENT_ENCODING, Metadata.ASCII_STRING_MARSHALLER); 108 InternalMetadata.keyOf(GrpcUtil.CONTENT_ACCEPT_ENCODING, new AcceptEncodingMarshaller()); 761 private GrpcUtil() {}
|
D | DnsNameResolverProvider.java | 55 GrpcUtil.SHARED_CHANNEL_EXECUTOR, in newNameResolver() 56 GrpcUtil.getDefaultProxyDetector(), in newNameResolver()
|
D | ClientCallImpl.java | 25 import static io.grpc.internal.GrpcUtil.CONTENT_ACCEPT_ENCODING_KEY; 26 import static io.grpc.internal.GrpcUtil.CONTENT_ENCODING_KEY; 27 import static io.grpc.internal.GrpcUtil.MESSAGE_ACCEPT_ENCODING_KEY; 28 import static io.grpc.internal.GrpcUtil.MESSAGE_ENCODING_KEY; 511 GrpcUtil.closeQuietly(producer); in messagesAvailable() 521 GrpcUtil.closeQuietly(message); in messagesAvailable() 527 GrpcUtil.closeQuietly(producer); in messagesAvailable()
|
/external/grpc-grpc-java/cronet/src/main/java/io/grpc/cronet/ |
D | CronetChannelBuilder.java | 21 import static io.grpc.internal.GrpcUtil.DEFAULT_MAX_MESSAGE_SIZE; 32 import io.grpc.internal.GrpcUtil; 94 GrpcUtil.authorityFromHostAndPort(host, port)); in CronetChannelBuilder() 200 .set(NameResolver.Factory.PARAMS_DEFAULT_PORT, GrpcUtil.DEFAULT_PORT_SSL).build(); in getNameResolverParams() 222 ? SharedResourceHolder.get(GrpcUtil.TIMER_SERVICE) : timeoutService; in CronetTransportFactory() 246 SharedResourceHolder.release(GrpcUtil.TIMER_SERVICE, timeoutService); in close()
|
D | CronetClientStream.java | 19 import static io.grpc.internal.GrpcUtil.CONTENT_TYPE_KEY; 20 import static io.grpc.internal.GrpcUtil.TE_HEADER; 21 import static io.grpc.internal.GrpcUtil.USER_AGENT_KEY; 36 import io.grpc.internal.GrpcUtil; 330 builder.addHeader(CONTENT_TYPE_KEY.name(), GrpcUtil.CONTENT_TYPE_GRPC); in setGrpcHeaders() 331 builder.addHeader("te", GrpcUtil.TE_TRAILERS); in setGrpcHeaders() 533 return GrpcUtil.httpStatusToGrpcStatus(info.getHttpStatusCode()); in toGrpcStatus()
|
/external/grpc-grpc-java/interop-testing/src/test/java/io/grpc/testing/integration/ |
D | Http2OkHttpTest.java | 27 import io.grpc.internal.GrpcUtil; 99 .overrideAuthority(GrpcUtil.authorityFromHostAndPort( in createChannelBuilder() 140 .overrideAuthority(GrpcUtil.authorityFromHostAndPort( in wrongHostNameFailHostnameVerification() 162 .overrideAuthority(GrpcUtil.authorityFromHostAndPort( in hostnameVerifierWithBadHostname() 182 .overrideAuthority(GrpcUtil.authorityFromHostAndPort( in hostnameVerifierWithCorrectHostname()
|
/external/grpc-grpc-java/core/src/main/java/io/grpc/inprocess/ |
D | InProcessChannelBuilder.java | 26 import io.grpc.internal.GrpcUtil; 168 ? SharedResourceHolder.get(GrpcUtil.TIMER_SERVICE) : scheduledExecutorService; in InProcessClientTransportFactory() 192 SharedResourceHolder.release(GrpcUtil.TIMER_SERVICE, timerService); in close()
|
/external/grpc-grpc-java/grpclb/src/main/java/io/grpc/grpclb/ |
D | GrpclbLoadBalancerFactory.java | 22 import io.grpc.internal.GrpcUtil; 52 SharedResourcePool.forResource(GrpcUtil.TIMER_SERVICE), in newLoadBalancer()
|