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
@@ -0,0 +1,131 @@
|
|
1
|
+
|
2
|
+
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
3
|
+
*
|
4
|
+
* Permission to use, copy, modify, and distribute this
|
5
|
+
* software and its documentation for any purpose and without
|
6
|
+
* fee is hereby granted, provided that the above copyright
|
7
|
+
* notice appear in all copies and that both that copyright
|
8
|
+
* notice and this permission notice appear in supporting
|
9
|
+
* documentation, and that the name of M.I.T. not be used in
|
10
|
+
* advertising or publicity pertaining to distribution of the
|
11
|
+
* software without specific, written prior permission.
|
12
|
+
* M.I.T. makes no representations about the suitability of
|
13
|
+
* this software for any purpose. It is provided "as is"
|
14
|
+
* without express or implied warranty.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#include "ares_setup.h"
|
18
|
+
|
19
|
+
#ifdef HAVE_NETINET_IN_H
|
20
|
+
# include <netinet/in.h>
|
21
|
+
#endif
|
22
|
+
#ifdef HAVE_ARPA_NAMESER_H
|
23
|
+
# include <arpa/nameser.h>
|
24
|
+
#else
|
25
|
+
# include "nameser.h"
|
26
|
+
#endif
|
27
|
+
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
28
|
+
# include <arpa/nameser_compat.h>
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#include "ares.h"
|
32
|
+
#include "ares_dns.h"
|
33
|
+
#include "ares_private.h"
|
34
|
+
|
35
|
+
void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
36
|
+
ares_callback callback, void *arg)
|
37
|
+
{
|
38
|
+
struct query *query;
|
39
|
+
int i, packetsz;
|
40
|
+
struct timeval now;
|
41
|
+
|
42
|
+
/* Verify that the query is at least long enough to hold the header. */
|
43
|
+
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
44
|
+
{
|
45
|
+
callback(arg, ARES_EBADQUERY, 0, NULL, 0);
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
/* Allocate space for query and allocated fields. */
|
50
|
+
query = ares_malloc(sizeof(struct query));
|
51
|
+
if (!query)
|
52
|
+
{
|
53
|
+
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
query->tcpbuf = ares_malloc(qlen + 2);
|
57
|
+
if (!query->tcpbuf)
|
58
|
+
{
|
59
|
+
ares_free(query);
|
60
|
+
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
query->server_info = ares_malloc(channel->nservers *
|
64
|
+
sizeof(query->server_info[0]));
|
65
|
+
if (!query->server_info)
|
66
|
+
{
|
67
|
+
ares_free(query->tcpbuf);
|
68
|
+
ares_free(query);
|
69
|
+
callback(arg, ARES_ENOMEM, 0, NULL, 0);
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
|
73
|
+
/* Compute the query ID. Start with no timeout. */
|
74
|
+
query->qid = DNS_HEADER_QID(qbuf);
|
75
|
+
query->timeout.tv_sec = 0;
|
76
|
+
query->timeout.tv_usec = 0;
|
77
|
+
|
78
|
+
/* Form the TCP query buffer by prepending qlen (as two
|
79
|
+
* network-order bytes) to qbuf.
|
80
|
+
*/
|
81
|
+
query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff);
|
82
|
+
query->tcpbuf[1] = (unsigned char)(qlen & 0xff);
|
83
|
+
memcpy(query->tcpbuf + 2, qbuf, qlen);
|
84
|
+
query->tcplen = qlen + 2;
|
85
|
+
|
86
|
+
/* Fill in query arguments. */
|
87
|
+
query->qbuf = query->tcpbuf + 2;
|
88
|
+
query->qlen = qlen;
|
89
|
+
query->callback = callback;
|
90
|
+
query->arg = arg;
|
91
|
+
|
92
|
+
/* Initialize query status. */
|
93
|
+
query->try_count = 0;
|
94
|
+
|
95
|
+
/* Choose the server to send the query to. If rotation is enabled, keep track
|
96
|
+
* of the next server we want to use. */
|
97
|
+
query->server = channel->last_server;
|
98
|
+
if (channel->rotate == 1)
|
99
|
+
channel->last_server = (channel->last_server + 1) % channel->nservers;
|
100
|
+
|
101
|
+
for (i = 0; i < channel->nservers; i++)
|
102
|
+
{
|
103
|
+
query->server_info[i].skip_server = 0;
|
104
|
+
query->server_info[i].tcp_connection_generation = 0;
|
105
|
+
}
|
106
|
+
|
107
|
+
packetsz = (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : PACKETSZ;
|
108
|
+
query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > packetsz;
|
109
|
+
|
110
|
+
query->error_status = ARES_ECONNREFUSED;
|
111
|
+
query->timeouts = 0;
|
112
|
+
|
113
|
+
/* Initialize our list nodes. */
|
114
|
+
ares__init_list_node(&(query->queries_by_qid), query);
|
115
|
+
ares__init_list_node(&(query->queries_by_timeout), query);
|
116
|
+
ares__init_list_node(&(query->queries_to_server), query);
|
117
|
+
ares__init_list_node(&(query->all_queries), query);
|
118
|
+
|
119
|
+
/* Chain the query into the list of all queries. */
|
120
|
+
ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
|
121
|
+
/* Keep track of queries bucketed by qid, so we can process DNS
|
122
|
+
* responses quickly.
|
123
|
+
*/
|
124
|
+
ares__insert_in_list(
|
125
|
+
&(query->queries_by_qid),
|
126
|
+
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
127
|
+
|
128
|
+
/* Perform the first query action. */
|
129
|
+
now = ares__tvnow();
|
130
|
+
ares__send_query(channel, query, &now);
|
131
|
+
}
|
@@ -0,0 +1,217 @@
|
|
1
|
+
#ifndef HEADER_CARES_SETUP_H
|
2
|
+
#define HEADER_CARES_SETUP_H
|
3
|
+
|
4
|
+
|
5
|
+
/* Copyright (C) 2004 - 2012 by Daniel Stenberg et al
|
6
|
+
*
|
7
|
+
* Permission to use, copy, modify, and distribute this software and its
|
8
|
+
* documentation for any purpose and without fee is hereby granted, provided
|
9
|
+
* that the above copyright notice appear in all copies and that both that
|
10
|
+
* copyright notice and this permission notice appear in supporting
|
11
|
+
* documentation, and that the name of M.I.T. not be used in advertising or
|
12
|
+
* publicity pertaining to distribution of the software without specific,
|
13
|
+
* written prior permission. M.I.T. makes no representations about the
|
14
|
+
* suitability of this software for any purpose. It is provided "as is"
|
15
|
+
* without express or implied warranty.
|
16
|
+
*/
|
17
|
+
|
18
|
+
/*
|
19
|
+
* Define WIN32 when build target is Win32 API
|
20
|
+
*/
|
21
|
+
|
22
|
+
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
23
|
+
#define WIN32
|
24
|
+
#endif
|
25
|
+
|
26
|
+
/*
|
27
|
+
* Include configuration script results or hand-crafted
|
28
|
+
* configuration file for platforms which lack config tool.
|
29
|
+
*/
|
30
|
+
|
31
|
+
#ifdef HAVE_CONFIG_H
|
32
|
+
#include "ares_config.h"
|
33
|
+
#else
|
34
|
+
|
35
|
+
#ifdef WIN32
|
36
|
+
#include "config-win32.h"
|
37
|
+
#endif
|
38
|
+
|
39
|
+
#endif /* HAVE_CONFIG_H */
|
40
|
+
|
41
|
+
/* ================================================================ */
|
42
|
+
/* Definition of preprocessor macros/symbols which modify compiler */
|
43
|
+
/* behaviour or generated code characteristics must be done here, */
|
44
|
+
/* as appropriate, before any system header file is included. It is */
|
45
|
+
/* also possible to have them defined in the config file included */
|
46
|
+
/* before this point. As a result of all this we frown inclusion of */
|
47
|
+
/* system header files in our config files, avoid this at any cost. */
|
48
|
+
/* ================================================================ */
|
49
|
+
|
50
|
+
/*
|
51
|
+
* AIX 4.3 and newer needs _THREAD_SAFE defined to build
|
52
|
+
* proper reentrant code. Others may also need it.
|
53
|
+
*/
|
54
|
+
|
55
|
+
#ifdef NEED_THREAD_SAFE
|
56
|
+
# ifndef _THREAD_SAFE
|
57
|
+
# define _THREAD_SAFE
|
58
|
+
# endif
|
59
|
+
#endif
|
60
|
+
|
61
|
+
/*
|
62
|
+
* Tru64 needs _REENTRANT set for a few function prototypes and
|
63
|
+
* things to appear in the system header files. Unixware needs it
|
64
|
+
* to build proper reentrant code. Others may also need it.
|
65
|
+
*/
|
66
|
+
|
67
|
+
#ifdef NEED_REENTRANT
|
68
|
+
# ifndef _REENTRANT
|
69
|
+
# define _REENTRANT
|
70
|
+
# endif
|
71
|
+
#endif
|
72
|
+
|
73
|
+
/* ================================================================ */
|
74
|
+
/* If you need to include a system header file for your platform, */
|
75
|
+
/* please, do it beyond the point further indicated in this file. */
|
76
|
+
/* ================================================================ */
|
77
|
+
|
78
|
+
/*
|
79
|
+
* c-ares external interface definitions are also used internally,
|
80
|
+
* and might also include required system header files to define them.
|
81
|
+
*/
|
82
|
+
|
83
|
+
#include <ares_build.h>
|
84
|
+
|
85
|
+
/*
|
86
|
+
* Compile time sanity checks must also be done when building the library.
|
87
|
+
*/
|
88
|
+
|
89
|
+
#include <ares_rules.h>
|
90
|
+
|
91
|
+
/* ================================================================= */
|
92
|
+
/* No system header file shall be included in this file before this */
|
93
|
+
/* point. The only allowed ones are those included from ares_build.h */
|
94
|
+
/* ================================================================= */
|
95
|
+
|
96
|
+
/*
|
97
|
+
* Include header files for windows builds before redefining anything.
|
98
|
+
* Use this preproessor block only to include or exclude windows.h,
|
99
|
+
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
|
100
|
+
* to any other further and independent block. Under Cygwin things work
|
101
|
+
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
|
102
|
+
* never be included when __CYGWIN__ is defined. configure script takes
|
103
|
+
* care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
|
104
|
+
* neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
|
105
|
+
*/
|
106
|
+
|
107
|
+
#ifdef HAVE_WINDOWS_H
|
108
|
+
# ifndef WIN32_LEAN_AND_MEAN
|
109
|
+
# define WIN32_LEAN_AND_MEAN
|
110
|
+
# endif
|
111
|
+
# include <windows.h>
|
112
|
+
# ifdef HAVE_WINSOCK2_H
|
113
|
+
# include <winsock2.h>
|
114
|
+
# ifdef HAVE_WS2TCPIP_H
|
115
|
+
# include <ws2tcpip.h>
|
116
|
+
# endif
|
117
|
+
# else
|
118
|
+
# ifdef HAVE_WINSOCK_H
|
119
|
+
# include <winsock.h>
|
120
|
+
# endif
|
121
|
+
# endif
|
122
|
+
#endif
|
123
|
+
|
124
|
+
/*
|
125
|
+
* Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
|
126
|
+
* define USE_WINSOCK to 1 if we have and use WINSOCK API, else
|
127
|
+
* undefine USE_WINSOCK.
|
128
|
+
*/
|
129
|
+
|
130
|
+
#undef USE_WINSOCK
|
131
|
+
|
132
|
+
#ifdef HAVE_WINSOCK2_H
|
133
|
+
# define USE_WINSOCK 2
|
134
|
+
#else
|
135
|
+
# ifdef HAVE_WINSOCK_H
|
136
|
+
# define USE_WINSOCK 1
|
137
|
+
# endif
|
138
|
+
#endif
|
139
|
+
|
140
|
+
/*
|
141
|
+
* Work-arounds for systems without configure support
|
142
|
+
*/
|
143
|
+
|
144
|
+
#ifndef HAVE_CONFIG_H
|
145
|
+
|
146
|
+
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
|
147
|
+
#define HAVE_SYS_TIME_H
|
148
|
+
#endif
|
149
|
+
|
150
|
+
#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
151
|
+
#define HAVE_UNISTD_H 1
|
152
|
+
#endif
|
153
|
+
|
154
|
+
#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
|
155
|
+
#define HAVE_SYS_UIO_H
|
156
|
+
#endif
|
157
|
+
|
158
|
+
#endif /* HAVE_CONFIG_H */
|
159
|
+
|
160
|
+
/*
|
161
|
+
* Arg 2 type for gethostname in case it hasn't been defined in config file.
|
162
|
+
*/
|
163
|
+
|
164
|
+
#ifndef GETHOSTNAME_TYPE_ARG2
|
165
|
+
# ifdef USE_WINSOCK
|
166
|
+
# define GETHOSTNAME_TYPE_ARG2 int
|
167
|
+
# else
|
168
|
+
# define GETHOSTNAME_TYPE_ARG2 size_t
|
169
|
+
# endif
|
170
|
+
#endif
|
171
|
+
|
172
|
+
#ifdef __POCC__
|
173
|
+
# include <sys/types.h>
|
174
|
+
# include <unistd.h>
|
175
|
+
# define ESRCH 3
|
176
|
+
#endif
|
177
|
+
|
178
|
+
/*
|
179
|
+
* Android does have the arpa/nameser.h header which is detected by configure
|
180
|
+
* but it appears to be empty with recent NDK r7b / r7c, so we undefine here.
|
181
|
+
*/
|
182
|
+
#if (defined(ANDROID) || defined(__ANDROID__)) && defined(HAVE_ARPA_NAMESER_H)
|
183
|
+
# undef HAVE_ARPA_NAMESER_H
|
184
|
+
#endif
|
185
|
+
|
186
|
+
/*
|
187
|
+
* Recent autoconf versions define these symbols in ares_config.h. We don't
|
188
|
+
* want them (since they collide with the libcurl ones when we build
|
189
|
+
* --enable-debug) so we undef them again here.
|
190
|
+
*/
|
191
|
+
|
192
|
+
#undef PACKAGE_STRING
|
193
|
+
#undef PACKAGE_TARNAME
|
194
|
+
#undef PACKAGE_VERSION
|
195
|
+
#undef PACKAGE_BUGREPORT
|
196
|
+
#undef PACKAGE_NAME
|
197
|
+
#undef VERSION
|
198
|
+
#undef PACKAGE
|
199
|
+
|
200
|
+
/* IPv6 compatibility */
|
201
|
+
#if !defined(HAVE_AF_INET6)
|
202
|
+
#if defined(HAVE_PF_INET6)
|
203
|
+
#define AF_INET6 PF_INET6
|
204
|
+
#else
|
205
|
+
#define AF_INET6 AF_MAX+1
|
206
|
+
#endif
|
207
|
+
#endif
|
208
|
+
|
209
|
+
/*
|
210
|
+
* Include macros and defines that should only be processed once.
|
211
|
+
*/
|
212
|
+
|
213
|
+
#ifndef __SETUP_ONCE_H
|
214
|
+
#include "setup_once.h"
|
215
|
+
#endif
|
216
|
+
|
217
|
+
#endif /* HEADER_CARES_SETUP_H */
|
@@ -0,0 +1,66 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this
|
6
|
+
* software and its documentation for any purpose and without
|
7
|
+
* fee is hereby granted, provided that the above copyright
|
8
|
+
* notice appear in all copies and that both that copyright
|
9
|
+
* notice and this permission notice appear in supporting
|
10
|
+
* documentation, and that the name of M.I.T. not be used in
|
11
|
+
* advertising or publicity pertaining to distribution of the
|
12
|
+
* software without specific, written prior permission.
|
13
|
+
* M.I.T. makes no representations about the suitability of
|
14
|
+
* this software for any purpose. It is provided "as is"
|
15
|
+
* without express or implied warranty.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include "ares_setup.h"
|
19
|
+
#include "ares_strcasecmp.h"
|
20
|
+
|
21
|
+
#ifndef HAVE_STRCASECMP
|
22
|
+
int ares_strcasecmp(const char *a, const char *b)
|
23
|
+
{
|
24
|
+
#if defined(HAVE_STRCMPI)
|
25
|
+
return strcmpi(a, b);
|
26
|
+
#elif defined(HAVE_STRICMP)
|
27
|
+
return stricmp(a, b);
|
28
|
+
#else
|
29
|
+
size_t i;
|
30
|
+
|
31
|
+
for (i = 0; i < (size_t)-1; i++) {
|
32
|
+
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
33
|
+
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
34
|
+
if (c1 != c2)
|
35
|
+
return c1-c2;
|
36
|
+
if (!c1)
|
37
|
+
break;
|
38
|
+
}
|
39
|
+
return 0;
|
40
|
+
#endif
|
41
|
+
}
|
42
|
+
#endif
|
43
|
+
|
44
|
+
#ifndef HAVE_STRNCASECMP
|
45
|
+
int ares_strncasecmp(const char *a, const char *b, size_t n)
|
46
|
+
{
|
47
|
+
#if defined(HAVE_STRNCMPI)
|
48
|
+
return strncmpi(a, b, n);
|
49
|
+
#elif defined(HAVE_STRNICMP)
|
50
|
+
return strnicmp(a, b, n);
|
51
|
+
#else
|
52
|
+
size_t i;
|
53
|
+
|
54
|
+
for (i = 0; i < n; i++) {
|
55
|
+
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
56
|
+
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
57
|
+
if (c1 != c2)
|
58
|
+
return c1-c2;
|
59
|
+
if (!c1)
|
60
|
+
break;
|
61
|
+
}
|
62
|
+
return 0;
|
63
|
+
#endif
|
64
|
+
}
|
65
|
+
#endif
|
66
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#ifndef HEADER_CARES_STRCASECMP_H
|
2
|
+
#define HEADER_CARES_STRCASECMP_H
|
3
|
+
|
4
|
+
|
5
|
+
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
6
|
+
*
|
7
|
+
* Permission to use, copy, modify, and distribute this
|
8
|
+
* software and its documentation for any purpose and without
|
9
|
+
* fee is hereby granted, provided that the above copyright
|
10
|
+
* notice appear in all copies and that both that copyright
|
11
|
+
* notice and this permission notice appear in supporting
|
12
|
+
* documentation, and that the name of M.I.T. not be used in
|
13
|
+
* advertising or publicity pertaining to distribution of the
|
14
|
+
* software without specific, written prior permission.
|
15
|
+
* M.I.T. makes no representations about the suitability of
|
16
|
+
* this software for any purpose. It is provided "as is"
|
17
|
+
* without express or implied warranty.
|
18
|
+
*/
|
19
|
+
|
20
|
+
#include "ares_setup.h"
|
21
|
+
|
22
|
+
#ifndef HAVE_STRCASECMP
|
23
|
+
extern int ares_strcasecmp(const char *a, const char *b);
|
24
|
+
#endif
|
25
|
+
|
26
|
+
#ifndef HAVE_STRNCASECMP
|
27
|
+
extern int ares_strncasecmp(const char *a, const char *b, size_t n);
|
28
|
+
#endif
|
29
|
+
|
30
|
+
#endif /* HEADER_CARES_STRCASECMP_H */
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
4
|
+
*
|
5
|
+
* Permission to use, copy, modify, and distribute this
|
6
|
+
* software and its documentation for any purpose and without
|
7
|
+
* fee is hereby granted, provided that the above copyright
|
8
|
+
* notice appear in all copies and that both that copyright
|
9
|
+
* notice and this permission notice appear in supporting
|
10
|
+
* documentation, and that the name of M.I.T. not be used in
|
11
|
+
* advertising or publicity pertaining to distribution of the
|
12
|
+
* software without specific, written prior permission.
|
13
|
+
* M.I.T. makes no representations about the suitability of
|
14
|
+
* this software for any purpose. It is provided "as is"
|
15
|
+
* without express or implied warranty.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include "ares_setup.h"
|
19
|
+
#include "ares_strdup.h"
|
20
|
+
#include "ares.h"
|
21
|
+
#include "ares_private.h"
|
22
|
+
|
23
|
+
char *ares_strdup(const char *s1)
|
24
|
+
{
|
25
|
+
#ifdef HAVE_STRDUP
|
26
|
+
if (ares_malloc == malloc)
|
27
|
+
return strdup(s1);
|
28
|
+
else
|
29
|
+
#endif
|
30
|
+
{
|
31
|
+
size_t sz;
|
32
|
+
char * s2;
|
33
|
+
|
34
|
+
if(s1) {
|
35
|
+
sz = strlen(s1);
|
36
|
+
if(sz < (size_t)-1) {
|
37
|
+
sz++;
|
38
|
+
if(sz < ((size_t)-1) / sizeof(char)) {
|
39
|
+
s2 = ares_malloc(sz * sizeof(char));
|
40
|
+
if(s2) {
|
41
|
+
memcpy(s2, s1, sz * sizeof(char));
|
42
|
+
return s2;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
return (char *)NULL;
|
48
|
+
}
|
49
|
+
}
|