Merge branch 'master' into interceptors_initial

pull/16716/head
Yash Tibrewal 6 years ago
commit 130eeeaeb9
  1. 2
      .github/lock.yml
  2. 2
      BUILD
  3. 1440
      CMakeLists.txt
  4. 6
      Makefile
  5. 60
      build.yaml
  6. 1
      config.m4
  7. 1
      config.w32
  8. 32
      doc/core/grpc-client-server-polling-engine-usage.md
  9. 64
      doc/core/grpc-cq.md
  10. 154
      doc/core/grpc-polling-engines.md
  11. BIN
      doc/images/grpc-call-channel-cq.png
  12. BIN
      doc/images/grpc-client-lb-pss.png
  13. BIN
      doc/images/grpc-cq.png
  14. BIN
      doc/images/grpc-epoll1.png
  15. BIN
      doc/images/grpc-epollex.png
  16. BIN
      doc/images/grpc-ps-pss-fd.png
  17. BIN
      doc/images/grpc-pss.png
  18. BIN
      doc/images/grpc-server-cq-fds.png
  19. 1
      doc/server-reflection.md
  20. 2
      examples/python/interceptors/default_value/default_value_client_interceptor.py
  21. 1
      gRPC-C++.podspec
  22. 3
      gRPC-Core.podspec
  23. 2
      grpc.gemspec
  24. 14
      grpc.gyp
  25. 2
      include/grpcpp/impl/codegen/client_context.h
  26. 2
      package.xml
  27. 11
      src/core/ext/filters/client_channel/client_channel_channelz.cc
  28. 3
      src/core/ext/filters/client_channel/connector.h
  29. 16
      src/core/ext/filters/client_channel/subchannel.cc
  30. 8
      src/core/ext/filters/client_channel/subchannel.h
  31. 2
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  32. 10
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  33. 2
      src/core/ext/transport/chttp2/transport/chttp2_transport.h
  34. 39
      src/core/ext/transport/chttp2/transport/hpack_mapping.cc
  35. 38
      src/core/ext/transport/chttp2/transport/hpack_mapping.h
  36. 10
      src/core/ext/transport/chttp2/transport/hpack_table.cc
  37. 4
      src/core/lib/iomgr/ev_epoll1_linux.cc
  38. 4
      src/core/lib/iomgr/ev_epollex_linux.cc
  39. 7
      src/core/lib/iomgr/tcp_posix.cc
  40. 2
      src/core/lib/iomgr/timer_generic.cc
  41. 442
      src/core/lib/transport/static_metadata.cc
  42. 378
      src/core/lib/transport/static_metadata.h
  43. 18
      src/cpp/client/channel_cc.cc
  44. 17
      src/cpp/server/channelz/channelz_service.cc
  45. 4
      src/cpp/server/channelz/channelz_service.h
  46. 17
      src/csharp/Grpc.Core.Tests/MetadataTest.cs
  47. 20
      src/csharp/Grpc.Core/ClientBase.cs
  48. 7
      src/csharp/Grpc.Core/Internal/MarshalUtils.cs
  49. 50
      src/csharp/Grpc.Core/Metadata.cs
  50. 2
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  51. 2
      src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj
  52. 1
      src/python/grpcio/grpc_core_dependencies.py
  53. 20
      src/ruby/pb/test/client.rb
  54. 28
      templates/CMakeLists.txt.template
  55. 39
      templates/README.md
  56. 64
      test/core/end2end/fuzzers/hpack.dictionary
  57. 152
      test/cpp/end2end/channelz_service_test.cc
  58. 2
      test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc
  59. 202
      tools/codegen/core/gen_static_metadata.py
  60. 18
      tools/dockerfile/grpc_artifact_linux_x64/Dockerfile
  61. 9
      tools/dockerfile/grpc_artifact_linux_x86/Dockerfile
  62. 3
      tools/doxygen/Doxyfile.core
  63. 5
      tools/doxygen/Doxyfile.core.internal
  64. 16
      tools/run_tests/generated/sources_and_headers.json
  65. 28
      tools/run_tests/run_interop_tests.py

@ -0,0 +1,2 @@
daysUntilLock: 90
lockComment: false

@ -1572,7 +1572,6 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/frame_window_update.cc",
"src/core/ext/transport/chttp2/transport/hpack_encoder.cc",
"src/core/ext/transport/chttp2/transport/hpack_parser.cc",
"src/core/ext/transport/chttp2/transport/hpack_mapping.cc",
"src/core/ext/transport/chttp2/transport/hpack_table.cc",
"src/core/ext/transport/chttp2/transport/http2_settings.cc",
"src/core/ext/transport/chttp2/transport/huffsyms.cc",
@ -1597,7 +1596,6 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/frame_window_update.h",
"src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.h",
"src/core/ext/transport/chttp2/transport/hpack_mapping.h",
"src/core/ext/transport/chttp2/transport/hpack_table.h",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
"src/core/ext/transport/chttp2/transport/huffsyms.h",

File diff suppressed because it is too large Load Diff

@ -3606,7 +3606,6 @@ LIBGRPC_SRC = \
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
@ -4016,7 +4015,6 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
@ -4427,7 +4425,6 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
@ -4728,7 +4725,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
@ -4974,7 +4970,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \
@ -5634,7 +5629,6 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \

@ -934,7 +934,6 @@ filegroups:
- src/core/ext/transport/chttp2/transport/frame_settings.h
- src/core/ext/transport/chttp2/transport/frame_window_update.h
- src/core/ext/transport/chttp2/transport/hpack_encoder.h
- src/core/ext/transport/chttp2/transport/hpack_mapping.h
- src/core/ext/transport/chttp2/transport/hpack_parser.h
- src/core/ext/transport/chttp2/transport/hpack_table.h
- src/core/ext/transport/chttp2/transport/http2_settings.h
@ -956,7 +955,6 @@ filegroups:
- src/core/ext/transport/chttp2/transport/frame_settings.cc
- src/core/ext/transport/chttp2/transport/frame_window_update.cc
- src/core/ext/transport/chttp2/transport/hpack_encoder.cc
- src/core/ext/transport/chttp2/transport/hpack_mapping.cc
- src/core/ext/transport/chttp2/transport/hpack_parser.cc
- src/core/ext/transport/chttp2/transport/hpack_table.cc
- src/core/ext/transport/chttp2/transport/http2_settings.cc
@ -1439,7 +1437,6 @@ libs:
filegroups:
- gpr_base
secure: false
vs_project_guid: '{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}'
- name: gpr_test_util
build: private
language: c
@ -1450,7 +1447,6 @@ libs:
deps:
- gpr
secure: false
vs_project_guid: '{EAB0A629-17A9-44DB-B5FF-E91A721FE037}'
- name: grpc
build: all
language: c
@ -1483,10 +1479,6 @@ libs:
- grpc_server_backward_compatibility
generate_plugin_registry: true
secure: true
vs_packages:
- grpc.dependencies.openssl
- grpc.dependencies.zlib
vs_project_guid: '{29D16885-7228-4C31-81ED-5F9187C7F2A9}'
- name: grpc_cronet
build: all
language: c
@ -1503,27 +1495,6 @@ libs:
platforms:
- linux
secure: true
- name: grpc_dll
build: private
language: c
src: []
deps:
- gpr
- grpc
build_system:
- visual_studio
deps_linkage: static
dll_def: grpc.def
vs_config_type: DynamicLibrary
vs_packages:
- grpc.dependencies.openssl
- grpc.dependencies.zlib
vs_project_guid: '{A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}'
vs_props:
- zlib
- openssl
- winsock
- global
- name: grpc_test_util
build: private
language: c
@ -1542,7 +1513,6 @@ libs:
- grpc
filegroups:
- grpc_test_util_base
vs_project_guid: '{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}'
- name: grpc_test_util_unsecure
build: private
language: c
@ -1553,7 +1523,6 @@ libs:
filegroups:
- grpc_test_util_base
secure: false
vs_project_guid: '{0A7E7F92-FDEA-40F1-A9EC-3BA484F98BBF}'
- name: grpc_unsecure
build: all
language: c
@ -1584,7 +1553,6 @@ libs:
- grpc_server_backward_compatibility
generate_plugin_registry: true
secure: false
vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}'
- name: reconnect_server
build: private
language: c
@ -1638,7 +1606,6 @@ libs:
- grpc++_codegen_proto
- grpc++_codegen_base_src
secure: check
vs_project_guid: '{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}'
- name: grpc++_core_stats
build: private
language: c++
@ -1684,7 +1651,6 @@ libs:
deps:
- grpc++
baselib: true
vs_project_guid: '{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}'
- name: grpc++_proto_reflection_desc_db
build: private
language: c++
@ -1797,7 +1763,6 @@ libs:
- grpc++_codegen_base
- grpc++_codegen_base_src
secure: false
vs_project_guid: '{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}'
- name: grpc_benchmark
build: test
language: c++
@ -1872,9 +1837,6 @@ libs:
filegroups:
- grpc++_config_proto
secure: false
vs_project_guid: '{B6E81D84-2ACB-41B8-8781-493A944C7817}'
vs_props:
- protoc
- name: grpcpp_channelz
build: all
language: c++
@ -2029,16 +1991,6 @@ libs:
LDFLAGS: $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy)
deps_linkage: static
dll: only
vs_config_type: DynamicLibrary
vs_packages:
- grpc.dependencies.openssl
- grpc.dependencies.zlib
vs_project_guid: '{D64C6D63-4458-4A88-AB38-35678384A7E4}'
vs_props:
- zlib
- openssl
- winsock
- global
targets:
- name: algorithm_test
build: test
@ -4734,8 +4686,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
vs_project_guid: '{7E51A25F-AC59-488F-906C-C60FAAE706AA}'
- name: grpc_csharp_plugin
build: protoc
language: c++
@ -4744,8 +4694,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
vs_project_guid: '{3C813052-A49A-4662-B90A-1ADBEC7EE453}'
- name: grpc_linux_system_roots_test
gtest: true
build: test
@ -4765,7 +4713,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
- name: grpc_objective_c_plugin
build: protoc
language: c++
@ -4774,8 +4721,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
vs_project_guid: '{19564640-CEE6-4921-ABA5-676ED79A36F6}'
- name: grpc_php_plugin
build: protoc
language: c++
@ -4784,7 +4729,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
- name: grpc_python_plugin
build: protoc
language: c++
@ -4793,8 +4737,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
vs_project_guid: '{DF52D501-A6CF-4E6F-BA38-6EBE2E8DAFB2}'
- name: grpc_ruby_plugin
build: protoc
language: c++
@ -4803,8 +4745,6 @@ targets:
deps:
- grpc_plugin_support
secure: false
vs_config_type: Application
vs_project_guid: '{069E9D05-B78B-4751-9252-D21EBAE7DE8E}'
- name: grpc_tool_test
gtest: true
build: test

@ -248,7 +248,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/frame_settings.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_table.cc \
src/core/ext/transport/chttp2/transport/http2_settings.cc \

@ -223,7 +223,6 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\transport\\chttp2\\transport\\frame_settings.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\frame_window_update.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\hpack_encoder.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\hpack_mapping.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\hpack_parser.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\hpack_table.cc " +
"src\\core\\ext\\transport\\chttp2\\transport\\http2_settings.cc " +

