grpc 1.50.0-x86_64-linux → 1.51.0-x86_64-linux
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 +131 -42
- data/include/grpc/event_engine/event_engine.h +10 -3
- data/include/grpc/event_engine/slice_buffer.h +17 -0
- data/include/grpc/grpc.h +0 -10
- data/include/grpc/impl/codegen/grpc_types.h +1 -5
- data/include/grpc/impl/codegen/port_platform.h +0 -3
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +19 -13
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +1 -0
- data/src/core/ext/filters/client_channel/backup_poller.cc +3 -3
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +7 -5
- data/src/core/ext/filters/client_channel/client_channel.cc +120 -140
- data/src/core/ext/filters/client_channel/client_channel.h +3 -4
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +0 -2
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel_service_config.cc +153 -0
- data/src/core/ext/filters/client_channel/{resolver_result_parsing.h → client_channel_service_config.h} +26 -23
- data/src/core/ext/filters/client_channel/connector.h +1 -1
- data/src/core/ext/filters/client_channel/dynamic_filters.cc +20 -47
- data/src/core/ext/filters/client_channel/dynamic_filters.h +7 -8
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +3 -4
- data/src/core/ext/filters/client_channel/http_proxy.cc +0 -1
- data/src/core/ext/filters/client_channel/lb_policy/address_filtering.cc +3 -4
- data/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc +5 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +8 -7
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +35 -44
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc +0 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +1 -3
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc +3 -4
- data/src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.cc +41 -29
- data/src/core/ext/filters/client_channel/lb_policy/outlier_detection/outlier_detection.h +2 -2
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +9 -11
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +15 -12
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +8 -10
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +26 -27
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +7 -9
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +44 -26
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +17 -27
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_attributes.cc +42 -0
- data/src/core/ext/filters/client_channel/lb_policy/xds/{xds.h → xds_attributes.h} +15 -17
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc +13 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +48 -47
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +40 -126
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_wrr_locality.cc +364 -0
- data/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc +9 -9
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +23 -32
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +1 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +22 -23
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +50 -52
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +2 -4
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +1 -3
- data/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc +34 -26
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +3 -4
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +4 -7
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +63 -46
- data/src/core/ext/filters/client_channel/retry_filter.cc +80 -102
- data/src/core/ext/filters/client_channel/retry_service_config.cc +192 -234
- data/src/core/ext/filters/client_channel/retry_service_config.h +20 -23
- data/src/core/ext/filters/client_channel/retry_throttle.cc +8 -8
- data/src/core/ext/filters/client_channel/retry_throttle.h +8 -7
- data/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc +2 -2
- data/src/core/ext/filters/client_channel/subchannel.cc +21 -25
- data/src/core/ext/filters/client_channel/subchannel.h +2 -2
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +11 -12
- data/src/core/ext/filters/deadline/deadline_filter.cc +13 -14
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +1 -1
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +0 -4
- data/src/core/ext/filters/fault_injection/fault_injection_service_config_parser.cc +118 -0
- data/src/core/ext/filters/fault_injection/{service_config_parser.h → fault_injection_service_config_parser.h} +20 -12
- data/src/core/ext/filters/http/client/http_client_filter.cc +16 -16
- data/src/core/ext/filters/http/client_authority_filter.cc +1 -1
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +13 -13
- data/src/core/ext/filters/http/message_compress/message_decompress_filter.cc +34 -34
- data/src/core/ext/filters/http/server/http_server_filter.cc +26 -25
- data/src/core/ext/filters/message_size/message_size_filter.cc +86 -117
- data/src/core/ext/filters/message_size/message_size_filter.h +22 -15
- data/src/core/ext/filters/rbac/rbac_filter.cc +12 -12
- data/src/core/ext/filters/rbac/rbac_service_config_parser.cc +728 -530
- data/src/core/ext/filters/rbac/rbac_service_config_parser.h +4 -3
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +1 -1
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +6 -7
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +17 -21
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +57 -72
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +5 -5
- data/src/core/ext/transport/chttp2/transport/bin_encoder.h +1 -1
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +212 -253
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +42 -11
- data/src/core/ext/transport/chttp2/transport/flow_control.h +4 -3
- data/src/core/ext/transport/chttp2/transport/frame_data.cc +16 -15
- data/src/core/ext/transport/chttp2/transport/frame_data.h +1 -1
- data/src/core/ext/transport/chttp2/transport/frame_goaway.cc +13 -13
- data/src/core/ext/transport/chttp2/transport/frame_ping.cc +4 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +10 -7
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +15 -17
- data/src/core/ext/transport/chttp2/transport/frame_window_update.cc +5 -4
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +5 -6
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +1 -1
- data/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc +2 -1
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +31 -39
- data/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +7 -6
- data/src/core/ext/transport/chttp2/transport/internal.h +24 -8
- data/src/core/ext/transport/chttp2/transport/parsing.cc +51 -52
- data/src/core/ext/transport/chttp2/transport/varint.cc +2 -3
- data/src/core/ext/transport/chttp2/transport/varint.h +11 -8
- data/src/core/ext/transport/chttp2/transport/writing.cc +16 -16
- data/src/core/ext/transport/inproc/inproc_transport.cc +97 -115
- data/src/core/ext/xds/certificate_provider_store.cc +4 -4
- data/src/core/ext/xds/file_watcher_certificate_provider_factory.cc +4 -7
- data/src/core/ext/xds/xds_api.cc +15 -68
- data/src/core/ext/xds/xds_api.h +3 -7
- data/src/core/ext/xds/xds_bootstrap.h +0 -1
- data/src/core/ext/xds/xds_bootstrap_grpc.cc +3 -12
- data/src/core/ext/xds/xds_bootstrap_grpc.h +16 -1
- data/src/core/ext/xds/xds_certificate_provider.cc +22 -25
- data/src/core/ext/xds/xds_channel_stack_modifier.cc +0 -1
- data/src/core/ext/xds/xds_client.cc +122 -90
- data/src/core/ext/xds/xds_client.h +7 -2
- data/src/core/ext/xds/xds_client_grpc.cc +5 -24
- data/src/core/ext/xds/xds_cluster.cc +291 -183
- data/src/core/ext/xds/xds_cluster.h +11 -15
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +32 -29
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +35 -16
- data/src/core/ext/xds/xds_common_types.cc +208 -141
- data/src/core/ext/xds/xds_common_types.h +19 -13
- data/src/core/ext/xds/xds_endpoint.cc +214 -129
- data/src/core/ext/xds/xds_endpoint.h +4 -7
- data/src/core/ext/xds/xds_http_fault_filter.cc +56 -43
- data/src/core/ext/xds/xds_http_fault_filter.h +13 -21
- data/src/core/ext/xds/xds_http_filters.cc +60 -73
- data/src/core/ext/xds/xds_http_filters.h +67 -19
- data/src/core/ext/xds/xds_http_rbac_filter.cc +152 -207
- data/src/core/ext/xds/xds_http_rbac_filter.h +12 -15
- data/src/core/ext/xds/xds_lb_policy_registry.cc +122 -169
- data/src/core/ext/xds/xds_lb_policy_registry.h +10 -11
- data/src/core/ext/xds/xds_listener.cc +459 -417
- data/src/core/ext/xds/xds_listener.h +43 -47
- data/src/core/ext/xds/xds_resource_type.h +3 -11
- data/src/core/ext/xds/xds_resource_type_impl.h +8 -13
- data/src/core/ext/xds/xds_route_config.cc +94 -80
- data/src/core/ext/xds/xds_route_config.h +10 -10
- data/src/core/ext/xds/xds_routing.cc +2 -1
- data/src/core/ext/xds/xds_routing.h +2 -0
- data/src/core/ext/xds/xds_server_config_fetcher.cc +109 -94
- data/src/core/ext/xds/xds_transport_grpc.cc +4 -5
- data/src/core/lib/address_utils/parse_address.cc +11 -10
- data/src/core/lib/channel/channel_args.h +16 -1
- data/src/core/lib/channel/channel_stack.cc +23 -20
- data/src/core/lib/channel/channel_stack.h +17 -4
- data/src/core/lib/channel/channel_stack_builder.cc +4 -7
- data/src/core/lib/channel/channel_stack_builder.h +14 -6
- data/src/core/lib/channel/channel_stack_builder_impl.cc +25 -7
- data/src/core/lib/channel/channel_stack_builder_impl.h +2 -0
- data/src/core/lib/channel/channel_trace.cc +4 -5
- data/src/core/lib/channel/channelz.cc +1 -1
- data/src/core/lib/channel/connected_channel.cc +695 -35
- data/src/core/lib/channel/connected_channel.h +0 -4
- data/src/core/lib/channel/promise_based_filter.cc +1004 -140
- data/src/core/lib/channel/promise_based_filter.h +364 -87
- data/src/core/lib/compression/message_compress.cc +5 -5
- data/src/core/lib/debug/event_log.cc +88 -0
- data/src/core/lib/debug/event_log.h +81 -0
- data/src/core/lib/debug/histogram_view.cc +69 -0
- data/src/core/lib/{slice/slice_refcount.cc → debug/histogram_view.h} +15 -13
- data/src/core/lib/debug/stats.cc +22 -119
- data/src/core/lib/debug/stats.h +29 -35
- data/src/core/lib/debug/stats_data.cc +224 -73
- data/src/core/lib/debug/stats_data.h +263 -122
- data/src/core/lib/event_engine/common_closures.h +71 -0
- data/src/core/lib/event_engine/default_event_engine.cc +38 -15
- data/src/core/lib/event_engine/default_event_engine.h +15 -3
- data/src/core/lib/event_engine/default_event_engine_factory.cc +2 -4
- data/src/core/lib/event_engine/memory_allocator.cc +1 -1
- data/src/core/lib/event_engine/poller.h +10 -4
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +618 -0
- data/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h +129 -0
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +901 -0
- data/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +97 -0
- data/src/core/lib/event_engine/posix_engine/event_poller.h +111 -0
- data/src/core/lib/event_engine/posix_engine/event_poller_posix_default.cc +74 -0
- data/src/core/lib/event_engine/{executor/threaded_executor.cc → posix_engine/event_poller_posix_default.h} +13 -16
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.cc +77 -0
- data/src/core/lib/event_engine/posix_engine/internal_errqueue.h +179 -0
- data/src/core/lib/event_engine/posix_engine/lockfree_event.cc +267 -0
- data/src/core/lib/event_engine/posix_engine/lockfree_event.h +73 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.cc +1270 -0
- data/src/core/lib/event_engine/posix_engine/posix_endpoint.h +682 -0
- data/src/core/lib/event_engine/posix_engine/posix_engine.cc +453 -18
- data/src/core/lib/event_engine/posix_engine/posix_engine.h +148 -24
- data/src/core/lib/event_engine/posix_engine/posix_engine_closure.h +80 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +1081 -0
- data/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +361 -0
- data/src/core/lib/event_engine/posix_engine/timer.h +9 -8
- data/src/core/lib/event_engine/posix_engine/timer_manager.cc +57 -194
- data/src/core/lib/event_engine/posix_engine/timer_manager.h +21 -49
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +301 -0
- data/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +179 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc +126 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.h +45 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc +151 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.h +45 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +76 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +67 -0
- data/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +37 -0
- data/src/core/lib/event_engine/slice.cc +7 -6
- data/src/core/lib/event_engine/slice_buffer.cc +2 -2
- data/src/core/lib/event_engine/thread_pool.cc +106 -25
- data/src/core/lib/event_engine/thread_pool.h +32 -9
- data/src/core/lib/event_engine/windows/win_socket.cc +7 -7
- data/src/core/lib/event_engine/windows/windows_engine.cc +18 -12
- data/src/core/lib/event_engine/windows/windows_engine.h +8 -4
- data/src/core/lib/experiments/config.cc +1 -1
- data/src/core/lib/experiments/experiments.cc +13 -2
- data/src/core/lib/experiments/experiments.h +8 -1
- data/src/core/lib/gpr/cpu_linux.cc +6 -2
- data/src/core/lib/gpr/log_linux.cc +3 -4
- data/src/core/lib/gpr/string.h +1 -1
- data/src/core/lib/gpr/tmpfile_posix.cc +3 -2
- data/src/core/lib/gprpp/load_file.cc +75 -0
- data/src/core/lib/gprpp/load_file.h +33 -0
- data/src/core/lib/gprpp/per_cpu.h +46 -0
- data/src/core/lib/gprpp/stat_posix.cc +5 -4
- data/src/core/lib/gprpp/stat_windows.cc +3 -2
- data/src/core/lib/gprpp/status_helper.h +1 -3
- data/src/core/lib/gprpp/strerror.cc +41 -0
- data/src/core/{ext/xds/xds_resource_type.cc → lib/gprpp/strerror.h} +9 -13
- data/src/core/lib/gprpp/thd_windows.cc +1 -2
- data/src/core/lib/gprpp/time.cc +3 -4
- data/src/core/lib/gprpp/time.h +13 -2
- data/src/core/lib/gprpp/validation_errors.h +18 -1
- data/src/core/lib/http/httpcli.cc +40 -44
- data/src/core/lib/http/httpcli.h +6 -5
- data/src/core/lib/http/httpcli_security_connector.cc +4 -6
- data/src/core/lib/http/parser.cc +54 -65
- data/src/core/lib/iomgr/buffer_list.cc +105 -116
- data/src/core/lib/iomgr/buffer_list.h +60 -44
- data/src/core/lib/iomgr/call_combiner.cc +11 -10
- data/src/core/lib/iomgr/call_combiner.h +3 -4
- data/src/core/lib/iomgr/cfstream_handle.cc +13 -16
- data/src/core/lib/iomgr/closure.h +49 -5
- data/src/core/lib/iomgr/combiner.cc +2 -2
- data/src/core/lib/iomgr/endpoint.h +1 -1
- data/src/core/lib/iomgr/endpoint_cfstream.cc +26 -25
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -2
- data/src/core/lib/iomgr/error.cc +27 -42
- data/src/core/lib/iomgr/error.h +22 -152
- data/src/core/lib/iomgr/ev_apple.cc +4 -4
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +26 -25
- data/src/core/lib/iomgr/ev_poll_posix.cc +27 -31
- data/src/core/lib/iomgr/exec_ctx.cc +3 -4
- data/src/core/lib/iomgr/exec_ctx.h +2 -3
- data/src/core/lib/iomgr/executor.cc +1 -2
- data/src/core/lib/iomgr/internal_errqueue.cc +3 -1
- data/src/core/lib/iomgr/iocp_windows.cc +1 -0
- data/src/core/lib/iomgr/iomgr_posix.cc +2 -2
- data/src/core/lib/iomgr/iomgr_posix_cfstream.cc +2 -1
- data/src/core/lib/iomgr/iomgr_windows.cc +2 -1
- data/src/core/lib/iomgr/load_file.cc +5 -9
- data/src/core/lib/iomgr/lockfree_event.cc +10 -10
- data/src/core/lib/iomgr/pollset_windows.cc +4 -4
- data/src/core/lib/iomgr/python_util.h +2 -2
- data/src/core/lib/iomgr/resolve_address.cc +8 -3
- data/src/core/lib/iomgr/resolve_address.h +3 -4
- data/src/core/lib/iomgr/resolve_address_impl.h +1 -1
- data/src/core/lib/iomgr/resolve_address_posix.cc +14 -25
- data/src/core/lib/iomgr/resolve_address_posix.h +1 -2
- data/src/core/lib/iomgr/resolve_address_windows.cc +14 -17
- data/src/core/lib/iomgr/resolve_address_windows.h +1 -2
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +30 -29
- data/src/core/lib/iomgr/socket_utils_posix.cc +1 -0
- data/src/core/lib/iomgr/socket_utils_posix.h +2 -2
- data/src/core/lib/iomgr/socket_windows.cc +2 -2
- data/src/core/lib/iomgr/tcp_client_cfstream.cc +6 -10
- data/src/core/lib/iomgr/tcp_client_posix.cc +31 -35
- data/src/core/lib/iomgr/tcp_client_windows.cc +8 -12
- data/src/core/lib/iomgr/tcp_posix.cc +92 -108
- data/src/core/lib/iomgr/tcp_server_posix.cc +34 -34
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +18 -21
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +12 -13
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +1 -1
- data/src/core/lib/iomgr/tcp_server_windows.cc +26 -29
- data/src/core/lib/iomgr/tcp_windows.cc +27 -34
- data/src/core/lib/iomgr/timer.h +8 -8
- data/src/core/lib/iomgr/timer_generic.cc +9 -15
- data/src/core/lib/iomgr/unix_sockets_posix.cc +2 -4
- data/src/core/lib/iomgr/wakeup_fd_eventfd.cc +4 -3
- data/src/core/lib/iomgr/wakeup_fd_pipe.cc +10 -8
- data/src/core/lib/json/json_channel_args.h +42 -0
- data/src/core/lib/json/json_object_loader.cc +7 -2
- data/src/core/lib/json/json_object_loader.h +22 -0
- data/src/core/lib/json/json_util.cc +5 -5
- data/src/core/lib/json/json_util.h +4 -4
- data/src/core/lib/load_balancing/lb_policy.cc +1 -1
- data/src/core/lib/load_balancing/lb_policy.h +4 -0
- data/src/core/lib/load_balancing/subchannel_interface.h +0 -7
- data/src/core/lib/matchers/matchers.cc +3 -4
- data/src/core/lib/promise/activity.cc +16 -2
- data/src/core/lib/promise/activity.h +38 -15
- data/src/core/lib/promise/arena_promise.h +80 -51
- data/src/core/lib/promise/context.h +13 -6
- data/src/core/lib/promise/detail/basic_seq.h +9 -28
- data/src/core/lib/promise/detail/promise_factory.h +58 -10
- data/src/core/lib/promise/detail/status.h +28 -0
- data/src/core/lib/promise/detail/switch.h +1455 -0
- data/src/core/lib/promise/exec_ctx_wakeup_scheduler.h +3 -1
- data/src/core/lib/promise/for_each.h +129 -0
- data/src/core/lib/promise/loop.h +7 -5
- data/src/core/lib/promise/map_pipe.h +87 -0
- data/src/core/lib/promise/pipe.cc +19 -0
- data/src/core/lib/promise/pipe.h +505 -0
- data/src/core/lib/promise/poll.h +13 -0
- data/src/core/lib/promise/seq.h +3 -5
- data/src/core/lib/promise/sleep.cc +5 -4
- data/src/core/lib/promise/sleep.h +1 -2
- data/src/core/lib/promise/try_concurrently.h +341 -0
- data/src/core/lib/promise/try_seq.h +10 -13
- data/src/core/lib/resolver/server_address.cc +1 -0
- data/src/core/lib/resolver/server_address.h +1 -3
- data/src/core/lib/resource_quota/api.cc +0 -1
- data/src/core/lib/resource_quota/arena.cc +19 -0
- data/src/core/lib/resource_quota/arena.h +89 -0
- data/src/core/lib/resource_quota/memory_quota.cc +1 -0
- data/src/core/lib/security/authorization/grpc_authorization_engine.cc +1 -3
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +4 -2
- data/src/core/lib/security/authorization/matchers.cc +25 -22
- data/src/core/lib/security/authorization/rbac_policy.cc +2 -3
- data/src/core/lib/security/context/security_context.h +10 -0
- data/src/core/lib/security/credentials/channel_creds_registry_init.cc +3 -4
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +1 -1
- data/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +77 -55
- data/src/core/lib/security/credentials/external/aws_request_signer.cc +4 -3
- data/src/core/lib/security/credentials/external/external_account_credentials.cc +40 -51
- data/src/core/lib/security/credentials/external/file_external_account_credentials.cc +17 -21
- data/src/core/lib/security/credentials/external/url_external_account_credentials.cc +21 -25
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +1 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +27 -24
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +1 -0
- data/src/core/lib/security/credentials/jwt/json_token.cc +1 -2
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +1 -1
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +5 -5
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +24 -30
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +6 -5
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +3 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +19 -27
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h +4 -11
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +29 -41
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +1 -1
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +6 -11
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +8 -15
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +2 -6
- data/src/core/lib/security/security_connector/load_system_roots_supported.cc +1 -4
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +7 -11
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +9 -14
- data/src/core/lib/security/security_connector/ssl_utils.cc +5 -7
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +21 -27
- data/src/core/lib/security/transport/client_auth_filter.cc +1 -1
- data/src/core/lib/security/transport/secure_endpoint.cc +26 -28
- data/src/core/lib/security/transport/security_handshaker.cc +53 -53
- data/src/core/lib/security/transport/server_auth_filter.cc +21 -21
- data/src/core/lib/security/transport/tsi_error.cc +6 -3
- data/src/core/lib/security/util/json_util.cc +4 -5
- data/src/core/lib/service_config/service_config.h +1 -1
- data/src/core/lib/service_config/service_config_impl.cc +111 -158
- data/src/core/lib/service_config/service_config_impl.h +14 -17
- data/src/core/lib/service_config/service_config_parser.cc +14 -31
- data/src/core/lib/service_config/service_config_parser.h +14 -10
- data/src/core/lib/slice/b64.cc +2 -2
- data/src/core/lib/slice/slice.cc +7 -1
- data/src/core/lib/slice/slice.h +19 -6
- data/src/core/lib/slice/slice_buffer.cc +13 -14
- data/src/core/lib/slice/slice_internal.h +13 -21
- data/src/core/lib/slice/slice_refcount.h +34 -19
- data/src/core/lib/surface/byte_buffer.cc +3 -4
- data/src/core/lib/surface/byte_buffer_reader.cc +4 -4
- data/src/core/lib/surface/call.cc +1366 -239
- data/src/core/lib/surface/call.h +44 -0
- data/src/core/lib/surface/call_details.cc +3 -3
- data/src/core/lib/surface/call_trace.cc +113 -0
- data/src/core/lib/surface/call_trace.h +30 -0
- data/src/core/lib/surface/channel.cc +44 -49
- data/src/core/lib/surface/channel.h +9 -1
- data/src/core/lib/surface/channel_ping.cc +1 -1
- data/src/core/lib/surface/channel_stack_type.cc +4 -0
- data/src/core/lib/surface/channel_stack_type.h +2 -0
- data/src/core/lib/surface/completion_queue.cc +38 -52
- data/src/core/lib/surface/init.cc +8 -39
- data/src/core/lib/surface/init_internally.h +8 -0
- data/src/core/lib/surface/lame_client.cc +10 -8
- data/src/core/lib/surface/server.cc +48 -70
- data/src/core/lib/surface/server.h +3 -4
- data/src/core/lib/surface/validate_metadata.cc +11 -12
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/connectivity_state.cc +2 -2
- data/src/core/lib/transport/error_utils.cc +34 -28
- data/src/core/lib/transport/error_utils.h +3 -3
- data/src/core/lib/transport/handshaker.cc +14 -14
- data/src/core/lib/transport/handshaker.h +1 -1
- data/src/core/lib/transport/handshaker_factory.h +26 -0
- data/src/core/lib/transport/handshaker_registry.cc +8 -2
- data/src/core/lib/transport/handshaker_registry.h +3 -4
- data/src/core/lib/transport/http_connect_handshaker.cc +23 -24
- data/src/core/lib/transport/metadata_batch.h +17 -1
- data/src/core/lib/transport/parsed_metadata.cc +2 -6
- data/src/core/lib/transport/tcp_connect_handshaker.cc +15 -20
- data/src/core/lib/transport/transport.cc +63 -17
- data/src/core/lib/transport/transport.h +64 -68
- data/src/core/lib/transport/transport_impl.h +1 -1
- data/src/core/lib/transport/transport_op_string.cc +7 -6
- data/src/core/plugin_registry/grpc_plugin_registry.cc +6 -10
- data/src/core/plugin_registry/grpc_plugin_registry_extra.cc +2 -14
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +10 -10
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +8 -8
- data/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +2 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +7 -7
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +7 -6
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +1 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +5 -5
- data/src/core/tsi/fake_transport_security.cc +3 -3
- data/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +7 -3
- data/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +1 -1
- data/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +6 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +0 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +0 -3
- data/src/ruby/lib/grpc/2.6/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.7/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.0/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.1/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/channel_spec.rb +0 -43
- data/src/ruby/spec/generic/active_call_spec.rb +12 -3
- data/third_party/abseil-cpp/absl/cleanup/cleanup.h +140 -0
- data/third_party/abseil-cpp/absl/cleanup/internal/cleanup.h +100 -0
- data/third_party/zlib/compress.c +3 -3
- data/third_party/zlib/crc32.c +21 -12
- data/third_party/zlib/deflate.c +112 -106
- data/third_party/zlib/deflate.h +2 -2
- data/third_party/zlib/gzlib.c +1 -1
- data/third_party/zlib/gzread.c +3 -5
- data/third_party/zlib/gzwrite.c +1 -1
- data/third_party/zlib/infback.c +10 -7
- data/third_party/zlib/inflate.c +5 -2
- data/third_party/zlib/inftrees.c +2 -2
- data/third_party/zlib/inftrees.h +1 -1
- data/third_party/zlib/trees.c +61 -62
- data/third_party/zlib/uncompr.c +2 -2
- data/third_party/zlib/zconf.h +16 -3
- data/third_party/zlib/zlib.h +10 -10
- data/third_party/zlib/zutil.c +9 -7
- data/third_party/zlib/zutil.h +1 -0
- metadata +55 -18
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +0 -188
- data/src/core/ext/filters/fault_injection/service_config_parser.cc +0 -187
- data/src/core/lib/event_engine/executor/threaded_executor.h +0 -44
- data/src/core/lib/gpr/murmur_hash.cc +0 -82
- data/src/core/lib/gpr/murmur_hash.h +0 -29
- data/src/core/lib/gpr/tls.h +0 -156
- data/src/core/lib/promise/call_push_pull.h +0 -148
- data/src/core/lib/slice/slice_api.cc +0 -39
- data/src/core/lib/slice/slice_buffer_api.cc +0 -35
- data/src/core/lib/slice/slice_refcount_base.h +0 -60
@@ -26,11 +26,11 @@
|
|
26
26
|
#include <utility>
|
27
27
|
#include <vector>
|
28
28
|
|
29
|
-
#include "absl/status/statusor.h"
|
30
29
|
#include "absl/strings/string_view.h"
|
31
30
|
|
32
31
|
#include "src/core/lib/channel/channel_args.h"
|
33
32
|
#include "src/core/lib/config/core_configuration.h"
|
33
|
+
#include "src/core/lib/gprpp/validation_errors.h"
|
34
34
|
#include "src/core/lib/json/json.h"
|
35
35
|
#include "src/core/lib/security/authorization/grpc_authorization_engine.h"
|
36
36
|
#include "src/core/lib/security/authorization/rbac_policy.h"
|
@@ -69,8 +69,9 @@ class RbacServiceConfigParser : public ServiceConfigParser::Parser {
|
|
69
69
|
public:
|
70
70
|
absl::string_view name() const override { return parser_name(); }
|
71
71
|
// Parses the per-method service config for rbac filter.
|
72
|
-
|
73
|
-
|
72
|
+
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
|
73
|
+
const ChannelArgs& args, const Json& json,
|
74
|
+
ValidationErrors* errors) override;
|
74
75
|
// Returns the parser index for RbacServiceConfigParser.
|
75
76
|
static size_t ParserIndex();
|
76
77
|
// Registers RbacServiceConfigParser to ServiceConfigParser.
|
@@ -43,7 +43,7 @@ class ServerConfigSelector : public RefCounted<ServerConfigSelector> {
|
|
43
43
|
public:
|
44
44
|
// Configuration to apply to an incoming call
|
45
45
|
struct CallConfig {
|
46
|
-
grpc_error_handle error
|
46
|
+
grpc_error_handle error;
|
47
47
|
const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
|
48
48
|
RefCountedPtr<ServiceConfig> service_config;
|
49
49
|
};
|
@@ -21,7 +21,6 @@
|
|
21
21
|
#include <utility>
|
22
22
|
|
23
23
|
#include "absl/base/thread_annotations.h"
|
24
|
-
#include "absl/memory/memory.h"
|
25
24
|
#include "absl/status/status.h"
|
26
25
|
#include "absl/status/statusor.h"
|
27
26
|
#include "absl/types/optional.h"
|
@@ -33,6 +32,7 @@
|
|
33
32
|
#include "src/core/lib/channel/context.h"
|
34
33
|
#include "src/core/lib/channel/promise_based_filter.h"
|
35
34
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
35
|
+
#include "src/core/lib/gprpp/status_helper.h"
|
36
36
|
#include "src/core/lib/gprpp/sync.h"
|
37
37
|
#include "src/core/lib/iomgr/error.h"
|
38
38
|
#include "src/core/lib/promise/arena_promise.h"
|
@@ -113,7 +113,7 @@ ServerConfigSelectorFilter::ServerConfigSelectorFilter(
|
|
113
113
|
state_(std::make_shared<State>()) {
|
114
114
|
GPR_ASSERT(server_config_selector_provider_ != nullptr);
|
115
115
|
auto server_config_selector_watcher =
|
116
|
-
|
116
|
+
std::make_unique<ServerConfigSelectorWatcher>(state_);
|
117
117
|
auto config_selector = server_config_selector_provider_->Watch(
|
118
118
|
std::move(server_config_selector_watcher));
|
119
119
|
MutexLock lock(&state_->mu);
|
@@ -132,13 +132,12 @@ ServerConfigSelectorFilter::~ServerConfigSelectorFilter() {
|
|
132
132
|
ArenaPromise<ServerMetadataHandle> ServerConfigSelectorFilter::MakeCallPromise(
|
133
133
|
CallArgs call_args, NextPromiseFactory next_promise_factory) {
|
134
134
|
auto sel = config_selector();
|
135
|
-
if (!sel.ok()) return Immediate(
|
135
|
+
if (!sel.ok()) return Immediate(ServerMetadataFromStatus(sel.status()));
|
136
136
|
auto call_config =
|
137
137
|
sel.value()->GetCallConfig(call_args.client_initial_metadata.get());
|
138
|
-
if (!
|
139
|
-
auto r = Immediate(
|
140
|
-
absl::UnavailableError(
|
141
|
-
GRPC_ERROR_UNREF(call_config.error);
|
138
|
+
if (!call_config.error.ok()) {
|
139
|
+
auto r = Immediate(ServerMetadataFromStatus(
|
140
|
+
absl::UnavailableError(StatusToString(call_config.error))));
|
142
141
|
return std::move(r);
|
143
142
|
}
|
144
143
|
auto& ctx = GetContext<
|
@@ -33,6 +33,7 @@
|
|
33
33
|
#include <grpc/grpc_posix.h>
|
34
34
|
#include <grpc/grpc_security.h>
|
35
35
|
#include <grpc/impl/codegen/grpc_types.h>
|
36
|
+
#include <grpc/slice_buffer.h>
|
36
37
|
#include <grpc/status.h>
|
37
38
|
#include <grpc/support/alloc.h>
|
38
39
|
#include <grpc/support/log.h>
|
@@ -52,6 +53,7 @@
|
|
52
53
|
#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
|
53
54
|
#include "src/core/lib/gprpp/debug_location.h"
|
54
55
|
#include "src/core/lib/gprpp/orphanable.h"
|
56
|
+
#include "src/core/lib/gprpp/status_helper.h"
|
55
57
|
#include "src/core/lib/gprpp/unique_type_name.h"
|
56
58
|
#include "src/core/lib/iomgr/endpoint.h"
|
57
59
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
@@ -60,7 +62,6 @@
|
|
60
62
|
#include "src/core/lib/security/credentials/credentials.h"
|
61
63
|
#include "src/core/lib/security/credentials/insecure/insecure_credentials.h"
|
62
64
|
#include "src/core/lib/security/security_connector/security_connector.h"
|
63
|
-
#include "src/core/lib/slice/slice_internal.h"
|
64
65
|
#include "src/core/lib/surface/api_trace.h"
|
65
66
|
#include "src/core/lib/surface/channel.h"
|
66
67
|
#include "src/core/lib/surface/channel_stack_type.h"
|
@@ -109,8 +110,7 @@ void Chttp2Connector::Connect(const Args& args, Result* result,
|
|
109
110
|
}
|
110
111
|
absl::StatusOr<std::string> address = grpc_sockaddr_to_uri(args.address);
|
111
112
|
if (!address.ok()) {
|
112
|
-
grpc_error_handle error =
|
113
|
-
GRPC_ERROR_CREATE_FROM_CPP_STRING(address.status().ToString());
|
113
|
+
grpc_error_handle error = GRPC_ERROR_CREATE(address.status().ToString());
|
114
114
|
NullThenSchedClosure(DEBUG_LOCATION, ¬ify_, error);
|
115
115
|
return;
|
116
116
|
}
|
@@ -133,9 +133,8 @@ void Chttp2Connector::Shutdown(grpc_error_handle error) {
|
|
133
133
|
shutdown_ = true;
|
134
134
|
if (handshake_mgr_ != nullptr) {
|
135
135
|
// Handshaker will also shutdown the endpoint if it exists
|
136
|
-
handshake_mgr_->Shutdown(
|
136
|
+
handshake_mgr_->Shutdown(error);
|
137
137
|
}
|
138
|
-
GRPC_ERROR_UNREF(error);
|
139
138
|
}
|
140
139
|
|
141
140
|
void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
|
@@ -143,9 +142,9 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
|
|
143
142
|
Chttp2Connector* self = static_cast<Chttp2Connector*>(args->user_data);
|
144
143
|
{
|
145
144
|
MutexLock lock(&self->mu_);
|
146
|
-
if (!
|
147
|
-
if (
|
148
|
-
error =
|
145
|
+
if (!error.ok() || self->shutdown_) {
|
146
|
+
if (error.ok()) {
|
147
|
+
error = GRPC_ERROR_CREATE("connector shutdown");
|
149
148
|
// We were shut down after handshaking completed successfully, so
|
150
149
|
// destroy the endpoint here.
|
151
150
|
if (args->endpoint != nullptr) {
|
@@ -153,13 +152,11 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
|
|
153
152
|
// before destroying them, even if we know that there are no
|
154
153
|
// pending read/write callbacks. This should be fixed, at which
|
155
154
|
// point this can be removed.
|
156
|
-
grpc_endpoint_shutdown(args->endpoint,
|
155
|
+
grpc_endpoint_shutdown(args->endpoint, error);
|
157
156
|
grpc_endpoint_destroy(args->endpoint);
|
158
|
-
|
157
|
+
grpc_slice_buffer_destroy(args->read_buffer);
|
159
158
|
gpr_free(args->read_buffer);
|
160
159
|
}
|
161
|
-
} else {
|
162
|
-
error = GRPC_ERROR_REF(error);
|
163
160
|
}
|
164
161
|
self->result_->Reset();
|
165
162
|
NullThenSchedClosure(DEBUG_LOCATION, &self->notify_, error);
|
@@ -200,19 +197,19 @@ void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error_handle error) {
|
|
200
197
|
if (!self->notify_error_.has_value()) {
|
201
198
|
grpc_endpoint_delete_from_pollset_set(self->endpoint_,
|
202
199
|
self->args_.interested_parties);
|
203
|
-
if (!
|
200
|
+
if (!error.ok()) {
|
204
201
|
// Transport got an error while waiting on SETTINGS frame.
|
205
202
|
// TODO(yashykt): The following two lines should be moved to
|
206
203
|
// SubchannelConnector::Result::Reset()
|
207
204
|
grpc_transport_destroy(self->result_->transport);
|
208
205
|
self->result_->Reset();
|
209
206
|
}
|
210
|
-
self->MaybeNotify(
|
207
|
+
self->MaybeNotify(error);
|
211
208
|
grpc_timer_cancel(&self->timer_);
|
212
209
|
} else {
|
213
210
|
// OnTimeout() was already invoked. Call Notify() again so that notify_
|
214
211
|
// can be invoked.
|
215
|
-
self->MaybeNotify(
|
212
|
+
self->MaybeNotify(absl::OkStatus());
|
216
213
|
}
|
217
214
|
}
|
218
215
|
self->Unref();
|
@@ -231,12 +228,12 @@ void Chttp2Connector::OnTimeout(void* arg, grpc_error_handle /*error*/) {
|
|
231
228
|
// SubchannelConnector::Result::Reset()
|
232
229
|
grpc_transport_destroy(self->result_->transport);
|
233
230
|
self->result_->Reset();
|
234
|
-
self->MaybeNotify(
|
231
|
+
self->MaybeNotify(GRPC_ERROR_CREATE(
|
235
232
|
"connection attempt timed out before receiving SETTINGS frame"));
|
236
233
|
} else {
|
237
234
|
// OnReceiveSettings() was already invoked. Call Notify() again so that
|
238
235
|
// notify_ can be invoked.
|
239
|
-
self->MaybeNotify(
|
236
|
+
self->MaybeNotify(absl::OkStatus());
|
240
237
|
}
|
241
238
|
}
|
242
239
|
self->Unref();
|
@@ -244,7 +241,6 @@ void Chttp2Connector::OnTimeout(void* arg, grpc_error_handle /*error*/) {
|
|
244
241
|
|
245
242
|
void Chttp2Connector::MaybeNotify(grpc_error_handle error) {
|
246
243
|
if (notify_error_.has_value()) {
|
247
|
-
GRPC_ERROR_UNREF(error);
|
248
244
|
NullThenSchedClosure(DEBUG_LOCATION, ¬ify_, notify_error_.value());
|
249
245
|
// Clear state for a new Connect().
|
250
246
|
// Clear out the endpoint_, since it is the responsibility of
|
@@ -348,7 +344,7 @@ grpc_channel* grpc_channel_create(const char* target,
|
|
348
344
|
GRPC_API_TRACE("grpc_secure_channel_create(target=%s, creds=%p, args=%p)", 3,
|
349
345
|
(target, (void*)creds, (void*)c_args));
|
350
346
|
grpc_channel* channel = nullptr;
|
351
|
-
grpc_error_handle error
|
347
|
+
grpc_error_handle error;
|
352
348
|
if (creds != nullptr) {
|
353
349
|
// Add channel args containing the client channel factory and channel
|
354
350
|
// credentials.
|
@@ -370,10 +366,10 @@ grpc_channel* grpc_channel_create(const char* target,
|
|
370
366
|
if (channel == nullptr) {
|
371
367
|
intptr_t integer;
|
372
368
|
grpc_status_code status = GRPC_STATUS_INTERNAL;
|
373
|
-
if (grpc_error_get_int(error,
|
369
|
+
if (grpc_error_get_int(error, grpc_core::StatusIntProperty::kRpcStatus,
|
370
|
+
&integer)) {
|
374
371
|
status = static_cast<grpc_status_code>(integer);
|
375
372
|
}
|
376
|
-
GRPC_ERROR_UNREF(error);
|
377
373
|
channel = grpc_lame_client_channel_create(
|
378
374
|
target, status, "Failed to create secure client channel");
|
379
375
|
}
|
@@ -31,7 +31,6 @@
|
|
31
31
|
#include <vector>
|
32
32
|
|
33
33
|
#include "absl/base/thread_annotations.h"
|
34
|
-
#include "absl/memory/memory.h"
|
35
34
|
#include "absl/status/status.h"
|
36
35
|
#include "absl/status/statusor.h"
|
37
36
|
#include "absl/strings/str_cat.h"
|
@@ -43,6 +42,7 @@
|
|
43
42
|
#include <grpc/grpc.h>
|
44
43
|
#include <grpc/grpc_posix.h>
|
45
44
|
#include <grpc/impl/codegen/grpc_types.h>
|
45
|
+
#include <grpc/slice_buffer.h>
|
46
46
|
#include <grpc/support/alloc.h>
|
47
47
|
#include <grpc/support/log.h>
|
48
48
|
|
@@ -58,6 +58,7 @@
|
|
58
58
|
#include "src/core/lib/gprpp/debug_location.h"
|
59
59
|
#include "src/core/lib/gprpp/orphanable.h"
|
60
60
|
#include "src/core/lib/gprpp/ref_counted_ptr.h"
|
61
|
+
#include "src/core/lib/gprpp/status_helper.h"
|
61
62
|
#include "src/core/lib/gprpp/sync.h"
|
62
63
|
#include "src/core/lib/gprpp/time.h"
|
63
64
|
#include "src/core/lib/gprpp/unique_type_name.h"
|
@@ -75,7 +76,6 @@
|
|
75
76
|
#include "src/core/lib/security/credentials/credentials.h"
|
76
77
|
#include "src/core/lib/security/credentials/insecure/insecure_credentials.h"
|
77
78
|
#include "src/core/lib/security/security_connector/security_connector.h"
|
78
|
-
#include "src/core/lib/slice/slice_internal.h"
|
79
79
|
#include "src/core/lib/surface/api_trace.h"
|
80
80
|
#include "src/core/lib/surface/server.h"
|
81
81
|
#include "src/core/lib/transport/error_utils.h"
|
@@ -323,10 +323,9 @@ void Chttp2ServerListener::ConfigFetcherWatcher::UpdateConnectionManager(
|
|
323
323
|
int port_temp;
|
324
324
|
grpc_error_handle error = grpc_tcp_server_add_port(
|
325
325
|
listener_->tcp_server_, &listener_->resolved_address_, &port_temp);
|
326
|
-
if (!
|
327
|
-
GRPC_ERROR_UNREF(error);
|
326
|
+
if (!error.ok()) {
|
328
327
|
gpr_log(GPR_ERROR, "Error adding port to server: %s",
|
329
|
-
|
328
|
+
StatusToString(error).c_str());
|
330
329
|
// TODO(yashykt): We wouldn't need to assert here if we bound to the
|
331
330
|
// port earlier during AddPort.
|
332
331
|
GPR_ASSERT(0);
|
@@ -390,8 +389,7 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::Orphan() {
|
|
390
389
|
{
|
391
390
|
MutexLock lock(&connection_->mu_);
|
392
391
|
if (handshake_mgr_ != nullptr) {
|
393
|
-
handshake_mgr_->Shutdown(
|
394
|
-
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Listener stopped serving."));
|
392
|
+
handshake_mgr_->Shutdown(GRPC_ERROR_CREATE("Listener stopped serving."));
|
395
393
|
}
|
396
394
|
}
|
397
395
|
Unref();
|
@@ -413,11 +411,11 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::Start(
|
|
413
411
|
void Chttp2ServerListener::ActiveConnection::HandshakingState::OnTimeout(
|
414
412
|
void* arg, grpc_error_handle error) {
|
415
413
|
HandshakingState* self = static_cast<HandshakingState*>(arg);
|
416
|
-
// Note that we may be called with
|
414
|
+
// Note that we may be called with absl::OkStatus() when the timer fires
|
417
415
|
// or with an error indicating that the timer system is being shut down.
|
418
|
-
if (error !=
|
416
|
+
if (error != absl::CancelledError()) {
|
419
417
|
grpc_transport_op* op = grpc_make_transport_op(nullptr);
|
420
|
-
op->disconnect_with_error =
|
418
|
+
op->disconnect_with_error = GRPC_ERROR_CREATE(
|
421
419
|
"Did not receive HTTP/2 settings before handshake timeout");
|
422
420
|
grpc_chttp2_transport* transport = nullptr;
|
423
421
|
{
|
@@ -445,20 +443,20 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
|
|
445
443
|
bool cleanup_connection = false;
|
446
444
|
{
|
447
445
|
MutexLock connection_lock(&self->connection_->mu_);
|
448
|
-
if (!
|
449
|
-
std::string error_str =
|
446
|
+
if (!error.ok() || self->connection_->shutdown_) {
|
447
|
+
std::string error_str = StatusToString(error);
|
450
448
|
gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str.c_str());
|
451
449
|
cleanup_connection = true;
|
452
|
-
if (
|
450
|
+
if (error.ok() && args->endpoint != nullptr) {
|
453
451
|
// We were shut down or stopped serving after handshaking completed
|
454
452
|
// successfully, so destroy the endpoint here.
|
455
453
|
// TODO(ctiller): It is currently necessary to shutdown endpoints
|
456
454
|
// before destroying them, even if we know that there are no
|
457
455
|
// pending read/write callbacks. This should be fixed, at which
|
458
456
|
// point this can be removed.
|
459
|
-
grpc_endpoint_shutdown(args->endpoint,
|
457
|
+
grpc_endpoint_shutdown(args->endpoint, absl::OkStatus());
|
460
458
|
grpc_endpoint_destroy(args->endpoint);
|
461
|
-
|
459
|
+
grpc_slice_buffer_destroy(args->read_buffer);
|
462
460
|
gpr_free(args->read_buffer);
|
463
461
|
}
|
464
462
|
} else {
|
@@ -472,7 +470,7 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
|
|
472
470
|
self->connection_->listener_->server_->SetupTransport(
|
473
471
|
transport, self->accepting_pollset_, args->args,
|
474
472
|
grpc_chttp2_transport_get_socket_node(transport));
|
475
|
-
if (
|
473
|
+
if (channel_init_err.ok()) {
|
476
474
|
// Use notify_on_receive_settings callback to enforce the
|
477
475
|
// handshake deadline.
|
478
476
|
// Note: The reinterpret_cast<>s here are safe, because
|
@@ -512,10 +510,9 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
|
|
512
510
|
} else {
|
513
511
|
// Failed to create channel from transport. Clean up.
|
514
512
|
gpr_log(GPR_ERROR, "Failed to create channel: %s",
|
515
|
-
|
516
|
-
GRPC_ERROR_UNREF(channel_init_err);
|
513
|
+
StatusToString(channel_init_err).c_str());
|
517
514
|
grpc_transport_destroy(transport);
|
518
|
-
|
515
|
+
grpc_slice_buffer_destroy(args->read_buffer);
|
519
516
|
gpr_free(args->read_buffer);
|
520
517
|
cleanup_connection = true;
|
521
518
|
}
|
@@ -601,8 +598,8 @@ void Chttp2ServerListener::ActiveConnection::SendGoAway() {
|
|
601
598
|
}
|
602
599
|
if (transport != nullptr) {
|
603
600
|
grpc_transport_op* op = grpc_make_transport_op(nullptr);
|
604
|
-
op->goaway_error =
|
605
|
-
"Server is stopping to serve requests.");
|
601
|
+
op->goaway_error =
|
602
|
+
GRPC_ERROR_CREATE("Server is stopping to serve requests.");
|
606
603
|
grpc_transport_perform_op(&transport->base, op);
|
607
604
|
}
|
608
605
|
}
|
@@ -652,14 +649,14 @@ void Chttp2ServerListener::ActiveConnection::OnDrainGraceTimeExpiry(
|
|
652
649
|
ActiveConnection* self = static_cast<ActiveConnection*>(arg);
|
653
650
|
// If the drain_grace_timer_ was not cancelled, disconnect the transport
|
654
651
|
// immediately.
|
655
|
-
if (
|
652
|
+
if (error.ok()) {
|
656
653
|
grpc_chttp2_transport* transport = nullptr;
|
657
654
|
{
|
658
655
|
MutexLock lock(&self->mu_);
|
659
656
|
transport = self->transport_;
|
660
657
|
}
|
661
658
|
grpc_transport_op* op = grpc_make_transport_op(nullptr);
|
662
|
-
op->disconnect_with_error =
|
659
|
+
op->disconnect_with_error = GRPC_ERROR_CREATE(
|
663
660
|
"Drain grace time expired. Closing connection immediately.");
|
664
661
|
grpc_transport_perform_op(&transport->base, op);
|
665
662
|
}
|
@@ -677,29 +674,28 @@ grpc_error_handle Chttp2ServerListener::Create(
|
|
677
674
|
// The bulk of this method is inside of a lambda to make cleanup
|
678
675
|
// easier without using goto.
|
679
676
|
grpc_error_handle error = [&]() {
|
680
|
-
grpc_error_handle error
|
677
|
+
grpc_error_handle error;
|
681
678
|
// Create Chttp2ServerListener.
|
682
679
|
listener = new Chttp2ServerListener(server, args, args_modifier);
|
683
680
|
error = grpc_tcp_server_create(
|
684
681
|
&listener->tcp_server_shutdown_complete_,
|
685
682
|
grpc_event_engine::experimental::ChannelArgsEndpointConfig(args),
|
686
683
|
&listener->tcp_server_);
|
687
|
-
if (!
|
684
|
+
if (!error.ok()) return error;
|
688
685
|
if (server->config_fetcher() != nullptr) {
|
689
686
|
listener->resolved_address_ = *addr;
|
690
687
|
// TODO(yashykt): Consider binding so as to be able to return the port
|
691
688
|
// number.
|
692
689
|
} else {
|
693
690
|
error = grpc_tcp_server_add_port(listener->tcp_server_, addr, port_num);
|
694
|
-
if (!
|
691
|
+
if (!error.ok()) return error;
|
695
692
|
}
|
696
693
|
// Create channelz node.
|
697
694
|
if (args.GetBool(GRPC_ARG_ENABLE_CHANNELZ)
|
698
695
|
.value_or(GRPC_ENABLE_CHANNELZ_DEFAULT)) {
|
699
696
|
auto string_address = grpc_sockaddr_to_uri(addr);
|
700
697
|
if (!string_address.ok()) {
|
701
|
-
return
|
702
|
-
string_address.status().ToString());
|
698
|
+
return GRPC_ERROR_CREATE(string_address.status().ToString());
|
703
699
|
}
|
704
700
|
listener->channelz_listen_socket_ =
|
705
701
|
MakeRefCounted<channelz::ListenSocketNode>(
|
@@ -708,9 +704,9 @@ grpc_error_handle Chttp2ServerListener::Create(
|
|
708
704
|
}
|
709
705
|
// Register with the server only upon success
|
710
706
|
server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
|
711
|
-
return
|
707
|
+
return absl::OkStatus();
|
712
708
|
}();
|
713
|
-
if (!
|
709
|
+
if (!error.ok()) {
|
714
710
|
if (listener != nullptr) {
|
715
711
|
if (listener->tcp_server_ != nullptr) {
|
716
712
|
// listener is deleted when tcp_server_ is shutdown.
|
@@ -732,7 +728,7 @@ grpc_error_handle Chttp2ServerListener::CreateWithAcceptor(
|
|
732
728
|
&listener->tcp_server_shutdown_complete_,
|
733
729
|
grpc_event_engine::experimental::ChannelArgsEndpointConfig(args),
|
734
730
|
&listener->tcp_server_);
|
735
|
-
if (!
|
731
|
+
if (!error.ok()) {
|
736
732
|
delete listener;
|
737
733
|
return error;
|
738
734
|
}
|
@@ -740,7 +736,7 @@ grpc_error_handle Chttp2ServerListener::CreateWithAcceptor(
|
|
740
736
|
TcpServerFdHandler** arg_val = args.GetPointer<TcpServerFdHandler*>(name);
|
741
737
|
*arg_val = grpc_tcp_server_create_fd_handler(listener->tcp_server_);
|
742
738
|
server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
|
743
|
-
return
|
739
|
+
return absl::OkStatus();
|
744
740
|
}
|
745
741
|
|
746
742
|
Chttp2ServerListener::Chttp2ServerListener(
|
@@ -759,7 +755,7 @@ Chttp2ServerListener::~Chttp2ServerListener() {
|
|
759
755
|
// may do a synchronous unref.
|
760
756
|
ExecCtx::Get()->Flush();
|
761
757
|
if (on_destroy_done_ != nullptr) {
|
762
|
-
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_,
|
758
|
+
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, absl::OkStatus());
|
763
759
|
ExecCtx::Get()->Flush();
|
764
760
|
}
|
765
761
|
}
|
@@ -768,7 +764,7 @@ Chttp2ServerListener::~Chttp2ServerListener() {
|
|
768
764
|
void Chttp2ServerListener::Start(
|
769
765
|
Server* /*server*/, const std::vector<grpc_pollset*>* /* pollsets */) {
|
770
766
|
if (server_->config_fetcher() != nullptr) {
|
771
|
-
auto watcher =
|
767
|
+
auto watcher = std::make_unique<ConfigFetcherWatcher>(Ref());
|
772
768
|
config_fetcher_watcher_ = watcher.get();
|
773
769
|
server_->config_fetcher()->StartWatch(
|
774
770
|
grpc_sockaddr_to_string(&resolved_address_, false).value(),
|
@@ -810,7 +806,7 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
|
|
810
806
|
};
|
811
807
|
if (self->server_->config_fetcher() != nullptr) {
|
812
808
|
if (connection_manager == nullptr) {
|
813
|
-
grpc_error_handle error =
|
809
|
+
grpc_error_handle error = GRPC_ERROR_CREATE(
|
814
810
|
"No ConnectionManager configured. Closing connection.");
|
815
811
|
endpoint_cleanup(error);
|
816
812
|
return;
|
@@ -820,15 +816,14 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
|
|
820
816
|
if (!args_result.ok()) {
|
821
817
|
gpr_log(GPR_DEBUG, "Closing connection: %s",
|
822
818
|
args_result.status().ToString().c_str());
|
823
|
-
endpoint_cleanup(
|
824
|
-
GRPC_ERROR_CREATE_FROM_CPP_STRING(args_result.status().ToString()));
|
819
|
+
endpoint_cleanup(GRPC_ERROR_CREATE(args_result.status().ToString()));
|
825
820
|
return;
|
826
821
|
}
|
827
|
-
grpc_error_handle error
|
822
|
+
grpc_error_handle error;
|
828
823
|
args = self->args_modifier_(*args_result, &error);
|
829
|
-
if (!
|
824
|
+
if (!error.ok()) {
|
830
825
|
gpr_log(GPR_DEBUG, "Closing connection: %s",
|
831
|
-
|
826
|
+
StatusToString(error).c_str());
|
832
827
|
endpoint_cleanup(error);
|
833
828
|
return;
|
834
829
|
}
|
@@ -859,17 +854,16 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
|
|
859
854
|
}
|
860
855
|
}
|
861
856
|
if (connection != nullptr) {
|
862
|
-
endpoint_cleanup(
|
857
|
+
endpoint_cleanup(absl::OkStatus());
|
863
858
|
} else {
|
864
859
|
connection_ref->Start(std::move(listener_ref), tcp, args);
|
865
860
|
}
|
866
861
|
}
|
867
862
|
|
868
|
-
void Chttp2ServerListener::TcpServerShutdownComplete(
|
869
|
-
|
863
|
+
void Chttp2ServerListener::TcpServerShutdownComplete(
|
864
|
+
void* arg, grpc_error_handle /*error*/) {
|
870
865
|
Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
|
871
866
|
self->channelz_listen_socket_.reset();
|
872
|
-
GRPC_ERROR_UNREF(error);
|
873
867
|
delete self;
|
874
868
|
}
|
875
869
|
|
@@ -912,8 +906,7 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
|
|
912
906
|
Chttp2ServerArgsModifier args_modifier,
|
913
907
|
int* port_num) {
|
914
908
|
if (addr == nullptr) {
|
915
|
-
return
|
916
|
-
"Invalid address: addr cannot be a nullptr.");
|
909
|
+
return GRPC_ERROR_CREATE("Invalid address: addr cannot be a nullptr.");
|
917
910
|
}
|
918
911
|
if (strncmp(addr, "external:", 9) == 0) {
|
919
912
|
return Chttp2ServerListener::CreateWithAcceptor(server, addr, args,
|
@@ -926,7 +919,7 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
|
|
926
919
|
absl::string_view parsed_addr_unprefixed{parsed_addr};
|
927
920
|
// Using lambda to avoid use of goto.
|
928
921
|
grpc_error_handle error = [&]() {
|
929
|
-
grpc_error_handle error
|
922
|
+
grpc_error_handle error;
|
930
923
|
if (absl::ConsumePrefix(&parsed_addr_unprefixed, kUnixUriPrefix)) {
|
931
924
|
resolved_or = grpc_resolve_unix_domain_address(parsed_addr_unprefixed);
|
932
925
|
} else if (absl::ConsumePrefix(&parsed_addr_unprefixed,
|
@@ -950,7 +943,7 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
|
|
950
943
|
int port_temp = -1;
|
951
944
|
error = Chttp2ServerListener::Create(server, &addr, args, args_modifier,
|
952
945
|
&port_temp);
|
953
|
-
if (!
|
946
|
+
if (!error.ok()) {
|
954
947
|
error_list.push_back(error);
|
955
948
|
} else {
|
956
949
|
if (*port_num == -1) {
|
@@ -964,25 +957,21 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
|
|
964
957
|
std::string msg = absl::StrFormat(
|
965
958
|
"No address added out of total %" PRIuPTR " resolved for '%s'",
|
966
959
|
resolved_or->size(), addr);
|
967
|
-
return
|
968
|
-
|
960
|
+
return GRPC_ERROR_CREATE_REFERENCING(msg.c_str(), error_list.data(),
|
961
|
+
error_list.size());
|
969
962
|
} else if (!error_list.empty()) {
|
970
963
|
std::string msg = absl::StrFormat(
|
971
964
|
"Only %" PRIuPTR " addresses added out of total %" PRIuPTR
|
972
965
|
" resolved",
|
973
966
|
resolved_or->size() - error_list.size(), resolved_or->size());
|
974
|
-
error =
|
975
|
-
|
976
|
-
gpr_log(GPR_INFO, "WARNING: %s",
|
977
|
-
GRPC_ERROR_UNREF(error);
|
967
|
+
error = GRPC_ERROR_CREATE_REFERENCING(msg.c_str(), error_list.data(),
|
968
|
+
error_list.size());
|
969
|
+
gpr_log(GPR_INFO, "WARNING: %s", StatusToString(error).c_str());
|
978
970
|
// we managed to bind some addresses: continue without error
|
979
971
|
}
|
980
|
-
return
|
972
|
+
return absl::OkStatus();
|
981
973
|
}(); // lambda end
|
982
|
-
|
983
|
-
GRPC_ERROR_UNREF(error);
|
984
|
-
}
|
985
|
-
if (!GRPC_ERROR_IS_NONE(error)) *port_num = 0;
|
974
|
+
if (!error.ok()) *port_num = 0;
|
986
975
|
return error;
|
987
976
|
}
|
988
977
|
|
@@ -992,13 +981,12 @@ ChannelArgs ModifyArgsForConnection(const ChannelArgs& args,
|
|
992
981
|
grpc_error_handle* error) {
|
993
982
|
auto* server_credentials = args.GetObject<grpc_server_credentials>();
|
994
983
|
if (server_credentials == nullptr) {
|
995
|
-
*error =
|
996
|
-
"Could not find server credentials");
|
984
|
+
*error = GRPC_ERROR_CREATE("Could not find server credentials");
|
997
985
|
return args;
|
998
986
|
}
|
999
987
|
auto security_connector = server_credentials->create_security_connector(args);
|
1000
988
|
if (security_connector == nullptr) {
|
1001
|
-
*error =
|
989
|
+
*error = GRPC_ERROR_CREATE(
|
1002
990
|
absl::StrCat("Unable to create secure server with credentials of type ",
|
1003
991
|
server_credentials->type().name()));
|
1004
992
|
return args;
|
@@ -1012,7 +1000,7 @@ ChannelArgs ModifyArgsForConnection(const ChannelArgs& args,
|
|
1012
1000
|
int grpc_server_add_http2_port(grpc_server* server, const char* addr,
|
1013
1001
|
grpc_server_credentials* creds) {
|
1014
1002
|
grpc_core::ExecCtx exec_ctx;
|
1015
|
-
grpc_error_handle err
|
1003
|
+
grpc_error_handle err;
|
1016
1004
|
grpc_core::RefCountedPtr<grpc_server_security_connector> sc;
|
1017
1005
|
int port_num = 0;
|
1018
1006
|
grpc_core::Server* core_server = grpc_core::Server::FromC(server);
|
@@ -1021,7 +1009,7 @@ int grpc_server_add_http2_port(grpc_server* server, const char* addr,
|
|
1021
1009
|
(server, addr, creds));
|
1022
1010
|
// Create security context.
|
1023
1011
|
if (creds == nullptr) {
|
1024
|
-
err =
|
1012
|
+
err = GRPC_ERROR_CREATE(
|
1025
1013
|
"No credentials specified for secure server port (creds==NULL)");
|
1026
1014
|
goto done;
|
1027
1015
|
}
|
@@ -1041,7 +1029,7 @@ int grpc_server_add_http2_port(grpc_server* server, const char* addr,
|
|
1041
1029
|
} else {
|
1042
1030
|
sc = creds->create_security_connector(grpc_core::ChannelArgs());
|
1043
1031
|
if (sc == nullptr) {
|
1044
|
-
err =
|
1032
|
+
err = GRPC_ERROR_CREATE(absl::StrCat(
|
1045
1033
|
"Unable to create secure server with credentials of type ",
|
1046
1034
|
creds->type().name()));
|
1047
1035
|
goto done;
|
@@ -1053,10 +1041,8 @@ int grpc_server_add_http2_port(grpc_server* server, const char* addr,
|
|
1053
1041
|
core_server, addr, args, grpc_core::ModifyArgsForConnection, &port_num);
|
1054
1042
|
done:
|
1055
1043
|
sc.reset(DEBUG_LOCATION, "server");
|
1056
|
-
if (!
|
1057
|
-
gpr_log(GPR_ERROR, "%s",
|
1058
|
-
|
1059
|
-
GRPC_ERROR_UNREF(err);
|
1044
|
+
if (!err.ok()) {
|
1045
|
+
gpr_log(GPR_ERROR, "%s", grpc_core::StatusToString(err).c_str());
|
1060
1046
|
}
|
1061
1047
|
return port_num;
|
1062
1048
|
}
|
@@ -1086,15 +1072,14 @@ void grpc_server_add_channel_from_fd(grpc_server* server, int fd,
|
|
1086
1072
|
);
|
1087
1073
|
grpc_error_handle error =
|
1088
1074
|
core_server->SetupTransport(transport, nullptr, server_args, nullptr);
|
1089
|
-
if (
|
1075
|
+
if (error.ok()) {
|
1090
1076
|
for (grpc_pollset* pollset : core_server->pollsets()) {
|
1091
1077
|
grpc_endpoint_add_to_pollset(server_endpoint, pollset);
|
1092
1078
|
}
|
1093
1079
|
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
|
1094
1080
|
} else {
|
1095
1081
|
gpr_log(GPR_ERROR, "Failed to create channel: %s",
|
1096
|
-
|
1097
|
-
GRPC_ERROR_UNREF(error);
|
1082
|
+
grpc_core::StatusToString(error).c_str());
|
1098
1083
|
grpc_transport_destroy(transport);
|
1099
1084
|
}
|
1100
1085
|
}
|
@@ -25,7 +25,7 @@
|
|
25
25
|
#include <grpc/support/alloc.h>
|
26
26
|
#include <grpc/support/log.h>
|
27
27
|
|
28
|
-
#include "src/core/lib/slice/
|
28
|
+
#include "src/core/lib/slice/slice.h"
|
29
29
|
|
30
30
|
static uint8_t decode_table[] = {
|
31
31
|
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
|
@@ -196,7 +196,7 @@ grpc_slice grpc_chttp2_base64_decode(const grpc_slice& input) {
|
|
196
196
|
char* s = grpc_slice_to_c_string(input);
|
197
197
|
gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s);
|
198
198
|
gpr_free(s);
|
199
|
-
|
199
|
+
grpc_core::CSliceUnref(output);
|
200
200
|
return grpc_empty_slice();
|
201
201
|
}
|
202
202
|
GPR_ASSERT(ctx.output_cur == GRPC_SLICE_END_PTR(output));
|
@@ -217,7 +217,7 @@ grpc_slice grpc_chttp2_base64_decode_with_length(const grpc_slice& input,
|
|
217
217
|
"grpc_chttp2_base64_decode_with_length has a length of %d, which "
|
218
218
|
"has a tail of 1 byte.\n",
|
219
219
|
static_cast<int>(input_length));
|
220
|
-
|
220
|
+
grpc_core::CSliceUnref(output);
|
221
221
|
return grpc_empty_slice();
|
222
222
|
}
|
223
223
|
|
@@ -229,7 +229,7 @@ grpc_slice grpc_chttp2_base64_decode_with_length(const grpc_slice& input,
|
|
229
229
|
"than the max possible output length %d.\n",
|
230
230
|
static_cast<int>(output_length),
|
231
231
|
static_cast<int>(input_length / 4 * 3 + tail_xtra[input_length % 4]));
|
232
|
-
|
232
|
+
grpc_core::CSliceUnref(output);
|
233
233
|
return grpc_empty_slice();
|
234
234
|
}
|
235
235
|
|
@@ -243,7 +243,7 @@ grpc_slice grpc_chttp2_base64_decode_with_length(const grpc_slice& input,
|
|
243
243
|
char* s = grpc_slice_to_c_string(input);
|
244
244
|
gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s);
|
245
245
|
gpr_free(s);
|
246
|
-
|
246
|
+
grpc_core::CSliceUnref(output);
|
247
247
|
return grpc_empty_slice();
|
248
248
|
}
|
249
249
|
GPR_ASSERT(ctx.output_cur == GRPC_SLICE_END_PTR(output));
|