grpc 1.6.7 → 1.7.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +579 -77
- data/include/grpc/byte_buffer.h +1 -63
- data/include/grpc/compression.h +27 -5
- data/include/grpc/fork.h +24 -0
- data/include/grpc/grpc.h +12 -6
- data/include/grpc/grpc_security.h +28 -7
- data/include/grpc/impl/codegen/atm.h +1 -0
- data/include/grpc/impl/codegen/byte_buffer.h +86 -0
- data/include/grpc/impl/codegen/compression_types.h +63 -5
- data/include/grpc/impl/codegen/fork.h +48 -0
- data/include/grpc/impl/codegen/grpc_types.h +26 -9
- data/include/grpc/impl/codegen/port_platform.h +11 -4
- data/include/grpc/impl/codegen/slice.h +6 -1
- data/include/grpc/impl/codegen/sync.h +3 -1
- data/include/grpc/impl/codegen/sync_custom.h +36 -0
- data/include/grpc/module.modulemap +75 -3
- data/include/grpc/slice.h +1 -5
- data/include/grpc/support/sync_custom.h +24 -0
- data/src/core/ext/census/base_resources.c +14 -14
- data/src/core/ext/census/context.c +7 -5
- data/src/core/ext/census/grpc_filter.c +12 -14
- data/src/core/ext/census/mlog.c +2 -1
- data/src/core/ext/census/resource.c +13 -9
- data/src/core/ext/filters/client_channel/channel_connectivity.c +15 -8
- data/src/core/ext/filters/client_channel/client_channel.c +418 -439
- data/src/core/ext/filters/client_channel/client_channel_factory.c +4 -5
- data/src/core/ext/filters/client_channel/client_channel_plugin.c +2 -2
- data/src/core/ext/filters/client_channel/http_connect_handshaker.c +7 -5
- data/src/core/ext/filters/client_channel/http_proxy.c +17 -21
- data/src/core/ext/filters/client_channel/lb_policy.c +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.c +7 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c +371 -257
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.c +7 -5
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.c +25 -14
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.c +16 -16
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +33 -28
- data/src/core/ext/filters/client_channel/lb_policy_factory.c +10 -8
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +1 -1
- data/src/core/ext/filters/client_channel/proxy_mapper_registry.c +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c +7 -6
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c +62 -28
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +29 -23
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.c +25 -14
- data/src/core/ext/filters/client_channel/retry_throttle.c +9 -6
- data/src/core/ext/filters/client_channel/subchannel.c +30 -30
- data/src/core/ext/filters/client_channel/subchannel.h +1 -4
- data/src/core/ext/filters/client_channel/subchannel_index.c +31 -15
- data/src/core/ext/filters/client_channel/subchannel_index.h +7 -0
- data/src/core/ext/filters/client_channel/uri_parser.c +4 -3
- data/src/core/ext/filters/deadline/deadline_filter.c +78 -39
- data/src/core/ext/filters/deadline/deadline_filter.h +7 -1
- data/src/core/ext/filters/http/client/http_client_filter.c +14 -14
- data/src/core/ext/filters/http/http_filters_plugin.c +1 -1
- data/src/core/ext/filters/http/message_compress/message_compress_filter.c +240 -175
- data/src/core/ext/filters/http/server/http_server_filter.c +48 -36
- data/src/core/ext/filters/load_reporting/{load_reporting_filter.c → server_load_reporting_filter.c} +11 -12
- data/src/core/ext/filters/load_reporting/{load_reporting_filter.h → server_load_reporting_filter.h} +6 -5
- data/src/core/ext/filters/load_reporting/{load_reporting.c → server_load_reporting_plugin.c} +19 -13
- data/src/core/ext/filters/load_reporting/{load_reporting.h → server_load_reporting_plugin.h} +4 -3
- data/src/core/ext/filters/max_age/max_age_filter.c +2 -3
- data/src/core/ext/filters/message_size/message_size_filter.c +4 -2
- data/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c +0 -1
- data/src/core/ext/transport/chttp2/client/chttp2_connector.c +5 -5
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +1 -1
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.c +20 -18
- data/src/core/ext/transport/chttp2/transport/chttp2_plugin.c +1 -0
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +493 -210
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +1 -0
- data/src/core/ext/transport/chttp2/transport/flow_control.c +9 -8
- data/src/core/ext/transport/chttp2/transport/frame_data.c +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_goaway.c +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.c +5 -4
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_settings.c +10 -9
- data/src/core/ext/transport/chttp2/transport/frame_window_update.c +9 -5
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +62 -41
- data/src/core/ext/transport/chttp2/transport/hpack_parser.c +52 -8
- data/src/core/ext/transport/chttp2/transport/hpack_table.c +2 -2
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +3 -2
- data/src/core/ext/transport/chttp2/transport/internal.h +60 -30
- data/src/core/ext/transport/chttp2/transport/parsing.c +16 -5
- data/src/core/ext/transport/chttp2/transport/stream_lists.c +36 -16
- data/src/core/ext/transport/chttp2/transport/stream_map.c +6 -4
- data/src/core/ext/transport/chttp2/transport/writing.c +133 -105
- data/src/core/ext/transport/inproc/inproc_transport.c +61 -65
- data/src/core/lib/channel/channel_args.c +112 -12
- data/src/core/lib/channel/channel_args.h +31 -0
- data/src/core/lib/channel/channel_stack.c +1 -15
- data/src/core/lib/channel/channel_stack.h +3 -10
- data/src/core/lib/channel/channel_stack_builder.c +41 -10
- data/src/core/lib/channel/channel_stack_builder.h +10 -0
- data/src/core/lib/channel/connected_channel.c +94 -23
- data/src/core/lib/channel/handshaker.c +8 -6
- data/src/core/lib/channel/handshaker_registry.c +1 -1
- data/src/core/lib/compression/algorithm_metadata.h +14 -0
- data/src/core/lib/compression/compression.c +101 -1
- data/src/core/lib/compression/stream_compression.c +32 -146
- data/src/core/lib/compression/stream_compression.h +28 -4
- data/src/core/lib/compression/stream_compression_gzip.c +228 -0
- data/src/core/lib/{iomgr/ev_epoll_thread_pool_linux.h → compression/stream_compression_gzip.h} +5 -7
- data/src/core/lib/compression/stream_compression_identity.c +94 -0
- data/src/core/lib/{iomgr/ev_epoll_limited_pollers_linux.h → compression/stream_compression_identity.h} +7 -8
- data/src/core/lib/debug/stats.c +174 -0
- data/src/core/lib/debug/stats.h +61 -0
- data/src/core/lib/debug/stats_data.c +687 -0
- data/src/core/lib/debug/stats_data.h +470 -0
- data/src/core/lib/debug/trace.c +3 -3
- data/src/core/lib/debug/trace.h +1 -1
- data/src/core/lib/http/format_request.c +1 -1
- data/src/core/lib/http/httpcli.c +8 -7
- data/src/core/lib/http/httpcli_security_connector.c +2 -1
- data/src/core/lib/http/parser.c +4 -3
- data/src/core/lib/iomgr/call_combiner.c +202 -0
- data/src/core/lib/iomgr/call_combiner.h +121 -0
- data/src/core/lib/iomgr/closure.c +18 -4
- data/src/core/lib/iomgr/combiner.c +11 -4
- data/src/core/lib/iomgr/error.c +26 -24
- data/src/core/lib/iomgr/ev_epoll1_linux.c +395 -212
- data/src/core/lib/iomgr/ev_epollex_linux.c +141 -128
- data/src/core/lib/iomgr/ev_epollsig_linux.c +44 -41
- data/src/core/lib/iomgr/ev_poll_posix.c +99 -75
- data/src/core/lib/iomgr/ev_posix.c +5 -9
- data/src/core/lib/iomgr/ev_posix.h +1 -1
- data/src/core/lib/iomgr/exec_ctx.h +6 -1
- data/src/core/lib/iomgr/executor.c +142 -36
- data/src/core/lib/iomgr/executor.h +6 -1
- data/src/core/lib/iomgr/fork_posix.c +88 -0
- data/src/core/lib/iomgr/fork_windows.c +39 -0
- data/src/core/lib/iomgr/iocp_windows.c +2 -0
- data/src/core/lib/iomgr/iomgr.c +2 -8
- data/src/core/lib/iomgr/is_epollexclusive_available.c +6 -6
- data/src/core/lib/iomgr/load_file.c +2 -1
- data/src/core/lib/iomgr/polling_entity.c +9 -9
- data/src/core/lib/iomgr/polling_entity.h +7 -1
- data/src/core/lib/iomgr/pollset.h +1 -1
- data/src/core/lib/iomgr/pollset_uv.c +1 -1
- data/src/core/lib/iomgr/pollset_windows.c +3 -3
- data/src/core/lib/iomgr/port.h +4 -0
- data/src/core/lib/iomgr/resolve_address_posix.c +8 -7
- data/src/core/lib/iomgr/resolve_address_windows.c +1 -1
- data/src/core/lib/iomgr/resource_quota.c +24 -19
- data/src/core/lib/iomgr/socket_factory_posix.c +4 -4
- data/src/core/lib/iomgr/socket_mutator.c +4 -4
- data/src/core/lib/iomgr/socket_utils_windows.c +0 -4
- data/src/core/lib/iomgr/tcp_client_posix.c +5 -4
- data/src/core/lib/iomgr/tcp_posix.c +181 -20
- data/src/core/lib/iomgr/tcp_server_posix.c +8 -7
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.c +1 -1
- data/src/core/lib/iomgr/timer.h +4 -0
- data/src/core/lib/iomgr/timer_generic.c +138 -3
- data/src/core/lib/iomgr/timer_generic.h +3 -0
- data/src/core/lib/iomgr/timer_heap.c +4 -4
- data/src/core/lib/iomgr/timer_manager.c +2 -2
- data/src/core/lib/iomgr/timer_uv.c +2 -0
- data/src/core/lib/iomgr/udp_server.c +10 -8
- data/src/core/lib/iomgr/unix_sockets_posix.c +4 -2
- data/src/core/lib/iomgr/wakeup_fd_cv.c +9 -8
- data/src/core/lib/iomgr/wakeup_fd_cv.h +2 -2
- data/src/core/lib/json/json.c +1 -1
- data/src/core/lib/json/json_string.c +13 -13
- data/src/core/lib/profiling/timers.h +18 -8
- data/src/core/lib/security/credentials/composite/composite_credentials.c +4 -10
- data/src/core/lib/security/credentials/google_default/google_default_credentials.c +2 -1
- data/src/core/lib/security/credentials/jwt/jwt_verifier.c +11 -6
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +4 -4
- data/src/core/lib/security/credentials/plugin/plugin_credentials.c +132 -50
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +2 -0
- data/src/core/lib/security/transport/client_auth_filter.c +68 -135
- data/src/core/lib/security/transport/secure_endpoint.c +110 -90
- data/src/core/lib/security/transport/secure_endpoint.h +8 -3
- data/src/core/lib/security/transport/security_connector.c +10 -12
- data/src/core/lib/security/transport/security_handshaker.c +45 -24
- data/src/core/lib/security/transport/server_auth_filter.c +71 -20
- data/src/core/lib/slice/b64.c +2 -2
- data/src/core/lib/slice/slice.c +16 -14
- data/src/core/lib/slice/slice_buffer.c +5 -4
- data/src/core/lib/slice/slice_hash_table.c +3 -2
- data/src/core/lib/slice/slice_intern.c +8 -5
- data/src/core/lib/support/block_annotate.h +22 -0
- data/src/core/lib/support/fork.c +62 -0
- data/src/core/lib/support/fork.h +35 -0
- data/src/core/lib/support/log_linux.c +1 -1
- data/src/core/lib/support/string.c +15 -1
- data/src/core/lib/support/string.h +3 -0
- data/src/core/lib/support/thd_internal.h +6 -0
- data/src/core/lib/support/thd_posix.c +56 -0
- data/src/core/lib/support/thd_windows.c +2 -0
- data/src/core/lib/surface/alarm.c +22 -15
- data/src/core/lib/surface/byte_buffer.c +4 -2
- data/src/core/lib/surface/call.c +442 -141
- data/src/core/lib/surface/call.h +6 -6
- data/src/core/lib/surface/call_log_batch.c +1 -1
- data/src/core/lib/surface/call_test_only.h +12 -0
- data/src/core/lib/surface/channel.c +39 -4
- data/src/core/lib/surface/channel_init.c +6 -6
- data/src/core/lib/surface/channel_ping.c +2 -2
- data/src/core/lib/surface/completion_queue.c +56 -57
- data/src/core/lib/surface/init.c +17 -3
- data/src/core/lib/surface/init_secure.c +5 -1
- data/src/core/lib/surface/lame_client.cc +9 -10
- data/src/core/lib/surface/server.c +81 -72
- data/src/core/lib/surface/version.c +2 -2
- data/src/core/lib/transport/byte_stream.c +1 -0
- data/src/core/lib/transport/byte_stream.h +3 -1
- data/src/core/lib/transport/connectivity_state.c +2 -1
- data/src/core/lib/transport/metadata.c +7 -4
- data/src/core/lib/transport/metadata_batch.c +18 -16
- data/src/core/lib/transport/metadata_batch.h +1 -0
- data/src/core/lib/transport/service_config.c +5 -3
- data/src/core/lib/transport/static_metadata.c +395 -614
- data/src/core/lib/transport/static_metadata.h +165 -133
- data/src/core/lib/transport/status_conversion.c +1 -1
- data/src/core/lib/transport/transport.c +20 -20
- data/src/core/lib/transport/transport.h +8 -5
- data/src/core/lib/transport/transport_impl.h +0 -3
- data/src/core/lib/transport/transport_op_string.c +8 -1
- data/src/core/plugin_registry/grpc_plugin_registry.c +4 -4
- data/src/core/tsi/fake_transport_security.c +133 -2
- data/src/core/tsi/fake_transport_security.h +5 -0
- data/src/core/tsi/ssl_transport_security.c +105 -8
- data/src/core/tsi/ssl_transport_security.h +30 -7
- data/src/core/tsi/transport_security.h +8 -2
- data/src/core/tsi/transport_security_grpc.c +20 -13
- data/src/core/tsi/transport_security_grpc.h +13 -9
- data/src/ruby/ext/grpc/rb_call_credentials.c +6 -2
- data/src/ruby/ext/grpc/rb_grpc.c +1 -1
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +30 -20
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +50 -35
- data/src/ruby/lib/grpc.rb +1 -0
- data/src/ruby/lib/grpc/generic/active_call.rb +34 -9
- data/src/ruby/lib/grpc/generic/bidi_call.rb +19 -10
- data/src/ruby/lib/grpc/generic/client_stub.rb +95 -38
- data/src/ruby/lib/grpc/generic/interceptor_registry.rb +53 -0
- data/src/ruby/lib/grpc/generic/interceptors.rb +186 -0
- data/src/ruby/lib/grpc/generic/rpc_desc.rb +66 -20
- data/src/ruby/lib/grpc/generic/rpc_server.rb +15 -3
- data/src/ruby/lib/grpc/google_rpc_status_utils.rb +1 -2
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb +1 -0
- data/src/ruby/spec/channel_connection_spec.rb +1 -34
- data/src/ruby/spec/client_server_spec.rb +188 -82
- data/src/ruby/spec/generic/active_call_spec.rb +65 -11
- data/src/ruby/spec/generic/client_interceptors_spec.rb +153 -0
- data/src/ruby/spec/generic/interceptor_registry_spec.rb +65 -0
- data/src/ruby/spec/generic/rpc_desc_spec.rb +38 -0
- data/src/ruby/spec/generic/rpc_server_spec.rb +1 -34
- data/src/ruby/spec/generic/server_interceptors_spec.rb +218 -0
- data/src/ruby/spec/spec_helper.rb +4 -0
- data/src/ruby/spec/support/helpers.rb +73 -0
- data/src/ruby/spec/support/services.rb +147 -0
- data/third_party/cares/ares_build.h +21 -62
- data/third_party/cares/cares/ares.h +23 -1
- data/third_party/cares/cares/ares__close_sockets.c +2 -2
- data/third_party/cares/cares/ares_create_query.c +3 -3
- data/third_party/cares/cares/ares_expand_name.c +6 -2
- data/third_party/cares/cares/ares_expand_string.c +1 -1
- data/third_party/cares/cares/ares_getnameinfo.c +27 -7
- data/third_party/cares/cares/ares_init.c +407 -39
- data/third_party/cares/cares/ares_library_init.c +10 -0
- data/third_party/cares/cares/ares_library_init.h +2 -1
- data/third_party/cares/cares/ares_nowarn.c +6 -6
- data/third_party/cares/cares/ares_nowarn.h +2 -2
- data/third_party/cares/cares/ares_parse_naptr_reply.c +6 -1
- data/third_party/cares/cares/ares_private.h +11 -0
- data/third_party/cares/cares/ares_process.c +126 -37
- data/third_party/cares/cares/ares_version.h +2 -2
- data/third_party/cares/cares/ares_writev.c +2 -2
- data/third_party/cares/cares/config-win32.h +8 -34
- data/third_party/cares/cares/inet_net_pton.c +2 -2
- data/third_party/cares/cares/setup_once.h +5 -5
- data/third_party/cares/config_darwin/ares_config.h +98 -196
- data/third_party/cares/config_linux/ares_config.h +103 -203
- metadata +47 -20
- data/src/core/lib/iomgr/ev_epoll_limited_pollers_linux.c +0 -1957
- data/src/core/lib/iomgr/ev_epoll_thread_pool_linux.c +0 -1182
@@ -0,0 +1,48 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2017 gRPC authors.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef GRPC_IMPL_CODEGEN_FORK_H
|
20
|
+
#define GRPC_IMPL_CODEGEN_FORK_H
|
21
|
+
|
22
|
+
/**
|
23
|
+
* gRPC applications should call this before calling fork(). There should be no
|
24
|
+
* active gRPC function calls between calling grpc_prefork() and
|
25
|
+
* grpc_postfork_parent()/grpc_postfork_child().
|
26
|
+
*
|
27
|
+
*
|
28
|
+
* Typical use:
|
29
|
+
* grpc_prefork();
|
30
|
+
* int pid = fork();
|
31
|
+
* if (pid) {
|
32
|
+
* grpc_postfork_parent();
|
33
|
+
* // Parent process..
|
34
|
+
* } else {
|
35
|
+
* grpc_postfork_child();
|
36
|
+
* // Child process...
|
37
|
+
* }
|
38
|
+
*/
|
39
|
+
|
40
|
+
void grpc_prefork();
|
41
|
+
|
42
|
+
void grpc_postfork_parent();
|
43
|
+
|
44
|
+
void grpc_postfork_child();
|
45
|
+
|
46
|
+
void grpc_fork_handlers_auto_register();
|
47
|
+
|
48
|
+
#endif /* GRPC_IMPL_CODEGEN_FORK_H */
|
@@ -188,9 +188,14 @@ typedef struct {
|
|
188
188
|
#define GRPC_ARG_HTTP2_MAX_FRAME_SIZE "grpc.http2.max_frame_size"
|
189
189
|
/** Should BDP probing be performed? */
|
190
190
|
#define GRPC_ARG_HTTP2_BDP_PROBE "grpc.http2.bdp_probe"
|
191
|
-
/** Minimum time
|
192
|
-
|
191
|
+
/** Minimum time between sending successive ping frames without receiving any
|
192
|
+
data frame, Int valued, milliseconds. */
|
193
|
+
#define GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS \
|
193
194
|
"grpc.http2.min_time_between_pings_ms"
|
195
|
+
/** Minimum allowed time between receiving successive ping frames without
|
196
|
+
sending any data frame. Int valued, milliseconds */
|
197
|
+
#define GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS \
|
198
|
+
"grpc.http2.min_ping_interval_without_data_ms"
|
194
199
|
/** Channel arg to override the http2 :scheme header */
|
195
200
|
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
|
196
201
|
/** How many pings can we send before needing to send a data frame or header
|
@@ -202,10 +207,6 @@ typedef struct {
|
|
202
207
|
closing the transport? (0 indicates that the server can bear an infinite
|
203
208
|
number of misbehaving pings) */
|
204
209
|
#define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes"
|
205
|
-
/** Minimum allowed time between two pings without sending any data frame. Int
|
206
|
-
valued, seconds */
|
207
|
-
#define GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_MS \
|
208
|
-
"grpc.http2.min_ping_interval_without_data_ms"
|
209
210
|
/** How much data are we willing to queue up per stream if
|
210
211
|
GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */
|
211
212
|
#define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size"
|
@@ -287,7 +288,11 @@ typedef struct {
|
|
287
288
|
"grpc.experimental.tcp_max_read_chunk_size"
|
288
289
|
/* Timeout in milliseconds to use for calls to the grpclb load balancer.
|
289
290
|
If 0 or unset, the balancer calls will have no deadline. */
|
290
|
-
#define GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS "grpc.
|
291
|
+
#define GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS "grpc.grpclb_call_timeout_ms"
|
292
|
+
/* Timeout in milliseconds to wait for the serverlist from the grpclb load
|
293
|
+
balancer before using fallback backend addresses from the resolver.
|
294
|
+
If 0, fallback will never be used. */
|
295
|
+
#define GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS "grpc.grpclb_fallback_timeout_ms"
|
291
296
|
/** If non-zero, grpc server's cronet compression workaround will be enabled */
|
292
297
|
#define GRPC_ARG_WORKAROUND_CRONET_COMPRESSION \
|
293
298
|
"grpc.workaround.cronet_compression"
|
@@ -355,8 +360,11 @@ typedef enum grpc_call_error {
|
|
355
360
|
/** Force compression to be disabled for a particular write
|
356
361
|
(start_write/add_metadata). Illegal on invoke/accept. */
|
357
362
|
#define GRPC_WRITE_NO_COMPRESS (0x00000002u)
|
363
|
+
/** Force this message to be written to the socket before completing it */
|
364
|
+
#define GRPC_WRITE_THROUGH (0x00000004u)
|
358
365
|
/** Mask of all valid flags. */
|
359
|
-
#define GRPC_WRITE_USED_MASK
|
366
|
+
#define GRPC_WRITE_USED_MASK \
|
367
|
+
(GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_THROUGH)
|
360
368
|
|
361
369
|
/** Initial metadata flags */
|
362
370
|
/** Signal that the call is idempotent */
|
@@ -377,7 +385,7 @@ typedef enum grpc_call_error {
|
|
377
385
|
GRPC_INITIAL_METADATA_WAIT_FOR_READY | \
|
378
386
|
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \
|
379
387
|
GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET | \
|
380
|
-
GRPC_INITIAL_METADATA_CORKED)
|
388
|
+
GRPC_INITIAL_METADATA_CORKED | GRPC_WRITE_THROUGH)
|
381
389
|
|
382
390
|
/** A single metadata element */
|
383
391
|
typedef struct grpc_metadata {
|
@@ -505,8 +513,17 @@ typedef struct grpc_op {
|
|
505
513
|
uint8_t is_set;
|
506
514
|
grpc_compression_level level;
|
507
515
|
} maybe_compression_level;
|
516
|
+
struct grpc_op_send_initial_metadata_maybe_stream_compression_level {
|
517
|
+
uint8_t is_set;
|
518
|
+
grpc_stream_compression_level level;
|
519
|
+
} maybe_stream_compression_level;
|
508
520
|
} send_initial_metadata;
|
509
521
|
struct grpc_op_send_message {
|
522
|
+
/** This op takes ownership of the slices in send_message. After
|
523
|
+
* a call completes, the contents of send_message are not guaranteed
|
524
|
+
* and likely empty. The original owner should still call
|
525
|
+
* grpc_byte_buffer_destroy() on this object however.
|
526
|
+
*/
|
510
527
|
struct grpc_byte_buffer *send_message;
|
511
528
|
} send_message;
|
512
529
|
struct grpc_op_send_status_from_server {
|
@@ -291,10 +291,6 @@
|
|
291
291
|
#endif
|
292
292
|
|
293
293
|
#ifdef _MSC_VER
|
294
|
-
#ifdef _PYTHON_MSVC
|
295
|
-
// The Python 3.5 Windows runtime is missing InetNtop
|
296
|
-
#define GPR_WIN_INET_NTOP
|
297
|
-
#endif // _PYTHON_MSVC
|
298
294
|
#if _MSC_VER < 1700
|
299
295
|
typedef __int8 int8_t;
|
300
296
|
typedef __int16 int16_t;
|
@@ -408,4 +404,15 @@ typedef unsigned __int64 uint64_t;
|
|
408
404
|
#define CENSUSAPI GRPCAPI
|
409
405
|
#endif
|
410
406
|
|
407
|
+
#ifndef GPR_ATTRIBUTE_NO_TSAN /* (1) */
|
408
|
+
#if defined(__has_feature)
|
409
|
+
#if __has_feature(thread_sanitizer)
|
410
|
+
#define GPR_ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread")))
|
411
|
+
#endif /* __has_feature(thread_sanitizer) */
|
412
|
+
#endif /* defined(__has_feature) */
|
413
|
+
#ifndef GPR_ATTRIBUTE_NO_TSAN /* (2) */
|
414
|
+
#define GPR_ATTRIBUTE_NO_TSAN
|
415
|
+
#endif /* GPR_ATTRIBUTE_NO_TSAN (2) */
|
416
|
+
#endif /* GPR_ATTRIBUTE_NO_TSAN (1) */
|
417
|
+
|
411
418
|
#endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */
|
@@ -62,7 +62,12 @@ typedef struct grpc_slice_refcount {
|
|
62
62
|
struct grpc_slice_refcount *sub_refcount;
|
63
63
|
} grpc_slice_refcount;
|
64
64
|
|
65
|
-
|
65
|
+
/* Inlined half of grpc_slice is allowed to expand the size of the overall type
|
66
|
+
by this many bytes */
|
67
|
+
#define GRPC_SLICE_INLINE_EXTRA_SIZE sizeof(void *)
|
68
|
+
|
69
|
+
#define GRPC_SLICE_INLINED_SIZE \
|
70
|
+
(sizeof(size_t) + sizeof(uint8_t *) - 1 + GRPC_SLICE_INLINE_EXTRA_SIZE)
|
66
71
|
|
67
72
|
/** A grpc_slice s, if initialized, represents the byte range
|
68
73
|
s.bytes[0..s.length-1].
|
@@ -49,7 +49,9 @@ extern "C" {
|
|
49
49
|
#include <grpc/impl/codegen/sync_posix.h>
|
50
50
|
#elif defined(GPR_WINDOWS)
|
51
51
|
#include <grpc/impl/codegen/sync_windows.h>
|
52
|
-
#elif
|
52
|
+
#elif defined(GPR_CUSTOM_SYNC)
|
53
|
+
#include <grpc/impl/codegen/sync_custom.h>
|
54
|
+
#else
|
53
55
|
#error Unable to determine platform for sync
|
54
56
|
#endif
|
55
57
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2017 gRPC authors.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
|
20
|
+
#define GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
|
21
|
+
|
22
|
+
#include <grpc/impl/codegen/sync_generic.h>
|
23
|
+
|
24
|
+
/* Users defining GPR_CUSTOM_SYNC need to define the following macros. */
|
25
|
+
|
26
|
+
#ifdef GPR_CUSTOM_SYNC
|
27
|
+
|
28
|
+
typedef GPR_CUSTOM_MU_TYPE gpr_mu;
|
29
|
+
typedef GPR_CUSTOM_CV_TYPE gpr_cv;
|
30
|
+
typedef GPR_CUSTOM_ONCE_TYPE gpr_once;
|
31
|
+
|
32
|
+
#define GPR_ONCE_INIT GPR_CUSTOM_ONCE_INIT
|
33
|
+
|
34
|
+
#endif
|
35
|
+
|
36
|
+
#endif /* GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H */
|
@@ -1,12 +1,84 @@
|
|
1
|
+
|
1
2
|
framework module grpc {
|
2
3
|
umbrella header "grpc.h"
|
3
4
|
|
4
|
-
header "byte_buffer_reader.h"
|
5
|
-
header "grpc_security.h"
|
6
|
-
header "grpc_security_constants.h"
|
7
5
|
header "support/alloc.h"
|
6
|
+
header "support/atm.h"
|
7
|
+
header "support/avl.h"
|
8
|
+
header "support/cmdline.h"
|
9
|
+
header "support/cpu.h"
|
10
|
+
header "support/histogram.h"
|
11
|
+
header "support/host_port.h"
|
12
|
+
header "support/log.h"
|
13
|
+
header "support/log_windows.h"
|
8
14
|
header "support/port_platform.h"
|
9
15
|
header "support/string_util.h"
|
16
|
+
header "support/subprocess.h"
|
17
|
+
header "support/sync.h"
|
18
|
+
header "support/sync_generic.h"
|
19
|
+
header "support/thd.h"
|
20
|
+
header "support/time.h"
|
21
|
+
header "support/tls.h"
|
22
|
+
header "support/useful.h"
|
23
|
+
header "impl/codegen/atm.h"
|
24
|
+
header "impl/codegen/fork.h"
|
25
|
+
header "impl/codegen/gpr_slice.h"
|
26
|
+
header "impl/codegen/gpr_types.h"
|
27
|
+
header "impl/codegen/port_platform.h"
|
28
|
+
header "impl/codegen/sync.h"
|
29
|
+
header "impl/codegen/sync_generic.h"
|
30
|
+
header "impl/codegen/byte_buffer.h"
|
31
|
+
header "impl/codegen/byte_buffer_reader.h"
|
32
|
+
header "impl/codegen/compression_types.h"
|
33
|
+
header "impl/codegen/connectivity_state.h"
|
34
|
+
header "impl/codegen/exec_ctx_fwd.h"
|
35
|
+
header "impl/codegen/grpc_types.h"
|
36
|
+
header "impl/codegen/propagation_bits.h"
|
37
|
+
header "impl/codegen/slice.h"
|
38
|
+
header "impl/codegen/status.h"
|
39
|
+
header "impl/codegen/atm.h"
|
40
|
+
header "impl/codegen/fork.h"
|
41
|
+
header "impl/codegen/gpr_slice.h"
|
42
|
+
header "impl/codegen/gpr_types.h"
|
43
|
+
header "impl/codegen/port_platform.h"
|
44
|
+
header "impl/codegen/sync.h"
|
45
|
+
header "impl/codegen/sync_generic.h"
|
46
|
+
header "grpc_security.h"
|
47
|
+
header "byte_buffer.h"
|
48
|
+
header "byte_buffer_reader.h"
|
49
|
+
header "compression.h"
|
50
|
+
header "fork.h"
|
51
|
+
header "grpc.h"
|
52
|
+
header "grpc_posix.h"
|
53
|
+
header "grpc_security_constants.h"
|
54
|
+
header "load_reporting.h"
|
55
|
+
header "slice.h"
|
56
|
+
header "slice_buffer.h"
|
57
|
+
header "status.h"
|
58
|
+
header "support/workaround_list.h"
|
59
|
+
header "census.h"
|
60
|
+
|
61
|
+
textual header "support/atm_gcc_atomic.h"
|
62
|
+
textual header "support/atm_gcc_sync.h"
|
63
|
+
textual header "support/atm_windows.h"
|
64
|
+
textual header "support/sync_custom.h"
|
65
|
+
textual header "support/sync_posix.h"
|
66
|
+
textual header "support/sync_windows.h"
|
67
|
+
textual header "support/tls_gcc.h"
|
68
|
+
textual header "support/tls_msvc.h"
|
69
|
+
textual header "support/tls_pthread.h"
|
70
|
+
textual header "impl/codegen/atm_gcc_atomic.h"
|
71
|
+
textual header "impl/codegen/atm_gcc_sync.h"
|
72
|
+
textual header "impl/codegen/atm_windows.h"
|
73
|
+
textual header "impl/codegen/sync_custom.h"
|
74
|
+
textual header "impl/codegen/sync_posix.h"
|
75
|
+
textual header "impl/codegen/sync_windows.h"
|
76
|
+
textual header "impl/codegen/atm_gcc_atomic.h"
|
77
|
+
textual header "impl/codegen/atm_gcc_sync.h"
|
78
|
+
textual header "impl/codegen/atm_windows.h"
|
79
|
+
textual header "impl/codegen/sync_custom.h"
|
80
|
+
textual header "impl/codegen/sync_posix.h"
|
81
|
+
textual header "impl/codegen/sync_windows.h"
|
10
82
|
|
11
83
|
export *
|
12
84
|
module * { export * }
|
data/include/grpc/slice.h
CHANGED
@@ -65,11 +65,7 @@ GPRAPI grpc_slice grpc_slice_new_with_len(void *p, size_t len,
|
|
65
65
|
GPRAPI grpc_slice grpc_slice_malloc(size_t length);
|
66
66
|
GPRAPI grpc_slice grpc_slice_malloc_large(size_t length);
|
67
67
|
|
68
|
-
#define GRPC_SLICE_MALLOC(len)
|
69
|
-
((len) <= GRPC_SLICE_INLINED_SIZE \
|
70
|
-
? (grpc_slice){.refcount = NULL, \
|
71
|
-
.data.inlined = {.length = (uint8_t)(len)}} \
|
72
|
-
: grpc_slice_malloc_large((len)))
|
68
|
+
#define GRPC_SLICE_MALLOC(len) grpc_slice_malloc(len)
|
73
69
|
|
74
70
|
/** Intern a slice:
|
75
71
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/*
|
2
|
+
*
|
3
|
+
* Copyright 2017 gRPC authors.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef GRPC_SUPPORT_SYNC_CUSTOM_H
|
20
|
+
#define GRPC_SUPPORT_SYNC_CUSTOM_H
|
21
|
+
|
22
|
+
#include <grpc/impl/codegen/sync_custom.h>
|
23
|
+
|
24
|
+
#endif /* GRPC_SUPPORT_SYNC_CUSTOM_H */
|
@@ -37,20 +37,20 @@
|
|
37
37
|
void define_base_resources() {
|
38
38
|
google_census_Resource_BasicUnit numerator =
|
39
39
|
google_census_Resource_BasicUnit_SECS;
|
40
|
-
resource r = {"client_rpc_latency", // name
|
41
|
-
"Client RPC latency in seconds", // description
|
42
|
-
0,
|
43
|
-
1,
|
44
|
-
&numerator,
|
45
|
-
0,
|
46
|
-
NULL};
|
40
|
+
resource r = {(char *)"client_rpc_latency", // name
|
41
|
+
(char *)"Client RPC latency in seconds", // description
|
42
|
+
0, // prefix
|
43
|
+
1, // n_numerators
|
44
|
+
&numerator, // numerators
|
45
|
+
0, // n_denominators
|
46
|
+
NULL}; // denominators
|
47
47
|
define_resource(&r);
|
48
|
-
r = (resource){"server_rpc_latency", // name
|
49
|
-
"Server RPC latency in seconds", // description
|
50
|
-
0,
|
51
|
-
1,
|
52
|
-
&numerator,
|
53
|
-
0,
|
54
|
-
NULL};
|
48
|
+
r = (resource){(char *)"server_rpc_latency", // name
|
49
|
+
(char *)"Server RPC latency in seconds", // description
|
50
|
+
0, // prefix
|
51
|
+
1, // n_numerators
|
52
|
+
&numerator, // numerators
|
53
|
+
0, // n_denominators
|
54
|
+
NULL}; // denominators
|
55
55
|
define_resource(&r);
|
56
56
|
}
|
@@ -141,7 +141,7 @@ static char *decode_tag(struct raw_tag *tag, char *header, int offset) {
|
|
141
141
|
// Make a copy (in 'to') of an existing tag_set.
|
142
142
|
static void tag_set_copy(struct tag_set *to, const struct tag_set *from) {
|
143
143
|
memcpy(to, from, sizeof(struct tag_set));
|
144
|
-
to->kvm = gpr_malloc(to->kvm_size);
|
144
|
+
to->kvm = (char *)gpr_malloc(to->kvm_size);
|
145
145
|
memcpy(to->kvm, from->kvm, from->kvm_used);
|
146
146
|
}
|
147
147
|
|
@@ -184,7 +184,7 @@ static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag,
|
|
184
184
|
if (tags->kvm_used + tag_size > tags->kvm_size) {
|
185
185
|
// allocate new memory if needed
|
186
186
|
tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE;
|
187
|
-
char *new_kvm = gpr_malloc(tags->kvm_size);
|
187
|
+
char *new_kvm = (char *)gpr_malloc(tags->kvm_size);
|
188
188
|
if (tags->kvm_used > 0) memcpy(new_kvm, tags->kvm, tags->kvm_used);
|
189
189
|
gpr_free(tags->kvm);
|
190
190
|
tags->kvm = new_kvm;
|
@@ -274,7 +274,8 @@ static void tag_set_flatten(struct tag_set *tags) {
|
|
274
274
|
census_context *census_context_create(const census_context *base,
|
275
275
|
const census_tag *tags, int ntags,
|
276
276
|
census_context_status const **status) {
|
277
|
-
census_context *context =
|
277
|
+
census_context *context =
|
278
|
+
(census_context *)gpr_malloc(sizeof(census_context));
|
278
279
|
// If we are given a base, copy it into our new tag set. Otherwise set it
|
279
280
|
// to zero/NULL everything.
|
280
281
|
if (base == NULL) {
|
@@ -459,7 +460,7 @@ static void tag_set_decode(struct tag_set *tags, const char *buffer,
|
|
459
460
|
}
|
460
461
|
tags->kvm_used = size - header_size;
|
461
462
|
tags->kvm_size = tags->kvm_used + CENSUS_MAX_TAG_KV_LEN;
|
462
|
-
tags->kvm = gpr_malloc(tags->kvm_size);
|
463
|
+
tags->kvm = (char *)gpr_malloc(tags->kvm_size);
|
463
464
|
if (tag_header_size != TAG_HEADER_SIZE) {
|
464
465
|
// something new in the tag information. I don't understand it, so
|
465
466
|
// don't copy it over.
|
@@ -481,7 +482,8 @@ static void tag_set_decode(struct tag_set *tags, const char *buffer,
|
|
481
482
|
}
|
482
483
|
|
483
484
|
census_context *census_context_decode(const char *buffer, size_t size) {
|
484
|
-
census_context *context =
|
485
|
+
census_context *context =
|
486
|
+
(census_context *)gpr_malloc(sizeof(census_context));
|
485
487
|
memset(&context->tags[LOCAL_TAGS], 0, sizeof(struct tag_set));
|
486
488
|
if (buffer == NULL) {
|
487
489
|
memset(&context->tags[PROPAGATED_TAGS], 0, sizeof(struct tag_set));
|
@@ -60,8 +60,8 @@ static void extract_and_annotate_method_tag(grpc_metadata_batch *md,
|
|
60
60
|
|
61
61
|
static void client_mutate_op(grpc_call_element *elem,
|
62
62
|
grpc_transport_stream_op_batch *op) {
|
63
|
-
call_data *calld = elem->call_data;
|
64
|
-
channel_data *chand = elem->channel_data;
|
63
|
+
call_data *calld = (call_data *)elem->call_data;
|
64
|
+
channel_data *chand = (channel_data *)elem->channel_data;
|
65
65
|
if (op->send_initial_metadata) {
|
66
66
|
extract_and_annotate_method_tag(
|
67
67
|
op->payload->send_initial_metadata.send_initial_metadata, calld, chand);
|
@@ -78,9 +78,9 @@ static void client_start_transport_op(grpc_exec_ctx *exec_ctx,
|
|
78
78
|
static void server_on_done_recv(grpc_exec_ctx *exec_ctx, void *ptr,
|
79
79
|
grpc_error *error) {
|
80
80
|
GPR_TIMER_BEGIN("census-server:server_on_done_recv", 0);
|
81
|
-
grpc_call_element *elem = ptr;
|
82
|
-
call_data *calld = elem->call_data;
|
83
|
-
channel_data *chand = elem->channel_data;
|
81
|
+
grpc_call_element *elem = (grpc_call_element *)ptr;
|
82
|
+
call_data *calld = (call_data *)elem->call_data;
|
83
|
+
channel_data *chand = (channel_data *)elem->channel_data;
|
84
84
|
if (error == GRPC_ERROR_NONE) {
|
85
85
|
extract_and_annotate_method_tag(calld->recv_initial_metadata, calld, chand);
|
86
86
|
}
|
@@ -90,7 +90,7 @@ static void server_on_done_recv(grpc_exec_ctx *exec_ctx, void *ptr,
|
|
90
90
|
|
91
91
|
static void server_mutate_op(grpc_call_element *elem,
|
92
92
|
grpc_transport_stream_op_batch *op) {
|
93
|
-
call_data *calld = elem->call_data;
|
93
|
+
call_data *calld = (call_data *)elem->call_data;
|
94
94
|
if (op->recv_initial_metadata) {
|
95
95
|
/* substitute our callback for the op callback */
|
96
96
|
calld->recv_initial_metadata =
|
@@ -117,7 +117,7 @@ static void server_start_transport_op(grpc_exec_ctx *exec_ctx,
|
|
117
117
|
static grpc_error *client_init_call_elem(grpc_exec_ctx *exec_ctx,
|
118
118
|
grpc_call_element *elem,
|
119
119
|
const grpc_call_element_args *args) {
|
120
|
-
call_data *d = elem->call_data;
|
120
|
+
call_data *d = (call_data *)elem->call_data;
|
121
121
|
GPR_ASSERT(d != NULL);
|
122
122
|
memset(d, 0, sizeof(*d));
|
123
123
|
d->start_ts = args->start_time;
|
@@ -128,7 +128,7 @@ static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx,
|
|
128
128
|
grpc_call_element *elem,
|
129
129
|
const grpc_call_final_info *final_info,
|
130
130
|
grpc_closure *ignored) {
|
131
|
-
call_data *d = elem->call_data;
|
131
|
+
call_data *d = (call_data *)elem->call_data;
|
132
132
|
GPR_ASSERT(d != NULL);
|
133
133
|
/* TODO(hongyu): record rpc client stats and census_rpc_end_op here */
|
134
134
|
}
|
@@ -136,7 +136,7 @@ static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx,
|
|
136
136
|
static grpc_error *server_init_call_elem(grpc_exec_ctx *exec_ctx,
|
137
137
|
grpc_call_element *elem,
|
138
138
|
const grpc_call_element_args *args) {
|
139
|
-
call_data *d = elem->call_data;
|
139
|
+
call_data *d = (call_data *)elem->call_data;
|
140
140
|
GPR_ASSERT(d != NULL);
|
141
141
|
memset(d, 0, sizeof(*d));
|
142
142
|
d->start_ts = args->start_time;
|
@@ -150,7 +150,7 @@ static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx,
|
|
150
150
|
grpc_call_element *elem,
|
151
151
|
const grpc_call_final_info *final_info,
|
152
152
|
grpc_closure *ignored) {
|
153
|
-
call_data *d = elem->call_data;
|
153
|
+
call_data *d = (call_data *)elem->call_data;
|
154
154
|
GPR_ASSERT(d != NULL);
|
155
155
|
/* TODO(hongyu): record rpc server stats and census_tracing_end_op here */
|
156
156
|
}
|
@@ -158,14 +158,14 @@ static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx,
|
|
158
158
|
static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
|
159
159
|
grpc_channel_element *elem,
|
160
160
|
grpc_channel_element_args *args) {
|
161
|
-
channel_data *chand = elem->channel_data;
|
161
|
+
channel_data *chand = (channel_data *)elem->channel_data;
|
162
162
|
GPR_ASSERT(chand != NULL);
|
163
163
|
return GRPC_ERROR_NONE;
|
164
164
|
}
|
165
165
|
|
166
166
|
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
|
167
167
|
grpc_channel_element *elem) {
|
168
|
-
channel_data *chand = elem->channel_data;
|
168
|
+
channel_data *chand = (channel_data *)elem->channel_data;
|
169
169
|
GPR_ASSERT(chand != NULL);
|
170
170
|
}
|
171
171
|
|
@@ -179,7 +179,6 @@ const grpc_channel_filter grpc_client_census_filter = {
|
|
179
179
|
sizeof(channel_data),
|
180
180
|
init_channel_elem,
|
181
181
|
destroy_channel_elem,
|
182
|
-
grpc_call_next_get_peer,
|
183
182
|
grpc_channel_next_get_info,
|
184
183
|
"census-client"};
|
185
184
|
|
@@ -193,6 +192,5 @@ const grpc_channel_filter grpc_server_census_filter = {
|
|
193
192
|
sizeof(channel_data),
|
194
193
|
init_channel_elem,
|
195
194
|
destroy_channel_elem,
|
196
|
-
grpc_call_next_get_peer,
|
197
195
|
grpc_channel_next_get_info,
|
198
196
|
"census-server"};
|