@ -0,0 +1,32 @@
# Polling Engine Usage on gRPC client and Server
_Author: Sree Kuchibhotla (@sreecha) - Sep 2018_
This document talks about how polling engine is used in gRPC core (both on client and server code paths).
## gRPC client
### Relation between Call, Channel (sub-channels), Completion queue, `grpc_pollset`
- A gRPC Call is tied to a channel (more specifically a sub-channel) and a completion queue for the lifetime of the call.
- Once a _sub-channel_ is picked for the call, the file-descriptor (socket fd in case of TCP channels) is added to the pollset corresponding to call's completion queue. (Recall that as per [grpc-cq](grpc-cq.md), a completion queue has a pollset by default)
![image](../images/grpc-call-channel-cq.png)
### Making progress on Async `connect()` on sub-channels (`grpc_pollset_set` usecase)
- A gRPC channel is created between a client and a 'target'. The 'target' may resolve in to one or more backend servers.
- A sub-channel is the 'connection' from a client to the backend server
- While establishing sub-cannels (i.e connections) to the backends, gRPC issues async [`connect()`](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/tcp_client_posix.cc#L296) calls which may not complete right away. When the `connect()` eventually succeeds, the socket fd is make 'writable'
- This means that the polling engine must be monitoring all these sub-channel `fd`s for writable events and we need to make sure there is a polling thread that monitors all these fds
- To accomplish this, the `grpc_pollset_set` is used the following way (see picture below)
![image](../images/grpc-client-lb-pss.png)
## gRPC server
- The listening fd (i.e., the socket fd corresponding to the server listening port) is added to each of the server completion queues. Note that in gRPC we use SO_REUSEPORT option and create multiple listening fds but all of them map to the same listening port
- A new incoming channel is assigned to some server completion queue picked randomly (note that we currently [round-robin](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/tcp_server_posix.cc#L231) over the server completion queues)
![image](../images/grpc-server-cq-fds.png)

@ -0,0 +1,64 @@
# gRPC Completion Queue
_Author: Sree Kuchibhotla (@sreecha) - Sep 2018_
Code: [completion_queue.cc](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/surface/completion_queue.cc)
This document gives an overview of completion queue architecture and focuses mainly on the interaction between completion queue and the Polling engine layer.
## Completion queue attributes
Completion queue has two attributes
- Completion_type:
- GRPC_CQ_NEXT: grpc_completion_queue_next() can be called (but not grpc_completion_queue_pluck())
- GRPC_CQ_PLUCK: grpc_completion_queue_pluck() can be called (but not grpc_completion_queue_next())
- GRPC_CQ_CALLBACK: The tags in the queue are function pointers to callbacks. Also, neither next() nor pluck() can be called on this
- Polling_type:
- GRPC_CQ_NON_POLLING: Threads calling completion_queue_next/pluck do not do any polling
- GRPC_CQ_DEFAULT_POLLING: Threads calling completion_queue_next/pluck do polling
- GRPC_CQ_NON_LISTENING: Functionally similar to default polling except for a boolean attribute that states that the cq is non-listening. This is used by the grpc-server code to not associate any listening sockets with this completion-queue’s pollset
## Details
![image](../images/grpc-cq.png)
### **grpc\_completion\_queue\_next()** & **grpc_completion_queue_pluck()** APIS
``` C++
grpc_completion_queue_next(cq, deadline)/pluck(cq, deadline, tag) {
while(true) {
\\ 1. If an event is queued in the completion queue, dequeue and return
\\ (in case of pluck() dequeue only if the tag is the one we are interested in)
\\ 2. If completion queue shutdown return
\\ 3. In case of pluck, add (tag, worker) pair to the tag<->worker map on the cq
\\ 4. Call grpc_pollset_work(cq’s-pollset, deadline) to do polling
\\ Note that if this function found some fds to be readable/writable/error,
\\ it would have scheduled those closures (which may queue completion events
\\ on SOME completion queue - not necessarily this one)
}
}
```
### Queuing a completion event (i.e., "tag")
``` C++
grpc_cq_end_op(cq, tag) {
\\ 1. Queue the tag in the event queue
\\ 2. Find the pollset corresponding to the completion queue
\\ (i) If the cq is of type GRPC_CQ_NEXT, then KICK ANY worker
\\ i.e., call grpc_pollset_kick(pollset, nullptr)
\\ (ii) If the cq is of type GRPC_CQ_PLUCK, then search the tag<->worker
\\ map on the completion queue to find the worker. Then specifically
\\ kick that worker i.e call grpc_pollset_kick(pollset, worker)
}
```

@ -0,0 +1,154 @@
# Polling Engines
_Author: Sree Kuchibhotla (@sreecha) - Sep 2018_
## Why do we need a 'polling engine' ?
Polling engine component was created for the following reasons:
- gRPC code deals with a bunch of file descriptors on which events like descriptor being readable/writable/error have to be monitored
- gRPC code knows the actions to perform when such events happen
- For example:
- `grpc_endpoint` code calls `recvmsg` call when the fd is readable and `sendmsg` call when the fd is writable
- ` tcp_client` connect code issues async `connect` and finishes creating the client once the fd is writable (i.e when the `connect` actually finished)
- gRPC needed some component that can "efficiently" do the above operations __using the threads provided by the applications (i.e., not create any new threads)__. Also by "efficiently" we mean optimized for latency and throughput
## Polling Engine Implementations in gRPC
There are multiple polling engine implementations depending on the OS and the OS version. Fortunately all of them expose the same interface
- Linux:
- **`epollex`** (default but requires kernel version >= 4.5),
- `epoll1` (If `epollex` is not available and glibc version >= 2.9)
- `poll` (If kernel does not have epoll support)
- `poll-cv` (If explicitly configured)
- Mac: **`poll`** (default), `poll-cv` (If explicitly configured)
- Windows: (no name)
- One-off polling engines:
- AppEngine platform: **`poll-cv`** (default)
- NodeJS : `libuv` polling engine implementation (requires different compile `#define`s)
## Polling Engine Interface
### Opaque Structures exposed by the polling engine
The following are the **Opaque** structures exposed by Polling Engine interface (NOTE: Different polling engine implementations have different definitions of these structures)
- **grpc_fd:** Structure representing a file descriptor
- **grpc_pollset:** A set of one or more grpc_fds that are ‘polled’ for readable/writable/error events. One grpc_fd can be in multiple `grpc_pollset`s
- **grpc_pollset_worker:** Structure representing a ‘polling thread’ - more specifically, the thread that calls `grpc_pollset_work()` API
- **grpc_pollset_set:** A group of `grpc_fds`, `grpc_pollsets` and `grpc_pollset_sets` (yes, a `grpc_pollset_set` can contain other `grpc_pollset_sets`)
### Polling engine API
#### grpc_fd
- **grpc\_fd\_notify\_on\_[read|write|error]**
- Signature: `grpc_fd_notify_on_(grpc_fd* fd, grpc_closure* closure)`
- Register a [closure](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/closure.h#L67) to be called when the fd becomes readable/writable or has an error (In grpc parlance, we refer to this act as “arming the fd”)
- The closure is called exactly once per event. I.e once the fd becomes readable (or writable or error), the closure is fired and the fd is ‘unarmed’. To be notified again, the fd has to be armed again.
- **grpc_fd_shutdown**
- Signature: `grpc_fd_shutdown(grpc_fd* fd)`
- Any current (or future) closures registered for readable/writable/error events are scheduled immediately with an error
- **grpc_fd_orphan**
- Signature: `grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, char* reason)`
- Release the `grpc_fd` structure and call `on_done` closure when the operation is complete
- If `release_fd` is set to `nullptr`, then `close()` the underlying fd as well. If not, put the underlying fd in `release_fd` (and do not call `close()`)
- `release_fd` set to non-null in cases where the underlying fd is NOT owned by grpc core (like for example the fds used by C-Ares DNS resolver )
#### grpc_pollset
- **grpc_pollset_add_fd **
- Signature: `grpc_pollset_add_fd(grpc_pollset* ps, grpc_fd *fd)`
- Add fd to pollset
> **NOTE**: There is no `grpc_pollset_remove_fd`. This is because calling `grpc_fd_orphan()` will effectively remove the fd from all the pollsets it’s a part of
- ** grpc_pollset_work **
- Signature: `grpc_pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker, grpc_millis deadline)`
> **NOTE**: `grpc_pollset_work()` requires the pollset mutex to be locked before calling it. Shortly after calling `grpc_pollset_work()`, the function populates the `*worker` pointer (among other things) and releases the mutex. Once `grpc_pollset_work()` returns, the `*worker` pointer is **invalid** and should not be used anymore. See the code in `completion_queue.cc` to see how this is used.
- Poll the fds in the pollset for events AND return when ANY of the following is true:
- Deadline expired
- Some fds in the pollset were found to be readable/writable/error and those associated closures were ‘scheduled’ (but not necessarily executed)
- worker is “kicked” (see `grpc_pollset_kick` for more details)
- **grpc_pollset_kick**
- Signature: `grpc_pollset_kick(grpc_pollset* ps, grpc_pollset_worker* worker)`
- “Kick the worker” i.e Force the worker to return from grpc_pollset_work()
- If `worker == nullptr`, kick ANY worker active on that pollset
#### grpc_pollset_set
- **grpc\_pollset\_set\_[add|del]\_fd**
- Signature: `grpc_pollset_set_[add|del]_fd(grpc_pollset_set* pss, grpc_fd *fd)`
Add/Remove fd to the `grpc_pollset_set`
- **grpc\_pollset\_set_[add|del]\_pollset**
- Signature: `grpc_pollset_set_[add|del]_pollset(grpc_pollset_set* pss, grpc_pollset* ps)`
- What does adding a pollset to a pollset_set mean ?
- It means that calling `grpc_pollset_work()` on the pollset will also poll all the fds in the pollset_set i.e semantically, it is similar to adding all the fds inside pollset_set to the pollset.
- This guarantee is no longer true once the pollset is removed from the pollset_set
- **grpc\_pollset\_set_[add|del]\_pollset\_set**
- Signature: `grpc_pollset_set_[add|del]_pollset_set(grpc_pollset_set* bag, grpc_pollset_set* item)`
- Semantically, this is similar to adding all the fds in the ‘bag’ pollset_set to the ‘item’ pollset_set
#### Recap:
__Relation between grpc_pollset_worker, grpc_pollset and grpc_fd:__
![image](../images/grpc-ps-pss-fd.png)
__grpc_pollset_set__
![image](../images/grpc-pss.png)
## Polling Engine Implementations
### epoll1
![image](../images/grpc-epoll1.png)
Code at `src/core/lib/iomgr/ev_epoll1_posix.cc`
- The logic to choose a designated poller is quite complicated. Pollsets are internally sharded into what are called `pollset_neighborhood` (a structure internal to `epoll1` polling engine implementation). `grpc_pollset_workers` that call `grpc_pollset_work` on a given pollset are all queued in a linked-list against the `grpc_pollset`. The head of the linked list is called "root worker"
- There are as many neighborhoods as the number of cores. A pollset is put in a neighborhood based on the CPU core of the root worker thread. When picking the next designated poller, we always try to find another worker on the current pollset. If there are no more workers in the current pollset, a `pollset_neighborhood` listed is scanned to pick the next pollset and worker that could be the new designated poller.
- NOTE: There is room to tune this implementation. All we really need is good way to maintain a list of `grpc_pollset_workers` with a way to group them per-pollset (needed to implement `grpc_pollset_kick` semantics) and a way randomly select a new designated poller
- See [`begin_worker()`](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/ev_epoll1_linux.cc#L729) function to see how a designated poller is chosen. Similarly [`end_worker()`](https://github.com/grpc/grpc/blob/v1.15.1/src/core/lib/iomgr/ev_epoll1_linux.cc#L916) function is called by the worker that was just out of `epoll_wait()` and will have to choose a new designated poller)
### epollex
![image](../images/grpc-epollex.png)
Code at `src/core/lib/iomgr/ev_epollex_posix.cc`
- FDs are added to multiple epollsets with EPOLLEXCLUSIVE flag. This prevents multiple worker threads from waking up from polling whenever the fd is readable/writable
- A few observations:
- If multiple pollsets are pointing to the same `Pollable`, then the `pollable` MUST be either empty or of type `PO_FD` (i.e single-fd)
- A multi-pollable has one-and-only-one incoming link from a pollset
- The same FD can be in multiple `Pollable`s (even if one of the `Pollable`s is of type PO_FD)
- There cannot be two `Pollable`s of type PO_FD for the same fd
- Why do we need `Pollable` of type PO_FD and PO_EMTPY ?
- The main reason is the Sync client API
- We create one new completion queue per call. If we didn’t have PO_EMPTY and PO_FD type pollables, then every call on a given channel will effectively have to create a `Pollable` and hence an epollset. This is because every completion queue automatically creates a pollset and the channel fd will have to be put in that pollset. This clearly requires an epollset to put that fd. Creating an epollset per call (even if we delete the epollset once the call is completed) would mean a lot of sys calls to create/delete epoll fds. This is clearly not a good idea.
- With these new types of `Pollable`s, all pollsets (corresponding to the new per-call completion queue) will initially point to PO_EMPTY global epollset. Then once the channel fd is added to the pollset, the pollset will point to the `Pollable` of type PO_FD containing just that fd (i.e it will reuse the existing `Pollable`). This way, the epoll fd creation/deletion churn is avoided.
### Other polling engine implementations (poll and windows polling engine)
- **poll** polling engine: gRPC's `poll` polling engine is quite complicated. It uses the `poll()` function to do the polling (and hence it is for platforms like osx where epoll is not available)
- The implementation is further complicated by the fact that poll() is level triggered (just keep this in mind in case you wonder why the code at `src/core/lib/iomgr/ev_poll_posix.cc` is written a certain/seemingly complicated way :))
- **Polling engine on Windows**: Windows polling engine looks nothing like other polling engines
- Unlike the grpc polling engines for Unix systems (epollex, epoll1 and poll) Windows endpoint implementation and polling engine implementations are very closely tied together
- Windows endpoint read/write API implementations use the Windows IO API which require specifying an [I/O completion port](https://docs.microsoft.com/en-us/windows/desktop/fileio/i-o-completion-ports)
- In Windows polling engine’s grpc_pollset_work() implementation, ONE of the threads is chosen to wait on the I/O completion port while other threads wait on a condition variable (much like the turnstile polling in epollex/epoll1)

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

@ -161,6 +161,7 @@ which FileDescriptorProtos have been sent on a given stream, for a given value
of valid_host, and avoid sending them repeatedly for overlapping requests.
| message_request message | Result |
| --------------------------- | ----------------------------------------------- |
| files_for_file_name | transitive closure of file name |
| files_for_symbol_name | transitive closure file containing symbol |
| file_containing_extension | transitive closure of file containing a given extension number of a given symbol |

@ -13,8 +13,6 @@
# limitations under the License.
"""Interceptor that adds headers to outgoing requests."""
import collections
import grpc

@ -256,7 +256,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_mapping.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',

@ -263,7 +263,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_mapping.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
@ -680,7 +679,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_mapping.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
@ -866,7 +864,6 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/frame_settings.h',
'src/core/ext/transport/chttp2/transport/frame_window_update.h',
'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_mapping.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',

@ -195,7 +195,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/frame_settings.h )
s.files += %w( src/core/ext/transport/chttp2/transport/frame_window_update.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_mapping.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.h )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.h )
@ -616,7 +615,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/frame_settings.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/frame_window_update.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_mapping.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.cc )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.cc )

@ -440,7 +440,6 @@
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_mapping.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
@ -592,16 +591,6 @@
'src/core/plugin_registry/grpc_plugin_registry.cc',
],
},
{
'target_name': 'grpc_dll',
'type': 'static_library',
'dependencies': [
'gpr',
'grpc',
],
'sources': [
],
},
{
'target_name': 'grpc_test_util',
'type': 'static_library',
@ -824,7 +813,6 @@
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_mapping.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
@ -1059,7 +1047,6 @@
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_mapping.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
@ -1251,7 +1238,6 @@
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_mapping.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',

@ -224,7 +224,7 @@ class ClientContext {
/// \warning This method should only be called before invoking the rpc.
///
/// \param deadline the deadline for the client call. Units are determined by
/// the type used.
/// the type used. The deadline is an absolute (not relative) time.
template <typename T>
void set_deadline(const T& deadline) {
TimePoint<T> deadline_tp(deadline);

@ -200,7 +200,6 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_settings.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_window_update.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_mapping.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/http2_settings.h" role="src" />
@ -621,7 +620,6 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_settings.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame_window_update.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_mapping.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/http2_settings.cc" role="src" />

@ -166,6 +166,17 @@ grpc_json* SubchannelNode::RenderJson() {
}
// ask CallCountingHelper to populate trace and call count data.
call_counter_.PopulateCallCounts(json);
json = top_level_json;
// populate the child socket.
intptr_t socket_uuid = grpc_subchannel_get_child_socket_uuid(subchannel_);
if (socket_uuid != 0) {
grpc_json* array_parent = grpc_json_create_child(
nullptr, json, "socketRef", nullptr, GRPC_JSON_ARRAY, false);
json_iterator = grpc_json_create_child(json_iterator, array_parent, nullptr,
nullptr, GRPC_JSON_OBJECT, false);
grpc_json_add_number_string_child(json_iterator, nullptr, "socketId",
socket_uuid);
}
return top_level_json;
}

@ -47,6 +47,9 @@ typedef struct {
/** channel arguments (to be passed to the filters) */
grpc_channel_args* channel_args;
/** socket uuid of the connected transport. 0 if not available */
intptr_t socket_uuid;
} grpc_connect_out_args;
struct grpc_connector_vtable {

@ -411,6 +411,14 @@ grpc_core::channelz::SubchannelNode* grpc_subchannel_get_channelz_node(
return subchannel->channelz_subchannel.get();
}
intptr_t grpc_subchannel_get_child_socket_uuid(grpc_subchannel* subchannel) {
if (subchannel->connected_subchannel != nullptr) {
return subchannel->connected_subchannel->socket_uuid();
} else {
return 0;
}
}
static void continue_connect_locked(grpc_subchannel* c) {
grpc_connect_in_args args;
args.interested_parties = c->pollset_set;
@ -621,6 +629,7 @@ static bool publish_transport_locked(grpc_subchannel* c) {
GRPC_ERROR_UNREF(error);
return false;
}
intptr_t socket_uuid = c->connecting_result.socket_uuid;
memset(&c->connecting_result, 0, sizeof(c->connecting_result));
/* initialize state watcher */
@ -641,7 +650,7 @@ static bool publish_transport_locked(grpc_subchannel* c) {
/* publish */
c->connected_subchannel.reset(grpc_core::New<grpc_core::ConnectedSubchannel>(
stk, c->channelz_subchannel.get()));
stk, c->channelz_subchannel.get(), socket_uuid));
gpr_log(GPR_INFO, "New connected subchannel at %p for subchannel %p",
c->connected_subchannel.get(), c);
@ -811,10 +820,11 @@ namespace grpc_core {
ConnectedSubchannel::ConnectedSubchannel(
grpc_channel_stack* channel_stack,
channelz::SubchannelNode* channelz_subchannel)
channelz::SubchannelNode* channelz_subchannel, intptr_t socket_uuid)
: RefCountedWithTracing<ConnectedSubchannel>(&grpc_trace_stream_refcount),
channel_stack_(channel_stack),
channelz_subchannel_(channelz_subchannel) {}
channelz_subchannel_(channelz_subchannel),
socket_uuid_(socket_uuid) {}
ConnectedSubchannel::~ConnectedSubchannel() {
GRPC_CHANNEL_STACK_UNREF(channel_stack_, "connected_subchannel_dtor");

@ -86,7 +86,8 @@ class ConnectedSubchannel : public RefCountedWithTracing<ConnectedSubchannel> {
};
explicit ConnectedSubchannel(grpc_channel_stack* channel_stack,
channelz::SubchannelNode* channelz_subchannel);
channelz::SubchannelNode* channelz_subchannel,
intptr_t socket_uuid);
~ConnectedSubchannel();
grpc_channel_stack* channel_stack() { return channel_stack_; }
@ -98,12 +99,15 @@ class ConnectedSubchannel : public RefCountedWithTracing<ConnectedSubchannel> {
channelz::SubchannelNode* channelz_subchannel() {
return channelz_subchannel_;
}
intptr_t socket_uuid() { return socket_uuid_; }
private:
grpc_channel_stack* channel_stack_;
// backpointer to the channelz node in this connected subchannel's
// owning subchannel.
channelz::SubchannelNode* channelz_subchannel_;
// uuid of this subchannel's socket. 0 if this subchannel is not connected.
const intptr_t socket_uuid_;
};
} // namespace grpc_core
@ -126,6 +130,8 @@ void grpc_subchannel_call_unref(
grpc_core::channelz::SubchannelNode* grpc_subchannel_get_channelz_node(
grpc_subchannel* subchannel);
intptr_t grpc_subchannel_get_child_socket_uuid(grpc_subchannel* subchannel);
/** Returns a pointer to the parent data associated with \a subchannel_call.
The data will be of the size specified in \a parent_data_size
field of the args passed to \a grpc_connected_subchannel_create_call(). */

@ -117,6 +117,8 @@ static void on_handshake_done(void* arg, grpc_error* error) {
c->args.interested_parties);
c->result->transport =
grpc_create_chttp2_transport(args->args, args->endpoint, true);
c->result->socket_uuid =
grpc_chttp2_transport_get_socket_uuid(c->result->transport);
GPR_ASSERT(c->result->transport);
// TODO(roth): We ideally want to wait until we receive HTTP/2
// settings from the server before we consider the connection

@ -3170,6 +3170,16 @@ static const grpc_transport_vtable vtable = {sizeof(grpc_chttp2_stream),
static const grpc_transport_vtable* get_vtable(void) { return &vtable; }
intptr_t grpc_chttp2_transport_get_socket_uuid(grpc_transport* transport) {
grpc_chttp2_transport* t =
reinterpret_cast<grpc_chttp2_transport*>(transport);
if (t->channelz_socket != nullptr) {
return t->channelz_socket->uuid();
} else {
return 0;
}
}
grpc_transport* grpc_create_chttp2_transport(
const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(

@ -34,6 +34,8 @@ extern bool g_flow_control_enabled;
grpc_transport* grpc_create_chttp2_transport(
const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client);
intptr_t grpc_chttp2_transport_get_socket_uuid(grpc_transport* transport);
/// Takes ownership of \a read_buffer, which (if non-NULL) contains
/// leftover bytes previously read from the endpoint (e.g., by handshakers).
/// If non-null, \a notify_on_receive_settings will be scheduled when

@ -1,39 +0,0 @@
/*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* WARNING: Auto-generated code.
*
* To make changes to this file, change
* tools/codegen/core/gen_static_metadata.py, and then re-run it.
*
* This file contains the mapping from the index of each metadata element in the
* grpc static metadata table to the index of that element in the hpack static
* metadata table. If the element is not contained in the static hpack table,
* then the returned index is 0.
*/
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/hpack_mapping.h"
const uint8_t grpc_hpack_static_mdelem_indices[GRPC_STATIC_MDELEM_COUNT] = {
0, 0, 0, 0, 0, 0, 0, 0, 3, 8, 13, 6, 7, 0, 1, 2, 0, 4,
5, 9, 10, 11, 12, 14, 15, 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 0, 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};

@ -1,38 +0,0 @@
/*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* WARNING: Auto-generated code.
*
* To make changes to this file, change
* tools/codegen/core/gen_static_metadata.py, and then re-run it.
*
* This file contains the mapping from the index of each metadata element in the
* grpc static metadata table to the index of that element in the hpack static
* metadata table. If the element is not contained in the static hpack table,
* then the returned index is 0.
*/
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_MAPPING_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_MAPPING_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/transport/static_metadata.h"
extern const uint8_t grpc_hpack_static_mdelem_indices[GRPC_STATIC_MDELEM_COUNT];
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_MAPPING_H */

@ -27,7 +27,6 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/transport/chttp2/transport/hpack_mapping.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/murmur_hash.h"
#include "src/core/lib/transport/static_metadata.h"
@ -389,9 +388,10 @@ size_t grpc_chttp2_get_size_in_hpack_table(grpc_mdelem elem,
uint8_t grpc_chttp2_get_static_hpack_table_index(grpc_mdelem md) {
if (GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC) {
return grpc_hpack_static_mdelem_indices[GRPC_MDELEM_DATA(md) -
grpc_static_mdelem_table];
} else {
return 0;
uint8_t index = GRPC_MDELEM_DATA(md) - grpc_static_mdelem_table;
if (index < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
return index + 1; // Hpack static metadata element indices start at 1
}
}
return 0;
}

@ -273,6 +273,10 @@ static gpr_mu fork_fd_list_mu;
static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
static void fd_global_shutdown(void) {
// TODO(guantaol): We don't have a reasonable explanation about this
// lock()/unlock() pattern. It can be a valid barrier if there is at most one
// pending lock() at this point. Otherwise, there is still a possibility of
// use-after-free race. Need to reason about the code and/or clean it up.
gpr_mu_lock(&fd_freelist_mu);
gpr_mu_unlock(&fd_freelist_mu);
while (fd_freelist != nullptr) {

@ -403,6 +403,10 @@ static void unref_by(grpc_fd* fd, int n) {
static void fd_global_init(void) { gpr_mu_init(&fd_freelist_mu); }
static void fd_global_shutdown(void) {
// TODO(guantaol): We don't have a reasonable explanation about this
// lock()/unlock() pattern. It can be a valid barrier if there is at most one
// pending lock() at this point. Otherwise, there is still a possibility of
// use-after-free race. Need to reason about the code and/or clean it up.
gpr_mu_lock(&fd_freelist_mu);
gpr_mu_unlock(&fd_freelist_mu);
while (fd_freelist != nullptr) {

@ -204,6 +204,13 @@ static void drop_uncovered(grpc_tcp* tcp) {
GPR_ASSERT(old_count != 1);
}
// gRPC API considers a Write operation to be done the moment it clears ‘flow
// control’ i.e., not necessarily sent on the wire. This means that the
// application MIGHT not call `grpc_completion_queue_next/pluck` in a timely
// manner when its `Write()` API is acked.
//
// We need to ensure that the fd is 'covered' (i.e being monitored by some
// polling thread and progress is made) and hence add it to a backup poller here
static void cover_self(grpc_tcp* tcp) {
backup_poller* p;
gpr_atm old_count =

@ -256,7 +256,7 @@ static grpc_millis compute_min_deadline(timer_shard* shard) {
static void timer_list_init() {
uint32_t i;
g_num_shards = GPR_MIN(1, 2 * gpr_cpu_num_cores());
g_num_shards = GPR_CLAMP(2 * gpr_cpu_num_cores(), 1, 32);
g_shards =
static_cast<timer_shard*>(gpr_zalloc(g_num_shards * sizeof(*g_shards)));
g_shard_queue = static_cast<timer_shard**>(

@ -64,46 +64,46 @@ static uint8_t g_bytes[] = {
99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108,
97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111,
97, 100, 100, 101, 102, 108, 97, 116, 101, 103, 122, 105, 112, 115, 116,
114, 101, 97, 109, 47, 103, 122, 105, 112, 48, 105, 100, 101, 110, 116,
105, 116, 121, 116, 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108,
105, 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, 80, 79, 83,
84, 50, 48, 48, 52, 48, 52, 104, 116, 116, 112, 104, 116, 116, 112,
115, 103, 114, 112, 99, 71, 69, 84, 80, 85, 84, 47, 47, 105, 110,
100, 101, 120, 46, 104, 116, 109, 108, 50, 48, 52, 50, 48, 54, 51,
48, 52, 52, 48, 48, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45,
99, 104, 97, 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101,
102, 108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110,
103, 117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110,
103, 101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115,
45, 99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45,
111, 114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97,
117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99,
104, 101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101,
110, 116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99,
111, 110, 116, 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101,
99, 111, 110, 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99,
111, 110, 116, 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110,
99, 111, 110, 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111,
111, 107, 105, 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112,
101, 99, 116, 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105,
102, 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102,
105, 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110,
101, 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101,
105, 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115,
105, 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105,
101, 100, 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 108, 105,
110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45, 102,
111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97, 117,
116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120, 121,
45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 114,
97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102, 114,
101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114, 115,
101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105, 101,
115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111, 114,
116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110, 115,
102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97, 114,
121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110, 116,
105, 99, 97, 116, 101, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100,
114, 101, 97, 109, 47, 103, 122, 105, 112, 71, 69, 84, 80, 79, 83,
84, 47, 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, 104, 116,
116, 112, 104, 116, 116, 112, 115, 50, 48, 48, 50, 48, 52, 50, 48,
54, 51, 48, 52, 52, 48, 48, 52, 48, 52, 53, 48, 48, 97, 99,
99, 101, 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, 103, 122, 105,
112, 44, 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, 99, 101, 112,
116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, 99, 101, 112,
116, 45, 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, 112, 116, 97,
99, 99, 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, 108, 45, 97,
108, 108, 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, 103, 101, 97,
108, 108, 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105,
111, 110, 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, 114, 111, 108,
99, 111, 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, 111, 115, 105,
116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 108, 97, 110,
103, 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, 45, 108, 101,
110, 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, 108, 111, 99,
97, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 114, 97,
110, 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, 101, 101, 116,
97, 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, 114, 101, 115,
102, 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, 105, 102, 45,
109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 105,
102, 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, 102, 45,
114, 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, 105, 102,
105, 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, 45, 109,
111, 100, 105, 102, 105, 101, 100, 108, 105, 110, 107, 108, 111, 99, 97,
116, 105, 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100,
115, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105,
99, 97, 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111,
114, 105, 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101,
102, 101, 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116,
114, 121, 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115,
101, 116, 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116,
45, 116, 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117,
114, 105, 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110,
99, 111, 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, 119, 119,
119, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 48,
105, 100, 101, 110, 116, 105, 116, 121, 116, 114, 97, 105, 108, 101, 114,
115, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114,
112, 99, 103, 114, 112, 99, 80, 85, 84, 108, 98, 45, 99, 111, 115,
116, 45, 98, 105, 110, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100,
101, 102, 108, 97, 116, 101, 105, 100, 101, 110, 116, 105, 116, 121, 44,
103, 122, 105, 112, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105,
112, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97,
@ -265,69 +265,69 @@ const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = {
{&grpc_static_metadata_refcounts[35], {{g_bytes + 482, 7}}},
{&grpc_static_metadata_refcounts[36], {{g_bytes + 489, 4}}},
{&grpc_static_metadata_refcounts[37], {{g_bytes + 493, 11}}},
{&grpc_static_metadata_refcounts[38], {{g_bytes + 504, 1}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 505, 8}}},
{&grpc_static_metadata_refcounts[40], {{g_bytes + 513, 8}}},
{&grpc_static_metadata_refcounts[41], {{g_bytes + 521, 16}}},
{&grpc_static_metadata_refcounts[42], {{g_bytes + 537, 4}}},
{&grpc_static_metadata_refcounts[43], {{g_bytes + 541, 3}}},
{&grpc_static_metadata_refcounts[44], {{g_bytes + 544, 3}}},
{&grpc_static_metadata_refcounts[45], {{g_bytes + 547, 4}}},
{&grpc_static_metadata_refcounts[46], {{g_bytes + 551, 5}}},
{&grpc_static_metadata_refcounts[47], {{g_bytes + 556, 4}}},
{&grpc_static_metadata_refcounts[48], {{g_bytes + 560, 3}}},
{&grpc_static_metadata_refcounts[49], {{g_bytes + 563, 3}}},
{&grpc_static_metadata_refcounts[50], {{g_bytes + 566, 1}}},
{&grpc_static_metadata_refcounts[51], {{g_bytes + 567, 11}}},
{&grpc_static_metadata_refcounts[52], {{g_bytes + 578, 3}}},
{&grpc_static_metadata_refcounts[53], {{g_bytes + 581, 3}}},
{&grpc_static_metadata_refcounts[54], {{g_bytes + 584, 3}}},
{&grpc_static_metadata_refcounts[55], {{g_bytes + 587, 3}}},
{&grpc_static_metadata_refcounts[56], {{g_bytes + 590, 3}}},
{&grpc_static_metadata_refcounts[57], {{g_bytes + 593, 14}}},
{&grpc_static_metadata_refcounts[58], {{g_bytes + 607, 13}}},
{&grpc_static_metadata_refcounts[59], {{g_bytes + 620, 15}}},
{&grpc_static_metadata_refcounts[60], {{g_bytes + 635, 13}}},
{&grpc_static_metadata_refcounts[61], {{g_bytes + 648, 6}}},
{&grpc_static_metadata_refcounts[62], {{g_bytes + 654, 27}}},
{&grpc_static_metadata_refcounts[63], {{g_bytes + 681, 3}}},
{&grpc_static_metadata_refcounts[64], {{g_bytes + 684, 5}}},
{&grpc_static_metadata_refcounts[65], {{g_bytes + 689, 13}}},
{&grpc_static_metadata_refcounts[66], {{g_bytes + 702, 13}}},
{&grpc_static_metadata_refcounts[67], {{g_bytes + 715, 19}}},
{&grpc_static_metadata_refcounts[68], {{g_bytes + 734, 16}}},
{&grpc_static_metadata_refcounts[69], {{g_bytes + 750, 14}}},
{&grpc_static_metadata_refcounts[70], {{g_bytes + 764, 16}}},
{&grpc_static_metadata_refcounts[71], {{g_bytes + 780, 13}}},
{&grpc_static_metadata_refcounts[72], {{g_bytes + 793, 6}}},
{&grpc_static_metadata_refcounts[73], {{g_bytes + 799, 4}}},
{&grpc_static_metadata_refcounts[74], {{g_bytes + 803, 4}}},
{&grpc_static_metadata_refcounts[75], {{g_bytes + 807, 6}}},
{&grpc_static_metadata_refcounts[76], {{g_bytes + 813, 7}}},
{&grpc_static_metadata_refcounts[77], {{g_bytes + 820, 4}}},
{&grpc_static_metadata_refcounts[78], {{g_bytes + 824, 8}}},
{&grpc_static_metadata_refcounts[79], {{g_bytes + 832, 17}}},
{&grpc_static_metadata_refcounts[80], {{g_bytes + 849, 13}}},
{&grpc_static_metadata_refcounts[81], {{g_bytes + 862, 8}}},
{&grpc_static_metadata_refcounts[82], {{g_bytes + 870, 19}}},
{&grpc_static_metadata_refcounts[83], {{g_bytes + 889, 13}}},
{&grpc_static_metadata_refcounts[84], {{g_bytes + 902, 11}}},
{&grpc_static_metadata_refcounts[85], {{g_bytes + 913, 4}}},
{&grpc_static_metadata_refcounts[86], {{g_bytes + 917, 8}}},
{&grpc_static_metadata_refcounts[87], {{g_bytes + 925, 12}}},
{&grpc_static_metadata_refcounts[88], {{g_bytes + 937, 18}}},
{&grpc_static_metadata_refcounts[89], {{g_bytes + 955, 19}}},
{&grpc_static_metadata_refcounts[90], {{g_bytes + 974, 5}}},
{&grpc_static_metadata_refcounts[91], {{g_bytes + 979, 7}}},
{&grpc_static_metadata_refcounts[92], {{g_bytes + 986, 7}}},
{&grpc_static_metadata_refcounts[93], {{g_bytes + 993, 11}}},
{&grpc_static_metadata_refcounts[94], {{g_bytes + 1004, 6}}},
{&grpc_static_metadata_refcounts[95], {{g_bytes + 1010, 10}}},
{&grpc_static_metadata_refcounts[96], {{g_bytes + 1020, 25}}},
{&grpc_static_metadata_refcounts[97], {{g_bytes + 1045, 17}}},
{&grpc_static_metadata_refcounts[98], {{g_bytes + 1062, 4}}},
{&grpc_static_metadata_refcounts[99], {{g_bytes + 1066, 3}}},
{&grpc_static_metadata_refcounts[100], {{g_bytes + 1069, 16}}},
{&grpc_static_metadata_refcounts[38], {{g_bytes + 504, 3}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 507, 4}}},
{&grpc_static_metadata_refcounts[40], {{g_bytes + 511, 1}}},
{&grpc_static_metadata_refcounts[41], {{g_bytes + 512, 11}}},
{&grpc_static_metadata_refcounts[42], {{g_bytes + 523, 4}}},
{&grpc_static_metadata_refcounts[43], {{g_bytes + 527, 5}}},
{&grpc_static_metadata_refcounts[44], {{g_bytes + 532, 3}}},
{&grpc_static_metadata_refcounts[45], {{g_bytes + 535, 3}}},
{&grpc_static_metadata_refcounts[46], {{g_bytes + 538, 3}}},
{&grpc_static_metadata_refcounts[47], {{g_bytes + 541, 3}}},
{&grpc_static_metadata_refcounts[48], {{g_bytes + 544, 3}}},
{&grpc_static_metadata_refcounts[49], {{g_bytes + 547, 3}}},
{&grpc_static_metadata_refcounts[50], {{g_bytes + 550, 3}}},
{&grpc_static_metadata_refcounts[51], {{g_bytes + 553, 14}}},
{&grpc_static_metadata_refcounts[52], {{g_bytes + 567, 13}}},
{&grpc_static_metadata_refcounts[53], {{g_bytes + 580, 15}}},
{&grpc_static_metadata_refcounts[54], {{g_bytes + 595, 13}}},
{&grpc_static_metadata_refcounts[55], {{g_bytes + 608, 6}}},
{&grpc_static_metadata_refcounts[56], {{g_bytes + 614, 27}}},
{&grpc_static_metadata_refcounts[57], {{g_bytes + 641, 3}}},
{&grpc_static_metadata_refcounts[58], {{g_bytes + 644, 5}}},
{&grpc_static_metadata_refcounts[59], {{g_bytes + 649, 13}}},
{&grpc_static_metadata_refcounts[60], {{g_bytes + 662, 13}}},
{&grpc_static_metadata_refcounts[61], {{g_bytes + 675, 19}}},
{&grpc_static_metadata_refcounts[62], {{g_bytes + 694, 16}}},
{&grpc_static_metadata_refcounts[63], {{g_bytes + 710, 14}}},
{&grpc_static_metadata_refcounts[64], {{g_bytes + 724, 16}}},
{&grpc_static_metadata_refcounts[65], {{g_bytes + 740, 13}}},
{&grpc_static_metadata_refcounts[66], {{g_bytes + 753, 6}}},
{&grpc_static_metadata_refcounts[67], {{g_bytes + 759, 4}}},
{&grpc_static_metadata_refcounts[68], {{g_bytes + 763, 4}}},
{&grpc_static_metadata_refcounts[69], {{g_bytes + 767, 6}}},
{&grpc_static_metadata_refcounts[70], {{g_bytes + 773, 7}}},
{&grpc_static_metadata_refcounts[71], {{g_bytes + 780, 4}}},
{&grpc_static_metadata_refcounts[72], {{g_bytes + 784, 8}}},
{&grpc_static_metadata_refcounts[73], {{g_bytes + 792, 17}}},
{&grpc_static_metadata_refcounts[74], {{g_bytes + 809, 13}}},
{&grpc_static_metadata_refcounts[75], {{g_bytes + 822, 8}}},
{&grpc_static_metadata_refcounts[76], {{g_bytes + 830, 19}}},
{&grpc_static_metadata_refcounts[77], {{g_bytes + 849, 13}}},
{&grpc_static_metadata_refcounts[78], {{g_bytes + 862, 4}}},
{&grpc_static_metadata_refcounts[79], {{g_bytes + 866, 8}}},
{&grpc_static_metadata_refcounts[80], {{g_bytes + 874, 12}}},
{&grpc_static_metadata_refcounts[81], {{g_bytes + 886, 18}}},
{&grpc_static_metadata_refcounts[82], {{g_bytes + 904, 19}}},
{&grpc_static_metadata_refcounts[83], {{g_bytes + 923, 5}}},
{&grpc_static_metadata_refcounts[84], {{g_bytes + 928, 7}}},
{&grpc_static_metadata_refcounts[85], {{g_bytes + 935, 7}}},
{&grpc_static_metadata_refcounts[86], {{g_bytes + 942, 11}}},
{&grpc_static_metadata_refcounts[87], {{g_bytes + 953, 6}}},
{&grpc_static_metadata_refcounts[88], {{g_bytes + 959, 10}}},
{&grpc_static_metadata_refcounts[89], {{g_bytes + 969, 25}}},
{&grpc_static_metadata_refcounts[90], {{g_bytes + 994, 17}}},
{&grpc_static_metadata_refcounts[91], {{g_bytes + 1011, 4}}},
{&grpc_static_metadata_refcounts[92], {{g_bytes + 1015, 3}}},
{&grpc_static_metadata_refcounts[93], {{g_bytes + 1018, 16}}},
{&grpc_static_metadata_refcounts[94], {{g_bytes + 1034, 1}}},
{&grpc_static_metadata_refcounts[95], {{g_bytes + 1035, 8}}},
{&grpc_static_metadata_refcounts[96], {{g_bytes + 1043, 8}}},
{&grpc_static_metadata_refcounts[97], {{g_bytes + 1051, 16}}},
{&grpc_static_metadata_refcounts[98], {{g_bytes + 1067, 4}}},
{&grpc_static_metadata_refcounts[99], {{g_bytes + 1071, 3}}},
{&grpc_static_metadata_refcounts[100], {{g_bytes + 1074, 11}}},
{&grpc_static_metadata_refcounts[101], {{g_bytes + 1085, 16}}},
{&grpc_static_metadata_refcounts[102], {{g_bytes + 1101, 13}}},
{&grpc_static_metadata_refcounts[103], {{g_bytes + 1114, 12}}},
@ -341,14 +341,15 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4};
static const int8_t elems_r[] = {
16, 11, -1, 0, 15, 2, -78, 24, 0, 18, -5, 0, 0, 0, 17, 14, -8, 0,
0, 27, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, -64, 0, -44, -43, -70, 0, 34, 33, 33, 32, 31, 30, 29, 28, 27,
27, 26, 25, 24, 23, 22, 21, 20, 20, 19, 19, 18, 17, 16, 15, 14, 13, 12,
11, 14, 13, 12, 11, 10, 9, 9, 8, 7, 6, 5, 0};
15, 9, -8, 0, 2, -44, -78, 17, 0, 6, -8, 0, 0, 0, 6,
-5, -10, 0, 0, -2, -3, -4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, -63, 0, -46, -68, -69, -53, 0, 31, 30,
29, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 18,
17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3,
2, 3, 3, 2, 6, 0, 0, 0, 0, 0, 0, -5, 0};
static uint32_t elems_phash(uint32_t i) {
i -= 50;
i -= 40;
uint32_t x = i % 103;
uint32_t y = i / 103;
uint32_t h = x;
@ -360,28 +361,25 @@ static uint32_t elems_phash(uint32_t i) {
}
static const uint16_t elem_keys[] = {
1085, 1086, 565, 1709, 1089, 262, 263, 264, 265, 266, 1716,
153, 154, 1719, 760, 761, 50, 51, 465, 466, 467, 980,
981, 1604, 1499, 984, 773, 2129, 2234, 6014, 1611, 6434, 1738,
1614, 6539, 6644, 1511, 6749, 6854, 6959, 7064, 7169, 7274, 7379,
2024, 7484, 7589, 7694, 7799, 7904, 8009, 8114, 8219, 6224, 8324,
8429, 6329, 8534, 8639, 8744, 8849, 8954, 9059, 9164, 9269, 9374,
1151, 1152, 1153, 1154, 9479, 9584, 9689, 9794, 9899, 10004, 1782,
10109, 10214, 10319, 10424, 10529, 0, 0, 0, 0, 0, 344,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 253, 254, 147, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
254, 255, 256, 257, 258, 259, 260, 1085, 1086, 143, 144, 1709,
462, 463, 1604, 40, 41, 761, 1716, 980, 981, 1611, 621, 1499,
760, 2024, 2129, 2234, 5384, 5699, 5804, 6014, 6119, 6224, 1732, 6329,
6434, 6539, 6644, 6749, 6854, 6959, 7064, 7169, 7274, 7379, 7484, 7589,
5909, 5594, 7694, 7799, 7904, 8009, 8114, 8219, 8324, 8429, 8534, 8639,
8744, 8849, 8954, 9059, 9164, 9269, 9374, 1145, 518, 9479, 204, 9584,
9689, 1151, 1152, 1153, 1154, 1775, 9794, 1040, 1670, 10529, 0, 0,
1782, 829, 0, 0, 0, 0, 344, 1567, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0};
static const uint8_t elem_idxs[] = {
77, 79, 6, 25, 76, 19, 20, 21, 22, 23, 84, 15, 16, 83, 1,
2, 17, 18, 11, 12, 13, 5, 4, 38, 43, 3, 0, 50, 57, 24,
37, 29, 26, 36, 30, 31, 7, 32, 33, 34, 35, 39, 40, 41, 72,
42, 44, 45, 46, 47, 48, 49, 51, 27, 52, 53, 28, 54, 55, 56,
58, 59, 60, 61, 62, 63, 78, 80, 81, 82, 64, 65, 66, 67, 68,
69, 85, 70, 71, 73, 74, 75, 255, 255, 255, 255, 255, 14, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 9, 10, 8};
7, 8, 9, 10, 11, 12, 13, 77, 79, 1, 2, 71, 5, 6, 25, 3,
4, 63, 84, 66, 65, 73, 67, 30, 62, 57, 37, 74, 14, 17, 18, 20,
21, 22, 15, 23, 24, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 38,
19, 16, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 76, 69, 56, 70, 58, 59, 78, 80, 81, 82, 83, 60, 64,
72, 75, 255, 255, 85, 61, 255, 255, 255, 255, 0, 68};
grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {
if (a == -1 || b == -1) return GRPC_MDNULL;
@ -395,160 +393,160 @@ grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {
}
grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
{{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}},
{&grpc_static_metadata_refcounts[38], {{g_bytes + 504, 1}}}},
{{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}},
{&grpc_static_metadata_refcounts[25], {{g_bytes + 350, 1}}}},
{{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}},
{&grpc_static_metadata_refcounts[26], {{g_bytes + 351, 1}}}},
{{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 505, 8}}}},
{{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}},
{&grpc_static_metadata_refcounts[36], {{g_bytes + 489, 4}}}},
{{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}},
{&grpc_static_metadata_refcounts[35], {{g_bytes + 482, 7}}}},
{{&grpc_static_metadata_refcounts[5], {{g_bytes + 36, 2}}},
{&grpc_static_metadata_refcounts[40], {{g_bytes + 513, 8}}}},
{{&grpc_static_metadata_refcounts[14], {{g_bytes + 158, 12}}},
{&grpc_static_metadata_refcounts[41], {{g_bytes + 521, 16}}}},
{{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}},
{&grpc_static_metadata_refcounts[42], {{g_bytes + 537, 4}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[43], {{g_bytes + 541, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[44], {{g_bytes + 544, 3}}}},
{{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}},
{&grpc_static_metadata_refcounts[45], {{g_bytes + 547, 4}}}},
{{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}},
{&grpc_static_metadata_refcounts[46], {{g_bytes + 551, 5}}}},
{{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}},
{&grpc_static_metadata_refcounts[47], {{g_bytes + 556, 4}}}},
{{&grpc_static_metadata_refcounts[3], {{g_bytes + 19, 10}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}},
{&grpc_static_metadata_refcounts[48], {{g_bytes + 560, 3}}}},
{&grpc_static_metadata_refcounts[38], {{g_bytes + 504, 3}}}},
{{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}},
{&grpc_static_metadata_refcounts[49], {{g_bytes + 563, 3}}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 507, 4}}}},
{{&grpc_static_metadata_refcounts[0], {{g_bytes + 0, 5}}},
{&grpc_static_metadata_refcounts[50], {{g_bytes + 566, 1}}}},
{&grpc_static_metadata_refcounts[40], {{g_bytes + 511, 1}}}},
{{&grpc_static_metadata_refcounts[0], {{g_bytes + 0, 5}}},
{&grpc_static_metadata_refcounts[51], {{g_bytes + 567, 11}}}},
{&grpc_static_metadata_refcounts[41], {{g_bytes + 512, 11}}}},
{{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}},
{&grpc_static_metadata_refcounts[42], {{g_bytes + 523, 4}}}},
{{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}},
{&grpc_static_metadata_refcounts[43], {{g_bytes + 527, 5}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[52], {{g_bytes + 578, 3}}}},
{&grpc_static_metadata_refcounts[44], {{g_bytes + 532, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[53], {{g_bytes + 581, 3}}}},
{&grpc_static_metadata_refcounts[45], {{g_bytes + 535, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[54], {{g_bytes + 584, 3}}}},
{&grpc_static_metadata_refcounts[46], {{g_bytes + 538, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[55], {{g_bytes + 587, 3}}}},
{&grpc_static_metadata_refcounts[47], {{g_bytes + 541, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[56], {{g_bytes + 590, 3}}}},
{{&grpc_static_metadata_refcounts[57], {{g_bytes + 593, 14}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}},
{&grpc_static_metadata_refcounts[48], {{g_bytes + 544, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[49], {{g_bytes + 547, 3}}}},
{{&grpc_static_metadata_refcounts[2], {{g_bytes + 12, 7}}},
{&grpc_static_metadata_refcounts[50], {{g_bytes + 550, 3}}}},
{{&grpc_static_metadata_refcounts[51], {{g_bytes + 553, 14}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}},
{&grpc_static_metadata_refcounts[58], {{g_bytes + 607, 13}}}},
{{&grpc_static_metadata_refcounts[59], {{g_bytes + 620, 15}}},
{&grpc_static_metadata_refcounts[52], {{g_bytes + 567, 13}}}},
{{&grpc_static_metadata_refcounts[53], {{g_bytes + 580, 15}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[60], {{g_bytes + 635, 13}}},
{{&grpc_static_metadata_refcounts[54], {{g_bytes + 595, 13}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[61], {{g_bytes + 648, 6}}},
{{&grpc_static_metadata_refcounts[55], {{g_bytes + 608, 6}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[62], {{g_bytes + 654, 27}}},
{{&grpc_static_metadata_refcounts[56], {{g_bytes + 614, 27}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[63], {{g_bytes + 681, 3}}},
{{&grpc_static_metadata_refcounts[57], {{g_bytes + 641, 3}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[64], {{g_bytes + 684, 5}}},
{{&grpc_static_metadata_refcounts[58], {{g_bytes + 644, 5}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[65], {{g_bytes + 689, 13}}},
{{&grpc_static_metadata_refcounts[59], {{g_bytes + 649, 13}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[66], {{g_bytes + 702, 13}}},
{{&grpc_static_metadata_refcounts[60], {{g_bytes + 662, 13}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[67], {{g_bytes + 715, 19}}},
{{&grpc_static_metadata_refcounts[61], {{g_bytes + 675, 19}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 505, 8}}}},
{{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}},
{&grpc_static_metadata_refcounts[36], {{g_bytes + 489, 4}}}},
{{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[68], {{g_bytes + 734, 16}}},
{{&grpc_static_metadata_refcounts[62], {{g_bytes + 694, 16}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[69], {{g_bytes + 750, 14}}},
{{&grpc_static_metadata_refcounts[63], {{g_bytes + 710, 14}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[70], {{g_bytes + 764, 16}}},
{{&grpc_static_metadata_refcounts[64], {{g_bytes + 724, 16}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[71], {{g_bytes + 780, 13}}},
{{&grpc_static_metadata_refcounts[65], {{g_bytes + 740, 13}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[14], {{g_bytes + 158, 12}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[72], {{g_bytes + 793, 6}}},
{{&grpc_static_metadata_refcounts[66], {{g_bytes + 753, 6}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[73], {{g_bytes + 799, 4}}},
{{&grpc_static_metadata_refcounts[67], {{g_bytes + 759, 4}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[74], {{g_bytes + 803, 4}}},
{{&grpc_static_metadata_refcounts[68], {{g_bytes + 763, 4}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[75], {{g_bytes + 807, 6}}},
{{&grpc_static_metadata_refcounts[69], {{g_bytes + 767, 6}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[76], {{g_bytes + 813, 7}}},
{{&grpc_static_metadata_refcounts[70], {{g_bytes + 773, 7}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[77], {{g_bytes + 820, 4}}},
{{&grpc_static_metadata_refcounts[71], {{g_bytes + 780, 4}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[20], {{g_bytes + 278, 4}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[78], {{g_bytes + 824, 8}}},
{{&grpc_static_metadata_refcounts[72], {{g_bytes + 784, 8}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[79], {{g_bytes + 832, 17}}},
{{&grpc_static_metadata_refcounts[73], {{g_bytes + 792, 17}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[80], {{g_bytes + 849, 13}}},
{{&grpc_static_metadata_refcounts[74], {{g_bytes + 809, 13}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[81], {{g_bytes + 862, 8}}},
{{&grpc_static_metadata_refcounts[75], {{g_bytes + 822, 8}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[82], {{g_bytes + 870, 19}}},
{{&grpc_static_metadata_refcounts[76], {{g_bytes + 830, 19}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[83], {{g_bytes + 889, 13}}},
{{&grpc_static_metadata_refcounts[77], {{g_bytes + 849, 13}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[21], {{g_bytes + 282, 8}}},
{{&grpc_static_metadata_refcounts[78], {{g_bytes + 862, 4}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[84], {{g_bytes + 902, 11}}},
{{&grpc_static_metadata_refcounts[79], {{g_bytes + 866, 8}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[85], {{g_bytes + 913, 4}}},
{{&grpc_static_metadata_refcounts[80], {{g_bytes + 874, 12}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[86], {{g_bytes + 917, 8}}},
{{&grpc_static_metadata_refcounts[81], {{g_bytes + 886, 18}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[87], {{g_bytes + 925, 12}}},
{{&grpc_static_metadata_refcounts[82], {{g_bytes + 904, 19}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[88], {{g_bytes + 937, 18}}},
{{&grpc_static_metadata_refcounts[83], {{g_bytes + 923, 5}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[89], {{g_bytes + 955, 19}}},
{{&grpc_static_metadata_refcounts[84], {{g_bytes + 928, 7}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[90], {{g_bytes + 974, 5}}},
{{&grpc_static_metadata_refcounts[85], {{g_bytes + 935, 7}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[91], {{g_bytes + 979, 7}}},
{{&grpc_static_metadata_refcounts[86], {{g_bytes + 942, 11}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[92], {{g_bytes + 986, 7}}},
{{&grpc_static_metadata_refcounts[87], {{g_bytes + 953, 6}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[93], {{g_bytes + 993, 11}}},
{{&grpc_static_metadata_refcounts[88], {{g_bytes + 959, 10}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[94], {{g_bytes + 1004, 6}}},
{{&grpc_static_metadata_refcounts[89], {{g_bytes + 969, 25}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[95], {{g_bytes + 1010, 10}}},
{{&grpc_static_metadata_refcounts[90], {{g_bytes + 994, 17}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[96], {{g_bytes + 1020, 25}}},
{{&grpc_static_metadata_refcounts[19], {{g_bytes + 268, 10}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[97], {{g_bytes + 1045, 17}}},
{{&grpc_static_metadata_refcounts[91], {{g_bytes + 1011, 4}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[19], {{g_bytes + 268, 10}}},
{{&grpc_static_metadata_refcounts[92], {{g_bytes + 1015, 3}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[98], {{g_bytes + 1062, 4}}},
{{&grpc_static_metadata_refcounts[93], {{g_bytes + 1018, 16}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[99], {{g_bytes + 1066, 3}}},
{{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}},
{&grpc_static_metadata_refcounts[94], {{g_bytes + 1034, 1}}}},
{{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}},
{&grpc_static_metadata_refcounts[25], {{g_bytes + 350, 1}}}},
{{&grpc_static_metadata_refcounts[7], {{g_bytes + 50, 11}}},
{&grpc_static_metadata_refcounts[26], {{g_bytes + 351, 1}}}},
{{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}},
{&grpc_static_metadata_refcounts[95], {{g_bytes + 1035, 8}}}},
{{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}},
{&grpc_static_metadata_refcounts[36], {{g_bytes + 489, 4}}}},
{{&grpc_static_metadata_refcounts[9], {{g_bytes + 77, 13}}},
{&grpc_static_metadata_refcounts[35], {{g_bytes + 482, 7}}}},
{{&grpc_static_metadata_refcounts[5], {{g_bytes + 36, 2}}},
{&grpc_static_metadata_refcounts[96], {{g_bytes + 1043, 8}}}},
{{&grpc_static_metadata_refcounts[14], {{g_bytes + 158, 12}}},
{&grpc_static_metadata_refcounts[97], {{g_bytes + 1051, 16}}}},
{{&grpc_static_metadata_refcounts[4], {{g_bytes + 29, 7}}},
{&grpc_static_metadata_refcounts[98], {{g_bytes + 1067, 4}}}},
{{&grpc_static_metadata_refcounts[1], {{g_bytes + 5, 7}}},
{&grpc_static_metadata_refcounts[99], {{g_bytes + 1071, 3}}}},
{{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}},
{&grpc_static_metadata_refcounts[95], {{g_bytes + 1035, 8}}}},
{{&grpc_static_metadata_refcounts[15], {{g_bytes + 170, 16}}},
{&grpc_static_metadata_refcounts[36], {{g_bytes + 489, 4}}}},
{{&grpc_static_metadata_refcounts[21], {{g_bytes + 282, 8}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[100], {{g_bytes + 1069, 16}}},
{{&grpc_static_metadata_refcounts[100], {{g_bytes + 1074, 11}}},
{&grpc_static_metadata_refcounts[29], {{g_bytes + 354, 0}}}},
{{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 505, 8}}}},
{&grpc_static_metadata_refcounts[95], {{g_bytes + 1035, 8}}}},
{{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}},
{&grpc_static_metadata_refcounts[35], {{g_bytes + 482, 7}}}},
{{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}},
@ -562,7 +560,7 @@ grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
{{&grpc_static_metadata_refcounts[10], {{g_bytes + 90, 20}}},
{&grpc_static_metadata_refcounts[104], {{g_bytes + 1126, 21}}}},
{{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}},
{&grpc_static_metadata_refcounts[39], {{g_bytes + 505, 8}}}},
{&grpc_static_metadata_refcounts[95], {{g_bytes + 1035, 8}}}},
{{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}},
{&grpc_static_metadata_refcounts[36], {{g_bytes + 489, 4}}}},
{{&grpc_static_metadata_refcounts[16], {{g_bytes + 186, 15}}},

@ -113,132 +113,132 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_MDSTR_GZIP (grpc_static_slice_table[36])
/* "stream/gzip" */
#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table[37])
/* "0" */
#define GRPC_MDSTR_0 (grpc_static_slice_table[38])
/* "identity" */
#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[39])
/* "trailers" */
#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[40])
/* "application/grpc" */
#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[41])
/* "POST" */
#define GRPC_MDSTR_POST (grpc_static_slice_table[42])
/* "200" */
#define GRPC_MDSTR_200 (grpc_static_slice_table[43])
/* "404" */
#define GRPC_MDSTR_404 (grpc_static_slice_table[44])
/* "http" */
#define GRPC_MDSTR_HTTP (grpc_static_slice_table[45])
/* "https" */
#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[46])
/* "grpc" */
#define GRPC_MDSTR_GRPC (grpc_static_slice_table[47])
/* "GET" */
#define GRPC_MDSTR_GET (grpc_static_slice_table[48])
/* "PUT" */
#define GRPC_MDSTR_PUT (grpc_static_slice_table[49])
#define GRPC_MDSTR_GET (grpc_static_slice_table[38])
/* "POST" */
#define GRPC_MDSTR_POST (grpc_static_slice_table[39])
/* "/" */
#define GRPC_MDSTR_SLASH (grpc_static_slice_table[50])
#define GRPC_MDSTR_SLASH (grpc_static_slice_table[40])
/* "/index.html" */
#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[51])
#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[41])
/* "http" */
#define GRPC_MDSTR_HTTP (grpc_static_slice_table[42])
/* "https" */
#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[43])
/* "200" */
#define GRPC_MDSTR_200 (grpc_static_slice_table[44])
/* "204" */
#define GRPC_MDSTR_204 (grpc_static_slice_table[52])
#define GRPC_MDSTR_204 (grpc_static_slice_table[45])
/* "206" */
#define GRPC_MDSTR_206 (grpc_static_slice_table[53])
#define GRPC_MDSTR_206 (grpc_static_slice_table[46])
/* "304" */
#define GRPC_MDSTR_304 (grpc_static_slice_table[54])
#define GRPC_MDSTR_304 (grpc_static_slice_table[47])
/* "400" */
#define GRPC_MDSTR_400 (grpc_static_slice_table[55])
#define GRPC_MDSTR_400 (grpc_static_slice_table[48])
/* "404" */
#define GRPC_MDSTR_404 (grpc_static_slice_table[49])
/* "500" */
#define GRPC_MDSTR_500 (grpc_static_slice_table[56])
#define GRPC_MDSTR_500 (grpc_static_slice_table[50])
/* "accept-charset" */
#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[57])
#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[51])
/* "gzip, deflate" */
#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[58])
#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[52])
/* "accept-language" */
#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[59])
#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[53])
/* "accept-ranges" */
#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[60])
#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[54])
/* "accept" */
#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[61])
#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[55])
/* "access-control-allow-origin" */
#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[62])
#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[56])
/* "age" */
#define GRPC_MDSTR_AGE (grpc_static_slice_table[63])
#define GRPC_MDSTR_AGE (grpc_static_slice_table[57])
/* "allow" */
#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[64])
#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[58])
/* "authorization" */
#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[65])
#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[59])
/* "cache-control" */
#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[66])
#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[60])
/* "content-disposition" */
#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[67])
#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[61])
/* "content-language" */
#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[68])
#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[62])
/* "content-length" */
#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[69])
#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[63])
/* "content-location" */
#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[70])
#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[64])
/* "content-range" */
#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[71])
#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[65])
/* "cookie" */
#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[72])
#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[66])
/* "date" */
#define GRPC_MDSTR_DATE (grpc_static_slice_table[73])
#define GRPC_MDSTR_DATE (grpc_static_slice_table[67])
/* "etag" */
#define GRPC_MDSTR_ETAG (grpc_static_slice_table[74])
#define GRPC_MDSTR_ETAG (grpc_static_slice_table[68])
/* "expect" */
#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[75])
#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[69])
/* "expires" */
#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[76])
#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[70])
/* "from" */
#define GRPC_MDSTR_FROM (grpc_static_slice_table[77])
#define GRPC_MDSTR_FROM (grpc_static_slice_table[71])
/* "if-match" */
#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[78])
#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[72])
/* "if-modified-since" */
#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[79])
#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[73])
/* "if-none-match" */
#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[80])
#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[74])
/* "if-range" */
#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[81])
#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[75])
/* "if-unmodified-since" */
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[82])
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[76])
/* "last-modified" */
#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[83])
/* "lb-cost-bin" */
#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[84])
#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[77])
/* "link" */
#define GRPC_MDSTR_LINK (grpc_static_slice_table[85])
#define GRPC_MDSTR_LINK (grpc_static_slice_table[78])
/* "location" */
#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[86])
#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[79])
/* "max-forwards" */
#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[87])
#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[80])
/* "proxy-authenticate" */
#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[88])
#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[81])
/* "proxy-authorization" */
#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[89])
#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[82])
/* "range" */
#define GRPC_MDSTR_RANGE (grpc_static_slice_table[90])
#define GRPC_MDSTR_RANGE (grpc_static_slice_table[83])
/* "referer" */
#define GRPC_MDSTR_REFERER (grpc_static_slice_table[91])
#define GRPC_MDSTR_REFERER (grpc_static_slice_table[84])
/* "refresh" */
#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[92])
#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[85])
/* "retry-after" */
#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[93])
#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[86])
/* "server" */
#define GRPC_MDSTR_SERVER (grpc_static_slice_table[94])
#define GRPC_MDSTR_SERVER (grpc_static_slice_table[87])
/* "set-cookie" */
#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[95])
#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[88])
/* "strict-transport-security" */
#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[96])
#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[89])
/* "transfer-encoding" */
#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[97])
#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[90])
/* "vary" */
#define GRPC_MDSTR_VARY (grpc_static_slice_table[98])
#define GRPC_MDSTR_VARY (grpc_static_slice_table[91])
/* "via" */
#define GRPC_MDSTR_VIA (grpc_static_slice_table[99])
#define GRPC_MDSTR_VIA (grpc_static_slice_table[92])
/* "www-authenticate" */
#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[100])
#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[93])
/* "0" */
#define GRPC_MDSTR_0 (grpc_static_slice_table[94])
/* "identity" */
#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[95])
/* "trailers" */
#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[96])
/* "application/grpc" */
#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[97])
/* "grpc" */
#define GRPC_MDSTR_GRPC (grpc_static_slice_table[98])
/* "PUT" */
#define GRPC_MDSTR_PUT (grpc_static_slice_table[99])
/* "lb-cost-bin" */
#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table[100])
/* "identity,deflate" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[101])
/* "identity,gzip" */
@ -262,233 +262,233 @@ extern grpc_slice_refcount
#define GRPC_STATIC_MDELEM_COUNT 86
extern grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
/* "grpc-status": "0" */
#define GRPC_MDELEM_GRPC_STATUS_0 \
/* ":authority": "" */
#define GRPC_MDELEM_AUTHORITY_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[0], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-status": "1" */
#define GRPC_MDELEM_GRPC_STATUS_1 \
/* ":method": "GET" */
#define GRPC_MDELEM_METHOD_GET \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[1], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-status": "2" */
#define GRPC_MDELEM_GRPC_STATUS_2 \
/* ":method": "POST" */
#define GRPC_MDELEM_METHOD_POST \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[2], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-encoding": "identity" */
#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY \
/* ":path": "/" */
#define GRPC_MDELEM_PATH_SLASH \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[3], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-encoding": "gzip" */
#define GRPC_MDELEM_GRPC_ENCODING_GZIP \
/* ":path": "/index.html" */
#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[4], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-encoding": "deflate" */
#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[5], GRPC_MDELEM_STORAGE_STATIC))
/* "te": "trailers" */
#define GRPC_MDELEM_TE_TRAILERS \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[6], GRPC_MDELEM_STORAGE_STATIC))
/* "content-type": "application/grpc" */
#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[7], GRPC_MDELEM_STORAGE_STATIC))
/* ":method": "POST" */
#define GRPC_MDELEM_METHOD_POST \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[8], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "200" */
#define GRPC_MDELEM_STATUS_200 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[9], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "404" */
#define GRPC_MDELEM_STATUS_404 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[10], GRPC_MDELEM_STORAGE_STATIC))
/* ":scheme": "http" */
#define GRPC_MDELEM_SCHEME_HTTP \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[11], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[5], GRPC_MDELEM_STORAGE_STATIC))
/* ":scheme": "https" */
#define GRPC_MDELEM_SCHEME_HTTPS \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[12], GRPC_MDELEM_STORAGE_STATIC))
/* ":scheme": "grpc" */
#define GRPC_MDELEM_SCHEME_GRPC \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[13], GRPC_MDELEM_STORAGE_STATIC))
/* ":authority": "" */
#define GRPC_MDELEM_AUTHORITY_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[14], GRPC_MDELEM_STORAGE_STATIC))
/* ":method": "GET" */
#define GRPC_MDELEM_METHOD_GET \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[15], GRPC_MDELEM_STORAGE_STATIC))
/* ":method": "PUT" */
#define GRPC_MDELEM_METHOD_PUT \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[16], GRPC_MDELEM_STORAGE_STATIC))
/* ":path": "/" */
#define GRPC_MDELEM_PATH_SLASH \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[17], GRPC_MDELEM_STORAGE_STATIC))
/* ":path": "/index.html" */
#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[18], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[6], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "200" */
#define GRPC_MDELEM_STATUS_200 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[7], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "204" */
#define GRPC_MDELEM_STATUS_204 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[19], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[8], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "206" */
#define GRPC_MDELEM_STATUS_206 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[20], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[9], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "304" */
#define GRPC_MDELEM_STATUS_304 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[21], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[10], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "400" */
#define GRPC_MDELEM_STATUS_400 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[22], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[11], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "404" */
#define GRPC_MDELEM_STATUS_404 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[12], GRPC_MDELEM_STORAGE_STATIC))
/* ":status": "500" */
#define GRPC_MDELEM_STATUS_500 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[23], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[13], GRPC_MDELEM_STORAGE_STATIC))
/* "accept-charset": "" */
#define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[24], GRPC_MDELEM_STORAGE_STATIC))
/* "accept-encoding": "" */
#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[25], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[14], GRPC_MDELEM_STORAGE_STATIC))
/* "accept-encoding": "gzip, deflate" */
#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[26], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[15], GRPC_MDELEM_STORAGE_STATIC))
/* "accept-language": "" */
#define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[27], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[16], GRPC_MDELEM_STORAGE_STATIC))
/* "accept-ranges": "" */
#define GRPC_MDELEM_ACCEPT_RANGES_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[28], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[17], GRPC_MDELEM_STORAGE_STATIC))
/* "accept": "" */
#define GRPC_MDELEM_ACCEPT_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[29], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[18], GRPC_MDELEM_STORAGE_STATIC))
/* "access-control-allow-origin": "" */
#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[30], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[19], GRPC_MDELEM_STORAGE_STATIC))
/* "age": "" */
#define GRPC_MDELEM_AGE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[31], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[20], GRPC_MDELEM_STORAGE_STATIC))
/* "allow": "" */
#define GRPC_MDELEM_ALLOW_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[32], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[21], GRPC_MDELEM_STORAGE_STATIC))
/* "authorization": "" */
#define GRPC_MDELEM_AUTHORIZATION_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[33], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[22], GRPC_MDELEM_STORAGE_STATIC))
/* "cache-control": "" */
#define GRPC_MDELEM_CACHE_CONTROL_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[34], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[23], GRPC_MDELEM_STORAGE_STATIC))
/* "content-disposition": "" */
#define GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[35], GRPC_MDELEM_STORAGE_STATIC))
/* "content-encoding": "identity" */
#define GRPC_MDELEM_CONTENT_ENCODING_IDENTITY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[36], GRPC_MDELEM_STORAGE_STATIC))
/* "content-encoding": "gzip" */
#define GRPC_MDELEM_CONTENT_ENCODING_GZIP \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[37], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[24], GRPC_MDELEM_STORAGE_STATIC))
/* "content-encoding": "" */
#define GRPC_MDELEM_CONTENT_ENCODING_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[38], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[25], GRPC_MDELEM_STORAGE_STATIC))
/* "content-language": "" */
#define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[39], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[26], GRPC_MDELEM_STORAGE_STATIC))
/* "content-length": "" */
#define GRPC_MDELEM_CONTENT_LENGTH_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[40], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[27], GRPC_MDELEM_STORAGE_STATIC))
/* "content-location": "" */
#define GRPC_MDELEM_CONTENT_LOCATION_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[41], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[28], GRPC_MDELEM_STORAGE_STATIC))
/* "content-range": "" */
#define GRPC_MDELEM_CONTENT_RANGE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[42], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[29], GRPC_MDELEM_STORAGE_STATIC))
/* "content-type": "" */
#define GRPC_MDELEM_CONTENT_TYPE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[43], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[30], GRPC_MDELEM_STORAGE_STATIC))
/* "cookie": "" */
#define GRPC_MDELEM_COOKIE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[44], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[31], GRPC_MDELEM_STORAGE_STATIC))
/* "date": "" */
#define GRPC_MDELEM_DATE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[45], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[32], GRPC_MDELEM_STORAGE_STATIC))
/* "etag": "" */
#define GRPC_MDELEM_ETAG_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[46], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[33], GRPC_MDELEM_STORAGE_STATIC))
/* "expect": "" */
#define GRPC_MDELEM_EXPECT_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[47], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[34], GRPC_MDELEM_STORAGE_STATIC))
/* "expires": "" */
#define GRPC_MDELEM_EXPIRES_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[48], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[35], GRPC_MDELEM_STORAGE_STATIC))
/* "from": "" */
#define GRPC_MDELEM_FROM_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[49], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[36], GRPC_MDELEM_STORAGE_STATIC))
/* "host": "" */
#define GRPC_MDELEM_HOST_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[50], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[37], GRPC_MDELEM_STORAGE_STATIC))
/* "if-match": "" */
#define GRPC_MDELEM_IF_MATCH_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[51], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[38], GRPC_MDELEM_STORAGE_STATIC))
/* "if-modified-since": "" */
#define GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[52], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[39], GRPC_MDELEM_STORAGE_STATIC))
/* "if-none-match": "" */
#define GRPC_MDELEM_IF_NONE_MATCH_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[53], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[40], GRPC_MDELEM_STORAGE_STATIC))
/* "if-range": "" */
#define GRPC_MDELEM_IF_RANGE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[54], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[41], GRPC_MDELEM_STORAGE_STATIC))
/* "if-unmodified-since": "" */
#define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[55], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[42], GRPC_MDELEM_STORAGE_STATIC))
/* "last-modified": "" */
#define GRPC_MDELEM_LAST_MODIFIED_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[56], GRPC_MDELEM_STORAGE_STATIC))
/* "lb-token": "" */
#define GRPC_MDELEM_LB_TOKEN_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[57], GRPC_MDELEM_STORAGE_STATIC))
/* "lb-cost-bin": "" */
#define GRPC_MDELEM_LB_COST_BIN_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[58], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[43], GRPC_MDELEM_STORAGE_STATIC))
/* "link": "" */
#define GRPC_MDELEM_LINK_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[59], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[44], GRPC_MDELEM_STORAGE_STATIC))
/* "location": "" */
#define GRPC_MDELEM_LOCATION_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[60], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[45], GRPC_MDELEM_STORAGE_STATIC))
/* "max-forwards": "" */
#define GRPC_MDELEM_MAX_FORWARDS_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[61], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[46], GRPC_MDELEM_STORAGE_STATIC))
/* "proxy-authenticate": "" */
#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[62], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[47], GRPC_MDELEM_STORAGE_STATIC))
/* "proxy-authorization": "" */
#define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[63], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[48], GRPC_MDELEM_STORAGE_STATIC))
/* "range": "" */
#define GRPC_MDELEM_RANGE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[64], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[49], GRPC_MDELEM_STORAGE_STATIC))
/* "referer": "" */
#define GRPC_MDELEM_REFERER_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[65], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[50], GRPC_MDELEM_STORAGE_STATIC))
/* "refresh": "" */
#define GRPC_MDELEM_REFRESH_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[66], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[51], GRPC_MDELEM_STORAGE_STATIC))
/* "retry-after": "" */
#define GRPC_MDELEM_RETRY_AFTER_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[67], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[52], GRPC_MDELEM_STORAGE_STATIC))
/* "server": "" */
#define GRPC_MDELEM_SERVER_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[68], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[53], GRPC_MDELEM_STORAGE_STATIC))
/* "set-cookie": "" */
#define GRPC_MDELEM_SET_COOKIE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[69], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[54], GRPC_MDELEM_STORAGE_STATIC))
/* "strict-transport-security": "" */
#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[70], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[55], GRPC_MDELEM_STORAGE_STATIC))
/* "transfer-encoding": "" */
#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[71], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[56], GRPC_MDELEM_STORAGE_STATIC))
/* "user-agent": "" */
#define GRPC_MDELEM_USER_AGENT_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[72], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[57], GRPC_MDELEM_STORAGE_STATIC))
/* "vary": "" */
#define GRPC_MDELEM_VARY_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[73], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[58], GRPC_MDELEM_STORAGE_STATIC))
/* "via": "" */
#define GRPC_MDELEM_VIA_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[74], GRPC_MDELEM_STORAGE_STATIC))
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[59], GRPC_MDELEM_STORAGE_STATIC))
/* "www-authenticate": "" */
#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[60], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-status": "0" */
#define GRPC_MDELEM_GRPC_STATUS_0 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[61], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-status": "1" */
#define GRPC_MDELEM_GRPC_STATUS_1 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[62], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-status": "2" */
#define GRPC_MDELEM_GRPC_STATUS_2 \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[63], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-encoding": "identity" */
#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[64], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-encoding": "gzip" */
#define GRPC_MDELEM_GRPC_ENCODING_GZIP \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[65], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-encoding": "deflate" */
#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[66], GRPC_MDELEM_STORAGE_STATIC))
/* "te": "trailers" */
#define GRPC_MDELEM_TE_TRAILERS \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[67], GRPC_MDELEM_STORAGE_STATIC))
/* "content-type": "application/grpc" */
#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[68], GRPC_MDELEM_STORAGE_STATIC))
/* ":scheme": "grpc" */
#define GRPC_MDELEM_SCHEME_GRPC \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[69], GRPC_MDELEM_STORAGE_STATIC))
/* ":method": "PUT" */
#define GRPC_MDELEM_METHOD_PUT \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[70], GRPC_MDELEM_STORAGE_STATIC))
/* "accept-encoding": "" */
#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[71], GRPC_MDELEM_STORAGE_STATIC))
/* "content-encoding": "identity" */
#define GRPC_MDELEM_CONTENT_ENCODING_IDENTITY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[72], GRPC_MDELEM_STORAGE_STATIC))
/* "content-encoding": "gzip" */
#define GRPC_MDELEM_CONTENT_ENCODING_GZIP \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[73], GRPC_MDELEM_STORAGE_STATIC))
/* "lb-token": "" */
#define GRPC_MDELEM_LB_TOKEN_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[74], GRPC_MDELEM_STORAGE_STATIC))
/* "lb-cost-bin": "" */
#define GRPC_MDELEM_LB_COST_BIN_EMPTY \
(GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[75], GRPC_MDELEM_STORAGE_STATIC))
/* "grpc-accept-encoding": "identity" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \

@ -20,6 +20,7 @@
#include <chrono>
#include <condition_variable>
#include <cstring>
#include <memory>
#include <mutex>
@ -72,6 +73,10 @@ Channel::~Channel() {
namespace {
inline grpc_slice SliceFromArray(const char* arr, size_t len) {
return g_core_codegen_interface->grpc_slice_from_copied_buffer(arr, len);
}
grpc::string GetChannelInfoField(grpc_channel* channel,
grpc_channel_info* channel_info,
char*** channel_info_field) {
@ -118,16 +123,17 @@ internal::Call Channel::CreateCall(const internal::RpcMethod& method,
context->propagation_options_.c_bitmask(), cq->cq(),
method.channel_tag(), context->raw_deadline(), nullptr);
} else {
const char* host_str = nullptr;
if (!context->authority().empty()) {
host_str = context->authority_.c_str();
const string* host_str = nullptr;
if (!context->authority_.empty()) {
host_str = &context->authority_;
} else if (!host_.empty()) {
host_str = host_.c_str();
host_str = &host_;
}
grpc_slice method_slice = SliceFromCopiedString(method.name());
grpc_slice method_slice =
SliceFromArray(method.name(), strlen(method.name()));
grpc_slice host_slice;
if (host_str != nullptr) {
host_slice = SliceFromCopiedString(host_str);
host_slice = SliceFromCopiedString(*host_str);
}
c_call = grpc_channel_create_call(
c_channel_, context->propagate_from_call_,

@ -92,4 +92,21 @@ Status ChannelzService::GetSubchannel(
return Status::OK;
}
Status ChannelzService::GetSocket(ServerContext* unused,
const channelz::v1::GetSocketRequest* request,
channelz::v1::GetSocketResponse* response) {
char* json_str = grpc_channelz_get_socket(request->socket_id());
gpr_log(GPR_ERROR, "%s", json_str);
if (json_str == nullptr) {
return Status(NOT_FOUND, "No object found for that SocketId");
}
google::protobuf::util::Status s =
google::protobuf::util::JsonStringToMessage(json_str, response);
gpr_free(json_str);
if (s != google::protobuf::util::Status::OK) {
return Status(INTERNAL, s.ToString());
}
return Status::OK;
}
} // namespace grpc

@ -44,6 +44,10 @@ class ChannelzService final : public channelz::v1::Channelz::Service {
Status GetSubchannel(ServerContext* unused,
const channelz::v1::GetSubchannelRequest* request,
channelz::v1::GetSubchannelResponse* response) override;
// implementation of GetSocket rpc
Status GetSocket(ServerContext* unused,
const channelz::v1::GetSocketRequest* request,
channelz::v1::GetSocketResponse* response) override;
};
} // namespace grpc

@ -72,6 +72,23 @@ namespace Grpc.Core.Tests
Assert.Throws(typeof(ArgumentException), () => new Metadata.Entry("abc/", "xyz"));
}
[Test]
public void KeysAreNormalized_UppercaseKey()
{
var uppercaseKey = "ABC";
var entry = new Metadata.Entry(uppercaseKey, "XYZ");
Assert.AreEqual("abc", entry.Key);
}
[Test]
public void KeysAreNormalized_LowercaseKey()
{
var lowercaseKey = "abc";
var entry = new Metadata.Entry(lowercaseKey, "XYZ");
// no allocation if key already lowercase
Assert.AreSame(lowercaseKey, entry.Key);
}
[Test]
public void Entry_ConstructionPreconditions()
{

@ -151,12 +151,12 @@ namespace Grpc.Core
{
private class ClientBaseConfigurationInterceptor : Interceptor
{
readonly Func<IMethod, string, CallOptions, Tuple<string, CallOptions>> interceptor;
readonly Func<IMethod, string, CallOptions, ClientBaseConfigurationInfo> interceptor;
/// <summary>
/// Creates a new instance of ClientBaseConfigurationInterceptor given the specified header and host interceptor function.
/// </summary>
public ClientBaseConfigurationInterceptor(Func<IMethod, string, CallOptions, Tuple<string, CallOptions>> interceptor)
public ClientBaseConfigurationInterceptor(Func<IMethod, string, CallOptions, ClientBaseConfigurationInfo> interceptor)
{
this.interceptor = GrpcPreconditions.CheckNotNull(interceptor, nameof(interceptor));
}
@ -166,7 +166,7 @@ namespace Grpc.Core
where TResponse : class
{
var newHostAndCallOptions = interceptor(context.Method, context.Host, context.Options);
return new ClientInterceptorContext<TRequest, TResponse>(context.Method, newHostAndCallOptions.Item1, newHostAndCallOptions.Item2);
return new ClientInterceptorContext<TRequest, TResponse>(context.Method, newHostAndCallOptions.Host, newHostAndCallOptions.CallOptions);
}
public override TResponse BlockingUnaryCall<TRequest, TResponse>(TRequest request, ClientInterceptorContext<TRequest, TResponse> context, BlockingUnaryCallContinuation<TRequest, TResponse> continuation)
@ -195,6 +195,18 @@ namespace Grpc.Core
}
}
internal struct ClientBaseConfigurationInfo
{
internal readonly string Host;
internal readonly CallOptions CallOptions;
internal ClientBaseConfigurationInfo(string host, CallOptions callOptions)
{
Host = host;
CallOptions = callOptions;
}
}
readonly CallInvoker undecoratedCallInvoker;
readonly string host;
@ -206,7 +218,7 @@ namespace Grpc.Core
internal CallInvoker CreateDecoratedCallInvoker()
{
return undecoratedCallInvoker.Intercept(new ClientBaseConfigurationInterceptor((method, host, options) => Tuple.Create(this.host, options)));
return undecoratedCallInvoker.Intercept(new ClientBaseConfigurationInterceptor((method, host, options) => new ClientBaseConfigurationInfo(this.host, options)));
}
internal ClientBaseConfiguration WithHost(string host)

@ -35,6 +35,13 @@ namespace Grpc.Core.Internal
/// </summary>
public static string PtrToStringUTF8(IntPtr ptr, int len)
{
if (len == 0)
{
return "";
}
// TODO(jtattermusch): once Span dependency is added,
// use Span-based API to decode the string without copying the buffer.
var bytes = new byte[len];
Marshal.Copy(ptr, bytes, 0, len);
return EncodingUTF8.GetString(bytes);

@ -135,7 +135,7 @@ namespace Grpc.Core
}
/// <summary>
/// <see cref="T:IList`1"/>
/// Adds a new ASCII-valued metadata entry. See <c>Metadata.Entry</c> constructor for params.
/// </summary>
public void Add(string key, string value)
{
@ -143,7 +143,7 @@ namespace Grpc.Core
}
/// <summary>
/// <see cref="T:IList`1"/>
/// Adds a new binary-valued metadata entry. See <c>Metadata.Entry</c> constructor for params.
/// </summary>
public void Add(string key, byte[] valueBytes)
{
@ -225,8 +225,6 @@ namespace Grpc.Core
/// </summary>
public class Entry
{
private static readonly Regex ValidKeyRegex = new Regex("^[.a-z0-9_-]+$");
readonly string key;
readonly string value;
readonly byte[] valueBytes;
@ -241,7 +239,7 @@ namespace Grpc.Core
/// <summary>
/// Initializes a new instance of the <see cref="Grpc.Core.Metadata.Entry"/> struct with a binary value.
/// </summary>
/// <param name="key">Metadata key, needs to have suffix indicating a binary valued metadata entry.</param>
/// <param name="key">Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens and dots.</param>
/// <param name="valueBytes">Value bytes.</param>
public Entry(string key, byte[] valueBytes)
{
@ -255,9 +253,9 @@ namespace Grpc.Core
}
/// <summary>
/// Initializes a new instance of the <see cref="Grpc.Core.Metadata.Entry"/> struct holding an ASCII value.
/// Initializes a new instance of the <see cref="Grpc.Core.Metadata.Entry"/> struct with an ASCII value.
/// </summary>
/// <param name="key">Metadata key, must not use suffix indicating a binary valued metadata entry.</param>
/// <param name="key">Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores, hyphens and dots.</param>
/// <param name="value">Value string. Only ASCII characters are allowed.</param>
public Entry(string key, string value)
{
@ -358,10 +356,42 @@ namespace Grpc.Core
private static string NormalizeKey(string key)
{
var normalized = GrpcPreconditions.CheckNotNull(key, "key").ToLowerInvariant();
GrpcPreconditions.CheckArgument(ValidKeyRegex.IsMatch(normalized),
GrpcPreconditions.CheckNotNull(key, "key");
GrpcPreconditions.CheckArgument(IsValidKey(key, out bool isLowercase),
"Metadata entry key not valid. Keys can only contain lowercase alphanumeric characters, underscores, hyphens and dots.");
return normalized;
if (isLowercase)
{
// save allocation of a new string if already lowercase
return key;
}
return key.ToLowerInvariant();
}
private static bool IsValidKey(string input, out bool isLowercase)
{
isLowercase = true;
for (int i = 0; i < input.Length; i++)
{
char c = input[i];
if ('a' <= c && c <= 'z' ||
'0' <= c && c <= '9' ||
c == '.' ||
c == '_' ||
c == '-' )
continue;
if ('A' <= c && c <= 'Z')
{
isLowercase = false;
continue;
}
return false;
}
return true;
}
/// <summary>

@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="$(GoogleProtobufVersion)" />
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="CommandLineParser" Version="2.3.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnitLite" Version="3.10.1" />
</ItemGroup>

@ -16,7 +16,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="CommandLineParser" Version="2.3.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">

@ -222,7 +222,6 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
'src/core/ext/transport/chttp2/transport/hpack_mapping.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
'src/core/ext/transport/chttp2/transport/hpack_table.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',

@ -95,7 +95,7 @@ end
# creates a test stub that accesses host:port securely.
def create_stub(opts)
address = "#{opts.host}:#{opts.port}"
address = "#{opts.server_host}:#{opts.server_port}"
# Provide channel args that request compression by default
# for compression interop tests
@ -112,7 +112,7 @@ def create_stub(opts)
creds = ssl_creds(opts.use_test_ca)
stub_opts = {
channel_args: {
GRPC::Core::Channel::SSL_TARGET => opts.host_override
GRPC::Core::Channel::SSL_TARGET => opts.server_host_override
}
}
@ -703,19 +703,19 @@ class NamedTests
end
# Args is used to hold the command line info.
Args = Struct.new(:default_service_account, :host, :host_override,
:oauth_scope, :port, :secure, :test_case,
Args = Struct.new(:default_service_account, :server_host, :server_host_override,
:oauth_scope, :server_port, :secure, :test_case,
:use_test_ca)
# validates the command line options, returning them as a Hash.
def parse_args
args = Args.new
args.host_override = 'foo.test.google.fr'
args.server_host_override = 'foo.test.google.fr'
OptionParser.new do |opts|
opts.on('--oauth_scope scope',
'Scope for OAuth tokens') { |v| args['oauth_scope'] = v }
opts.on('--server_host SERVER_HOST', 'server hostname') do |v|
args['host'] = v
args['server_host'] = v
end
opts.on('--default_service_account email_address',
'email address of the default service account') do |v|
@ -723,9 +723,11 @@ def parse_args
end
opts.on('--server_host_override HOST_OVERRIDE',
'override host via a HTTP header') do |v|
args['host_override'] = v
args['server_host_override'] = v
end
opts.on('--server_port SERVER_PORT', 'server port') do |v|
args['server_port'] = v
end
opts.on('--server_port SERVER_PORT', 'server port') { |v| args['port'] = v }
# instance_methods(false) gives only the methods defined in that class
test_cases = NamedTests.instance_methods(false).map(&:to_s)
test_case_list = test_cases.join(',')
@ -744,7 +746,7 @@ def parse_args
end
def _check_args(args)
%w(host port test_case).each do |a|
%w(server_host server_port test_case).each do |a|
if args[a].nil?
fail(OptionParser::MissingArgument, "please specify --#{a}")
end

@ -164,6 +164,17 @@
set(_gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf")
endif()
if (_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC)
# C core has C++ source code, but should not depend on libstc++ (for better portability).
# We need to use a few tricks to convince cmake to do that.
# https://stackoverflow.com/questions/15058403/how-to-stop-cmake-from-linking-against-libstdc
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
# Exceptions and RTTI must be off to avoid dependency on libstdc++
set(_gRPC_CORE_NOSTDCXX_FLAGS -fno-exceptions -fno-rtti)
else()
set(_gRPC_CORE_NOSTDCXX_FLAGS "")
endif()
include(cmake/zlib.cmake)
include(cmake/cares.cmake)
include(cmake/protobuf.cmake)
@ -403,7 +414,14 @@
PRIVATE <%text>${_gRPC_PROTO_GENS_DIR}</%text>
% endif
)
% if lib.language in ['c', 'csharp']:
# avoid dependency on libstdc++
if (_gRPC_CORE_NOSTDCXX_FLAGS)
set_target_properties(${lib.name} PROPERTIES LINKER_LANGUAGE C)
# only use the flags for C++ source files
target_compile_options(${lib.name} PRIVATE <%text>$<$<COMPILE_LANGUAGE:CXX>:${_gRPC_CORE_NOSTDCXX_FLAGS}></%text>)
endif()
% endif
% if len(get_deps(lib)) > 0:
target_link_libraries(${lib.name}
% for dep in get_deps(lib):
@ -492,6 +510,14 @@
${dep}
% endfor
)
% if tgt.language in ['c', 'csharp']:
# avoid dependency on libstdc++
if (_gRPC_CORE_NOSTDCXX_FLAGS)
set_target_properties(${tgt.name} PROPERTIES LINKER_LANGUAGE C)
target_compile_options(${tgt.name} PRIVATE <%text>$<$<COMPILE_LANGUAGE:CXX>:${_gRPC_CORE_NOSTDCXX_FLAGS}></%text>)
endif()
% endif
% endif
</%def>

@ -1,9 +1,13 @@
# Regenerating project files
Prerequisites: `python`, `pip install mako`, `go`
Prerequisites
- `python`
- `pip install mako` (the template processor)
- `pip install pyyaml` (to read the yaml files)
- `go` (required by boringssl dependency)
```
# Regenerate the projects files using templates
# Regenerate the projects files (and other generated files) using templates
tools/buildgen/generate_projects.sh
```
@ -19,25 +23,13 @@ So instead we decided to work the following way:
targets and files needed to build grpc and its tests, as well as a basic system
for dependency description.
* Each project file (Makefile, Visual Studio project files, Bazel's BUILD) is
a [YAML](http://yaml.org) file used by the `build.yaml` file to generate the
final output file.
* Most of the build systems supported by gRPC (e.g. Makefile, cmake, XCode) have a template defined in this directory. The templates use the information from the `build.yaml` file to generate the project files specific to a given build system.
This way we can maintain as many project system as we see fit, without having
to manually maintain them when we add or remove new code to the repository.
Only the structure of the project file is relevant to the template. The actual
list of source code and targets isn't.
We currently have template files for GNU Make, Visual Studio 2013,
[Bazel](http://bazel.io) and [gyp](https://gyp.gsrc.io/) (albeit only for
Node.js). In the future, we
would like to expand to also generate [cmake](https://cmake.org)
project files, XCode project files, and an Android.mk file allowing to compile
gRPC using Android's NDK.
We'll gladly accept contribution that'd create additional project files
using that system.
# Structure of `build.yaml`
The `build.yaml` file has the following structure:
@ -87,7 +79,6 @@ src: # list of files to compile
secure: boolean, # see below
baselib: boolean, # this is a low level library that has system
# dependencies
vs_project_guid: '{...}', # Visual Studio's unique guid for that project
filegroups: # list of filegroups to merge to that project
# note that this will be expanded automatically
deps: # list of libraries this target depends on
@ -95,12 +86,6 @@ deps_linkage: "..." # "static" or "dynamic". Used by the Makefile only to
# determine the way dependencies are linkned. Defaults
# to "dynamic".
dll: "..." # see below.
dll_def: "..." # Visual Studio's dll definition file.
vs_props: # List of property sheets to attach to that project.
vs_config_type: "..." # DynamicLibrary/StaticLibrary. Used only when
# creating a library. Specifies if we're building a
# static library or a dll. Use in conjunction with `dll_def`.
vs_packages: # List of nuget packages this project depends on.
```
## The `"build"` tag
@ -137,23 +122,17 @@ protobuf is for `"c++"` ones.
## The `"dll"` tag
Used only by Visual Studio's project files. "true" means the project will be
Currently only used by cmake. "true" means the project will be
built with both static and dynamic runtimes. "false" means it'll only be built
with static runtime. "only" means it'll only be built with the dll runtime.
## The `"dll_def"` tag
Specifies the visual studio's dll definition file. When creating a DLL, you
sometimes (not always) need a def file (see grpc.def).
# The template system
We're currently using the [mako templates](http://www.makotemplates.org/)
renderer. That choice enables us to simply render text files without dragging
with us a lot of other features. Feel free to explore the current templates
in that directory. The simplest one is probably [BUILD.template](BUILD.template)
which is used to create the [Bazel](http://bazel.io/) project file.
in that directory.
## The renderer engine

@ -37,24 +37,18 @@
"\x07deflate"
"\x04gzip"
"\x0Bstream/gzip"
"\x010"
"\x08identity"
"\x08trailers"
"\x10application/grpc"
"\x04POST"
"\x03200"
"\x03404"
"\x04http"
"\x05https"
"\x04grpc"
"\x03GET"
"\x03PUT"
"\x04POST"
"\x01/"
"\x0B/index.html"
"\x04http"
"\x05https"
"\x03200"
"\x03204"
"\x03206"
"\x03304"
"\x03400"
"\x03404"
"\x03500"
"\x0Eaccept-charset"
"\x0Dgzip, deflate"
@ -83,7 +77,6 @@
"\x08if-range"
"\x13if-unmodified-since"
"\x0Dlast-modified"
"\x0Blb-cost-bin"
"\x04link"
"\x08location"
"\x0Cmax-forwards"
@ -100,36 +93,32 @@
"\x04vary"
"\x03via"
"\x10www-authenticate"
"\x010"
"\x08identity"
"\x08trailers"
"\x10application/grpc"
"\x04grpc"
"\x03PUT"
"\x0Blb-cost-bin"
"\x10identity,deflate"
"\x0Didentity,gzip"
"\x0Cdeflate,gzip"
"\x15identity,deflate,gzip"
"\x00\x0Bgrpc-status\x010"
"\x00\x0Bgrpc-status\x011"
"\x00\x0Bgrpc-status\x012"
"\x00\x0Dgrpc-encoding\x08identity"
"\x00\x0Dgrpc-encoding\x04gzip"
"\x00\x0Dgrpc-encoding\x07deflate"
"\x00\x02te\x08trailers"
"\x00\x0Ccontent-type\x10application/grpc"
"\x00\x07:method\x04POST"
"\x00\x07:status\x03200"
"\x00\x07:status\x03404"
"\x00\x07:scheme\x04http"
"\x00\x07:scheme\x05https"
"\x00\x07:scheme\x04grpc"
"\x00\x0A:authority\x00"
"\x00\x07:method\x03GET"
"\x00\x07:method\x03PUT"
"\x00\x07:method\x04POST"
"\x00\x05:path\x01/"
"\x00\x05:path\x0B/index.html"
"\x00\x07:scheme\x04http"
"\x00\x07:scheme\x05https"
"\x00\x07:status\x03200"
"\x00\x07:status\x03204"
"\x00\x07:status\x03206"
"\x00\x07:status\x03304"
"\x00\x07:status\x03400"
"\x00\x07:status\x03404"
"\x00\x07:status\x03500"
"\x00\x0Eaccept-charset\x00"
"\x00\x0Faccept-encoding\x00"
"\x00\x0Faccept-encoding\x0Dgzip, deflate"
"\x00\x0Faccept-language\x00"
"\x00\x0Daccept-ranges\x00"
@ -140,8 +129,6 @@
"\x00\x0Dauthorization\x00"
"\x00\x0Dcache-control\x00"
"\x00\x13content-disposition\x00"
"\x00\x10content-encoding\x08identity"
"\x00\x10content-encoding\x04gzip"
"\x00\x10content-encoding\x00"
"\x00\x10content-language\x00"
"\x00\x0Econtent-length\x00"
@ -161,8 +148,6 @@
"\x00\x08if-range\x00"
"\x00\x13if-unmodified-since\x00"
"\x00\x0Dlast-modified\x00"
"\x00\x08lb-token\x00"
"\x00\x0Blb-cost-bin\x00"
"\x00\x04link\x00"
"\x00\x08location\x00"
"\x00\x0Cmax-forwards\x00"
@ -180,6 +165,21 @@
"\x00\x04vary\x00"
"\x00\x03via\x00"
"\x00\x10www-authenticate\x00"
"\x00\x0Bgrpc-status\x010"
"\x00\x0Bgrpc-status\x011"
"\x00\x0Bgrpc-status\x012"
"\x00\x0Dgrpc-encoding\x08identity"
"\x00\x0Dgrpc-encoding\x04gzip"
"\x00\x0Dgrpc-encoding\x07deflate"
"\x00\x02te\x08trailers"
"\x00\x0Ccontent-type\x10application/grpc"
"\x00\x07:scheme\x04grpc"
"\x00\x07:method\x03PUT"
"\x00\x0Faccept-encoding\x00"
"\x00\x10content-encoding\x08identity"
"\x00\x10content-encoding\x04gzip"
"\x00\x08lb-token\x00"
"\x00\x0Blb-cost-bin\x00"
"\x00\x14grpc-accept-encoding\x08identity"
"\x00\x14grpc-accept-encoding\x07deflate"
"\x00\x14grpc-accept-encoding\x10identity,deflate"

@ -43,6 +43,8 @@ using grpc::channelz::v1::GetChannelRequest;
using grpc::channelz::v1::GetChannelResponse;
using grpc::channelz::v1::GetServersRequest;
using grpc::channelz::v1::GetServersResponse;
using grpc::channelz::v1::GetSocketRequest;
using grpc::channelz::v1::GetSocketResponse;
using grpc::channelz::v1::GetSubchannelRequest;
using grpc::channelz::v1::GetSubchannelResponse;
using grpc::channelz::v1::GetTopChannelsRequest;
@ -71,6 +73,26 @@ class Proxy : public ::grpc::testing::EchoTestService::Service {
return stubs_[idx]->Echo(client_context.get(), *request, response);
}
Status BidiStream(ServerContext* server_context,
ServerReaderWriter<EchoResponse, EchoRequest>*
stream_from_client) override {
EchoRequest request;
EchoResponse response;
std::unique_ptr<ClientContext> client_context =
ClientContext::FromServerContext(*server_context);
// always use the first proxy for streaming
auto stream_to_backend = stubs_[0]->BidiStream(client_context.get());
while (stream_from_client->Read(&request)) {
stream_to_backend->Write(request);
stream_to_backend->Read(&response);
stream_from_client->Write(response);
}
stream_to_backend->WritesDone();
return stream_to_backend->Finish();
}
private:
std::vector<std::unique_ptr<::grpc::testing::EchoTestService::Stub>> stubs_;
};
@ -149,6 +171,21 @@ class ChannelzServerTest : public ::testing::Test {
EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message();
}
void SendSuccessfulStream(int num_messages) {
EchoRequest request;
EchoResponse response;
request.set_message("Hello channelz");
ClientContext context;
auto stream_to_proxy = echo_stub_->BidiStream(&context);
for (int i = 0; i < num_messages; ++i) {
EXPECT_TRUE(stream_to_proxy->Write(request));
EXPECT_TRUE(stream_to_proxy->Read(&response));
}
stream_to_proxy->WritesDone();
Status s = stream_to_proxy->Finish();
EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message();
}
void SendFailedEcho(int channel_idx) {
EchoRequest request;
EchoResponse response;
@ -448,6 +485,121 @@ TEST_F(ChannelzServerTest, ServerCallTest) {
kNumSuccess + kNumFailed + 1);
}
TEST_F(ChannelzServerTest, ManySubchannelsAndSockets) {
ResetStubs();
const int kNumChannels = 4;
ConfigureProxy(kNumChannels);
const int kNumSuccess = 10;
const int kNumFailed = 11;
for (int i = 0; i < kNumSuccess; ++i) {
SendSuccessfulEcho(0);
SendSuccessfulEcho(2);
}
for (int i = 0; i < kNumFailed; ++i) {
SendFailedEcho(1);
SendFailedEcho(2);
}
GetTopChannelsRequest gtc_request;
GetTopChannelsResponse gtc_response;
gtc_request.set_start_channel_id(0);
ClientContext context;
Status s =
channelz_stub_->GetTopChannels(&context, gtc_request, &gtc_response);
EXPECT_TRUE(s.ok()) << s.error_message();
EXPECT_EQ(gtc_response.channel_size(), kNumChannels);
for (int i = 0; i < gtc_response.channel_size(); ++i) {
// if the channel sent no RPCs, then expect no subchannels to have been
// created.
if (gtc_response.channel(i).data().calls_started() == 0) {
EXPECT_EQ(gtc_response.channel(i).subchannel_ref_size(), 0);
continue;
}
// The resolver must return at least one address.
ASSERT_GT(gtc_response.channel(i).subchannel_ref_size(), 0);
// First grab the subchannel
GetSubchannelRequest get_subchannel_req;
GetSubchannelResponse get_subchannel_resp;
get_subchannel_req.set_subchannel_id(
gtc_response.channel(i).subchannel_ref(0).subchannel_id());
ClientContext get_subchannel_ctx;
Status s = channelz_stub_->GetSubchannel(
&get_subchannel_ctx, get_subchannel_req, &get_subchannel_resp);
EXPECT_TRUE(s.ok()) << s.error_message();
EXPECT_EQ(get_subchannel_resp.subchannel().socket_ref_size(), 1);
// Now grab the socket.
GetSocketRequest get_socket_req;
GetSocketResponse get_socket_resp;
ClientContext get_socket_ctx;
get_socket_req.set_socket_id(
get_subchannel_resp.subchannel().socket_ref(0).socket_id());
s = channelz_stub_->GetSocket(&get_socket_ctx, get_socket_req,
&get_socket_resp);
EXPECT_TRUE(s.ok()) << s.error_message();
// calls started == streams started AND stream succeeded. Since none of
// these RPCs were canceled, all of the streams will succeeded even though
// the RPCs they represent might have failed.
EXPECT_EQ(get_subchannel_resp.subchannel().data().calls_started(),
get_socket_resp.socket().data().streams_started());
EXPECT_EQ(get_subchannel_resp.subchannel().data().calls_started(),
get_socket_resp.socket().data().streams_succeeded());
// All of the calls were unary, so calls started == messages sent.
EXPECT_EQ(get_subchannel_resp.subchannel().data().calls_started(),
get_socket_resp.socket().data().messages_sent());
// We only get responses when the RPC was successful, so
// calls succeeded == messages received.
EXPECT_EQ(get_subchannel_resp.subchannel().data().calls_succeeded(),
get_socket_resp.socket().data().messages_received());
}
}
TEST_F(ChannelzServerTest, StreamingRPC) {
ResetStubs();
ConfigureProxy(1);
const int kNumMessages = 5;
SendSuccessfulStream(kNumMessages);
// Get the channel
GetChannelRequest get_channel_request;
GetChannelResponse get_channel_response;
get_channel_request.set_channel_id(GetChannelId(0));
ClientContext get_channel_context;
Status s = channelz_stub_->GetChannel(
&get_channel_context, get_channel_request, &get_channel_response);
EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message();
EXPECT_EQ(get_channel_response.channel().data().calls_started(), 1);
EXPECT_EQ(get_channel_response.channel().data().calls_succeeded(), 1);
EXPECT_EQ(get_channel_response.channel().data().calls_failed(), 0);
// Get the subchannel
ASSERT_GT(get_channel_response.channel().subchannel_ref_size(), 0);
GetSubchannelRequest get_subchannel_request;
GetSubchannelResponse get_subchannel_response;
ClientContext get_subchannel_context;
get_subchannel_request.set_subchannel_id(
get_channel_response.channel().subchannel_ref(0).subchannel_id());
s = channelz_stub_->GetSubchannel(&get_subchannel_context,
get_subchannel_request,
&get_subchannel_response);
EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message();
EXPECT_EQ(get_subchannel_response.subchannel().data().calls_started(), 1);
EXPECT_EQ(get_subchannel_response.subchannel().data().calls_succeeded(), 1);
EXPECT_EQ(get_subchannel_response.subchannel().data().calls_failed(), 0);
// Get the socket
ASSERT_GT(get_subchannel_response.subchannel().socket_ref_size(), 0);
GetSocketRequest get_socket_request;
GetSocketResponse get_socket_response;
ClientContext get_socket_context;
get_socket_request.set_socket_id(
get_subchannel_response.subchannel().socket_ref(0).socket_id());
s = channelz_stub_->GetSocket(&get_socket_context, get_socket_request,
&get_socket_response);
EXPECT_TRUE(s.ok()) << "s.error_message() = " << s.error_message();
EXPECT_EQ(get_socket_response.socket().data().streams_started(), 1);
EXPECT_EQ(get_socket_response.socket().data().streams_succeeded(), 1);
EXPECT_EQ(get_socket_response.socket().data().streams_failed(), 0);
EXPECT_EQ(get_socket_response.socket().data().messages_sent(), kNumMessages);
EXPECT_EQ(get_socket_response.socket().data().messages_received(),
kNumMessages);
}
} // namespace testing
} // namespace grpc

@ -31,6 +31,8 @@ auto& force_library_initialization = Library::get();
* CONFIGURATIONS
*/
// Replace "benchmark::internal::Benchmark" with "::testing::Benchmark" to use
// internal microbenchmarking tooling
static void SweepSizesArgs(benchmark::internal::Benchmark* b) {
b->Args({0, 0});
for (int i = 1; i <= 128 * 1024 * 1024; i *= 8) {

@ -23,14 +23,14 @@ import subprocess
import re
import perfection
# Configuration: a list of either strings or 2-tuples of strings or 3-tuples of
# strings.
# Configuration: a list of either strings or 2-tuples of strings.
# A single string represents a static grpc_mdstr.
# A 2-tuple represents a static grpc_mdelem (and appropriate grpc_mdstrs will
# also be created).
# A 3-tuple represents a static grpc_mdelem (and appropriate grpc_mdstrs will
# also be created), with the last value equivalent to the mdelem's static hpack
# table index as defined by RFC 7541
# The list of 2-tuples must begin with the static hpack table elements as
# defined by RFC 7541 and be in the same order because of an hpack encoding
# performance optimization that relies on this. If you want to change this, then
# you must change the implementation of the encoding optimization as well.
CONFIG = [
# metadata strings
@ -68,6 +68,69 @@ CONFIG = [
'gzip',
'stream/gzip',
# metadata elements
# begin hpack static elements
(':authority', ''),
(':method', 'GET'),
(':method', 'POST'),
(':path', '/'),
(':path', '/index.html'),
(':scheme', 'http'),
(':scheme', 'https'),
(':status', '200'),
(':status', '204'),
(':status', '206'),
(':status', '304'),
(':status', '400'),
(':status', '404'),
(':status', '500'),
('accept-charset', ''),
('accept-encoding', 'gzip, deflate'),
('accept-language', ''),
('accept-ranges', ''),
('accept', ''),
('access-control-allow-origin', ''),
('age', ''),
('allow', ''),
('authorization', ''),
('cache-control', ''),
('content-disposition', ''),
('content-encoding', ''),
('content-language', ''),
('content-length', ''),
('content-location', ''),
('content-range', ''),
('content-type', ''),
('cookie', ''),
('date', ''),
('etag', ''),
('expect', ''),
('expires', ''),
('from', ''),
('host', ''),
('if-match', ''),
('if-modified-since', ''),
('if-none-match', ''),
('if-range', ''),
('if-unmodified-since', ''),
('last-modified', ''),
('link', ''),
('location', ''),
('max-forwards', ''),
('proxy-authenticate', ''),
('proxy-authorization', ''),
('range', ''),
('referer', ''),
('refresh', ''),
('retry-after', ''),
('server', ''),
('set-cookie', ''),
('strict-transport-security', ''),
('transfer-encoding', ''),
('user-agent', ''),
('vary', ''),
('via', ''),
('www-authenticate', ''),
# end hpack static elements
('grpc-status', '0'),
('grpc-status', '1'),
('grpc-status', '2'),
@ -76,74 +139,13 @@ CONFIG = [
('grpc-encoding', 'deflate'),
('te', 'trailers'),
('content-type', 'application/grpc'),
(':method', 'POST', 3),
(':status', '200', 8),
(':status', '404', 13),
(':scheme', 'http', 6),
(':scheme', 'https', 7),
(':scheme', 'grpc', 0),
(':authority', '', 1),
(':method', 'GET', 2),
(':scheme', 'grpc'),
(':method', 'PUT'),
(':path', '/', 4),
(':path', '/index.html', 5),
(':status', '204', 9),
(':status', '206', 10),
(':status', '304', 11),
(':status', '400', 12),
(':status', '500', 14),
('accept-charset', '', 15),
('accept-encoding', ''),
('accept-encoding', 'gzip, deflate', 16),
('accept-language', '', 17),
('accept-ranges', '', 18),
('accept', '', 19),
('access-control-allow-origin', '', 20),
('age', '', 21),
('allow', '', 22),
('authorization', '', 23),
('cache-control', '', 24),
('content-disposition', '', 25),
('content-encoding', 'identity'),
('content-encoding', 'gzip'),
('content-encoding', '', 26),
('content-language', '', 27),
('content-length', '', 28),
('content-location', '', 29),
('content-range', '', 30),
('content-type', '', 31),
('cookie', '', 32),
('date', '', 33),
('etag', '', 34),
('expect', '', 35),
('expires', '', 36),
('from', '', 37),
('host', '', 38),
('if-match', '', 39),
('if-modified-since', '', 40),
('if-none-match', '', 41),
('if-range', '', 42),
('if-unmodified-since', '', 43),
('last-modified', '', 44),
('lb-token', ''),
('lb-cost-bin', ''),
('link', '', 45),
('location', '', 46),
('max-forwards', '', 47),
('proxy-authenticate', '', 48),
('proxy-authorization', '', 49),
('range', '', 50),
('referer', '', 51),
('refresh', '', 52),
('retry-after', '', 53),
('server', '', 54),
('set-cookie', '', 55),
('strict-transport-security', '', 56),
('transfer-encoding', '', 57),
('user-agent', '', 58),
('vary', '', 59),
('via', '', 60),
('www-authenticate', '', 61),
]
# All entries here are ignored when counting non-default initial metadata that
@ -326,17 +328,6 @@ else:
os.path.dirname(sys.argv[0]),
'../../../test/core/end2end/fuzzers/hpack.dictionary'), 'w')
HPACK_H = open(
os.path.join(
os.path.dirname(sys.argv[0]),
'../../../src/core/ext/transport/chttp2/transport/hpack_mapping.h'),
'w')
HPACK_C = open(
os.path.join(
os.path.dirname(sys.argv[0]),
'../../../src/core/ext/transport/chttp2/transport/hpack_mapping.cc'),
'w')
# copy-paste copyright notice from this file
with open(sys.argv[0]) as my_source:
copyright = []
@ -351,8 +342,7 @@ with open(sys.argv[0]) as my_source:
if line[0] != '#':
break
copyright.append(line)
put_banner([H, C, HPACK_H, HPACK_C],
[line[2:].rstrip() for line in copyright])
put_banner([H, C], [line[2:].rstrip() for line in copyright])
hex_bytes = [ord(c) for c in 'abcdefABCDEF0123456789']
@ -379,17 +369,6 @@ See metadata.h for an explanation of the interface here, and metadata.cc for
an explanation of what's going on.
""".splitlines())
put_banner([HPACK_H, HPACK_C], """WARNING: Auto-generated code.
To make changes to this file, change
tools/codegen/core/gen_static_metadata.py, and then re-run it.
This file contains the mapping from the index of each metadata element in the
grpc static metadata table to the index of that element in the hpack static
metadata table. If the element is not contained in the static hpack table, then
the returned index is 0.
""".splitlines())
print >> H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H'
print >> H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H'
print >> H
@ -403,20 +382,6 @@ print >> C, '#include "src/core/lib/transport/static_metadata.h"'
print >> C
print >> C, '#include "src/core/lib/slice/slice_internal.h"'
print >> C
print >> HPACK_H, ('#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_'
'MAPPING_H')
print >> HPACK_H, ('#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_'
'MAPPING_H')
print >> HPACK_H
print >> HPACK_H, '#include <grpc/support/port_platform.h>'
print >> HPACK_H
print >> HPACK_H, '#include "src/core/lib/transport/static_metadata.h"'
print >> HPACK_H
print >> HPACK_C, '#include <grpc/support/port_platform.h>'
print >> HPACK_C
print >> HPACK_C, ('#include '
'"src/core/ext/transport/chttp2/transport/hpack_mapping.h"')
print >> HPACK_C
str_ofs = 0
id2strofs = {}
@ -493,28 +458,11 @@ print >> H, ('extern grpc_mdelem_data '
print >> H, ('extern uintptr_t '
'grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];')
for i, elem in enumerate(all_elems):
print >> H, '/* "%s": "%s" */' % (elem[0], elem[1])
print >> H, '/* "%s": "%s" */' % elem
print >> H, ('#define %s (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[%d], '
'GRPC_MDELEM_STORAGE_STATIC))') % (mangle(elem).upper(), i)
print >> H
# Print out the chttp2 mapping between static mdelem index and the hpack static
# table index
print >> HPACK_H, ('extern const uint8_t grpc_hpack_static_mdelem_indices['
'GRPC_STATIC_MDELEM_COUNT];')
print >> HPACK_H
print >> HPACK_C, ('const uint8_t grpc_hpack_static_mdelem_indices['
'GRPC_STATIC_MDELEM_COUNT] = {')
indices = ''
for elem in all_elems:
index = 0
if len(elem) == 3:
index = elem[2]
indices += '%d,' % index
print >> HPACK_C, ' %s' % indices
print >> HPACK_C, '};'
print >> HPACK_C
print >> C, ('uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] '
'= {')
print >> C, ' %s' % ','.join(
@ -607,9 +555,8 @@ print >> C, '}'
print >> C
print >> C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {'
for elem in all_elems:
print >> C, '{%s,%s},' % (slice_def(str_idx(elem[0])),
slice_def(str_idx(elem[1])))
for a, b in all_elems:
print >> C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b)))
print >> C, '};'
print >> H, 'typedef enum {'
@ -653,8 +600,5 @@ print >> H, '#define GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(algs) (GR
print >> H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */'
print >> HPACK_H, ('#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_'
'MAPPING_H */')
H.close()
C.close()

@ -16,10 +16,8 @@
FROM debian:jessie
RUN apt-get update && apt-get install debian-keyring && apt-key update
# Install Git and basic packages.
RUN apt-get update && apt-key update && apt-get install -y \
RUN apt-get update && apt-get install -y \
autoconf \
autotools-dev \
build-essential \
@ -46,11 +44,6 @@ RUN apt-get update && apt-key update && apt-get install -y \
wget \
zip && apt-get clean
# Install Node dependencies
RUN touch .profile
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp"
##################
# Ruby dependencies
@ -72,15 +65,8 @@ RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
# PHP dependencies
RUN apt-get update && apt-get install -y \
php5 php5-dev php-pear phpunit
##################
# Install cross compiler for ARM
RUN echo 'deb http://emdebian.org/tools/debian/ jessie main' | tee -a /etc/apt/sources.list.d/crosstools.list && \
curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
php5 php5-dev php-pear phpunit && apt-get clean
RUN dpkg --add-architecture armhf && apt-get update && apt-get install -y crossbuild-essential-armhf
RUN mkdir /var/local/jenkins

@ -16,10 +16,8 @@
FROM 32bit/debian:jessie
RUN apt-get update && apt-get install debian-keyring && apt-key update
# Install Git and basic packages.
RUN apt-get update && apt-key update && apt-get install -y \
RUN apt-get update && apt-get install -y \
autoconf \
autotools-dev \
build-essential \
@ -46,11 +44,6 @@ RUN apt-get update && apt-key update && apt-get install -y \
wget \
zip && apt-get clean
# Install Node dependencies
RUN touch .profile
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp"
##################
# Ruby dependencies

@ -771,7 +771,10 @@ doc/compression_cookbook.md \
doc/connection-backoff-interop-test-description.md \
doc/connection-backoff.md \
doc/connectivity-semantics-and-api.md \
doc/core/grpc-client-server-polling-engine-usage.md \
doc/core/grpc-cq.md \
doc/core/grpc-error.md \
doc/core/grpc-polling-engines.md \
doc/core/moving-to-c++.md \
doc/core/pending_api_cleanups.md \
doc/core/transport_explainer.md \

@ -771,7 +771,10 @@ doc/compression_cookbook.md \
doc/connection-backoff-interop-test-description.md \
doc/connection-backoff.md \
doc/connectivity-semantics-and-api.md \
doc/core/grpc-client-server-polling-engine-usage.md \
doc/core/grpc-cq.md \
doc/core/grpc-error.md \
doc/core/grpc-polling-engines.md \
doc/core/moving-to-c++.md \
doc/core/pending_api_cleanups.md \
doc/core/transport_explainer.md \
@ -1013,8 +1016,6 @@ src/core/ext/transport/chttp2/transport/frame_window_update.cc \
src/core/ext/transport/chttp2/transport/frame_window_update.h \
src/core/ext/transport/chttp2/transport/hpack_encoder.cc \
src/core/ext/transport/chttp2/transport/hpack_encoder.h \
src/core/ext/transport/chttp2/transport/hpack_mapping.cc \
src/core/ext/transport/chttp2/transport/hpack_mapping.h \
src/core/ext/transport/chttp2/transport/hpack_parser.cc \
src/core/ext/transport/chttp2/transport/hpack_parser.h \
src/core/ext/transport/chttp2/transport/hpack_table.cc \

@ -7089,19 +7089,6 @@
"third_party": false,
"type": "lib"
},
{
"deps": [
"gpr",
"grpc"
],
"headers": [],
"is_filegroup": false,
"language": "c",
"name": "grpc_dll",
"src": [],
"third_party": false,
"type": "lib"
},
{
"deps": [
"gpr",
@ -10660,7 +10647,6 @@
"src/core/ext/transport/chttp2/transport/frame_settings.h",
"src/core/ext/transport/chttp2/transport/frame_window_update.h",
"src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_mapping.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.h",
"src/core/ext/transport/chttp2/transport/hpack_table.h",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
@ -10698,8 +10684,6 @@
"src/core/ext/transport/chttp2/transport/frame_window_update.h",
"src/core/ext/transport/chttp2/transport/hpack_encoder.cc",
"src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_mapping.cc",
"src/core/ext/transport/chttp2/transport/hpack_mapping.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.cc",
"src/core/ext/transport/chttp2/transport/hpack_parser.h",
"src/core/ext/transport/chttp2/transport/hpack_table.cc",

@ -777,12 +777,14 @@ def cloud_to_prod_jobspec(language,
]
if transport_security == 'tls':
transport_security_options = ['--use_tls=true']
elif transport_security == 'google_default_credentials' and language == 'c++':
elif transport_security == 'google_default_credentials' and str(
language) in ['c++', 'go']:
transport_security_options = [
'--custom_credentials_type=google_default_credentials'
]
else:
print('Invalid transport security option.')
print('Invalid transport security option %s in cloud_to_prod_jobspec.' %
transport_security)
sys.exit(1)
cmdargs = cmdargs + transport_security_options
environ = dict(language.cloud_to_prod_env(), **language.global_env())
@ -817,8 +819,9 @@ def cloud_to_prod_jobspec(language,
cmdline=cmdline,
cwd=cwd,
environ=environ,
shortname='%s:%s:%s:%s' % (suite_name, language, server_host_nickname,
test_case),
shortname='%s:%s:%s:%s:%s' %
(suite_name, language, server_host_nickname, test_case,
transport_security),
timeout_seconds=_TEST_TIMEOUT,
flake_retries=4 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0,
@ -848,7 +851,8 @@ def cloud_to_cloud_jobspec(language,
elif transport_security == 'insecure':
interop_only_options += ['--use_tls=false']
else:
print('Invalid transport security option.')
print('Invalid transport security option %s in cloud_to_cloud_jobspec.'
% transport_security)
sys.exit(1)
client_test_case = test_case
@ -903,8 +907,8 @@ def cloud_to_cloud_jobspec(language,
cmdline=cmdline,
cwd=cwd,
environ=environ,
shortname='cloud_to_cloud:%s:%s_server:%s' % (language, server_name,
test_case),
shortname='cloud_to_cloud:%s:%s_server:%s:%s' %
(language, server_name, test_case, transport_security),
timeout_seconds=_TEST_TIMEOUT,
flake_retries=4 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0,
@ -929,7 +933,8 @@ def server_jobspec(language,
elif transport_security == 'insecure':
server_cmd += ['--use_tls=false']
else:
print('Invalid transport security option.')
print('Invalid transport security option %s in server_jobspec.' %
transport_security)
sys.exit(1)
cmdline = bash_cmdline(language.server_cmd(server_cmd))
environ = language.global_env()
@ -1318,7 +1323,7 @@ try:
service_account_key_file,
transport_security='tls')
jobs.append(tls_test_job)
if language == 'c++':
if str(language) in ['c++', 'go']:
google_default_creds_test_job = cloud_to_prod_jobspec(
language,
test_case,
@ -1370,7 +1375,9 @@ try:
service_account_key_file,
transport_security='tls')
jobs.append(tls_test_job)
if language == 'c++':
if str(language) in [
'go'
]: # Add more languages to the list to turn on tests.
google_default_creds_test_job = cloud_to_prod_jobspec(
language,
test_case,
@ -1378,6 +1385,7 @@ try:
prod_servers[server_host_nickname],
docker_image=docker_images.get(
str(language)),
auth=True,
manual_cmd_log=client_manual_cmd_log,
service_account_key_file=args.
service_account_key_file,

Loading…
Cancel
Save