grpc-flamingo 1.11.0 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +1150 -176
- data/etc/roots.pem +40 -196
- data/include/grpc/grpc.h +49 -8
- data/include/grpc/grpc_security.h +123 -2
- data/include/grpc/grpc_security_constants.h +6 -0
- data/include/grpc/impl/codegen/fork.h +4 -4
- data/include/grpc/impl/codegen/grpc_types.h +26 -5
- data/include/grpc/impl/codegen/log.h +112 -0
- data/include/grpc/impl/codegen/port_platform.h +55 -4
- data/include/grpc/module.modulemap +2 -0
- data/include/grpc/support/log.h +2 -80
- data/include/grpc/support/string_util.h +2 -0
- data/include/grpc/support/sync.h +0 -16
- data/src/boringssl/err_data.c +602 -588
- data/src/core/ext/{census → filters/census}/grpc_context.cc +0 -0
- data/src/core/ext/filters/client_channel/channel_connectivity.cc +1 -1
- data/src/core/ext/filters/client_channel/client_channel.cc +1234 -1070
- data/src/core/ext/filters/client_channel/client_channel.h +5 -0
- data/src/core/ext/filters/client_channel/client_channel_channelz.cc +113 -0
- data/src/core/ext/filters/client_channel/client_channel_channelz.h +71 -0
- data/src/core/ext/filters/client_channel/client_channel_plugin.cc +9 -0
- data/src/core/ext/filters/client_channel/http_connect_handshaker.cc +1 -1
- data/src/core/ext/filters/client_channel/http_proxy.cc +22 -5
- data/src/core/ext/filters/client_channel/lb_policy.cc +2 -2
- data/src/core/ext/filters/client_channel/lb_policy.h +30 -10
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +11 -9
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +120 -127
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +36 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +36 -102
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +37 -32
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +25 -22
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +4 -2
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.c +19 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/duration.pb.h +54 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.c +19 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/google/protobuf/timestamp.pb.h +54 -0
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +4 -17
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +37 -63
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +306 -239
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +444 -392
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +538 -98
- data/src/core/ext/filters/client_channel/lb_policy_factory.cc +8 -0
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +4 -0
- data/src/core/ext/filters/client_channel/method_params.h +4 -0
- data/src/core/ext/filters/client_channel/resolver.h +10 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +36 -19
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +320 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +62 -9
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +49 -294
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +537 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +112 -87
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +17 -2
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +6 -5
- data/src/core/ext/filters/{load_reporting/server_load_reporting_filter.h → client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc} +7 -8
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +29 -0
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +32 -15
- data/src/core/ext/filters/client_channel/retry_throttle.h +4 -0
- data/src/core/ext/filters/client_channel/subchannel.cc +58 -15
- data/src/core/ext/filters/client_channel/subchannel.h +11 -0
- data/src/core/ext/filters/deadline/deadline_filter.cc +18 -15
- data/src/core/ext/filters/deadline/deadline_filter.h +5 -5
- data/src/core/ext/filters/http/client/http_client_filter.cc +10 -9
- data/src/core/ext/filters/http/client_authority_filter.cc +6 -5
- data/src/core/ext/filters/http/message_compress/message_compress_filter.cc +6 -6
- data/src/core/ext/filters/http/server/http_server_filter.cc +123 -131
- data/src/core/ext/filters/http/server/http_server_filter.h +1 -1
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc +1 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +3 -2
- data/src/core/ext/transport/chttp2/transport/bin_decoder.cc +9 -8
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +97 -48
- data/src/core/ext/transport/chttp2/transport/flow_control.cc +10 -7
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +12 -8
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +4 -3
- data/src/core/ext/transport/chttp2/transport/hpack_parser.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_table.cc +2 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +14 -12
- data/src/core/ext/transport/chttp2/transport/stream_lists.cc +3 -3
- data/src/core/ext/transport/chttp2/transport/writing.cc +32 -27
- data/src/core/ext/transport/inproc/inproc_transport.cc +87 -49
- data/src/core/lib/channel/channel_args.cc +28 -0
- data/src/core/lib/channel/channel_args.h +4 -0
- data/src/core/lib/channel/channel_stack.cc +22 -29
- data/src/core/lib/channel/channel_stack.h +2 -2
- data/src/core/lib/channel/channel_stack_builder.cc +0 -3
- data/src/core/lib/channel/channel_stack_builder.h +0 -2
- data/src/core/lib/channel/channel_trace.cc +28 -63
- data/src/core/lib/channel/channel_trace.h +13 -17
- data/src/core/lib/channel/channelz.cc +153 -0
- data/src/core/lib/channel/channelz.h +133 -0
- data/src/core/lib/channel/channelz_registry.cc +145 -0
- data/src/core/lib/channel/channelz_registry.h +120 -0
- data/src/core/lib/channel/connected_channel.cc +8 -1
- data/src/core/lib/channel/handshaker.cc +71 -0
- data/src/core/lib/channel/handshaker.h +4 -0
- data/src/core/lib/debug/stats.h +7 -0
- data/src/core/lib/debug/stats_data.cc +5 -0
- data/src/core/lib/debug/stats_data.h +120 -0
- data/src/core/lib/debug/trace.cc +2 -1
- data/src/core/lib/debug/trace.h +12 -1
- data/src/core/lib/gpr/alloc.h +28 -0
- data/src/core/lib/gpr/arena.cc +38 -45
- data/src/core/lib/gpr/log.cc +8 -2
- data/src/core/lib/gpr/log_android.cc +4 -0
- data/src/core/lib/gpr/log_linux.cc +4 -0
- data/src/core/lib/gpr/log_posix.cc +4 -0
- data/src/core/lib/gpr/log_windows.cc +5 -0
- data/src/core/lib/gpr/string.cc +28 -0
- data/src/core/lib/gpr/string.h +10 -0
- data/src/core/lib/gprpp/abstract.h +5 -2
- data/src/core/lib/gprpp/fork.cc +268 -0
- data/src/core/lib/gprpp/fork.h +88 -0
- data/src/core/lib/gprpp/inlined_vector.h +87 -37
- data/src/core/lib/gprpp/memory.h +12 -0
- data/src/core/lib/gprpp/mutex_lock.h +42 -0
- data/src/core/lib/gprpp/orphanable.h +10 -12
- data/src/core/lib/gprpp/ref_counted.h +10 -12
- data/src/core/lib/gprpp/ref_counted_ptr.h +65 -8
- data/src/core/lib/gprpp/thd.h +0 -3
- data/src/core/lib/gprpp/thd_posix.cc +5 -54
- data/src/core/lib/gprpp/thd_windows.cc +0 -7
- data/src/core/lib/http/httpcli_security_connector.cc +1 -3
- data/src/core/lib/iomgr/call_combiner.cc +13 -13
- data/src/core/lib/iomgr/call_combiner.h +84 -1
- data/src/core/lib/iomgr/closure.h +6 -5
- data/src/core/lib/iomgr/combiner.cc +30 -13
- data/src/core/lib/iomgr/combiner.h +1 -1
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -2
- data/src/core/lib/iomgr/error.cc +12 -0
- data/src/core/lib/iomgr/error.h +5 -0
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +138 -51
- data/src/core/lib/iomgr/ev_epollex_linux.cc +276 -93
- data/src/core/lib/iomgr/ev_epollsig_linux.cc +58 -50
- data/src/core/lib/iomgr/ev_poll_posix.cc +163 -42
- data/src/core/lib/iomgr/ev_posix.cc +88 -24
- data/src/core/lib/iomgr/ev_posix.h +48 -12
- data/src/core/lib/iomgr/exec_ctx.cc +15 -9
- data/src/core/lib/iomgr/exec_ctx.h +48 -20
- data/src/core/lib/iomgr/executor.cc +274 -142
- data/src/core/lib/iomgr/executor.h +82 -16
- data/src/core/lib/iomgr/fork_posix.cc +42 -19
- data/src/core/lib/iomgr/iocp_windows.cc +9 -4
- data/src/core/lib/iomgr/iomgr.cc +2 -0
- data/src/core/lib/iomgr/iomgr.h +5 -0
- data/src/core/lib/iomgr/iomgr_posix.cc +2 -2
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +1 -0
- data/src/core/lib/iomgr/lockfree_event.cc +5 -1
- data/src/core/lib/iomgr/polling_entity.cc +11 -2
- data/src/core/lib/iomgr/pollset_custom.cc +2 -2
- data/src/core/lib/iomgr/port.h +51 -1
- data/src/core/lib/iomgr/resolve_address.h +1 -1
- data/src/core/lib/iomgr/resolve_address_posix.cc +4 -3
- data/src/core/lib/iomgr/resolve_address_windows.cc +3 -2
- data/src/core/lib/iomgr/resource_quota.cc +89 -12
- data/src/core/lib/iomgr/resource_quota.h +16 -0
- data/src/core/lib/iomgr/sockaddr_posix.h +1 -1
- data/src/core/lib/iomgr/socket_factory_posix.cc +1 -1
- data/src/core/lib/iomgr/socket_mutator.cc +1 -1
- data/src/core/lib/iomgr/socket_mutator.h +1 -1
- data/src/core/lib/iomgr/socket_utils.h +9 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.cc +29 -1
- data/src/core/lib/iomgr/socket_utils_linux.cc +0 -1
- data/src/core/lib/iomgr/socket_utils_posix.cc +2 -3
- data/src/core/lib/iomgr/socket_utils_posix.h +3 -0
- data/src/core/lib/iomgr/socket_utils_uv.cc +4 -0
- data/src/core/lib/iomgr/socket_utils_windows.cc +4 -0
- data/src/core/lib/iomgr/socket_windows.cc +33 -0
- data/src/core/lib/iomgr/socket_windows.h +6 -0
- data/src/core/lib/iomgr/tcp_client_custom.cc +5 -5
- data/src/core/lib/iomgr/tcp_client_posix.cc +10 -11
- data/src/core/lib/iomgr/tcp_custom.cc +11 -11
- data/src/core/lib/iomgr/tcp_posix.cc +49 -36
- data/src/core/lib/iomgr/tcp_server_custom.cc +5 -5
- data/src/core/lib/iomgr/tcp_server_posix.cc +16 -36
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +1 -1
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +17 -5
- data/src/core/lib/iomgr/tcp_server_windows.cc +1 -0
- data/src/core/lib/iomgr/tcp_uv.cc +3 -0
- data/src/core/lib/iomgr/tcp_windows.cc +18 -2
- data/src/core/lib/iomgr/tcp_windows.h +2 -0
- data/src/core/lib/iomgr/timer.h +4 -3
- data/src/core/lib/iomgr/timer_generic.cc +133 -51
- data/src/core/lib/iomgr/timer_manager.cc +12 -14
- data/src/core/lib/iomgr/timer_uv.cc +3 -0
- data/src/core/lib/iomgr/udp_server.cc +106 -52
- data/src/core/lib/iomgr/udp_server.h +8 -4
- data/src/core/lib/json/json.cc +12 -1
- data/src/core/lib/json/json.h +5 -0
- data/src/core/lib/profiling/basic_timers.cc +1 -0
- data/src/core/lib/security/context/security_context.cc +8 -8
- data/src/core/lib/security/context/security_context.h +6 -2
- data/src/core/lib/security/credentials/alts/alts_credentials.h +0 -20
- data/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +3 -2
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +7 -7
- data/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +1 -38
- data/src/core/lib/security/credentials/credentials.h +1 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +89 -115
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +16 -0
- data/src/core/lib/security/credentials/jwt/json_token.h +2 -0
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -0
- data/src/core/lib/security/credentials/local/local_credentials.cc +77 -0
- data/src/core/lib/security/credentials/local/local_credentials.h +40 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +11 -7
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +1 -1
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +17 -3
- data/src/core/lib/security/security_connector/alts_security_connector.cc +2 -1
- data/src/core/lib/security/security_connector/load_system_roots.h +29 -0
- data/src/core/lib/{gpr/fork.h → security/security_connector/load_system_roots_fallback.cc} +10 -13
- data/src/core/lib/security/security_connector/load_system_roots_linux.cc +165 -0
- data/src/core/lib/security/security_connector/load_system_roots_linux.h +44 -0
- data/src/core/lib/security/security_connector/local_security_connector.cc +245 -0
- data/src/core/lib/security/security_connector/local_security_connector.h +58 -0
- data/src/core/lib/security/security_connector/security_connector.cc +79 -32
- data/src/core/lib/security/security_connector/security_connector.h +5 -3
- data/src/core/lib/security/transport/client_auth_filter.cc +5 -5
- data/src/core/lib/security/transport/secure_endpoint.cc +2 -2
- data/src/core/lib/security/transport/security_handshaker.cc +7 -2
- data/src/core/lib/security/transport/server_auth_filter.cc +4 -7
- data/src/core/lib/security/util/json_util.cc +4 -0
- data/src/core/lib/slice/slice.cc +6 -2
- data/src/core/lib/slice/slice_buffer.cc +27 -7
- data/src/core/lib/slice/slice_hash_table.h +4 -0
- data/src/core/lib/slice/slice_weak_hash_table.h +4 -0
- data/src/core/lib/surface/call.cc +119 -58
- data/src/core/lib/surface/call.h +7 -0
- data/src/core/lib/surface/channel.cc +50 -18
- data/src/core/lib/surface/channel.h +4 -0
- data/src/core/lib/surface/completion_queue.cc +153 -18
- data/src/core/lib/surface/completion_queue.h +20 -2
- data/src/core/lib/surface/completion_queue_factory.cc +13 -4
- data/src/core/lib/surface/init.cc +7 -8
- data/src/core/lib/surface/init.h +0 -1
- data/src/core/lib/surface/server.cc +16 -0
- data/src/core/lib/surface/version.cc +1 -1
- data/src/core/lib/transport/bdp_estimator.cc +3 -3
- data/src/core/lib/transport/bdp_estimator.h +2 -2
- data/src/core/lib/transport/byte_stream.cc +1 -1
- data/src/core/lib/transport/connectivity_state.cc +6 -7
- data/src/core/lib/transport/service_config.cc +2 -2
- data/src/core/lib/transport/service_config.h +3 -3
- data/src/core/lib/transport/transport.cc +22 -10
- data/src/core/lib/transport/transport.h +18 -18
- data/src/core/lib/transport/transport_op_string.cc +1 -8
- data/src/core/plugin_registry/grpc_plugin_registry.cc +0 -4
- data/src/core/tsi/alts/crypt/aes_gcm.cc +2 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +19 -7
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.h +10 -0
- data/src/core/tsi/alts/handshaker/alts_handshaker_service_api_util.h +2 -2
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +38 -3
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +3 -0
- data/src/core/tsi/alts/handshaker/altscontext.pb.c +0 -1
- data/src/core/tsi/alts/handshaker/altscontext.pb.h +1 -2
- data/src/core/tsi/alts/handshaker/handshaker.pb.c +0 -1
- data/src/core/tsi/alts/handshaker/handshaker.pb.h +1 -2
- data/src/core/tsi/alts/handshaker/transport_security_common.pb.c +0 -1
- data/src/core/tsi/alts/handshaker/transport_security_common.pb.h +1 -1
- data/src/core/tsi/alts/handshaker/transport_security_common_api.h +2 -2
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +47 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +3 -1
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +12 -11
- data/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +7 -2
- data/src/core/tsi/fake_transport_security.cc +1 -0
- data/src/core/tsi/grpc_shadow_boringssl.h +3006 -0
- data/src/core/tsi/local_transport_security.cc +209 -0
- data/src/core/tsi/local_transport_security.h +51 -0
- data/src/core/tsi/ssl/session_cache/ssl_session.h +2 -0
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +5 -5
- data/src/core/tsi/ssl/session_cache/ssl_session_cache.h +6 -0
- data/src/core/tsi/ssl_transport_security.cc +245 -116
- data/src/core/tsi/ssl_types.h +2 -0
- data/src/core/tsi/transport_security.cc +14 -0
- data/src/core/tsi/transport_security.h +2 -0
- data/src/core/tsi/transport_security_interface.h +11 -1
- data/src/ruby/bin/math_client.rb +17 -9
- data/src/ruby/ext/grpc/extconf.rb +1 -26
- data/src/ruby/ext/grpc/rb_channel_credentials.c +3 -3
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +42 -16
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +65 -26
- data/src/ruby/lib/grpc/generic/active_call.rb +19 -23
- data/src/ruby/lib/grpc/generic/rpc_server.rb +2 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +7 -1
- data/src/ruby/pb/grpc/health/v1/health_services_pb.rb +4 -1
- data/src/ruby/spec/call_credentials_spec.rb +1 -1
- data/src/ruby/spec/call_spec.rb +1 -1
- data/src/ruby/spec/channel_credentials_spec.rb +1 -1
- data/src/ruby/spec/channel_spec.rb +1 -1
- data/src/ruby/spec/client_auth_spec.rb +1 -12
- data/src/ruby/spec/client_server_spec.rb +1 -1
- data/src/ruby/spec/compression_options_spec.rb +1 -1
- data/src/ruby/spec/error_sanity_spec.rb +1 -1
- data/src/ruby/spec/generic/client_stub_spec.rb +16 -4
- data/src/ruby/spec/generic/rpc_desc_spec.rb +1 -1
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +1 -1
- data/src/ruby/spec/generic/service_spec.rb +1 -1
- data/src/ruby/spec/google_rpc_status_utils_spec.rb +1 -12
- data/src/ruby/spec/pb/duplicate/codegen_spec.rb +1 -0
- data/src/ruby/spec/pb/health/checker_spec.rb +1 -1
- data/src/ruby/spec/server_credentials_spec.rb +1 -1
- data/src/ruby/spec/server_spec.rb +1 -1
- data/src/ruby/spec/spec_helper.rb +1 -0
- data/src/ruby/spec/support/services.rb +1 -1
- data/src/ruby/spec/time_consts_spec.rb +1 -1
- data/third_party/address_sorting/address_sorting.c +17 -11
- data/third_party/address_sorting/address_sorting_windows.c +43 -3
- data/third_party/address_sorting/include/address_sorting/address_sorting.h +3 -0
- data/third_party/boringssl/crypto/asn1/a_int.c +33 -28
- data/third_party/boringssl/crypto/asn1/a_mbstr.c +24 -22
- data/third_party/boringssl/crypto/asn1/a_utf8.c +13 -11
- data/third_party/boringssl/crypto/asn1/asn1_locl.h +3 -0
- data/third_party/boringssl/crypto/asn1/tasn_dec.c +40 -19
- data/third_party/boringssl/crypto/bio/fd.c +1 -0
- data/third_party/boringssl/crypto/bio/file.c +2 -0
- data/third_party/boringssl/crypto/bn_extra/convert.c +6 -5
- data/third_party/boringssl/crypto/bytestring/ber.c +1 -4
- data/third_party/boringssl/crypto/bytestring/cbb.c +116 -16
- data/third_party/boringssl/crypto/bytestring/cbs.c +151 -20
- data/third_party/boringssl/crypto/cipher_extra/e_aesccm.c +203 -0
- data/third_party/boringssl/crypto/cipher_extra/e_rc2.c +2 -0
- data/third_party/boringssl/crypto/cipher_extra/e_tls.c +1 -2
- data/third_party/boringssl/crypto/cpu-aarch64-fuchsia.c +55 -0
- data/third_party/boringssl/crypto/cpu-aarch64-linux.c +2 -1
- data/third_party/boringssl/crypto/dsa/dsa.c +16 -54
- data/third_party/boringssl/crypto/ec_extra/ec_asn1.c +9 -10
- data/third_party/boringssl/crypto/ecdh/ecdh.c +4 -3
- data/third_party/boringssl/crypto/fipsmodule/bcm.c +11 -542
- data/third_party/boringssl/crypto/fipsmodule/bn/add.c +57 -112
- data/third_party/boringssl/crypto/fipsmodule/bn/asm/x86_64-gcc.c +4 -3
- data/third_party/boringssl/crypto/fipsmodule/bn/bn.c +128 -70
- data/third_party/boringssl/crypto/fipsmodule/bn/bytes.c +32 -71
- data/third_party/boringssl/crypto/fipsmodule/bn/cmp.c +64 -118
- data/third_party/boringssl/crypto/fipsmodule/bn/div.c +284 -122
- data/third_party/boringssl/crypto/fipsmodule/bn/exponentiation.c +31 -65
- data/third_party/boringssl/crypto/fipsmodule/bn/gcd.c +274 -218
- data/third_party/boringssl/crypto/fipsmodule/bn/generic.c +2 -1
- data/third_party/boringssl/crypto/fipsmodule/bn/internal.h +187 -27
- data/third_party/boringssl/crypto/fipsmodule/bn/jacobi.c +1 -1
- data/third_party/boringssl/crypto/fipsmodule/bn/montgomery.c +124 -81
- data/third_party/boringssl/crypto/fipsmodule/bn/montgomery_inv.c +8 -30
- data/third_party/boringssl/crypto/fipsmodule/bn/mul.c +321 -347
- data/third_party/boringssl/crypto/fipsmodule/bn/prime.c +326 -66
- data/third_party/boringssl/crypto/fipsmodule/bn/random.c +77 -25
- data/third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.c +199 -222
- data/third_party/boringssl/crypto/fipsmodule/bn/rsaz_exp.h +27 -47
- data/third_party/boringssl/crypto/fipsmodule/bn/shift.c +155 -96
- data/third_party/boringssl/crypto/fipsmodule/bn/sqrt.c +1 -1
- data/third_party/boringssl/crypto/fipsmodule/cipher/e_aes.c +10 -10
- data/third_party/boringssl/crypto/fipsmodule/des/internal.h +2 -0
- data/third_party/boringssl/crypto/fipsmodule/ec/ec.c +78 -47
- data/third_party/boringssl/crypto/fipsmodule/ec/ec_key.c +99 -163
- data/third_party/boringssl/crypto/fipsmodule/ec/ec_montgomery.c +3 -10
- data/third_party/boringssl/crypto/fipsmodule/ec/internal.h +44 -23
- data/third_party/boringssl/crypto/fipsmodule/ec/oct.c +59 -90
- data/third_party/boringssl/crypto/fipsmodule/ec/p224-64.c +38 -65
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64-table.h +5378 -5418
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.c +17 -26
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-x86_64.h +15 -11
- data/third_party/boringssl/crypto/fipsmodule/ec/simple.c +45 -51
- data/third_party/boringssl/crypto/fipsmodule/ec/{util-64.c → util.c} +0 -5
- data/third_party/boringssl/crypto/fipsmodule/ec/wnaf.c +144 -264
- data/third_party/boringssl/crypto/fipsmodule/ecdsa/ecdsa.c +78 -62
- data/third_party/boringssl/crypto/fipsmodule/modes/ccm.c +256 -0
- data/third_party/boringssl/crypto/fipsmodule/modes/internal.h +36 -32
- data/third_party/boringssl/crypto/fipsmodule/rand/ctrdrbg.c +9 -7
- data/third_party/boringssl/crypto/fipsmodule/rsa/blinding.c +16 -40
- data/third_party/boringssl/crypto/fipsmodule/rsa/internal.h +1 -6
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa.c +57 -39
- data/third_party/boringssl/crypto/fipsmodule/rsa/rsa_impl.c +309 -142
- data/third_party/boringssl/crypto/fipsmodule/self_check/self_check.c +581 -0
- data/third_party/boringssl/crypto/fipsmodule/tls/internal.h +39 -0
- data/third_party/boringssl/crypto/fipsmodule/tls/kdf.c +165 -0
- data/third_party/boringssl/crypto/internal.h +65 -2
- data/third_party/boringssl/crypto/mem.c +0 -2
- data/third_party/boringssl/crypto/obj/obj.c +6 -73
- data/third_party/boringssl/crypto/thread_pthread.c +35 -5
- data/third_party/boringssl/crypto/x509/a_strex.c +11 -11
- data/third_party/boringssl/crypto/x509/vpm_int.h +1 -0
- data/third_party/boringssl/crypto/x509/x509_vfy.c +4 -0
- data/third_party/boringssl/crypto/x509/x509_vpm.c +44 -22
- data/third_party/boringssl/crypto/x509/x_name.c +13 -0
- data/third_party/boringssl/include/openssl/aead.h +10 -0
- data/third_party/boringssl/include/openssl/asn1.h +2 -3
- data/third_party/boringssl/include/openssl/base.h +5 -14
- data/third_party/boringssl/include/openssl/bio.h +1 -1
- data/third_party/boringssl/include/openssl/bn.h +62 -18
- data/third_party/boringssl/include/openssl/bytestring.h +53 -28
- data/third_party/boringssl/include/openssl/crypto.h +4 -0
- data/third_party/boringssl/include/openssl/ec.h +10 -4
- data/third_party/boringssl/include/openssl/ec_key.h +7 -6
- data/third_party/boringssl/include/openssl/err.h +9 -9
- data/third_party/boringssl/include/openssl/evp.h +1 -1
- data/third_party/boringssl/include/openssl/rsa.h +35 -10
- data/third_party/boringssl/include/openssl/ssl.h +167 -19
- data/third_party/boringssl/include/openssl/ssl3.h +0 -1
- data/third_party/boringssl/include/openssl/stack.h +1 -1
- data/third_party/boringssl/include/openssl/tls1.h +10 -2
- data/third_party/boringssl/include/openssl/x509.h +4 -0
- data/third_party/boringssl/include/openssl/x509v3.h +1 -0
- data/third_party/boringssl/ssl/d1_both.cc +16 -2
- data/third_party/boringssl/ssl/dtls_method.cc +1 -1
- data/third_party/boringssl/ssl/handoff.cc +285 -0
- data/third_party/boringssl/ssl/handshake.cc +26 -12
- data/third_party/boringssl/ssl/handshake_client.cc +101 -95
- data/third_party/boringssl/ssl/handshake_server.cc +14 -2
- data/third_party/boringssl/ssl/internal.h +132 -79
- data/third_party/boringssl/ssl/s3_both.cc +2 -2
- data/third_party/boringssl/ssl/s3_lib.cc +3 -1
- data/third_party/boringssl/ssl/s3_pkt.cc +0 -18
- data/third_party/boringssl/ssl/ssl_aead_ctx.cc +1 -4
- data/third_party/boringssl/ssl/ssl_asn1.cc +47 -43
- data/third_party/boringssl/ssl/ssl_cipher.cc +12 -8
- data/third_party/boringssl/ssl/ssl_key_share.cc +3 -1
- data/third_party/boringssl/ssl/ssl_lib.cc +83 -14
- data/third_party/boringssl/ssl/ssl_privkey.cc +6 -0
- data/third_party/boringssl/ssl/ssl_stat.cc +6 -6
- data/third_party/boringssl/ssl/ssl_versions.cc +12 -85
- data/third_party/boringssl/ssl/ssl_x509.cc +59 -61
- data/third_party/boringssl/ssl/t1_enc.cc +73 -124
- data/third_party/boringssl/ssl/t1_lib.cc +367 -41
- data/third_party/boringssl/ssl/tls13_both.cc +8 -0
- data/third_party/boringssl/ssl/tls13_client.cc +98 -184
- data/third_party/boringssl/ssl/tls13_enc.cc +88 -158
- data/third_party/boringssl/ssl/tls13_server.cc +91 -137
- data/third_party/boringssl/ssl/tls_method.cc +0 -17
- data/third_party/boringssl/ssl/tls_record.cc +1 -10
- data/third_party/boringssl/third_party/fiat/curve25519.c +921 -2753
- data/third_party/boringssl/third_party/fiat/curve25519_tables.h +7880 -0
- data/third_party/boringssl/third_party/fiat/internal.h +32 -20
- data/third_party/boringssl/third_party/fiat/p256.c +1824 -0
- metadata +86 -71
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.cc +0 -253
- data/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +0 -222
- data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc +0 -71
- data/src/core/ext/filters/load_reporting/server_load_reporting_plugin.h +0 -61
- data/src/core/lib/channel/channel_trace_registry.cc +0 -80
- data/src/core/lib/channel/channel_trace_registry.h +0 -43
- data/src/core/lib/gpr/fork.cc +0 -78
- data/src/core/tsi/transport_security_adapter.cc +0 -235
- data/src/core/tsi/transport_security_adapter.h +0 -41
- data/src/ruby/bin/apis/google/protobuf/empty.rb +0 -29
- data/src/ruby/bin/apis/pubsub_demo.rb +0 -241
- data/src/ruby/bin/apis/tech/pubsub/proto/pubsub.rb +0 -159
- data/src/ruby/bin/apis/tech/pubsub/proto/pubsub_services.rb +0 -88
- data/src/ruby/pb/test/client.rb +0 -764
- data/src/ruby/pb/test/server.rb +0 -252
- data/src/ruby/spec/pb/package_with_underscore/checker_spec.rb +0 -54
- data/src/ruby/spec/pb/package_with_underscore/data.proto +0 -23
- data/src/ruby/spec/pb/package_with_underscore/service.proto +0 -23
- data/third_party/boringssl/crypto/curve25519/x25519-x86_64.c +0 -247
- data/third_party/boringssl/crypto/fipsmodule/ec/p256-64.c +0 -1674
@@ -40,6 +40,7 @@ namespace chttp2 {
|
|
40
40
|
namespace {
|
41
41
|
|
42
42
|
static constexpr const int kTracePadding = 30;
|
43
|
+
static constexpr const uint32_t kMaxWindowUpdateSize = (1u << 31) - 1;
|
43
44
|
|
44
45
|
static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
|
45
46
|
char* str;
|
@@ -55,7 +56,7 @@ static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
|
|
55
56
|
|
56
57
|
static char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
|
57
58
|
char* str;
|
58
|
-
if (
|
59
|
+
if (old_val != new_val) {
|
59
60
|
gpr_asprintf(&str, "%" PRIu32 " -> %" PRIu32 "", old_val, new_val);
|
60
61
|
} else {
|
61
62
|
gpr_asprintf(&str, "%" PRIu32 "", old_val);
|
@@ -98,10 +99,12 @@ void FlowControlTrace::Finish() {
|
|
98
99
|
if (sfc_ != nullptr) {
|
99
100
|
srw_str = fmt_int64_diff_str(remote_window_delta_ + remote_window,
|
100
101
|
sfc_->remote_window_delta() + remote_window);
|
101
|
-
slw_str =
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
slw_str =
|
103
|
+
fmt_int64_diff_str(local_window_delta_ + acked_local_window,
|
104
|
+
sfc_->local_window_delta() + acked_local_window);
|
105
|
+
saw_str =
|
106
|
+
fmt_int64_diff_str(announced_window_delta_ + acked_local_window,
|
107
|
+
sfc_->announced_window_delta() + acked_local_window);
|
105
108
|
} else {
|
106
109
|
srw_str = gpr_leftpad("", ' ', kTracePadding);
|
107
110
|
slw_str = gpr_leftpad("", ' ', kTracePadding);
|
@@ -191,7 +194,7 @@ uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
|
|
191
194
|
if ((writing_anyway || announced_window_ <= target_announced_window / 2) &&
|
192
195
|
announced_window_ != target_announced_window) {
|
193
196
|
const uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
|
194
|
-
target_announced_window - announced_window_, 0,
|
197
|
+
target_announced_window - announced_window_, 0, kMaxWindowUpdateSize);
|
195
198
|
announced_window_ += announce;
|
196
199
|
return announce;
|
197
200
|
}
|
@@ -265,7 +268,7 @@ uint32_t StreamFlowControl::MaybeSendUpdate() {
|
|
265
268
|
FlowControlTrace trace("s updt sent", tfc_, this);
|
266
269
|
if (local_window_delta_ > announced_window_delta_) {
|
267
270
|
uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
|
268
|
-
local_window_delta_ - announced_window_delta_, 0,
|
271
|
+
local_window_delta_ - announced_window_delta_, 0, kMaxWindowUpdateSize);
|
269
272
|
UpdateAnnouncedWindowDelta(tfc_, announce);
|
270
273
|
return announce;
|
271
274
|
}
|
@@ -217,14 +217,14 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
|
|
217
217
|
t->initial_window_update += static_cast<int64_t>(parser->value) -
|
218
218
|
parser->incoming_settings[id];
|
219
219
|
if (grpc_http_trace.enabled() || grpc_flowctl_trace.enabled()) {
|
220
|
-
gpr_log(
|
221
|
-
t
|
220
|
+
gpr_log(GPR_INFO, "%p[%s] adding %d for initial_window change", t,
|
221
|
+
t->is_client ? "cli" : "svr",
|
222
222
|
static_cast<int>(t->initial_window_update));
|
223
223
|
}
|
224
224
|
}
|
225
225
|
parser->incoming_settings[id] = parser->value;
|
226
226
|
if (grpc_http_trace.enabled()) {
|
227
|
-
gpr_log(
|
227
|
+
gpr_log(GPR_INFO, "CHTTP2:%s:%s: got setting %s = %d",
|
228
228
|
t->is_client ? "CLI" : "SVR", t->peer_string, sp->name,
|
229
229
|
parser->value);
|
230
230
|
}
|
@@ -41,14 +41,18 @@
|
|
41
41
|
#include "src/core/lib/transport/static_metadata.h"
|
42
42
|
#include "src/core/lib/transport/timeout_encoding.h"
|
43
43
|
|
44
|
-
#define
|
45
|
-
#define
|
46
|
-
#define
|
47
|
-
|
44
|
+
#define HASH_FRAGMENT_MASK (GRPC_CHTTP2_HPACKC_NUM_VALUES - 1)
|
45
|
+
#define HASH_FRAGMENT_1(x) ((x)&HASH_FRAGMENT_MASK)
|
46
|
+
#define HASH_FRAGMENT_2(x) \
|
47
|
+
(((x) >> GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS) & HASH_FRAGMENT_MASK)
|
48
|
+
#define HASH_FRAGMENT_3(x) \
|
49
|
+
(((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 2)) & HASH_FRAGMENT_MASK)
|
50
|
+
#define HASH_FRAGMENT_4(x) \
|
51
|
+
(((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 3)) & HASH_FRAGMENT_MASK)
|
48
52
|
|
49
53
|
/* if the probability of this item being seen again is < 1/x then don't add
|
50
54
|
it to the table */
|
51
|
-
#define ONE_ON_ADD_PROBABILITY
|
55
|
+
#define ONE_ON_ADD_PROBABILITY (GRPC_CHTTP2_HPACKC_NUM_VALUES >> 1)
|
52
56
|
/* don't consider adding anything bigger than this to the hpack table */
|
53
57
|
#define MAX_DECODER_SPACE_USAGE 512
|
54
58
|
|
@@ -135,7 +139,7 @@ static void inc_filter(uint8_t idx, uint32_t* sum, uint8_t* elems) {
|
|
135
139
|
} else {
|
136
140
|
int i;
|
137
141
|
*sum = 0;
|
138
|
-
for (i = 0; i <
|
142
|
+
for (i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) {
|
139
143
|
elems[i] /= 2;
|
140
144
|
(*sum) += elems[i];
|
141
145
|
}
|
@@ -470,7 +474,7 @@ static void hpack_enc(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
|
|
470
474
|
v = grpc_slice_to_c_string(GRPC_MDVALUE(elem));
|
471
475
|
}
|
472
476
|
gpr_log(
|
473
|
-
|
477
|
+
GPR_INFO,
|
474
478
|
"Encode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
|
475
479
|
k, v, GRPC_MDELEM_IS_INTERNED(elem), GRPC_MDELEM_STORAGE(elem),
|
476
480
|
grpc_slice_is_interned(GRPC_MDKEY(elem)),
|
@@ -654,7 +658,7 @@ void grpc_chttp2_hpack_compressor_set_max_table_size(
|
|
654
658
|
}
|
655
659
|
c->advertise_table_size_change = 1;
|
656
660
|
if (grpc_http_trace.enabled()) {
|
657
|
-
gpr_log(
|
661
|
+
gpr_log(GPR_INFO, "set max table size from encoder to %d", max_table_size);
|
658
662
|
}
|
659
663
|
}
|
660
664
|
|
@@ -28,8 +28,9 @@
|
|
28
28
|
#include "src/core/lib/transport/metadata_batch.h"
|
29
29
|
#include "src/core/lib/transport/transport.h"
|
30
30
|
|
31
|
-
|
32
|
-
#define
|
31
|
+
// This should be <= 8. We use 6 to save space.
|
32
|
+
#define GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS 6
|
33
|
+
#define GRPC_CHTTP2_HPACKC_NUM_VALUES (1 << GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS)
|
33
34
|
/* initial table size, per spec */
|
34
35
|
#define GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE 4096
|
35
36
|
/* maximum table size we'll actually use */
|
@@ -58,7 +59,7 @@ typedef struct {
|
|
58
59
|
a new literal should be added to the compression table or not.
|
59
60
|
They track a single integer that counts how often a particular value has
|
60
61
|
been seen. When that count reaches max (255), all values are halved. */
|
61
|
-
uint8_t filter_elems[
|
62
|
+
uint8_t filter_elems[GRPC_CHTTP2_HPACKC_NUM_VALUES];
|
62
63
|
|
63
64
|
/* entry tables for keys & elems: these tables track values that have been
|
64
65
|
seen and *may* be in the decompressor table */
|
@@ -633,7 +633,7 @@ static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md,
|
|
633
633
|
v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
|
634
634
|
}
|
635
635
|
gpr_log(
|
636
|
-
|
636
|
+
GPR_INFO,
|
637
637
|
"Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
|
638
638
|
k, v, GRPC_MDELEM_IS_INTERNED(md), GRPC_MDELEM_STORAGE(md),
|
639
639
|
grpc_slice_is_interned(GRPC_MDKEY(md)),
|
@@ -1622,7 +1622,7 @@ grpc_error* grpc_chttp2_header_parser_parse(void* hpack_parser,
|
|
1622
1622
|
grpc_chttp2_transport* t,
|
1623
1623
|
grpc_chttp2_stream* s,
|
1624
1624
|
grpc_slice slice, int is_last) {
|
1625
|
-
GPR_TIMER_SCOPE("
|
1625
|
+
GPR_TIMER_SCOPE("grpc_chttp2_header_parser_parse", 0);
|
1626
1626
|
grpc_chttp2_hpack_parser* parser =
|
1627
1627
|
static_cast<grpc_chttp2_hpack_parser*>(hpack_parser);
|
1628
1628
|
if (s != nullptr) {
|
@@ -247,7 +247,7 @@ void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl* tbl,
|
|
247
247
|
return;
|
248
248
|
}
|
249
249
|
if (grpc_http_trace.enabled()) {
|
250
|
-
gpr_log(
|
250
|
+
gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes);
|
251
251
|
}
|
252
252
|
while (tbl->mem_used > max_bytes) {
|
253
253
|
evict1(tbl);
|
@@ -270,7 +270,7 @@ grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_chttp2_hptbl* tbl,
|
|
270
270
|
return err;
|
271
271
|
}
|
272
272
|
if (grpc_http_trace.enabled()) {
|
273
|
-
gpr_log(
|
273
|
+
gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes);
|
274
274
|
}
|
275
275
|
while (tbl->mem_used > bytes) {
|
276
276
|
evict1(tbl);
|
@@ -422,7 +422,8 @@ static void on_initial_header(void* tp, grpc_mdelem md) {
|
|
422
422
|
if (cached_timeout != nullptr) {
|
423
423
|
timeout = *cached_timeout;
|
424
424
|
} else {
|
425
|
-
if (
|
425
|
+
if (GPR_UNLIKELY(
|
426
|
+
!grpc_http2_decode_timeout(GRPC_MDVALUE(md), &timeout))) {
|
426
427
|
char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
|
427
428
|
gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'", val);
|
428
429
|
gpr_free(val);
|
@@ -550,15 +551,15 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
|
|
550
551
|
/* could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream */
|
551
552
|
s = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
|
552
553
|
if (s == nullptr) {
|
553
|
-
if (is_continuation) {
|
554
|
+
if (GPR_UNLIKELY(is_continuation)) {
|
554
555
|
GRPC_CHTTP2_IF_TRACING(
|
555
556
|
gpr_log(GPR_ERROR,
|
556
557
|
"grpc_chttp2_stream disbanded before CONTINUATION received"));
|
557
558
|
return init_skip_frame_parser(t, 1);
|
558
559
|
}
|
559
560
|
if (t->is_client) {
|
560
|
-
if ((t->incoming_stream_id & 1) &&
|
561
|
-
|
561
|
+
if (GPR_LIKELY((t->incoming_stream_id & 1) &&
|
562
|
+
t->incoming_stream_id < t->next_stream_id)) {
|
562
563
|
/* this is an old (probably cancelled) grpc_chttp2_stream */
|
563
564
|
} else {
|
564
565
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
@@ -569,7 +570,7 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
|
|
569
570
|
grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
|
570
571
|
}
|
571
572
|
return err;
|
572
|
-
} else if (t->last_new_stream_id >= t->incoming_stream_id) {
|
573
|
+
} else if (GPR_UNLIKELY(t->last_new_stream_id >= t->incoming_stream_id)) {
|
573
574
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
574
575
|
GPR_ERROR,
|
575
576
|
"ignoring out of order new grpc_chttp2_stream request on server; "
|
@@ -577,21 +578,22 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
|
|
577
578
|
"id=%d, new grpc_chttp2_stream id=%d",
|
578
579
|
t->last_new_stream_id, t->incoming_stream_id));
|
579
580
|
return init_skip_frame_parser(t, 1);
|
580
|
-
} else if ((t->incoming_stream_id & 1) == 0) {
|
581
|
+
} else if (GPR_UNLIKELY((t->incoming_stream_id & 1) == 0)) {
|
581
582
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
582
583
|
GPR_ERROR,
|
583
584
|
"ignoring grpc_chttp2_stream with non-client generated index %d",
|
584
585
|
t->incoming_stream_id));
|
585
586
|
return init_skip_frame_parser(t, 1);
|
586
|
-
} else if (
|
587
|
-
|
588
|
-
|
587
|
+
} else if (GPR_UNLIKELY(
|
588
|
+
grpc_chttp2_stream_map_size(&t->stream_map) >=
|
589
|
+
t->settings[GRPC_ACKED_SETTINGS]
|
590
|
+
[GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS])) {
|
589
591
|
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Max stream count exceeded");
|
590
592
|
}
|
591
593
|
t->last_new_stream_id = t->incoming_stream_id;
|
592
594
|
s = t->incoming_stream =
|
593
595
|
grpc_chttp2_parsing_accept_stream(t, t->incoming_stream_id);
|
594
|
-
if (s == nullptr) {
|
596
|
+
if (GPR_UNLIKELY(s == nullptr)) {
|
595
597
|
GRPC_CHTTP2_IF_TRACING(
|
596
598
|
gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted"));
|
597
599
|
return init_skip_frame_parser(t, 1);
|
@@ -601,7 +603,7 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
|
|
601
603
|
}
|
602
604
|
GPR_ASSERT(s != nullptr);
|
603
605
|
s->stats.incoming.framing_bytes += 9;
|
604
|
-
if (s->read_closed) {
|
606
|
+
if (GPR_UNLIKELY(s->read_closed)) {
|
605
607
|
GRPC_CHTTP2_IF_TRACING(gpr_log(
|
606
608
|
GPR_ERROR, "skipping already closed grpc_chttp2_stream header"));
|
607
609
|
t->incoming_stream = nullptr;
|
@@ -723,7 +725,7 @@ static grpc_error* parse_frame_slice(grpc_chttp2_transport* t, grpc_slice slice,
|
|
723
725
|
int is_last) {
|
724
726
|
grpc_chttp2_stream* s = t->incoming_stream;
|
725
727
|
grpc_error* err = t->parser(t->parser_data, t, s, slice, is_last);
|
726
|
-
if (err == GRPC_ERROR_NONE) {
|
728
|
+
if (GPR_LIKELY(err == GRPC_ERROR_NONE)) {
|
727
729
|
return err;
|
728
730
|
} else if (grpc_error_get_int(err, GRPC_ERROR_INT_STREAM_ID, nullptr)) {
|
729
731
|
if (grpc_http_trace.enabled()) {
|
@@ -68,7 +68,7 @@ static bool stream_list_pop(grpc_chttp2_transport* t,
|
|
68
68
|
}
|
69
69
|
*stream = s;
|
70
70
|
if (s && grpc_trace_http2_stream_state.enabled()) {
|
71
|
-
gpr_log(
|
71
|
+
gpr_log(GPR_INFO, "%p[%d][%s]: pop from %s", t, s->id,
|
72
72
|
t->is_client ? "cli" : "svr", stream_list_id_string(id));
|
73
73
|
}
|
74
74
|
return s != nullptr;
|
@@ -90,7 +90,7 @@ static void stream_list_remove(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
90
90
|
t->lists[id].tail = s->links[id].prev;
|
91
91
|
}
|
92
92
|
if (grpc_trace_http2_stream_state.enabled()) {
|
93
|
-
gpr_log(
|
93
|
+
gpr_log(GPR_INFO, "%p[%d][%s]: remove from %s", t, s->id,
|
94
94
|
t->is_client ? "cli" : "svr", stream_list_id_string(id));
|
95
95
|
}
|
96
96
|
}
|
@@ -122,7 +122,7 @@ static void stream_list_add_tail(grpc_chttp2_transport* t,
|
|
122
122
|
t->lists[id].tail = s;
|
123
123
|
s->included[id] = 1;
|
124
124
|
if (grpc_trace_http2_stream_state.enabled()) {
|
125
|
-
gpr_log(
|
125
|
+
gpr_log(GPR_INFO, "%p[%d][%s]: add to %s", t, s->id,
|
126
126
|
t->is_client ? "cli" : "svr", stream_list_id_string(id));
|
127
127
|
}
|
128
128
|
}
|
@@ -52,7 +52,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
|
|
52
52
|
if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) {
|
53
53
|
/* ping already in-flight: wait */
|
54
54
|
if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {
|
55
|
-
gpr_log(
|
55
|
+
gpr_log(GPR_INFO, "%s: Ping delayed [%p]: already pinging",
|
56
56
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string);
|
57
57
|
}
|
58
58
|
return;
|
@@ -61,7 +61,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
|
|
61
61
|
t->ping_policy.max_pings_without_data != 0) {
|
62
62
|
/* need to receive something of substance before sending a ping again */
|
63
63
|
if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {
|
64
|
-
gpr_log(
|
64
|
+
gpr_log(GPR_INFO, "%s: Ping delayed [%p]: too many recent pings: %d/%d",
|
65
65
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string,
|
66
66
|
t->ping_state.pings_before_data_required,
|
67
67
|
t->ping_policy.max_pings_without_data);
|
@@ -81,7 +81,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
|
|
81
81
|
if (next_allowed_ping > now) {
|
82
82
|
/* not enough elapsed time between successive pings */
|
83
83
|
if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {
|
84
|
-
gpr_log(
|
84
|
+
gpr_log(GPR_INFO,
|
85
85
|
"%s: Ping delayed [%p]: not enough time elapsed since last ping. "
|
86
86
|
" Last ping %f: Next ping %f: Now %f",
|
87
87
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string,
|
@@ -107,7 +107,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
|
|
107
107
|
GRPC_STATS_INC_HTTP2_PINGS_SENT();
|
108
108
|
t->ping_state.last_ping_sent_time = now;
|
109
109
|
if (grpc_http_trace.enabled() || grpc_bdp_estimator_trace.enabled()) {
|
110
|
-
gpr_log(
|
110
|
+
gpr_log(GPR_INFO, "%s: Ping sent [%p]: %d/%d",
|
111
111
|
t->is_client ? "CLIENT" : "SERVER", t->peer_string,
|
112
112
|
t->ping_state.pings_before_data_required,
|
113
113
|
t->ping_policy.max_pings_without_data);
|
@@ -139,22 +139,27 @@ static bool update_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
|
139
139
|
|
140
140
|
static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
|
141
141
|
const char* staller) {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
142
|
+
if (grpc_flowctl_trace.enabled()) {
|
143
|
+
gpr_log(
|
144
|
+
GPR_DEBUG,
|
145
|
+
"%s:%p stream %d moved to stalled list by %s. This is FULLY expected "
|
146
|
+
"to happen in a healthy program that is not seeing flow control stalls."
|
147
|
+
" However, if you know that there are unwanted stalls, here is some "
|
148
|
+
"helpful data: [fc:pending=%" PRIdPTR ":pending-compressed=%" PRIdPTR
|
149
|
+
":flowed=%" PRId64 ":peer_initwin=%d:t_win=%" PRId64
|
150
|
+
":s_win=%d:s_delta=%" PRId64 "]",
|
151
|
+
t->peer_string, t, s->id, staller, s->flow_controlled_buffer.length,
|
152
|
+
s->compressed_data_buffer.length, s->flow_controlled_bytes_flowed,
|
153
|
+
t->settings[GRPC_ACKED_SETTINGS]
|
154
|
+
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
|
155
|
+
t->flow_control->remote_window(),
|
156
|
+
static_cast<uint32_t> GPR_MAX(
|
157
|
+
0,
|
158
|
+
s->flow_control->remote_window_delta() +
|
159
|
+
(int64_t)t->settings[GRPC_PEER_SETTINGS]
|
160
|
+
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]),
|
161
|
+
s->flow_control->remote_window_delta());
|
162
|
+
}
|
158
163
|
}
|
159
164
|
|
160
165
|
static bool stream_ref_if_not_destroyed(gpr_refcount* r) {
|
@@ -337,10 +342,10 @@ class DataSendContext {
|
|
337
342
|
s_->fetching_send_message == nullptr);
|
338
343
|
if (is_last_data_frame && s_->send_trailing_metadata != nullptr &&
|
339
344
|
s_->stream_compression_ctx != nullptr) {
|
340
|
-
if (!grpc_stream_compress(
|
345
|
+
if (GPR_UNLIKELY(!grpc_stream_compress(
|
341
346
|
s_->stream_compression_ctx, &s_->flow_controlled_buffer,
|
342
347
|
&s_->compressed_data_buffer, nullptr, MAX_SIZE_T,
|
343
|
-
GRPC_STREAM_COMPRESSION_FLUSH_FINISH)) {
|
348
|
+
GRPC_STREAM_COMPRESSION_FLUSH_FINISH))) {
|
344
349
|
gpr_log(GPR_ERROR, "Stream compression failed.");
|
345
350
|
}
|
346
351
|
grpc_stream_compression_context_destroy(s_->stream_compression_ctx);
|
@@ -368,10 +373,10 @@ class DataSendContext {
|
|
368
373
|
grpc_stream_compression_context_create(s_->stream_compression_method);
|
369
374
|
}
|
370
375
|
s_->uncompressed_data_size = s_->flow_controlled_buffer.length;
|
371
|
-
if (!grpc_stream_compress(
|
372
|
-
|
373
|
-
|
374
|
-
|
376
|
+
if (GPR_UNLIKELY(!grpc_stream_compress(
|
377
|
+
s_->stream_compression_ctx, &s_->flow_controlled_buffer,
|
378
|
+
&s_->compressed_data_buffer, nullptr, MAX_SIZE_T,
|
379
|
+
GRPC_STREAM_COMPRESSION_FLUSH_SYNC))) {
|
375
380
|
gpr_log(GPR_ERROR, "Stream compression failed.");
|
376
381
|
}
|
377
382
|
}
|
@@ -401,7 +406,7 @@ class StreamWriteContext {
|
|
401
406
|
StreamWriteContext(WriteContext* write_context, grpc_chttp2_stream* s)
|
402
407
|
: write_context_(write_context), t_(write_context->transport()), s_(s) {
|
403
408
|
GRPC_CHTTP2_IF_TRACING(
|
404
|
-
gpr_log(
|
409
|
+
gpr_log(GPR_INFO, "W:%p %s[%d] im-(sent,send)=(%d,%d) announce=%d", t_,
|
405
410
|
t_->is_client ? "CLIENT" : "SERVER", s->id,
|
406
411
|
s->sent_initial_metadata, s->send_initial_metadata != nullptr,
|
407
412
|
(int)(s->flow_control->local_window_delta() -
|
@@ -120,17 +120,16 @@ typedef struct inproc_stream {
|
|
120
120
|
struct inproc_stream* stream_list_next;
|
121
121
|
} inproc_stream;
|
122
122
|
|
123
|
-
static grpc_closure do_nothing_closure;
|
124
123
|
static bool cancel_stream_locked(inproc_stream* s, grpc_error* error);
|
125
124
|
static void op_state_machine(void* arg, grpc_error* error);
|
126
125
|
|
127
126
|
static void ref_transport(inproc_transport* t) {
|
128
|
-
INPROC_LOG(
|
127
|
+
INPROC_LOG(GPR_INFO, "ref_transport %p", t);
|
129
128
|
gpr_ref(&t->refs);
|
130
129
|
}
|
131
130
|
|
132
131
|
static void really_destroy_transport(inproc_transport* t) {
|
133
|
-
INPROC_LOG(
|
132
|
+
INPROC_LOG(GPR_INFO, "really_destroy_transport %p", t);
|
134
133
|
grpc_connectivity_state_destroy(&t->connectivity);
|
135
134
|
if (gpr_unref(&t->mu->refs)) {
|
136
135
|
gpr_free(t->mu);
|
@@ -139,7 +138,7 @@ static void really_destroy_transport(inproc_transport* t) {
|
|
139
138
|
}
|
140
139
|
|
141
140
|
static void unref_transport(inproc_transport* t) {
|
142
|
-
INPROC_LOG(
|
141
|
+
INPROC_LOG(GPR_INFO, "unref_transport %p", t);
|
143
142
|
if (gpr_unref(&t->refs)) {
|
144
143
|
really_destroy_transport(t);
|
145
144
|
}
|
@@ -154,17 +153,17 @@ static void unref_transport(inproc_transport* t) {
|
|
154
153
|
#endif
|
155
154
|
|
156
155
|
static void ref_stream(inproc_stream* s, const char* reason) {
|
157
|
-
INPROC_LOG(
|
156
|
+
INPROC_LOG(GPR_INFO, "ref_stream %p %s", s, reason);
|
158
157
|
STREAM_REF(s->refs, reason);
|
159
158
|
}
|
160
159
|
|
161
160
|
static void unref_stream(inproc_stream* s, const char* reason) {
|
162
|
-
INPROC_LOG(
|
161
|
+
INPROC_LOG(GPR_INFO, "unref_stream %p %s", s, reason);
|
163
162
|
STREAM_UNREF(s->refs, reason);
|
164
163
|
}
|
165
164
|
|
166
165
|
static void really_destroy_stream(inproc_stream* s) {
|
167
|
-
INPROC_LOG(
|
166
|
+
INPROC_LOG(GPR_INFO, "really_destroy_stream %p", s);
|
168
167
|
|
169
168
|
GRPC_ERROR_UNREF(s->write_buffer_cancel_error);
|
170
169
|
GRPC_ERROR_UNREF(s->cancel_self_error);
|
@@ -225,7 +224,7 @@ static grpc_error* fill_in_metadata(inproc_stream* s,
|
|
225
224
|
static int init_stream(grpc_transport* gt, grpc_stream* gs,
|
226
225
|
grpc_stream_refcount* refcount, const void* server_data,
|
227
226
|
gpr_arena* arena) {
|
228
|
-
INPROC_LOG(
|
227
|
+
INPROC_LOG(GPR_INFO, "init_stream %p %p %p", gt, gs, server_data);
|
229
228
|
inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
|
230
229
|
inproc_stream* s = reinterpret_cast<inproc_stream*>(gs);
|
231
230
|
s->arena = arena;
|
@@ -282,8 +281,8 @@ static int init_stream(grpc_transport* gt, grpc_stream* gs,
|
|
282
281
|
// Pass the client-side stream address to the server-side for a ref
|
283
282
|
ref_stream(s, "inproc_init_stream:clt"); // ref it now on behalf of server
|
284
283
|
// side to avoid destruction
|
285
|
-
INPROC_LOG(
|
286
|
-
st->
|
284
|
+
INPROC_LOG(GPR_INFO, "calling accept stream cb %p %p", st->accept_stream_cb,
|
285
|
+
st->accept_stream_data);
|
287
286
|
(*st->accept_stream_cb)(st->accept_stream_data, &st->base, (void*)s);
|
288
287
|
} else {
|
289
288
|
// This is the server-side and is being called through accept_stream_cb
|
@@ -373,12 +372,16 @@ static void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error,
|
|
373
372
|
const char* msg) {
|
374
373
|
int is_sm = static_cast<int>(op == s->send_message_op);
|
375
374
|
int is_stm = static_cast<int>(op == s->send_trailing_md_op);
|
375
|
+
// TODO(vjpai): We should not consider the recv ops here, since they
|
376
|
+
// have their own callbacks. We should invoke a batch's on_complete
|
377
|
+
// as soon as all of the batch's send ops are complete, even if there
|
378
|
+
// are still recv ops pending.
|
376
379
|
int is_rim = static_cast<int>(op == s->recv_initial_md_op);
|
377
380
|
int is_rm = static_cast<int>(op == s->recv_message_op);
|
378
381
|
int is_rtm = static_cast<int>(op == s->recv_trailing_md_op);
|
379
382
|
|
380
383
|
if ((is_sm + is_stm + is_rim + is_rm + is_rtm) == 1) {
|
381
|
-
INPROC_LOG(
|
384
|
+
INPROC_LOG(GPR_INFO, "%s %p %p %p", msg, s, op, error);
|
382
385
|
GRPC_CLOSURE_SCHED(op->on_complete, GRPC_ERROR_REF(error));
|
383
386
|
}
|
384
387
|
}
|
@@ -393,7 +396,7 @@ static void maybe_schedule_op_closure_locked(inproc_stream* s,
|
|
393
396
|
}
|
394
397
|
|
395
398
|
static void fail_helper_locked(inproc_stream* s, grpc_error* error) {
|
396
|
-
INPROC_LOG(
|
399
|
+
INPROC_LOG(GPR_INFO, "op_state_machine %p fail_helper", s);
|
397
400
|
// If we're failing this side, we need to make sure that
|
398
401
|
// we also send or have already sent trailing metadata
|
399
402
|
if (!s->trailing_md_sent) {
|
@@ -458,7 +461,7 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) {
|
|
458
461
|
*s->recv_initial_md_op->payload->recv_initial_metadata
|
459
462
|
.trailing_metadata_available = true;
|
460
463
|
}
|
461
|
-
INPROC_LOG(
|
464
|
+
INPROC_LOG(GPR_INFO,
|
462
465
|
"fail_helper %p scheduling initial-metadata-ready %p %p", s,
|
463
466
|
error, err);
|
464
467
|
GRPC_CLOSURE_SCHED(s->recv_initial_md_op->payload->recv_initial_metadata
|
@@ -472,7 +475,7 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) {
|
|
472
475
|
s->recv_initial_md_op = nullptr;
|
473
476
|
}
|
474
477
|
if (s->recv_message_op) {
|
475
|
-
INPROC_LOG(
|
478
|
+
INPROC_LOG(GPR_INFO, "fail_helper %p scheduling message-ready %p", s,
|
476
479
|
error);
|
477
480
|
GRPC_CLOSURE_SCHED(
|
478
481
|
s->recv_message_op->payload->recv_message.recv_message_ready,
|
@@ -496,9 +499,13 @@ static void fail_helper_locked(inproc_stream* s, grpc_error* error) {
|
|
496
499
|
s->send_trailing_md_op = nullptr;
|
497
500
|
}
|
498
501
|
if (s->recv_trailing_md_op) {
|
499
|
-
INPROC_LOG(
|
500
|
-
|
501
|
-
|
502
|
+
INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-metadata-ready %p",
|
503
|
+
s, error);
|
504
|
+
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->payload->recv_trailing_metadata
|
505
|
+
.recv_trailing_metadata_ready,
|
506
|
+
GRPC_ERROR_REF(error));
|
507
|
+
INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %p",
|
508
|
+
s, error);
|
502
509
|
complete_if_batch_end_locked(
|
503
510
|
s, error, s->recv_trailing_md_op,
|
504
511
|
"fail_helper scheduling recv-trailing-metadata-on-complete");
|
@@ -549,7 +556,7 @@ static void message_transfer_locked(inproc_stream* sender,
|
|
549
556
|
receiver->recv_stream.Init(&receiver->recv_message, 0);
|
550
557
|
receiver->recv_message_op->payload->recv_message.recv_message->reset(
|
551
558
|
receiver->recv_stream.get());
|
552
|
-
INPROC_LOG(
|
559
|
+
INPROC_LOG(GPR_INFO, "message_transfer_locked %p scheduling message-ready",
|
553
560
|
receiver);
|
554
561
|
GRPC_CLOSURE_SCHED(
|
555
562
|
receiver->recv_message_op->payload->recv_message.recv_message_ready,
|
@@ -577,7 +584,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
577
584
|
|
578
585
|
bool needs_close = false;
|
579
586
|
|
580
|
-
INPROC_LOG(
|
587
|
+
INPROC_LOG(GPR_INFO, "op_state_machine %p", arg);
|
581
588
|
inproc_stream* s = static_cast<inproc_stream*>(arg);
|
582
589
|
gpr_mu* mu = &s->t->mu->mu; // keep aside in case s gets closed
|
583
590
|
gpr_mu_lock(mu);
|
@@ -626,7 +633,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
626
633
|
: &other->to_read_trailing_md_filled;
|
627
634
|
if (*destfilled || s->trailing_md_sent) {
|
628
635
|
// The buffer is already in use; that's an error!
|
629
|
-
INPROC_LOG(
|
636
|
+
INPROC_LOG(GPR_INFO, "Extra trailing metadata %p", s);
|
630
637
|
new_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra trailing metadata");
|
631
638
|
fail_helper_locked(s, GRPC_ERROR_REF(new_err));
|
632
639
|
goto done;
|
@@ -639,7 +646,13 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
639
646
|
}
|
640
647
|
s->trailing_md_sent = true;
|
641
648
|
if (!s->t->is_client && s->trailing_md_recvd && s->recv_trailing_md_op) {
|
642
|
-
INPROC_LOG(
|
649
|
+
INPROC_LOG(GPR_INFO,
|
650
|
+
"op_state_machine %p scheduling trailing-metadata-ready", s);
|
651
|
+
GRPC_CLOSURE_SCHED(
|
652
|
+
s->recv_trailing_md_op->payload->recv_trailing_metadata
|
653
|
+
.recv_trailing_metadata_ready,
|
654
|
+
GRPC_ERROR_NONE);
|
655
|
+
INPROC_LOG(GPR_INFO,
|
643
656
|
"op_state_machine %p scheduling trailing-md-on-complete", s);
|
644
657
|
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->on_complete,
|
645
658
|
GRPC_ERROR_NONE);
|
@@ -658,7 +671,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
658
671
|
new_err =
|
659
672
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already recvd initial md");
|
660
673
|
INPROC_LOG(
|
661
|
-
|
674
|
+
GPR_INFO,
|
662
675
|
"op_state_machine %p scheduling on_complete errors for already "
|
663
676
|
"recvd initial md %p",
|
664
677
|
s, new_err);
|
@@ -684,7 +697,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
684
697
|
}
|
685
698
|
grpc_metadata_batch_clear(&s->to_read_initial_md);
|
686
699
|
s->to_read_initial_md_filled = false;
|
687
|
-
INPROC_LOG(
|
700
|
+
INPROC_LOG(GPR_INFO,
|
688
701
|
"op_state_machine %p scheduling initial-metadata-ready %p", s,
|
689
702
|
new_err);
|
690
703
|
GRPC_CLOSURE_SCHED(s->recv_initial_md_op->payload->recv_initial_metadata
|
@@ -696,7 +709,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
696
709
|
s->recv_initial_md_op = nullptr;
|
697
710
|
|
698
711
|
if (new_err != GRPC_ERROR_NONE) {
|
699
|
-
INPROC_LOG(
|
712
|
+
INPROC_LOG(GPR_INFO,
|
700
713
|
"op_state_machine %p scheduling on_complete errors2 %p", s,
|
701
714
|
new_err);
|
702
715
|
fail_helper_locked(s, GRPC_ERROR_REF(new_err));
|
@@ -712,6 +725,12 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
712
725
|
}
|
713
726
|
if (s->recv_trailing_md_op && s->t->is_client && other &&
|
714
727
|
other->send_message_op) {
|
728
|
+
INPROC_LOG(GPR_INFO,
|
729
|
+
"op_state_machine %p scheduling trailing-metadata-ready %p", s,
|
730
|
+
GRPC_ERROR_NONE);
|
731
|
+
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->payload->recv_trailing_metadata
|
732
|
+
.recv_trailing_metadata_ready,
|
733
|
+
GRPC_ERROR_NONE);
|
715
734
|
maybe_schedule_op_closure_locked(other, GRPC_ERROR_NONE);
|
716
735
|
}
|
717
736
|
if (s->to_read_trailing_md_filled) {
|
@@ -719,7 +738,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
719
738
|
new_err =
|
720
739
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already recvd trailing md");
|
721
740
|
INPROC_LOG(
|
722
|
-
|
741
|
+
GPR_INFO,
|
723
742
|
"op_state_machine %p scheduling on_complete errors for already "
|
724
743
|
"recvd trailing md %p",
|
725
744
|
s, new_err);
|
@@ -729,7 +748,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
729
748
|
if (s->recv_message_op != nullptr) {
|
730
749
|
// This message needs to be wrapped up because it will never be
|
731
750
|
// satisfied
|
732
|
-
INPROC_LOG(
|
751
|
+
INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling message-ready", s);
|
733
752
|
GRPC_CLOSURE_SCHED(
|
734
753
|
s->recv_message_op->payload->recv_message.recv_message_ready,
|
735
754
|
GRPC_ERROR_NONE);
|
@@ -764,29 +783,33 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
764
783
|
// (If the server hasn't already sent its trailing md, it doesn't have
|
765
784
|
// a final status, so don't mark this op complete)
|
766
785
|
if (s->t->is_client || s->trailing_md_sent) {
|
767
|
-
INPROC_LOG(
|
786
|
+
INPROC_LOG(GPR_INFO,
|
768
787
|
"op_state_machine %p scheduling trailing-md-on-complete %p",
|
769
788
|
s, new_err);
|
789
|
+
GRPC_CLOSURE_SCHED(
|
790
|
+
s->recv_trailing_md_op->payload->recv_trailing_metadata
|
791
|
+
.recv_trailing_metadata_ready,
|
792
|
+
GRPC_ERROR_REF(new_err));
|
770
793
|
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->on_complete,
|
771
794
|
GRPC_ERROR_REF(new_err));
|
772
795
|
s->recv_trailing_md_op = nullptr;
|
773
796
|
needs_close = true;
|
774
797
|
} else {
|
775
|
-
INPROC_LOG(
|
798
|
+
INPROC_LOG(GPR_INFO,
|
776
799
|
"op_state_machine %p server needs to delay handling "
|
777
800
|
"trailing-md-on-complete %p",
|
778
801
|
s, new_err);
|
779
802
|
}
|
780
803
|
} else {
|
781
804
|
INPROC_LOG(
|
782
|
-
|
805
|
+
GPR_INFO,
|
783
806
|
"op_state_machine %p has trailing md but not yet waiting for it", s);
|
784
807
|
}
|
785
808
|
}
|
786
809
|
if (s->trailing_md_recvd && s->recv_message_op) {
|
787
810
|
// No further message will come on this stream, so finish off the
|
788
811
|
// recv_message_op
|
789
|
-
INPROC_LOG(
|
812
|
+
INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling message-ready", s);
|
790
813
|
GRPC_CLOSURE_SCHED(
|
791
814
|
s->recv_message_op->payload->recv_message.recv_message_ready,
|
792
815
|
GRPC_ERROR_NONE);
|
@@ -810,7 +833,7 @@ static void op_state_machine(void* arg, grpc_error* error) {
|
|
810
833
|
// Didn't get the item we wanted so we still need to get
|
811
834
|
// rescheduled
|
812
835
|
INPROC_LOG(
|
813
|
-
|
836
|
+
GPR_INFO, "op_state_machine %p still needs closure %p %p %p %p %p", s,
|
814
837
|
s->send_message_op, s->send_trailing_md_op, s->recv_initial_md_op,
|
815
838
|
s->recv_message_op, s->recv_trailing_md_op);
|
816
839
|
s->ops_needed = true;
|
@@ -826,8 +849,7 @@ done:
|
|
826
849
|
|
827
850
|
static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
|
828
851
|
bool ret = false; // was the cancel accepted
|
829
|
-
INPROC_LOG(
|
830
|
-
grpc_error_string(error));
|
852
|
+
INPROC_LOG(GPR_INFO, "cancel_stream %p with %s", s, grpc_error_string(error));
|
831
853
|
if (s->cancel_self_error == GRPC_ERROR_NONE) {
|
832
854
|
ret = true;
|
833
855
|
s->cancel_self_error = GRPC_ERROR_REF(error);
|
@@ -861,6 +883,9 @@ static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
|
|
861
883
|
// couldn't complete that because we hadn't yet sent out trailing
|
862
884
|
// md, now's the chance
|
863
885
|
if (!s->t->is_client && s->trailing_md_recvd && s->recv_trailing_md_op) {
|
886
|
+
GRPC_CLOSURE_SCHED(s->recv_trailing_md_op->payload->recv_trailing_metadata
|
887
|
+
.recv_trailing_metadata_ready,
|
888
|
+
GRPC_ERROR_REF(s->cancel_self_error));
|
864
889
|
complete_if_batch_end_locked(
|
865
890
|
s, s->cancel_self_error, s->recv_trailing_md_op,
|
866
891
|
"cancel_stream scheduling trailing-md-on-complete");
|
@@ -875,9 +900,11 @@ static bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
|
|
875
900
|
return ret;
|
876
901
|
}
|
877
902
|
|
903
|
+
static void do_nothing(void* arg, grpc_error* error) {}
|
904
|
+
|
878
905
|
static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
879
906
|
grpc_transport_stream_op_batch* op) {
|
880
|
-
INPROC_LOG(
|
907
|
+
INPROC_LOG(GPR_INFO, "perform_stream_op %p %p %p", gt, gs, op);
|
881
908
|
inproc_stream* s = reinterpret_cast<inproc_stream*>(gs);
|
882
909
|
gpr_mu* mu = &s->t->mu->mu; // save aside in case s gets closed
|
883
910
|
gpr_mu_lock(mu);
|
@@ -894,8 +921,14 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
894
921
|
}
|
895
922
|
grpc_error* error = GRPC_ERROR_NONE;
|
896
923
|
grpc_closure* on_complete = op->on_complete;
|
924
|
+
// TODO(roth): This is a hack needed because we use data inside of the
|
925
|
+
// closure itself to do the barrier calculation (i.e., to ensure that
|
926
|
+
// we don't schedule the closure until all ops in the batch have been
|
927
|
+
// completed). This can go away once we move to a new C++ closure API
|
928
|
+
// that provides the ability to create a barrier closure.
|
897
929
|
if (on_complete == nullptr) {
|
898
|
-
on_complete = &
|
930
|
+
on_complete = GRPC_CLOSURE_INIT(&op->handler_private.closure, do_nothing,
|
931
|
+
nullptr, grpc_schedule_on_exec_ctx);
|
899
932
|
}
|
900
933
|
|
901
934
|
if (op->cancel_stream) {
|
@@ -907,7 +940,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
907
940
|
// already self-canceled so still give it an error
|
908
941
|
error = GRPC_ERROR_REF(s->cancel_self_error);
|
909
942
|
} else {
|
910
|
-
INPROC_LOG(
|
943
|
+
INPROC_LOG(GPR_INFO, "perform_stream_op %p %s%s%s%s%s%s%s", s,
|
911
944
|
s->t->is_client ? "client" : "server",
|
912
945
|
op->send_initial_metadata ? " send_initial_metadata" : "",
|
913
946
|
op->send_message ? " send_message" : "",
|
@@ -936,7 +969,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
936
969
|
: &other->to_read_initial_md_filled;
|
937
970
|
if (*destfilled || s->initial_md_sent) {
|
938
971
|
// The buffer is already in use; that's an error!
|
939
|
-
INPROC_LOG(
|
972
|
+
INPROC_LOG(GPR_INFO, "Extra initial metadata %p", s);
|
940
973
|
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra initial metadata");
|
941
974
|
} else {
|
942
975
|
if (!other || !other->closed) {
|
@@ -1013,7 +1046,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
1013
1046
|
true;
|
1014
1047
|
}
|
1015
1048
|
INPROC_LOG(
|
1016
|
-
|
1049
|
+
GPR_INFO,
|
1017
1050
|
"perform_stream_op error %p scheduling initial-metadata-ready %p",
|
1018
1051
|
s, error);
|
1019
1052
|
GRPC_CLOSURE_SCHED(
|
@@ -1022,14 +1055,23 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
1022
1055
|
}
|
1023
1056
|
if (op->recv_message) {
|
1024
1057
|
INPROC_LOG(
|
1025
|
-
|
1058
|
+
GPR_INFO,
|
1026
1059
|
"perform_stream_op error %p scheduling recv message-ready %p", s,
|
1027
1060
|
error);
|
1028
1061
|
GRPC_CLOSURE_SCHED(op->payload->recv_message.recv_message_ready,
|
1029
1062
|
GRPC_ERROR_REF(error));
|
1030
1063
|
}
|
1064
|
+
if (op->recv_trailing_metadata) {
|
1065
|
+
INPROC_LOG(
|
1066
|
+
GPR_INFO,
|
1067
|
+
"perform_stream_op error %p scheduling trailing-metadata-ready %p",
|
1068
|
+
s, error);
|
1069
|
+
GRPC_CLOSURE_SCHED(
|
1070
|
+
op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
|
1071
|
+
GRPC_ERROR_REF(error));
|
1072
|
+
}
|
1031
1073
|
}
|
1032
|
-
INPROC_LOG(
|
1074
|
+
INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %p", s,
|
1033
1075
|
error);
|
1034
1076
|
GRPC_CLOSURE_SCHED(on_complete, GRPC_ERROR_REF(error));
|
1035
1077
|
}
|
@@ -1042,7 +1084,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
|
|
1042
1084
|
}
|
1043
1085
|
|
1044
1086
|
static void close_transport_locked(inproc_transport* t) {
|
1045
|
-
INPROC_LOG(
|
1087
|
+
INPROC_LOG(GPR_INFO, "close_transport %p %d", t, t->is_closed);
|
1046
1088
|
grpc_connectivity_state_set(
|
1047
1089
|
&t->connectivity, GRPC_CHANNEL_SHUTDOWN,
|
1048
1090
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Closing transport."),
|
@@ -1063,7 +1105,7 @@ static void close_transport_locked(inproc_transport* t) {
|
|
1063
1105
|
|
1064
1106
|
static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
|
1065
1107
|
inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
|
1066
|
-
INPROC_LOG(
|
1108
|
+
INPROC_LOG(GPR_INFO, "perform_transport_op %p %p", t, op);
|
1067
1109
|
gpr_mu_lock(&t->mu->mu);
|
1068
1110
|
if (op->on_connectivity_state_change) {
|
1069
1111
|
grpc_connectivity_state_notify_on_state_change(
|
@@ -1096,7 +1138,7 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
|
|
1096
1138
|
|
1097
1139
|
static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
|
1098
1140
|
grpc_closure* then_schedule_closure) {
|
1099
|
-
INPROC_LOG(
|
1141
|
+
INPROC_LOG(GPR_INFO, "destroy_stream %p %p", gs, then_schedule_closure);
|
1100
1142
|
inproc_stream* s = reinterpret_cast<inproc_stream*>(gs);
|
1101
1143
|
s->closure_at_destroy = then_schedule_closure;
|
1102
1144
|
really_destroy_stream(s);
|
@@ -1104,7 +1146,7 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
|
|
1104
1146
|
|
1105
1147
|
static void destroy_transport(grpc_transport* gt) {
|
1106
1148
|
inproc_transport* t = reinterpret_cast<inproc_transport*>(gt);
|
1107
|
-
INPROC_LOG(
|
1149
|
+
INPROC_LOG(GPR_INFO, "destroy_transport %p", t);
|
1108
1150
|
gpr_mu_lock(&t->mu->mu);
|
1109
1151
|
close_transport_locked(t);
|
1110
1152
|
gpr_mu_unlock(&t->mu->mu);
|
@@ -1131,12 +1173,8 @@ static grpc_endpoint* get_endpoint(grpc_transport* t) { return nullptr; }
|
|
1131
1173
|
/*******************************************************************************
|
1132
1174
|
* GLOBAL INIT AND DESTROY
|
1133
1175
|
*/
|
1134
|
-
static void do_nothing(void* arg, grpc_error* error) {}
|
1135
|
-
|
1136
1176
|
void grpc_inproc_transport_init(void) {
|
1137
1177
|
grpc_core::ExecCtx exec_ctx;
|
1138
|
-
GRPC_CLOSURE_INIT(&do_nothing_closure, do_nothing, nullptr,
|
1139
|
-
grpc_schedule_on_exec_ctx);
|
1140
1178
|
g_empty_slice = grpc_slice_from_static_buffer(nullptr, 0);
|
1141
1179
|
|
1142
1180
|
grpc_slice key_tmp = grpc_slice_from_static_string(":path");
|
@@ -1165,7 +1203,7 @@ static void inproc_transports_create(grpc_transport** server_transport,
|
|
1165
1203
|
const grpc_channel_args* server_args,
|
1166
1204
|
grpc_transport** client_transport,
|
1167
1205
|
const grpc_channel_args* client_args) {
|
1168
|
-
INPROC_LOG(
|
1206
|
+
INPROC_LOG(GPR_INFO, "inproc_transports_create");
|
1169
1207
|
inproc_transport* st =
|
1170
1208
|
static_cast<inproc_transport*>(gpr_zalloc(sizeof(*st)));
|
1171
1209
|
inproc_transport* ct =
|