grpc 1.2.5 → 1.3.4
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 +1434 -399
- data/etc/roots.pem +34 -150
- data/include/grpc/grpc.h +71 -0
- data/include/grpc/impl/codegen/atm.h +5 -0
- data/include/grpc/impl/codegen/atm_gcc_atomic.h +6 -0
- data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
- data/include/grpc/impl/codegen/atm_windows.h +11 -0
- data/include/grpc/impl/codegen/grpc_types.h +54 -13
- data/include/grpc/impl/codegen/port_platform.h +15 -1
- data/include/grpc/support/alloc.h +2 -1
- data/include/grpc/support/sync.h +4 -0
- data/include/grpc/support/tls.h +1 -1
- data/src/core/ext/census/gen/trace_context.pb.h +1 -1
- data/src/core/ext/census/grpc_filter.c +14 -10
- data/src/core/ext/census/grpc_plugin.c +3 -1
- data/src/core/ext/census/trace_label.h +1 -1
- data/src/core/ext/census/trace_propagation.h +1 -1
- data/src/core/ext/census/trace_status.h +1 -1
- data/src/core/ext/census/trace_string.h +1 -1
- data/src/core/ext/census/tracing.h +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/channel_connectivity.c +56 -27
- data/src/core/ext/{client_channel → filters/client_channel}/client_channel.c +407 -202
- data/src/core/ext/{client_channel → filters/client_channel}/client_channel.h +10 -6
- data/src/core/ext/{client_channel → filters/client_channel}/client_channel_factory.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/client_channel_factory.h +4 -4
- data/src/core/ext/{client_channel → filters/client_channel}/client_channel_plugin.c +12 -7
- data/src/core/ext/{client_channel → filters/client_channel}/connector.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/connector.h +3 -5
- data/src/core/ext/{client_channel → filters/client_channel}/http_connect_handshaker.c +6 -6
- data/src/core/ext/{client_channel → filters/client_channel}/http_connect_handshaker.h +3 -3
- data/src/core/ext/{client_channel → filters/client_channel}/http_proxy.c +4 -4
- data/src/core/ext/{client_channel → filters/client_channel}/http_proxy.h +3 -3
- data/src/core/ext/{client_channel → filters/client_channel}/lb_policy.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/lb_policy.h +4 -4
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb.c +22 -20
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb.h +4 -4
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb_channel.h +5 -4
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/grpclb_channel_secure.c +2 -2
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/load_balancer_api.c +1 -1
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/load_balancer_api.h +6 -5
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/proto/grpc/lb/v1/load_balancer.pb.c +1 -1
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +0 -0
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/pick_first/pick_first.c +20 -15
- data/src/core/ext/{lb_policy → filters/client_channel/lb_policy}/round_robin/round_robin.c +21 -16
- data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_factory.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_factory.h +5 -5
- data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_registry.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/lb_policy_registry.h +4 -4
- data/src/core/ext/{client_channel → filters/client_channel}/parse_address.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/parse_address.h +4 -4
- data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper.h +3 -3
- data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper_registry.c +10 -4
- data/src/core/ext/{client_channel → filters/client_channel}/proxy_mapper_registry.h +4 -4
- data/src/core/ext/{client_channel → filters/client_channel}/resolver.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/resolver.h +4 -4
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c +350 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +66 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c +319 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +289 -0
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +64 -0
- data/src/core/ext/{resolver → filters/client_channel/resolver}/dns/native/dns_resolver.c +21 -5
- data/src/core/ext/{resolver → filters/client_channel/resolver}/sockaddr/sockaddr_resolver.c +3 -3
- data/src/core/ext/{client_channel → filters/client_channel}/resolver_factory.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/resolver_factory.h +6 -6
- data/src/core/ext/{client_channel → filters/client_channel}/resolver_registry.c +1 -2
- data/src/core/ext/{client_channel → filters/client_channel}/resolver_registry.h +4 -4
- data/src/core/ext/filters/client_channel/retry_throttle.c +210 -0
- data/src/core/ext/filters/client_channel/retry_throttle.h +65 -0
- data/src/core/ext/{client_channel → filters/client_channel}/subchannel.c +49 -43
- data/src/core/ext/{client_channel → filters/client_channel}/subchannel.h +21 -7
- data/src/core/ext/{client_channel → filters/client_channel}/subchannel_index.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/subchannel_index.h +5 -5
- data/src/core/ext/{client_channel → filters/client_channel}/uri_parser.c +1 -1
- data/src/core/ext/{client_channel → filters/client_channel}/uri_parser.h +3 -3
- data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting.c +4 -2
- data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting.h +3 -3
- data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting_filter.c +17 -14
- data/src/core/ext/{load_reporting → filters/load_reporting}/load_reporting_filter.h +4 -4
- data/src/core/ext/filters/max_age/max_age_filter.c +439 -0
- data/src/core/ext/filters/max_age/max_age_filter.h +39 -0
- data/src/core/ext/transport/chttp2/client/chttp2_connector.c +6 -41
- data/src/core/ext/transport/chttp2/client/chttp2_connector.h +1 -1
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +2 -2
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +3 -3
- data/src/core/ext/transport/chttp2/server/chttp2_server.c +2 -2
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +2 -5
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +2 -2
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +449 -204
- data/src/core/ext/transport/chttp2/transport/frame_data.c +10 -7
- data/src/core/ext/transport/chttp2/transport/frame_goaway.c +3 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.c +37 -7
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -0
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +4 -3
- data/src/core/ext/transport/chttp2/transport/frame_settings.c +18 -38
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +1 -29
- data/src/core/ext/transport/chttp2/transport/frame_window_update.c +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.c +64 -37
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.h +11 -4
- data/src/core/ext/transport/chttp2/transport/hpack_parser.c +60 -39
- data/src/core/ext/transport/chttp2/transport/hpack_table.c +2 -2
- data/src/core/ext/transport/chttp2/transport/http2_settings.c +75 -0
- data/src/core/ext/transport/chttp2/transport/http2_settings.h +74 -0
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +22 -43
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +8 -10
- data/src/core/ext/transport/chttp2/transport/internal.h +24 -2
- data/src/core/ext/transport/chttp2/transport/parsing.c +33 -15
- data/src/core/ext/transport/chttp2/transport/writing.c +56 -10
- data/src/core/lib/channel/channel_args.c +7 -0
- data/src/core/lib/channel/channel_args.h +2 -0
- data/src/core/lib/channel/channel_stack.c +20 -27
- data/src/core/lib/channel/channel_stack.h +18 -16
- data/src/core/lib/channel/compress_filter.c +20 -18
- data/src/core/lib/channel/connected_channel.c +9 -8
- data/src/core/lib/channel/deadline_filter.c +28 -24
- data/src/core/lib/channel/deadline_filter.h +3 -3
- data/src/core/lib/channel/handshaker.c +3 -2
- data/src/core/lib/channel/http_client_filter.c +119 -61
- data/src/core/lib/channel/http_server_filter.c +124 -69
- data/src/core/lib/channel/message_size_filter.c +23 -19
- data/src/core/lib/http/httpcli.c +8 -6
- data/src/core/lib/http/httpcli_security_connector.c +5 -5
- data/src/core/lib/http/parser.c +57 -31
- data/src/core/lib/iomgr/closure.c +15 -0
- data/src/core/lib/iomgr/closure.h +4 -0
- data/src/core/lib/iomgr/combiner.c +8 -0
- data/src/core/lib/iomgr/endpoint_pair.h +2 -3
- data/src/core/lib/iomgr/endpoint_pair_posix.c +10 -7
- data/src/core/lib/iomgr/endpoint_pair_uv.c +2 -3
- data/src/core/lib/iomgr/endpoint_pair_windows.c +9 -6
- data/src/core/lib/iomgr/error.c +360 -177
- data/src/core/lib/iomgr/error.h +31 -33
- data/src/core/lib/iomgr/error_internal.h +30 -9
- data/src/core/lib/iomgr/ev_epoll_linux.c +25 -239
- data/src/core/lib/iomgr/ev_poll_posix.c +11 -7
- data/src/core/lib/iomgr/ev_posix.c +6 -0
- data/src/core/lib/iomgr/ev_posix.h +3 -0
- data/src/core/lib/iomgr/exec_ctx.c +6 -0
- data/src/core/lib/iomgr/executor.c +8 -2
- data/src/core/lib/iomgr/load_file.c +6 -3
- data/src/core/lib/iomgr/lockfree_event.c +238 -0
- data/src/core/{ext/client_channel/initial_connect_string.h → lib/iomgr/lockfree_event.h} +17 -13
- data/src/core/lib/iomgr/pollset.h +4 -0
- data/src/core/lib/iomgr/pollset_windows.c +2 -2
- data/src/core/lib/iomgr/port.h +9 -0
- data/src/core/lib/iomgr/resolve_address_posix.c +15 -9
- data/src/core/lib/iomgr/resolve_address_uv.c +8 -6
- data/src/core/lib/iomgr/resolve_address_windows.c +2 -2
- data/src/core/lib/iomgr/resource_quota.c +19 -4
- data/src/core/lib/iomgr/resource_quota.h +2 -0
- data/src/core/lib/iomgr/sockaddr_utils.c +3 -1
- data/src/core/lib/iomgr/socket_factory_posix.c +110 -0
- data/src/core/lib/iomgr/socket_factory_posix.h +90 -0
- data/src/core/lib/iomgr/socket_utils_common_posix.c +25 -9
- data/src/core/lib/iomgr/socket_utils_posix.h +7 -0
- data/src/core/lib/iomgr/tcp_client.h +0 -4
- data/src/core/lib/iomgr/tcp_client_posix.c +15 -31
- data/src/core/lib/iomgr/tcp_client_uv.c +10 -6
- data/src/core/lib/iomgr/tcp_client_windows.c +9 -19
- data/src/core/lib/iomgr/tcp_posix.c +111 -22
- data/src/core/lib/iomgr/tcp_posix.h +3 -4
- data/src/core/lib/iomgr/tcp_server_posix.c +39 -417
- data/src/core/lib/iomgr/tcp_server_utils_posix.h +135 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_common.c +221 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.c +196 -0
- data/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.c +49 -0
- data/src/core/lib/iomgr/tcp_server_uv.c +43 -16
- data/src/core/lib/iomgr/tcp_server_windows.c +10 -22
- data/src/core/lib/iomgr/tcp_uv.c +16 -13
- data/src/core/lib/iomgr/tcp_windows.c +24 -12
- data/src/core/lib/iomgr/tcp_windows.h +2 -2
- data/src/core/lib/iomgr/timer.h +3 -0
- data/src/core/lib/iomgr/timer_generic.c +257 -72
- data/src/core/lib/iomgr/timer_generic.h +1 -1
- data/src/core/lib/iomgr/timer_heap.c +8 -8
- data/src/core/lib/iomgr/udp_server.c +54 -24
- data/src/core/lib/iomgr/udp_server.h +7 -7
- data/src/core/lib/iomgr/unix_sockets_posix.c +1 -1
- data/src/core/lib/iomgr/unix_sockets_posix_noop.c +2 -1
- data/src/core/lib/iomgr/wakeup_fd_posix.h +1 -1
- data/src/core/lib/profiling/basic_timers.c +1 -1
- data/src/core/lib/security/credentials/credentials.h +1 -1
- data/src/core/lib/security/credentials/google_default/google_default_credentials.c +10 -9
- data/src/core/lib/security/credentials/jwt/json_token.c +1 -1
- data/src/core/lib/security/credentials/jwt/jwt_verifier.c +2 -2
- data/src/core/lib/security/transport/client_auth_filter.c +33 -26
- data/src/core/lib/security/transport/secure_endpoint.c +8 -5
- data/src/core/lib/security/transport/security_connector.c +37 -37
- data/src/core/lib/security/transport/security_connector.h +1 -1
- data/src/core/lib/security/transport/security_handshaker.c +15 -12
- data/src/core/lib/security/transport/server_auth_filter.c +20 -18
- data/src/core/lib/security/transport/tsi_error.c +5 -3
- data/src/core/lib/security/transport/tsi_error.h +1 -1
- data/src/core/lib/{security/util → slice}/b64.c +21 -6
- data/src/core/lib/{security/util → slice}/b64.h +16 -4
- data/src/core/lib/slice/slice.c +4 -2
- data/src/core/lib/slice/slice_buffer.c +16 -14
- data/src/core/lib/support/arena.c +98 -0
- data/src/core/{ext/client_channel/initial_connect_string.c → lib/support/arena.h} +17 -15
- data/src/core/{ext/client_channel/default_initial_connect_string.c → lib/support/atm.c} +14 -5
- data/src/core/lib/support/cpu_linux.c +5 -0
- data/src/core/lib/support/sync.c +4 -0
- data/src/core/lib/support/time.c +4 -10
- data/src/core/lib/support/wrap_memcpy.c +3 -1
- data/src/core/lib/surface/call.c +252 -221
- data/src/core/lib/surface/channel.c +72 -21
- data/src/core/lib/surface/channel.h +8 -0
- data/src/core/lib/surface/completion_queue.c +2 -3
- data/src/core/lib/surface/completion_queue_factory.c +77 -0
- data/src/core/lib/surface/completion_queue_factory.h +51 -0
- data/src/core/lib/surface/init_secure.c +3 -1
- data/src/core/lib/surface/lame_client.c +18 -14
- data/src/core/lib/surface/server.c +43 -41
- data/src/core/lib/surface/validate_metadata.c +8 -4
- data/src/core/lib/surface/version.c +2 -2
- data/src/core/lib/transport/bdp_estimator.h +1 -1
- data/src/core/lib/transport/connectivity_state.c +2 -1
- data/src/core/lib/transport/error_utils.c +17 -17
- data/src/core/lib/transport/error_utils.h +1 -1
- data/src/core/lib/transport/metadata_batch.c +6 -7
- data/src/core/lib/transport/pid_controller.c +1 -0
- data/src/core/lib/transport/service_config.c +12 -0
- data/src/core/lib/transport/service_config.h +6 -0
- data/src/core/lib/transport/transport.c +29 -17
- data/src/core/lib/transport/transport.h +85 -42
- data/src/core/lib/transport/transport_impl.h +5 -3
- data/src/core/lib/transport/transport_op_string.c +20 -14
- data/src/core/plugin_registry/grpc_plugin_registry.c +8 -0
- data/src/core/{lib/tsi → tsi}/fake_transport_security.c +2 -2
- data/src/core/{lib/tsi → tsi}/fake_transport_security.h +4 -4
- data/src/core/{lib/tsi → tsi}/ssl_transport_security.c +40 -79
- data/src/core/{lib/tsi → tsi}/ssl_transport_security.h +44 -21
- data/src/core/{lib/tsi → tsi}/ssl_types.h +3 -3
- data/src/core/{lib/tsi → tsi}/transport_security.c +2 -2
- data/src/core/{lib/tsi → tsi}/transport_security.h +4 -4
- data/src/core/{lib/tsi → tsi}/transport_security_interface.h +3 -3
- data/src/ruby/ext/grpc/extconf.rb +1 -0
- data/src/ruby/ext/grpc/rb_call_credentials.c +2 -2
- data/src/ruby/ext/grpc/rb_channel.c +520 -93
- data/src/ruby/ext/grpc/rb_channel.h +2 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +3 -0
- data/src/ruby/ext/grpc/rb_compression_options.c +5 -2
- data/src/ruby/ext/grpc/rb_event_thread.c +6 -6
- data/src/ruby/ext/grpc/rb_grpc.c +29 -7
- data/src/ruby/ext/grpc/rb_grpc.h +2 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +10 -0
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +15 -0
- data/src/ruby/ext/grpc/rb_server.c +5 -3
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/spec/channel_connection_spec.rb +173 -0
- data/src/ruby/spec/channel_spec.rb +29 -0
- data/src/ruby/spec/generic/rpc_server_pool_spec.rb +27 -17
- data/third_party/cares/ares_build.h +264 -0
- data/third_party/cares/cares/ares.h +636 -0
- data/third_party/cares/cares/ares__close_sockets.c +61 -0
- data/third_party/cares/cares/ares__get_hostent.c +261 -0
- data/third_party/cares/cares/ares__read_line.c +73 -0
- data/third_party/cares/cares/ares__timeval.c +111 -0
- data/third_party/cares/cares/ares_cancel.c +63 -0
- data/third_party/cares/cares/ares_create_query.c +202 -0
- data/third_party/cares/cares/ares_data.c +221 -0
- data/third_party/cares/cares/ares_data.h +72 -0
- data/third_party/cares/cares/ares_destroy.c +108 -0
- data/third_party/cares/cares/ares_dns.h +103 -0
- data/third_party/cares/cares/ares_expand_name.c +205 -0
- data/third_party/cares/cares/ares_expand_string.c +70 -0
- data/third_party/cares/cares/ares_fds.c +59 -0
- data/third_party/cares/cares/ares_free_hostent.c +41 -0
- data/third_party/cares/cares/ares_free_string.c +25 -0
- data/third_party/cares/cares/ares_getenv.c +30 -0
- data/third_party/cares/cares/ares_getenv.h +26 -0
- data/third_party/cares/cares/ares_gethostbyaddr.c +294 -0
- data/third_party/cares/cares/ares_gethostbyname.c +518 -0
- data/third_party/cares/cares/ares_getnameinfo.c +422 -0
- data/third_party/cares/cares/ares_getopt.c +122 -0
- data/third_party/cares/cares/ares_getopt.h +53 -0
- data/third_party/cares/cares/ares_getsock.c +66 -0
- data/third_party/cares/cares/ares_inet_net_pton.h +25 -0
- data/third_party/cares/cares/ares_init.c +2146 -0
- data/third_party/cares/cares/ares_iphlpapi.h +221 -0
- data/third_party/cares/cares/ares_ipv6.h +78 -0
- data/third_party/cares/cares/ares_library_init.c +167 -0
- data/third_party/cares/cares/ares_library_init.h +42 -0
- data/third_party/cares/cares/ares_llist.c +63 -0
- data/third_party/cares/cares/ares_llist.h +39 -0
- data/third_party/cares/cares/ares_mkquery.c +24 -0
- data/third_party/cares/cares/ares_nowarn.c +260 -0
- data/third_party/cares/cares/ares_nowarn.h +61 -0
- data/third_party/cares/cares/ares_options.c +402 -0
- data/third_party/cares/cares/ares_parse_a_reply.c +264 -0
- data/third_party/cares/cares/ares_parse_aaaa_reply.c +264 -0
- data/third_party/cares/cares/ares_parse_mx_reply.c +170 -0
- data/third_party/cares/cares/ares_parse_naptr_reply.c +188 -0
- data/third_party/cares/cares/ares_parse_ns_reply.c +183 -0
- data/third_party/cares/cares/ares_parse_ptr_reply.c +219 -0
- data/third_party/cares/cares/ares_parse_soa_reply.c +133 -0
- data/third_party/cares/cares/ares_parse_srv_reply.c +179 -0
- data/third_party/cares/cares/ares_parse_txt_reply.c +220 -0
- data/third_party/cares/cares/ares_platform.c +11035 -0
- data/third_party/cares/cares/ares_platform.h +43 -0
- data/third_party/cares/cares/ares_private.h +363 -0
- data/third_party/cares/cares/ares_process.c +1359 -0
- data/third_party/cares/cares/ares_query.c +186 -0
- data/third_party/cares/cares/ares_rules.h +125 -0
- data/third_party/cares/cares/ares_search.c +316 -0
- data/third_party/cares/cares/ares_send.c +131 -0
- data/third_party/cares/cares/ares_setup.h +217 -0
- data/third_party/cares/cares/ares_strcasecmp.c +66 -0
- data/third_party/cares/cares/ares_strcasecmp.h +30 -0
- data/third_party/cares/cares/ares_strdup.c +49 -0
- data/third_party/cares/cares/ares_strdup.h +24 -0
- data/third_party/cares/cares/ares_strerror.c +56 -0
- data/third_party/cares/cares/ares_timeout.c +88 -0
- data/third_party/cares/cares/ares_version.c +11 -0
- data/third_party/cares/cares/ares_version.h +24 -0
- data/third_party/cares/cares/ares_writev.c +79 -0
- data/third_party/cares/cares/bitncmp.c +59 -0
- data/third_party/cares/cares/bitncmp.h +26 -0
- data/third_party/cares/cares/config-win32.h +377 -0
- data/third_party/cares/cares/inet_net_pton.c +450 -0
- data/third_party/cares/cares/inet_ntop.c +208 -0
- data/third_party/cares/cares/setup_once.h +554 -0
- data/third_party/cares/cares/windows_port.c +22 -0
- data/third_party/cares/config_darwin/ares_config.h +523 -0
- data/third_party/cares/config_linux/ares_config.h +524 -0
- metadata +164 -68
@@ -37,6 +37,7 @@
|
|
37
37
|
#include <grpc/support/log.h>
|
38
38
|
#include <string.h>
|
39
39
|
#include "src/core/lib/profiling/timers.h"
|
40
|
+
#include "src/core/lib/slice/b64.h"
|
40
41
|
#include "src/core/lib/slice/percent_encoding.h"
|
41
42
|
#include "src/core/lib/slice/slice_internal.h"
|
42
43
|
#include "src/core/lib/slice/slice_string_helpers.h"
|
@@ -51,17 +52,16 @@ typedef struct call_data {
|
|
51
52
|
grpc_linked_mdelem status;
|
52
53
|
grpc_linked_mdelem content_type;
|
53
54
|
|
54
|
-
/* did this request come with payload
|
55
|
-
bool
|
55
|
+
/* did this request come with path query containing request payload */
|
56
|
+
bool seen_path_with_query;
|
56
57
|
/* flag to ensure payload_bin is delivered only once */
|
57
58
|
bool payload_bin_delivered;
|
58
59
|
|
59
60
|
grpc_metadata_batch *recv_initial_metadata;
|
60
|
-
|
61
|
-
bool *recv_cacheable_request;
|
61
|
+
uint32_t *recv_initial_metadata_flags;
|
62
62
|
/** Closure to call when finished with the hs_on_recv hook */
|
63
63
|
grpc_closure *on_done_recv;
|
64
|
-
/** Closure to call when we retrieve read message from the
|
64
|
+
/** Closure to call when we retrieve read message from the path URI
|
65
65
|
*/
|
66
66
|
grpc_closure *recv_message_ready;
|
67
67
|
grpc_closure *on_complete;
|
@@ -101,7 +101,7 @@ static void add_error(const char *error_name, grpc_error **cumulative,
|
|
101
101
|
grpc_error *new) {
|
102
102
|
if (new == GRPC_ERROR_NONE) return;
|
103
103
|
if (*cumulative == GRPC_ERROR_NONE) {
|
104
|
-
*cumulative =
|
104
|
+
*cumulative = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_name);
|
105
105
|
}
|
106
106
|
*cumulative = grpc_error_add_child(*cumulative, new);
|
107
107
|
}
|
@@ -115,37 +115,49 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
|
|
115
115
|
|
116
116
|
if (b->idx.named.method != NULL) {
|
117
117
|
if (grpc_mdelem_eq(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) {
|
118
|
-
*calld->
|
119
|
-
|
118
|
+
*calld->recv_initial_metadata_flags &=
|
119
|
+
~(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST |
|
120
|
+
GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
|
120
121
|
} else if (grpc_mdelem_eq(b->idx.named.method->md,
|
121
122
|
GRPC_MDELEM_METHOD_PUT)) {
|
122
|
-
*calld->
|
123
|
+
*calld->recv_initial_metadata_flags &=
|
124
|
+
~GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
|
125
|
+
*calld->recv_initial_metadata_flags |=
|
126
|
+
GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
|
123
127
|
} else if (grpc_mdelem_eq(b->idx.named.method->md,
|
124
128
|
GRPC_MDELEM_METHOD_GET)) {
|
125
|
-
*calld->
|
129
|
+
*calld->recv_initial_metadata_flags |=
|
130
|
+
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
|
131
|
+
*calld->recv_initial_metadata_flags &=
|
132
|
+
~GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
|
126
133
|
} else {
|
127
134
|
add_error(error_name, &error,
|
128
|
-
grpc_attach_md_to_error(
|
129
|
-
|
135
|
+
grpc_attach_md_to_error(
|
136
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
|
137
|
+
b->idx.named.method->md));
|
130
138
|
}
|
131
139
|
grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.method);
|
132
140
|
} else {
|
133
|
-
add_error(
|
134
|
-
|
135
|
-
|
141
|
+
add_error(
|
142
|
+
error_name, &error,
|
143
|
+
grpc_error_set_str(
|
144
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
|
145
|
+
GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":method")));
|
136
146
|
}
|
137
147
|
|
138
148
|
if (b->idx.named.te != NULL) {
|
139
149
|
if (!grpc_mdelem_eq(b->idx.named.te->md, GRPC_MDELEM_TE_TRAILERS)) {
|
140
150
|
add_error(error_name, &error,
|
141
|
-
grpc_attach_md_to_error(
|
142
|
-
|
151
|
+
grpc_attach_md_to_error(
|
152
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
|
153
|
+
b->idx.named.te->md));
|
143
154
|
}
|
144
155
|
grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.te);
|
145
156
|
} else {
|
146
157
|
add_error(error_name, &error,
|
147
|
-
grpc_error_set_str(
|
148
|
-
|
158
|
+
grpc_error_set_str(
|
159
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
|
160
|
+
GRPC_ERROR_STR_KEY, grpc_slice_from_static_string("te")));
|
149
161
|
}
|
150
162
|
|
151
163
|
if (b->idx.named.scheme != NULL) {
|
@@ -153,14 +165,17 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
|
|
153
165
|
!grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTPS) &&
|
154
166
|
!grpc_mdelem_eq(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_GRPC)) {
|
155
167
|
add_error(error_name, &error,
|
156
|
-
grpc_attach_md_to_error(
|
157
|
-
|
168
|
+
grpc_attach_md_to_error(
|
169
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
|
170
|
+
b->idx.named.scheme->md));
|
158
171
|
}
|
159
172
|
grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.scheme);
|
160
173
|
} else {
|
161
|
-
add_error(
|
162
|
-
|
163
|
-
|
174
|
+
add_error(
|
175
|
+
error_name, &error,
|
176
|
+
grpc_error_set_str(
|
177
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
|
178
|
+
GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":scheme")));
|
164
179
|
}
|
165
180
|
|
166
181
|
if (b->idx.named.content_type != NULL) {
|
@@ -194,8 +209,47 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
|
|
194
209
|
|
195
210
|
if (b->idx.named.path == NULL) {
|
196
211
|
add_error(error_name, &error,
|
197
|
-
grpc_error_set_str(
|
198
|
-
|
212
|
+
grpc_error_set_str(
|
213
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
|
214
|
+
GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":path")));
|
215
|
+
} else if (*calld->recv_initial_metadata_flags &
|
216
|
+
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) {
|
217
|
+
/* We have a cacheable request made with GET verb. The path contains the
|
218
|
+
* query parameter which is base64 encoded request payload. */
|
219
|
+
const char k_query_separator = '?';
|
220
|
+
grpc_slice path_slice = GRPC_MDVALUE(b->idx.named.path->md);
|
221
|
+
uint8_t *path_ptr = (uint8_t *)GRPC_SLICE_START_PTR(path_slice);
|
222
|
+
size_t path_length = GRPC_SLICE_LENGTH(path_slice);
|
223
|
+
/* offset of the character '?' */
|
224
|
+
size_t offset = 0;
|
225
|
+
for (offset = 0; offset < path_length && *path_ptr != k_query_separator;
|
226
|
+
path_ptr++, offset++)
|
227
|
+
;
|
228
|
+
if (offset < path_length) {
|
229
|
+
grpc_slice query_slice =
|
230
|
+
grpc_slice_sub(path_slice, offset + 1, path_length);
|
231
|
+
|
232
|
+
/* substitute path metadata with just the path (not query) */
|
233
|
+
grpc_mdelem mdelem_path_without_query = grpc_mdelem_from_slices(
|
234
|
+
exec_ctx, GRPC_MDSTR_PATH, grpc_slice_sub(path_slice, 0, offset));
|
235
|
+
|
236
|
+
grpc_metadata_batch_substitute(exec_ctx, b, b->idx.named.path,
|
237
|
+
mdelem_path_without_query);
|
238
|
+
|
239
|
+
/* decode payload from query and add to the slice buffer to be returned */
|
240
|
+
const int k_url_safe = 1;
|
241
|
+
grpc_slice_buffer_add(
|
242
|
+
&calld->read_slice_buffer,
|
243
|
+
grpc_base64_decode(exec_ctx,
|
244
|
+
(const char *)GRPC_SLICE_START_PTR(query_slice),
|
245
|
+
k_url_safe));
|
246
|
+
grpc_slice_buffer_stream_init(&calld->read_stream,
|
247
|
+
&calld->read_slice_buffer, 0);
|
248
|
+
calld->seen_path_with_query = true;
|
249
|
+
grpc_slice_unref_internal(exec_ctx, query_slice);
|
250
|
+
} else {
|
251
|
+
gpr_log(GPR_ERROR, "GET request without QUERY");
|
252
|
+
}
|
199
253
|
}
|
200
254
|
|
201
255
|
if (b->idx.named.host != NULL && b->idx.named.authority == NULL) {
|
@@ -212,19 +266,11 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
|
|
212
266
|
}
|
213
267
|
|
214
268
|
if (b->idx.named.authority == NULL) {
|
215
|
-
add_error(
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
if (b->idx.named.grpc_payload_bin != NULL) {
|
221
|
-
calld->seen_payload_bin = true;
|
222
|
-
grpc_slice_buffer_add(&calld->read_slice_buffer,
|
223
|
-
grpc_slice_ref_internal(
|
224
|
-
GRPC_MDVALUE(b->idx.named.grpc_payload_bin->md)));
|
225
|
-
grpc_slice_buffer_stream_init(&calld->read_stream,
|
226
|
-
&calld->read_slice_buffer, 0);
|
227
|
-
grpc_metadata_batch_remove(exec_ctx, b, b->idx.named.grpc_payload_bin);
|
269
|
+
add_error(
|
270
|
+
error_name, &error,
|
271
|
+
grpc_error_set_str(
|
272
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
|
273
|
+
GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":authority")));
|
228
274
|
}
|
229
275
|
|
230
276
|
return error;
|
@@ -247,8 +293,8 @@ static void hs_on_complete(grpc_exec_ctx *exec_ctx, void *user_data,
|
|
247
293
|
grpc_error *err) {
|
248
294
|
grpc_call_element *elem = user_data;
|
249
295
|
call_data *calld = elem->call_data;
|
250
|
-
/* Call recv_message_ready if we got the payload via the
|
251
|
-
if (calld->
|
296
|
+
/* Call recv_message_ready if we got the payload via the path field */
|
297
|
+
if (calld->seen_path_with_query && calld->recv_message_ready != NULL) {
|
252
298
|
*calld->pp_recv_message = calld->payload_bin_delivered
|
253
299
|
? NULL
|
254
300
|
: (grpc_byte_stream *)&calld->read_stream;
|
@@ -263,7 +309,7 @@ static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data,
|
|
263
309
|
grpc_error *err) {
|
264
310
|
grpc_call_element *elem = user_data;
|
265
311
|
call_data *calld = elem->call_data;
|
266
|
-
if (calld->
|
312
|
+
if (calld->seen_path_with_query) {
|
267
313
|
/* do nothing. This is probably a GET request, and payload will be returned
|
268
314
|
in hs_on_complete callback. */
|
269
315
|
} else {
|
@@ -272,45 +318,53 @@ static void hs_recv_message_ready(grpc_exec_ctx *exec_ctx, void *user_data,
|
|
272
318
|
}
|
273
319
|
|
274
320
|
static void hs_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
275
|
-
|
321
|
+
grpc_transport_stream_op_batch *op) {
|
276
322
|
/* grab pointers to our data from the call element */
|
277
323
|
call_data *calld = elem->call_data;
|
278
324
|
|
279
|
-
if (op->send_initial_metadata
|
325
|
+
if (op->send_initial_metadata) {
|
280
326
|
grpc_error *error = GRPC_ERROR_NONE;
|
281
327
|
static const char *error_name = "Failed sending initial metadata";
|
282
|
-
add_error(
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
328
|
+
add_error(
|
329
|
+
error_name, &error,
|
330
|
+
grpc_metadata_batch_add_head(
|
331
|
+
exec_ctx, op->payload->send_initial_metadata.send_initial_metadata,
|
332
|
+
&calld->status, GRPC_MDELEM_STATUS_200));
|
333
|
+
add_error(
|
334
|
+
error_name, &error,
|
335
|
+
grpc_metadata_batch_add_tail(
|
336
|
+
exec_ctx, op->payload->send_initial_metadata.send_initial_metadata,
|
337
|
+
&calld->content_type,
|
338
|
+
GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC));
|
289
339
|
add_error(error_name, &error,
|
290
|
-
server_filter_outgoing_metadata(
|
291
|
-
|
340
|
+
server_filter_outgoing_metadata(
|
341
|
+
exec_ctx, elem,
|
342
|
+
op->payload->send_initial_metadata.send_initial_metadata));
|
292
343
|
if (error != GRPC_ERROR_NONE) {
|
293
|
-
|
344
|
+
grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error);
|
294
345
|
return;
|
295
346
|
}
|
296
347
|
}
|
297
348
|
|
298
349
|
if (op->recv_initial_metadata) {
|
299
350
|
/* substitute our callback for the higher callback */
|
300
|
-
GPR_ASSERT(op->
|
301
|
-
|
302
|
-
|
303
|
-
calld->
|
304
|
-
|
305
|
-
calld->on_done_recv =
|
306
|
-
|
351
|
+
GPR_ASSERT(op->payload->recv_initial_metadata.recv_flags != NULL);
|
352
|
+
calld->recv_initial_metadata =
|
353
|
+
op->payload->recv_initial_metadata.recv_initial_metadata;
|
354
|
+
calld->recv_initial_metadata_flags =
|
355
|
+
op->payload->recv_initial_metadata.recv_flags;
|
356
|
+
calld->on_done_recv =
|
357
|
+
op->payload->recv_initial_metadata.recv_initial_metadata_ready;
|
358
|
+
op->payload->recv_initial_metadata.recv_initial_metadata_ready =
|
359
|
+
&calld->hs_on_recv;
|
307
360
|
}
|
308
361
|
|
309
362
|
if (op->recv_message) {
|
310
|
-
calld->recv_message_ready = op->recv_message_ready;
|
311
|
-
calld->pp_recv_message = op->recv_message;
|
312
|
-
if (op->recv_message_ready) {
|
313
|
-
op->recv_message_ready =
|
363
|
+
calld->recv_message_ready = op->payload->recv_message.recv_message_ready;
|
364
|
+
calld->pp_recv_message = op->payload->recv_message.recv_message;
|
365
|
+
if (op->payload->recv_message.recv_message_ready) {
|
366
|
+
op->payload->recv_message.recv_message_ready =
|
367
|
+
&calld->hs_recv_message_ready;
|
314
368
|
}
|
315
369
|
if (op->on_complete) {
|
316
370
|
calld->on_complete = op->on_complete;
|
@@ -320,9 +374,10 @@ static void hs_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
|
320
374
|
|
321
375
|
if (op->send_trailing_metadata) {
|
322
376
|
grpc_error *error = server_filter_outgoing_metadata(
|
323
|
-
exec_ctx, elem,
|
377
|
+
exec_ctx, elem,
|
378
|
+
op->payload->send_trailing_metadata.send_trailing_metadata);
|
324
379
|
if (error != GRPC_ERROR_NONE) {
|
325
|
-
|
380
|
+
grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error);
|
326
381
|
return;
|
327
382
|
}
|
328
383
|
}
|
@@ -330,7 +385,7 @@ static void hs_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
|
330
385
|
|
331
386
|
static void hs_start_transport_op(grpc_exec_ctx *exec_ctx,
|
332
387
|
grpc_call_element *elem,
|
333
|
-
|
388
|
+
grpc_transport_stream_op_batch *op) {
|
334
389
|
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
|
335
390
|
GPR_TIMER_BEGIN("hs_start_transport_op", 0);
|
336
391
|
hs_mutate_op(exec_ctx, elem, op);
|
@@ -358,7 +413,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
|
|
358
413
|
/* Destructor for call_data */
|
359
414
|
static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
|
360
415
|
const grpc_call_final_info *final_info,
|
361
|
-
|
416
|
+
grpc_closure *ignored) {
|
362
417
|
call_data *calld = elem->call_data;
|
363
418
|
grpc_slice_buffer_destroy_internal(exec_ctx, &calld->read_slice_buffer);
|
364
419
|
}
|
@@ -121,8 +121,8 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
|
|
121
121
|
"Received message larger than max (%u vs. %d)",
|
122
122
|
(*calld->recv_message)->length, calld->max_recv_size);
|
123
123
|
grpc_error* new_error = grpc_error_set_int(
|
124
|
-
|
125
|
-
|
124
|
+
GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string),
|
125
|
+
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
|
126
126
|
if (error == GRPC_ERROR_NONE) {
|
127
127
|
error = new_error;
|
128
128
|
} else {
|
@@ -132,32 +132,36 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
|
|
132
132
|
gpr_free(message_string);
|
133
133
|
}
|
134
134
|
// Invoke the next callback.
|
135
|
-
|
135
|
+
grpc_closure_run(exec_ctx, calld->next_recv_message_ready, error);
|
136
136
|
}
|
137
137
|
|
138
138
|
// Start transport stream op.
|
139
|
-
static void
|
140
|
-
|
141
|
-
|
139
|
+
static void start_transport_stream_op_batch(
|
140
|
+
grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
|
141
|
+
grpc_transport_stream_op_batch* op) {
|
142
142
|
call_data* calld = elem->call_data;
|
143
143
|
// Check max send message size.
|
144
|
-
if (op->send_message
|
145
|
-
op->send_message->length >
|
144
|
+
if (op->send_message && calld->max_send_size >= 0 &&
|
145
|
+
op->payload->send_message.send_message->length >
|
146
|
+
(size_t)calld->max_send_size) {
|
146
147
|
char* message_string;
|
147
148
|
gpr_asprintf(&message_string, "Sent message larger than max (%u vs. %d)",
|
148
|
-
op->send_message->length,
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
149
|
+
op->payload->send_message.send_message->length,
|
150
|
+
calld->max_send_size);
|
151
|
+
grpc_transport_stream_op_batch_finish_with_failure(
|
152
|
+
exec_ctx, op,
|
153
|
+
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string),
|
154
|
+
GRPC_ERROR_INT_GRPC_STATUS,
|
155
|
+
GRPC_STATUS_RESOURCE_EXHAUSTED));
|
153
156
|
gpr_free(message_string);
|
154
157
|
return;
|
155
158
|
}
|
156
159
|
// Inject callback for receiving a message.
|
157
|
-
if (op->
|
158
|
-
calld->next_recv_message_ready =
|
159
|
-
|
160
|
-
|
160
|
+
if (op->recv_message) {
|
161
|
+
calld->next_recv_message_ready =
|
162
|
+
op->payload->recv_message.recv_message_ready;
|
163
|
+
calld->recv_message = op->payload->recv_message.recv_message;
|
164
|
+
op->payload->recv_message.recv_message_ready = &calld->recv_message_ready;
|
161
165
|
}
|
162
166
|
// Chain to the next filter.
|
163
167
|
grpc_call_next_op(exec_ctx, elem, op);
|
@@ -200,7 +204,7 @@ static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
|
|
200
204
|
// Destructor for call_data.
|
201
205
|
static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
|
202
206
|
const grpc_call_final_info* final_info,
|
203
|
-
|
207
|
+
grpc_closure* ignored) {}
|
204
208
|
|
205
209
|
// Constructor for channel_data.
|
206
210
|
static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
|
@@ -252,7 +256,7 @@ static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
|
|
252
256
|
}
|
253
257
|
|
254
258
|
const grpc_channel_filter grpc_message_size_filter = {
|
255
|
-
|
259
|
+
start_transport_stream_op_batch,
|
256
260
|
grpc_channel_next_op,
|
257
261
|
sizeof(call_data),
|
258
262
|
init_call_elem,
|
data/src/core/lib/http/httpcli.c
CHANGED
@@ -126,13 +126,15 @@ static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
|
|
126
126
|
|
127
127
|
static void append_error(internal_request *req, grpc_error *error) {
|
128
128
|
if (req->overall_error == GRPC_ERROR_NONE) {
|
129
|
-
req->overall_error =
|
129
|
+
req->overall_error =
|
130
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
|
130
131
|
}
|
131
132
|
grpc_resolved_address *addr = &req->addresses->addrs[req->next_address - 1];
|
132
133
|
char *addr_text = grpc_sockaddr_to_uri(addr);
|
133
134
|
req->overall_error = grpc_error_add_child(
|
134
135
|
req->overall_error,
|
135
|
-
grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
|
136
|
+
grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
|
137
|
+
grpc_slice_from_copied_string(addr_text)));
|
136
138
|
gpr_free(addr_text);
|
137
139
|
}
|
138
140
|
|
@@ -190,8 +192,8 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
|
|
190
192
|
internal_request *req = arg;
|
191
193
|
|
192
194
|
if (!ep) {
|
193
|
-
next_address(exec_ctx, req,
|
194
|
-
|
195
|
+
next_address(exec_ctx, req, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
|
196
|
+
"Unexplained handshake failure"));
|
195
197
|
return;
|
196
198
|
}
|
197
199
|
|
@@ -221,8 +223,8 @@ static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req,
|
|
221
223
|
}
|
222
224
|
if (req->next_address == req->addresses->naddrs) {
|
223
225
|
finish(exec_ctx, req,
|
224
|
-
|
225
|
-
|
226
|
+
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
|
227
|
+
"Failed HTTP requests to all targets", &req->overall_error, 1));
|
226
228
|
return;
|
227
229
|
}
|
228
230
|
addr = &req->addresses->addrs[req->next_address++];
|
@@ -43,11 +43,11 @@
|
|
43
43
|
#include "src/core/lib/security/transport/security_handshaker.h"
|
44
44
|
#include "src/core/lib/slice/slice_internal.h"
|
45
45
|
#include "src/core/lib/support/string.h"
|
46
|
-
#include "src/core/
|
46
|
+
#include "src/core/tsi/ssl_transport_security.h"
|
47
47
|
|
48
48
|
typedef struct {
|
49
49
|
grpc_channel_security_connector base;
|
50
|
-
|
50
|
+
tsi_ssl_client_handshaker_factory *handshaker_factory;
|
51
51
|
char *secure_peer_name;
|
52
52
|
} grpc_httpcli_ssl_channel_security_connector;
|
53
53
|
|
@@ -56,7 +56,7 @@ static void httpcli_ssl_destroy(grpc_exec_ctx *exec_ctx,
|
|
56
56
|
grpc_httpcli_ssl_channel_security_connector *c =
|
57
57
|
(grpc_httpcli_ssl_channel_security_connector *)sc;
|
58
58
|
if (c->handshaker_factory != NULL) {
|
59
|
-
|
59
|
+
tsi_ssl_client_handshaker_factory_destroy(c->handshaker_factory);
|
60
60
|
}
|
61
61
|
if (c->secure_peer_name != NULL) gpr_free(c->secure_peer_name);
|
62
62
|
gpr_free(sc);
|
@@ -69,7 +69,7 @@ static void httpcli_ssl_add_handshakers(grpc_exec_ctx *exec_ctx,
|
|
69
69
|
(grpc_httpcli_ssl_channel_security_connector *)sc;
|
70
70
|
tsi_handshaker *handshaker = NULL;
|
71
71
|
if (c->handshaker_factory != NULL) {
|
72
|
-
tsi_result result =
|
72
|
+
tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
|
73
73
|
c->handshaker_factory, c->secure_peer_name, &handshaker);
|
74
74
|
if (result != TSI_OK) {
|
75
75
|
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
|
@@ -95,7 +95,7 @@ static void httpcli_ssl_check_peer(grpc_exec_ctx *exec_ctx,
|
|
95
95
|
char *msg;
|
96
96
|
gpr_asprintf(&msg, "Peer name %s is not in peer certificate",
|
97
97
|
c->secure_peer_name);
|
98
|
-
error =
|
98
|
+
error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(msg);
|
99
99
|
gpr_free(msg);
|
100
100
|
}
|
101
101
|
grpc_closure_sched(exec_ctx, on_peer_checked, error);
|