From 588b2243e6312f499022b98e5edf39cccd2e81f9 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 25 Apr 2018 14:20:56 -0700 Subject: build_project --- gRPC-Core.podspec | 337 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 337 insertions(+) (limited to 'gRPC-Core.podspec') diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index fc6b31fd23..dc85e541a5 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -398,6 +398,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_cfstream.h', 'src/core/lib/iomgr/iomgr_custom.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.h', @@ -546,6 +547,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', + 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -978,6 +980,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_cfstream.h', 'src/core/lib/iomgr/iomgr_custom.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.h', @@ -1082,6 +1085,340 @@ Pod::Spec.new do |s| 'src/core/ext/filters/workarounds/workaround_utils.h' end + s.subspec 'CFStream-Implementation' do |ss| + ss.header_mappings_dir = '.' + ss.dependency "#{s.name}/Implementation", version + ss.pod_target_xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1' + } + ss.source_files = 'src/core/lib/iomgr/error_apple.mm', + 'src/core/lib/iomgr/tcp_cfstream.mm', + 'src/core/lib/iomgr/tcp_cfstream_sync.mm', + 'src/core/lib/iomgr/tcp_client_cfstream.mm', + 'src/core/lib/iomgr/error_apple.h', + 'src/core/lib/iomgr/tcp_cfstream.h', + 'src/core/lib/iomgr/tcp_cfstream_sync.h', + 'src/core/lib/gpr/arena.h', + 'src/core/lib/gpr/env.h', + 'src/core/lib/gpr/fork.h', + 'src/core/lib/gpr/host_port.h', + 'src/core/lib/gpr/mpscq.h', + 'src/core/lib/gpr/murmur_hash.h', + 'src/core/lib/gpr/spinlock.h', + 'src/core/lib/gpr/string.h', + 'src/core/lib/gpr/string_windows.h', + 'src/core/lib/gpr/time_precise.h', + 'src/core/lib/gpr/tls.h', + 'src/core/lib/gpr/tls_gcc.h', + 'src/core/lib/gpr/tls_msvc.h', + 'src/core/lib/gpr/tls_pthread.h', + 'src/core/lib/gpr/tmpfile.h', + 'src/core/lib/gpr/useful.h', + 'src/core/lib/gprpp/abstract.h', + 'src/core/lib/gprpp/atomic.h', + 'src/core/lib/gprpp/atomic_with_atm.h', + 'src/core/lib/gprpp/atomic_with_std.h', + 'src/core/lib/gprpp/manual_constructor.h', + 'src/core/lib/gprpp/memory.h', + 'src/core/lib/gprpp/thd.h', + 'src/core/lib/profiling/timers.h', + 'src/core/lib/avl/avl.h', + 'src/core/lib/backoff/backoff.h', + 'src/core/lib/channel/channel_args.h', + 'src/core/lib/channel/channel_stack.h', + 'src/core/lib/channel/channel_stack_builder.h', + 'src/core/lib/channel/channel_trace.h', + 'src/core/lib/channel/channel_trace_registry.h', + 'src/core/lib/channel/connected_channel.h', + 'src/core/lib/channel/context.h', + 'src/core/lib/channel/handshaker.h', + 'src/core/lib/channel/handshaker_factory.h', + 'src/core/lib/channel/handshaker_registry.h', + 'src/core/lib/channel/status_util.h', + 'src/core/lib/compression/algorithm_metadata.h', + 'src/core/lib/compression/compression_internal.h', + 'src/core/lib/compression/message_compress.h', + 'src/core/lib/compression/stream_compression.h', + 'src/core/lib/compression/stream_compression_gzip.h', + 'src/core/lib/compression/stream_compression_identity.h', + 'src/core/lib/debug/stats.h', + 'src/core/lib/debug/stats_data.h', + 'src/core/lib/gprpp/debug_location.h', + 'src/core/lib/gprpp/inlined_vector.h', + 'src/core/lib/gprpp/orphanable.h', + 'src/core/lib/gprpp/ref_counted.h', + 'src/core/lib/gprpp/ref_counted_ptr.h', + 'src/core/lib/http/format_request.h', + 'src/core/lib/http/httpcli.h', + 'src/core/lib/http/parser.h', + 'src/core/lib/iomgr/block_annotate.h', + 'src/core/lib/iomgr/call_combiner.h', + 'src/core/lib/iomgr/closure.h', + 'src/core/lib/iomgr/combiner.h', + 'src/core/lib/iomgr/endpoint.h', + 'src/core/lib/iomgr/endpoint_pair.h', + 'src/core/lib/iomgr/error.h', + 'src/core/lib/iomgr/error_internal.h', + 'src/core/lib/iomgr/ev_epoll1_linux.h', + 'src/core/lib/iomgr/ev_epollex_linux.h', + 'src/core/lib/iomgr/ev_epollsig_linux.h', + 'src/core/lib/iomgr/ev_poll_posix.h', + 'src/core/lib/iomgr/ev_posix.h', + 'src/core/lib/iomgr/exec_ctx.h', + 'src/core/lib/iomgr/executor.h', + 'src/core/lib/iomgr/gethostname.h', + 'src/core/lib/iomgr/iocp_windows.h', + 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_cfstream.h', + 'src/core/lib/iomgr/iomgr_custom.h', + 'src/core/lib/iomgr/iomgr_internal.h', + 'src/core/lib/iomgr/iomgr_posix.h', + 'src/core/lib/iomgr/is_epollexclusive_available.h', + 'src/core/lib/iomgr/load_file.h', + 'src/core/lib/iomgr/lockfree_event.h', + 'src/core/lib/iomgr/nameser.h', + 'src/core/lib/iomgr/network_status_tracker.h', + 'src/core/lib/iomgr/polling_entity.h', + 'src/core/lib/iomgr/pollset.h', + 'src/core/lib/iomgr/pollset_custom.h', + 'src/core/lib/iomgr/pollset_set.h', + 'src/core/lib/iomgr/pollset_set_custom.h', + 'src/core/lib/iomgr/pollset_set_windows.h', + 'src/core/lib/iomgr/pollset_windows.h', + 'src/core/lib/iomgr/port.h', + 'src/core/lib/iomgr/resolve_address.h', + 'src/core/lib/iomgr/resolve_address_custom.h', + 'src/core/lib/iomgr/resource_quota.h', + 'src/core/lib/iomgr/sockaddr.h', + 'src/core/lib/iomgr/sockaddr_custom.h', + 'src/core/lib/iomgr/sockaddr_posix.h', + 'src/core/lib/iomgr/sockaddr_utils.h', + 'src/core/lib/iomgr/sockaddr_windows.h', + 'src/core/lib/iomgr/socket_factory_posix.h', + 'src/core/lib/iomgr/socket_mutator.h', + 'src/core/lib/iomgr/socket_utils.h', + 'src/core/lib/iomgr/socket_utils_posix.h', + 'src/core/lib/iomgr/socket_windows.h', + 'src/core/lib/iomgr/sys_epoll_wrapper.h', + 'src/core/lib/iomgr/tcp_client.h', + 'src/core/lib/iomgr/tcp_client_posix.h', + 'src/core/lib/iomgr/tcp_custom.h', + 'src/core/lib/iomgr/tcp_posix.h', + 'src/core/lib/iomgr/tcp_server.h', + 'src/core/lib/iomgr/tcp_server_utils_posix.h', + 'src/core/lib/iomgr/tcp_windows.h', + 'src/core/lib/iomgr/time_averaged_stats.h', + 'src/core/lib/iomgr/timer.h', + 'src/core/lib/iomgr/timer_custom.h', + 'src/core/lib/iomgr/timer_heap.h', + 'src/core/lib/iomgr/timer_manager.h', + 'src/core/lib/iomgr/udp_server.h', + 'src/core/lib/iomgr/unix_sockets_posix.h', + 'src/core/lib/iomgr/wakeup_fd_cv.h', + 'src/core/lib/iomgr/wakeup_fd_pipe.h', + 'src/core/lib/iomgr/wakeup_fd_posix.h', + 'src/core/lib/json/json.h', + 'src/core/lib/json/json_common.h', + 'src/core/lib/json/json_reader.h', + 'src/core/lib/json/json_writer.h', + 'src/core/lib/slice/b64.h', + 'src/core/lib/slice/percent_encoding.h', + 'src/core/lib/slice/slice_hash_table.h', + 'src/core/lib/slice/slice_internal.h', + 'src/core/lib/slice/slice_string_helpers.h', + 'src/core/lib/slice/slice_weak_hash_table.h', + 'src/core/lib/surface/api_trace.h', + 'src/core/lib/surface/call.h', + 'src/core/lib/surface/call_test_only.h', + 'src/core/lib/surface/channel.h', + 'src/core/lib/surface/channel_init.h', + 'src/core/lib/surface/channel_stack_type.h', + 'src/core/lib/surface/completion_queue.h', + 'src/core/lib/surface/completion_queue_factory.h', + 'src/core/lib/surface/event_string.h', + 'src/core/lib/surface/init.h', + 'src/core/lib/surface/lame_client.h', + 'src/core/lib/surface/server.h', + 'src/core/lib/surface/validate_metadata.h', + 'src/core/lib/transport/bdp_estimator.h', + 'src/core/lib/transport/byte_stream.h', + 'src/core/lib/transport/connectivity_state.h', + 'src/core/lib/transport/error_utils.h', + 'src/core/lib/transport/http2_errors.h', + 'src/core/lib/transport/metadata.h', + 'src/core/lib/transport/metadata_batch.h', + 'src/core/lib/transport/pid_controller.h', + 'src/core/lib/transport/service_config.h', + 'src/core/lib/transport/static_metadata.h', + 'src/core/lib/transport/status_conversion.h', + 'src/core/lib/transport/status_metadata.h', + 'src/core/lib/transport/timeout_encoding.h', + 'src/core/lib/transport/transport.h', + 'src/core/lib/transport/transport_impl.h', + 'src/core/lib/debug/trace.h' + ss.private_header_files = 'src/core/lib/iomgr/error_apple.h', + 'src/core/lib/iomgr/tcp_cfstream.h', + 'src/core/lib/iomgr/tcp_cfstream_sync.h', + 'src/core/lib/gpr/arena.h', + 'src/core/lib/gpr/env.h', + 'src/core/lib/gpr/fork.h', + 'src/core/lib/gpr/host_port.h', + 'src/core/lib/gpr/mpscq.h', + 'src/core/lib/gpr/murmur_hash.h', + 'src/core/lib/gpr/spinlock.h', + 'src/core/lib/gpr/string.h', + 'src/core/lib/gpr/string_windows.h', + 'src/core/lib/gpr/time_precise.h', + 'src/core/lib/gpr/tls.h', + 'src/core/lib/gpr/tls_gcc.h', + 'src/core/lib/gpr/tls_msvc.h', + 'src/core/lib/gpr/tls_pthread.h', + 'src/core/lib/gpr/tmpfile.h', + 'src/core/lib/gpr/useful.h', + 'src/core/lib/gprpp/abstract.h', + 'src/core/lib/gprpp/atomic.h', + 'src/core/lib/gprpp/atomic_with_atm.h', + 'src/core/lib/gprpp/atomic_with_std.h', + 'src/core/lib/gprpp/manual_constructor.h', + 'src/core/lib/gprpp/memory.h', + 'src/core/lib/gprpp/thd.h', + 'src/core/lib/profiling/timers.h', + 'src/core/lib/avl/avl.h', + 'src/core/lib/backoff/backoff.h', + 'src/core/lib/channel/channel_args.h', + 'src/core/lib/channel/channel_stack.h', + 'src/core/lib/channel/channel_stack_builder.h', + 'src/core/lib/channel/channel_trace.h', + 'src/core/lib/channel/channel_trace_registry.h', + 'src/core/lib/channel/connected_channel.h', + 'src/core/lib/channel/context.h', + 'src/core/lib/channel/handshaker.h', + 'src/core/lib/channel/handshaker_factory.h', + 'src/core/lib/channel/handshaker_registry.h', + 'src/core/lib/channel/status_util.h', + 'src/core/lib/compression/algorithm_metadata.h', + 'src/core/lib/compression/compression_internal.h', + 'src/core/lib/compression/message_compress.h', + 'src/core/lib/compression/stream_compression.h', + 'src/core/lib/compression/stream_compression_gzip.h', + 'src/core/lib/compression/stream_compression_identity.h', + 'src/core/lib/debug/stats.h', + 'src/core/lib/debug/stats_data.h', + 'src/core/lib/gprpp/debug_location.h', + 'src/core/lib/gprpp/inlined_vector.h', + 'src/core/lib/gprpp/orphanable.h', + 'src/core/lib/gprpp/ref_counted.h', + 'src/core/lib/gprpp/ref_counted_ptr.h', + 'src/core/lib/http/format_request.h', + 'src/core/lib/http/httpcli.h', + 'src/core/lib/http/parser.h', + 'src/core/lib/iomgr/block_annotate.h', + 'src/core/lib/iomgr/call_combiner.h', + 'src/core/lib/iomgr/closure.h', + 'src/core/lib/iomgr/combiner.h', + 'src/core/lib/iomgr/endpoint.h', + 'src/core/lib/iomgr/endpoint_pair.h', + 'src/core/lib/iomgr/error.h', + 'src/core/lib/iomgr/error_internal.h', + 'src/core/lib/iomgr/ev_epoll1_linux.h', + 'src/core/lib/iomgr/ev_epollex_linux.h', + 'src/core/lib/iomgr/ev_epollsig_linux.h', + 'src/core/lib/iomgr/ev_poll_posix.h', + 'src/core/lib/iomgr/ev_posix.h', + 'src/core/lib/iomgr/exec_ctx.h', + 'src/core/lib/iomgr/executor.h', + 'src/core/lib/iomgr/gethostname.h', + 'src/core/lib/iomgr/iocp_windows.h', + 'src/core/lib/iomgr/iomgr.h', + 'src/core/lib/iomgr/iomgr_cfstream.h', + 'src/core/lib/iomgr/iomgr_custom.h', + 'src/core/lib/iomgr/iomgr_internal.h', + 'src/core/lib/iomgr/iomgr_posix.h', + 'src/core/lib/iomgr/is_epollexclusive_available.h', + 'src/core/lib/iomgr/load_file.h', + 'src/core/lib/iomgr/lockfree_event.h', + 'src/core/lib/iomgr/nameser.h', + 'src/core/lib/iomgr/network_status_tracker.h', + 'src/core/lib/iomgr/polling_entity.h', + 'src/core/lib/iomgr/pollset.h', + 'src/core/lib/iomgr/pollset_custom.h', + 'src/core/lib/iomgr/pollset_set.h', + 'src/core/lib/iomgr/pollset_set_custom.h', + 'src/core/lib/iomgr/pollset_set_windows.h', + 'src/core/lib/iomgr/pollset_windows.h', + 'src/core/lib/iomgr/port.h', + 'src/core/lib/iomgr/resolve_address.h', + 'src/core/lib/iomgr/resolve_address_custom.h', + 'src/core/lib/iomgr/resource_quota.h', + 'src/core/lib/iomgr/sockaddr.h', + 'src/core/lib/iomgr/sockaddr_custom.h', + 'src/core/lib/iomgr/sockaddr_posix.h', + 'src/core/lib/iomgr/sockaddr_utils.h', + 'src/core/lib/iomgr/sockaddr_windows.h', + 'src/core/lib/iomgr/socket_factory_posix.h', + 'src/core/lib/iomgr/socket_mutator.h', + 'src/core/lib/iomgr/socket_utils.h', + 'src/core/lib/iomgr/socket_utils_posix.h', + 'src/core/lib/iomgr/socket_windows.h', + 'src/core/lib/iomgr/sys_epoll_wrapper.h', + 'src/core/lib/iomgr/tcp_client.h', + 'src/core/lib/iomgr/tcp_client_posix.h', + 'src/core/lib/iomgr/tcp_custom.h', + 'src/core/lib/iomgr/tcp_posix.h', + 'src/core/lib/iomgr/tcp_server.h', + 'src/core/lib/iomgr/tcp_server_utils_posix.h', + 'src/core/lib/iomgr/tcp_windows.h', + 'src/core/lib/iomgr/time_averaged_stats.h', + 'src/core/lib/iomgr/timer.h', + 'src/core/lib/iomgr/timer_custom.h', + 'src/core/lib/iomgr/timer_heap.h', + 'src/core/lib/iomgr/timer_manager.h', + 'src/core/lib/iomgr/udp_server.h', + 'src/core/lib/iomgr/unix_sockets_posix.h', + 'src/core/lib/iomgr/wakeup_fd_cv.h', + 'src/core/lib/iomgr/wakeup_fd_pipe.h', + 'src/core/lib/iomgr/wakeup_fd_posix.h', + 'src/core/lib/json/json.h', + 'src/core/lib/json/json_common.h', + 'src/core/lib/json/json_reader.h', + 'src/core/lib/json/json_writer.h', + 'src/core/lib/slice/b64.h', + 'src/core/lib/slice/percent_encoding.h', + 'src/core/lib/slice/slice_hash_table.h', + 'src/core/lib/slice/slice_internal.h', + 'src/core/lib/slice/slice_string_helpers.h', + 'src/core/lib/slice/slice_weak_hash_table.h', + 'src/core/lib/surface/api_trace.h', + 'src/core/lib/surface/call.h', + 'src/core/lib/surface/call_test_only.h', + 'src/core/lib/surface/channel.h', + 'src/core/lib/surface/channel_init.h', + 'src/core/lib/surface/channel_stack_type.h', + 'src/core/lib/surface/completion_queue.h', + 'src/core/lib/surface/completion_queue_factory.h', + 'src/core/lib/surface/event_string.h', + 'src/core/lib/surface/init.h', + 'src/core/lib/surface/lame_client.h', + 'src/core/lib/surface/server.h', + 'src/core/lib/surface/validate_metadata.h', + 'src/core/lib/transport/bdp_estimator.h', + 'src/core/lib/transport/byte_stream.h', + 'src/core/lib/transport/connectivity_state.h', + 'src/core/lib/transport/error_utils.h', + 'src/core/lib/transport/http2_errors.h', + 'src/core/lib/transport/metadata.h', + 'src/core/lib/transport/metadata_batch.h', + 'src/core/lib/transport/pid_controller.h', + 'src/core/lib/transport/service_config.h', + 'src/core/lib/transport/static_metadata.h', + 'src/core/lib/transport/status_conversion.h', + 'src/core/lib/transport/status_metadata.h', + 'src/core/lib/transport/timeout_encoding.h', + 'src/core/lib/transport/transport.h', + 'src/core/lib/transport/transport_impl.h', + 'src/core/lib/debug/trace.h' + end + s.subspec 'Cronet-Interface' do |ss| ss.header_mappings_dir = 'include/grpc' ss.source_files = 'include/grpc/grpc_cronet.h' -- cgit v1.2.3 From 8b01a4a55a4a3716adf0f6d1db74b74e2df0df36 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 18 May 2018 07:46:59 -0700 Subject: build_project --- CMakeLists.txt | 30 +- Makefile | 30 +- config.m4 | 5 +- config.w32 | 5 +- gRPC-C++.podspec | 8 +- gRPC-Core.podspec | 339 +-------------------- grpc.gemspec | 9 +- grpc.gyp | 20 +- package.xml | 9 +- src/python/grpcio/grpc_core_dependencies.py | 5 +- tools/doxygen/Doxyfile.c++.internal | 4 +- tools/doxygen/Doxyfile.core.internal | 9 +- tools/run_tests/generated/sources_and_headers.json | 39 +-- 13 files changed, 126 insertions(+), 386 deletions(-) (limited to 'gRPC-Core.podspec') diff --git a/CMakeLists.txt b/CMakeLists.txt index bc1314376e..1635621a7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -937,6 +937,7 @@ add_library(grpc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc + src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -952,7 +953,6 @@ add_library(grpc src/core/lib/iomgr/gethostname_sysconf.cc src/core/lib/iomgr/iocp_windows.cc src/core/lib/iomgr/iomgr.cc - src/core/lib/iomgr/iomgr_cfstream.cc src/core/lib/iomgr/iomgr_custom.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/iomgr/iomgr_posix.cc @@ -984,7 +984,10 @@ add_library(grpc src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc + src/core/lib/iomgr/tcp_cfstream.cc + src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc + src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -1333,6 +1336,7 @@ add_library(grpc_cronet src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc + src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -1348,7 +1352,6 @@ add_library(grpc_cronet src/core/lib/iomgr/gethostname_sysconf.cc src/core/lib/iomgr/iocp_windows.cc src/core/lib/iomgr/iomgr.cc - src/core/lib/iomgr/iomgr_cfstream.cc src/core/lib/iomgr/iomgr_custom.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/iomgr/iomgr_posix.cc @@ -1380,7 +1383,10 @@ add_library(grpc_cronet src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc + src/core/lib/iomgr/tcp_cfstream.cc + src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc + src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -1719,6 +1725,7 @@ add_library(grpc_test_util src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc + src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -1734,7 +1741,6 @@ add_library(grpc_test_util src/core/lib/iomgr/gethostname_sysconf.cc src/core/lib/iomgr/iocp_windows.cc src/core/lib/iomgr/iomgr.cc - src/core/lib/iomgr/iomgr_cfstream.cc src/core/lib/iomgr/iomgr_custom.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/iomgr/iomgr_posix.cc @@ -1766,7 +1772,10 @@ add_library(grpc_test_util src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc + src/core/lib/iomgr/tcp_cfstream.cc + src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc + src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -2023,6 +2032,7 @@ add_library(grpc_test_util_unsecure src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc + src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -2038,7 +2048,6 @@ add_library(grpc_test_util_unsecure src/core/lib/iomgr/gethostname_sysconf.cc src/core/lib/iomgr/iocp_windows.cc src/core/lib/iomgr/iomgr.cc - src/core/lib/iomgr/iomgr_cfstream.cc src/core/lib/iomgr/iomgr_custom.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/iomgr/iomgr_posix.cc @@ -2070,7 +2079,10 @@ add_library(grpc_test_util_unsecure src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc + src/core/lib/iomgr/tcp_cfstream.cc + src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc + src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -2307,6 +2319,7 @@ add_library(grpc_unsecure src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc + src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -2322,7 +2335,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/gethostname_sysconf.cc src/core/lib/iomgr/iocp_windows.cc src/core/lib/iomgr/iomgr.cc - src/core/lib/iomgr/iomgr_cfstream.cc src/core/lib/iomgr/iomgr_custom.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/iomgr/iomgr_posix.cc @@ -2354,7 +2366,10 @@ add_library(grpc_unsecure src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc + src/core/lib/iomgr/tcp_cfstream.cc + src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc + src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -3135,6 +3150,7 @@ add_library(grpc++_cronet src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc + src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -3150,7 +3166,6 @@ add_library(grpc++_cronet src/core/lib/iomgr/gethostname_sysconf.cc src/core/lib/iomgr/iocp_windows.cc src/core/lib/iomgr/iomgr.cc - src/core/lib/iomgr/iomgr_cfstream.cc src/core/lib/iomgr/iomgr_custom.cc src/core/lib/iomgr/iomgr_internal.cc src/core/lib/iomgr/iomgr_posix.cc @@ -3182,7 +3197,10 @@ add_library(grpc++_cronet src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc + src/core/lib/iomgr/tcp_cfstream.cc + src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc + src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc diff --git a/Makefile b/Makefile index 89ecfdfe31..ec476ad7dc 100644 --- a/Makefile +++ b/Makefile @@ -3319,6 +3319,7 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -3334,7 +3335,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -3366,7 +3366,10 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -3715,6 +3718,7 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -3730,7 +3734,6 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -3762,7 +3765,10 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -4100,6 +4106,7 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -4115,7 +4122,6 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -4147,7 +4153,10 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -4396,6 +4405,7 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -4411,7 +4421,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -4443,7 +4452,10 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -4659,6 +4671,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -4674,7 +4687,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -4706,7 +4718,10 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -5480,6 +5495,7 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -5495,7 +5511,6 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -5527,7 +5542,10 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ diff --git a/config.m4 b/config.m4 index 96189f1fbc..c12c61666f 100644 --- a/config.m4 +++ b/config.m4 @@ -113,6 +113,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ + src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -128,7 +129,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/gethostname_sysconf.cc \ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iomgr.cc \ - src/core/lib/iomgr/iomgr_cfstream.cc \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_internal.cc \ src/core/lib/iomgr/iomgr_posix.cc \ @@ -160,7 +160,10 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ + src/core/lib/iomgr/tcp_cfstream.cc \ + src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ + src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ diff --git a/config.w32 b/config.w32 index 1fc4eabd5b..abb6ae4b6b 100644 --- a/config.w32 +++ b/config.w32 @@ -89,6 +89,7 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\endpoint_pair_uv.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_windows.cc " + "src\\core\\lib\\iomgr\\error.cc " + + "src\\core\\lib\\iomgr\\error_apple.cc " + "src\\core\\lib\\iomgr\\ev_epoll1_linux.cc " + "src\\core\\lib\\iomgr\\ev_epollex_linux.cc " + "src\\core\\lib\\iomgr\\ev_epollsig_linux.cc " + @@ -104,7 +105,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\gethostname_sysconf.cc " + "src\\core\\lib\\iomgr\\iocp_windows.cc " + "src\\core\\lib\\iomgr\\iomgr.cc " + - "src\\core\\lib\\iomgr\\iomgr_cfstream.cc " + "src\\core\\lib\\iomgr\\iomgr_custom.cc " + "src\\core\\lib\\iomgr\\iomgr_internal.cc " + "src\\core\\lib\\iomgr\\iomgr_posix.cc " + @@ -136,7 +136,10 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\socket_utils_uv.cc " + "src\\core\\lib\\iomgr\\socket_utils_windows.cc " + "src\\core\\lib\\iomgr\\socket_windows.cc " + + "src\\core\\lib\\iomgr\\tcp_cfstream.cc " + + "src\\core\\lib\\iomgr\\tcp_cfstream_sync.cc " + "src\\core\\lib\\iomgr\\tcp_client.cc " + + "src\\core\\lib\\iomgr\\tcp_client_cfstream.cc " + "src\\core\\lib\\iomgr\\tcp_client_custom.cc " + "src\\core\\lib\\iomgr\\tcp_client_posix.cc " + "src\\core\\lib\\iomgr\\tcp_client_windows.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 4f05e85eed..ab92f4c483 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -377,6 +377,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/endpoint.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', + 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -388,7 +389,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_cfstream.h', 'src/core/lib/iomgr/iomgr_custom.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.h', @@ -419,6 +419,8 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', + 'src/core/lib/iomgr/tcp_cfstream.h', + 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', @@ -563,6 +565,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/endpoint.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', + 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -574,7 +577,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_cfstream.h', 'src/core/lib/iomgr/iomgr_custom.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.h', @@ -605,6 +607,8 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', + 'src/core/lib/iomgr/tcp_cfstream.h', + 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index dc85e541a5..7f9ba09330 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -387,6 +387,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/endpoint.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', + 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -398,7 +399,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_cfstream.h', 'src/core/lib/iomgr/iomgr_custom.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.h', @@ -429,6 +429,8 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', + 'src/core/lib/iomgr/tcp_cfstream.h', + 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', @@ -532,6 +534,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', + 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -547,7 +550,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -579,7 +581,10 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', + 'src/core/lib/iomgr/tcp_cfstream.cc', + 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -969,6 +974,7 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/endpoint.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', + 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -980,7 +986,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/gethostname.h', 'src/core/lib/iomgr/iocp_windows.h', 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_cfstream.h', 'src/core/lib/iomgr/iomgr_custom.h', 'src/core/lib/iomgr/iomgr_internal.h', 'src/core/lib/iomgr/iomgr_posix.h', @@ -1011,6 +1016,8 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', + 'src/core/lib/iomgr/tcp_cfstream.h', + 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', @@ -1091,332 +1098,6 @@ Pod::Spec.new do |s| ss.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1' } - ss.source_files = 'src/core/lib/iomgr/error_apple.mm', - 'src/core/lib/iomgr/tcp_cfstream.mm', - 'src/core/lib/iomgr/tcp_cfstream_sync.mm', - 'src/core/lib/iomgr/tcp_client_cfstream.mm', - 'src/core/lib/iomgr/error_apple.h', - 'src/core/lib/iomgr/tcp_cfstream.h', - 'src/core/lib/iomgr/tcp_cfstream_sync.h', - 'src/core/lib/gpr/arena.h', - 'src/core/lib/gpr/env.h', - 'src/core/lib/gpr/fork.h', - 'src/core/lib/gpr/host_port.h', - 'src/core/lib/gpr/mpscq.h', - 'src/core/lib/gpr/murmur_hash.h', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/string_windows.h', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tls.h', - 'src/core/lib/gpr/tls_gcc.h', - 'src/core/lib/gpr/tls_msvc.h', - 'src/core/lib/gpr/tls_pthread.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', - 'src/core/lib/gprpp/abstract.h', - 'src/core/lib/gprpp/atomic.h', - 'src/core/lib/gprpp/atomic_with_atm.h', - 'src/core/lib/gprpp/atomic_with_std.h', - 'src/core/lib/gprpp/manual_constructor.h', - 'src/core/lib/gprpp/memory.h', - 'src/core/lib/gprpp/thd.h', - 'src/core/lib/profiling/timers.h', - 'src/core/lib/avl/avl.h', - 'src/core/lib/backoff/backoff.h', - 'src/core/lib/channel/channel_args.h', - 'src/core/lib/channel/channel_stack.h', - 'src/core/lib/channel/channel_stack_builder.h', - 'src/core/lib/channel/channel_trace.h', - 'src/core/lib/channel/channel_trace_registry.h', - 'src/core/lib/channel/connected_channel.h', - 'src/core/lib/channel/context.h', - 'src/core/lib/channel/handshaker.h', - 'src/core/lib/channel/handshaker_factory.h', - 'src/core/lib/channel/handshaker_registry.h', - 'src/core/lib/channel/status_util.h', - 'src/core/lib/compression/algorithm_metadata.h', - 'src/core/lib/compression/compression_internal.h', - 'src/core/lib/compression/message_compress.h', - 'src/core/lib/compression/stream_compression.h', - 'src/core/lib/compression/stream_compression_gzip.h', - 'src/core/lib/compression/stream_compression_identity.h', - 'src/core/lib/debug/stats.h', - 'src/core/lib/debug/stats_data.h', - 'src/core/lib/gprpp/debug_location.h', - 'src/core/lib/gprpp/inlined_vector.h', - 'src/core/lib/gprpp/orphanable.h', - 'src/core/lib/gprpp/ref_counted.h', - 'src/core/lib/gprpp/ref_counted_ptr.h', - 'src/core/lib/http/format_request.h', - 'src/core/lib/http/httpcli.h', - 'src/core/lib/http/parser.h', - 'src/core/lib/iomgr/block_annotate.h', - 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/closure.h', - 'src/core/lib/iomgr/combiner.h', - 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_pair.h', - 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_internal.h', - 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.h', - 'src/core/lib/iomgr/ev_epollsig_linux.h', - 'src/core/lib/iomgr/ev_poll_posix.h', - 'src/core/lib/iomgr/ev_posix.h', - 'src/core/lib/iomgr/exec_ctx.h', - 'src/core/lib/iomgr/executor.h', - 'src/core/lib/iomgr/gethostname.h', - 'src/core/lib/iomgr/iocp_windows.h', - 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_cfstream.h', - 'src/core/lib/iomgr/iomgr_custom.h', - 'src/core/lib/iomgr/iomgr_internal.h', - 'src/core/lib/iomgr/iomgr_posix.h', - 'src/core/lib/iomgr/is_epollexclusive_available.h', - 'src/core/lib/iomgr/load_file.h', - 'src/core/lib/iomgr/lockfree_event.h', - 'src/core/lib/iomgr/nameser.h', - 'src/core/lib/iomgr/network_status_tracker.h', - 'src/core/lib/iomgr/polling_entity.h', - 'src/core/lib/iomgr/pollset.h', - 'src/core/lib/iomgr/pollset_custom.h', - 'src/core/lib/iomgr/pollset_set.h', - 'src/core/lib/iomgr/pollset_set_custom.h', - 'src/core/lib/iomgr/pollset_set_windows.h', - 'src/core/lib/iomgr/pollset_windows.h', - 'src/core/lib/iomgr/port.h', - 'src/core/lib/iomgr/resolve_address.h', - 'src/core/lib/iomgr/resolve_address_custom.h', - 'src/core/lib/iomgr/resource_quota.h', - 'src/core/lib/iomgr/sockaddr.h', - 'src/core/lib/iomgr/sockaddr_custom.h', - 'src/core/lib/iomgr/sockaddr_posix.h', - 'src/core/lib/iomgr/sockaddr_utils.h', - 'src/core/lib/iomgr/sockaddr_windows.h', - 'src/core/lib/iomgr/socket_factory_posix.h', - 'src/core/lib/iomgr/socket_mutator.h', - 'src/core/lib/iomgr/socket_utils.h', - 'src/core/lib/iomgr/socket_utils_posix.h', - 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_client.h', - 'src/core/lib/iomgr/tcp_client_posix.h', - 'src/core/lib/iomgr/tcp_custom.h', - 'src/core/lib/iomgr/tcp_posix.h', - 'src/core/lib/iomgr/tcp_server.h', - 'src/core/lib/iomgr/tcp_server_utils_posix.h', - 'src/core/lib/iomgr/tcp_windows.h', - 'src/core/lib/iomgr/time_averaged_stats.h', - 'src/core/lib/iomgr/timer.h', - 'src/core/lib/iomgr/timer_custom.h', - 'src/core/lib/iomgr/timer_heap.h', - 'src/core/lib/iomgr/timer_manager.h', - 'src/core/lib/iomgr/udp_server.h', - 'src/core/lib/iomgr/unix_sockets_posix.h', - 'src/core/lib/iomgr/wakeup_fd_cv.h', - 'src/core/lib/iomgr/wakeup_fd_pipe.h', - 'src/core/lib/iomgr/wakeup_fd_posix.h', - 'src/core/lib/json/json.h', - 'src/core/lib/json/json_common.h', - 'src/core/lib/json/json_reader.h', - 'src/core/lib/json/json_writer.h', - 'src/core/lib/slice/b64.h', - 'src/core/lib/slice/percent_encoding.h', - 'src/core/lib/slice/slice_hash_table.h', - 'src/core/lib/slice/slice_internal.h', - 'src/core/lib/slice/slice_string_helpers.h', - 'src/core/lib/slice/slice_weak_hash_table.h', - 'src/core/lib/surface/api_trace.h', - 'src/core/lib/surface/call.h', - 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/channel.h', - 'src/core/lib/surface/channel_init.h', - 'src/core/lib/surface/channel_stack_type.h', - 'src/core/lib/surface/completion_queue.h', - 'src/core/lib/surface/completion_queue_factory.h', - 'src/core/lib/surface/event_string.h', - 'src/core/lib/surface/init.h', - 'src/core/lib/surface/lame_client.h', - 'src/core/lib/surface/server.h', - 'src/core/lib/surface/validate_metadata.h', - 'src/core/lib/transport/bdp_estimator.h', - 'src/core/lib/transport/byte_stream.h', - 'src/core/lib/transport/connectivity_state.h', - 'src/core/lib/transport/error_utils.h', - 'src/core/lib/transport/http2_errors.h', - 'src/core/lib/transport/metadata.h', - 'src/core/lib/transport/metadata_batch.h', - 'src/core/lib/transport/pid_controller.h', - 'src/core/lib/transport/service_config.h', - 'src/core/lib/transport/static_metadata.h', - 'src/core/lib/transport/status_conversion.h', - 'src/core/lib/transport/status_metadata.h', - 'src/core/lib/transport/timeout_encoding.h', - 'src/core/lib/transport/transport.h', - 'src/core/lib/transport/transport_impl.h', - 'src/core/lib/debug/trace.h' - ss.private_header_files = 'src/core/lib/iomgr/error_apple.h', - 'src/core/lib/iomgr/tcp_cfstream.h', - 'src/core/lib/iomgr/tcp_cfstream_sync.h', - 'src/core/lib/gpr/arena.h', - 'src/core/lib/gpr/env.h', - 'src/core/lib/gpr/fork.h', - 'src/core/lib/gpr/host_port.h', - 'src/core/lib/gpr/mpscq.h', - 'src/core/lib/gpr/murmur_hash.h', - 'src/core/lib/gpr/spinlock.h', - 'src/core/lib/gpr/string.h', - 'src/core/lib/gpr/string_windows.h', - 'src/core/lib/gpr/time_precise.h', - 'src/core/lib/gpr/tls.h', - 'src/core/lib/gpr/tls_gcc.h', - 'src/core/lib/gpr/tls_msvc.h', - 'src/core/lib/gpr/tls_pthread.h', - 'src/core/lib/gpr/tmpfile.h', - 'src/core/lib/gpr/useful.h', - 'src/core/lib/gprpp/abstract.h', - 'src/core/lib/gprpp/atomic.h', - 'src/core/lib/gprpp/atomic_with_atm.h', - 'src/core/lib/gprpp/atomic_with_std.h', - 'src/core/lib/gprpp/manual_constructor.h', - 'src/core/lib/gprpp/memory.h', - 'src/core/lib/gprpp/thd.h', - 'src/core/lib/profiling/timers.h', - 'src/core/lib/avl/avl.h', - 'src/core/lib/backoff/backoff.h', - 'src/core/lib/channel/channel_args.h', - 'src/core/lib/channel/channel_stack.h', - 'src/core/lib/channel/channel_stack_builder.h', - 'src/core/lib/channel/channel_trace.h', - 'src/core/lib/channel/channel_trace_registry.h', - 'src/core/lib/channel/connected_channel.h', - 'src/core/lib/channel/context.h', - 'src/core/lib/channel/handshaker.h', - 'src/core/lib/channel/handshaker_factory.h', - 'src/core/lib/channel/handshaker_registry.h', - 'src/core/lib/channel/status_util.h', - 'src/core/lib/compression/algorithm_metadata.h', - 'src/core/lib/compression/compression_internal.h', - 'src/core/lib/compression/message_compress.h', - 'src/core/lib/compression/stream_compression.h', - 'src/core/lib/compression/stream_compression_gzip.h', - 'src/core/lib/compression/stream_compression_identity.h', - 'src/core/lib/debug/stats.h', - 'src/core/lib/debug/stats_data.h', - 'src/core/lib/gprpp/debug_location.h', - 'src/core/lib/gprpp/inlined_vector.h', - 'src/core/lib/gprpp/orphanable.h', - 'src/core/lib/gprpp/ref_counted.h', - 'src/core/lib/gprpp/ref_counted_ptr.h', - 'src/core/lib/http/format_request.h', - 'src/core/lib/http/httpcli.h', - 'src/core/lib/http/parser.h', - 'src/core/lib/iomgr/block_annotate.h', - 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/closure.h', - 'src/core/lib/iomgr/combiner.h', - 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_pair.h', - 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_internal.h', - 'src/core/lib/iomgr/ev_epoll1_linux.h', - 'src/core/lib/iomgr/ev_epollex_linux.h', - 'src/core/lib/iomgr/ev_epollsig_linux.h', - 'src/core/lib/iomgr/ev_poll_posix.h', - 'src/core/lib/iomgr/ev_posix.h', - 'src/core/lib/iomgr/exec_ctx.h', - 'src/core/lib/iomgr/executor.h', - 'src/core/lib/iomgr/gethostname.h', - 'src/core/lib/iomgr/iocp_windows.h', - 'src/core/lib/iomgr/iomgr.h', - 'src/core/lib/iomgr/iomgr_cfstream.h', - 'src/core/lib/iomgr/iomgr_custom.h', - 'src/core/lib/iomgr/iomgr_internal.h', - 'src/core/lib/iomgr/iomgr_posix.h', - 'src/core/lib/iomgr/is_epollexclusive_available.h', - 'src/core/lib/iomgr/load_file.h', - 'src/core/lib/iomgr/lockfree_event.h', - 'src/core/lib/iomgr/nameser.h', - 'src/core/lib/iomgr/network_status_tracker.h', - 'src/core/lib/iomgr/polling_entity.h', - 'src/core/lib/iomgr/pollset.h', - 'src/core/lib/iomgr/pollset_custom.h', - 'src/core/lib/iomgr/pollset_set.h', - 'src/core/lib/iomgr/pollset_set_custom.h', - 'src/core/lib/iomgr/pollset_set_windows.h', - 'src/core/lib/iomgr/pollset_windows.h', - 'src/core/lib/iomgr/port.h', - 'src/core/lib/iomgr/resolve_address.h', - 'src/core/lib/iomgr/resolve_address_custom.h', - 'src/core/lib/iomgr/resource_quota.h', - 'src/core/lib/iomgr/sockaddr.h', - 'src/core/lib/iomgr/sockaddr_custom.h', - 'src/core/lib/iomgr/sockaddr_posix.h', - 'src/core/lib/iomgr/sockaddr_utils.h', - 'src/core/lib/iomgr/sockaddr_windows.h', - 'src/core/lib/iomgr/socket_factory_posix.h', - 'src/core/lib/iomgr/socket_mutator.h', - 'src/core/lib/iomgr/socket_utils.h', - 'src/core/lib/iomgr/socket_utils_posix.h', - 'src/core/lib/iomgr/socket_windows.h', - 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_client.h', - 'src/core/lib/iomgr/tcp_client_posix.h', - 'src/core/lib/iomgr/tcp_custom.h', - 'src/core/lib/iomgr/tcp_posix.h', - 'src/core/lib/iomgr/tcp_server.h', - 'src/core/lib/iomgr/tcp_server_utils_posix.h', - 'src/core/lib/iomgr/tcp_windows.h', - 'src/core/lib/iomgr/time_averaged_stats.h', - 'src/core/lib/iomgr/timer.h', - 'src/core/lib/iomgr/timer_custom.h', - 'src/core/lib/iomgr/timer_heap.h', - 'src/core/lib/iomgr/timer_manager.h', - 'src/core/lib/iomgr/udp_server.h', - 'src/core/lib/iomgr/unix_sockets_posix.h', - 'src/core/lib/iomgr/wakeup_fd_cv.h', - 'src/core/lib/iomgr/wakeup_fd_pipe.h', - 'src/core/lib/iomgr/wakeup_fd_posix.h', - 'src/core/lib/json/json.h', - 'src/core/lib/json/json_common.h', - 'src/core/lib/json/json_reader.h', - 'src/core/lib/json/json_writer.h', - 'src/core/lib/slice/b64.h', - 'src/core/lib/slice/percent_encoding.h', - 'src/core/lib/slice/slice_hash_table.h', - 'src/core/lib/slice/slice_internal.h', - 'src/core/lib/slice/slice_string_helpers.h', - 'src/core/lib/slice/slice_weak_hash_table.h', - 'src/core/lib/surface/api_trace.h', - 'src/core/lib/surface/call.h', - 'src/core/lib/surface/call_test_only.h', - 'src/core/lib/surface/channel.h', - 'src/core/lib/surface/channel_init.h', - 'src/core/lib/surface/channel_stack_type.h', - 'src/core/lib/surface/completion_queue.h', - 'src/core/lib/surface/completion_queue_factory.h', - 'src/core/lib/surface/event_string.h', - 'src/core/lib/surface/init.h', - 'src/core/lib/surface/lame_client.h', - 'src/core/lib/surface/server.h', - 'src/core/lib/surface/validate_metadata.h', - 'src/core/lib/transport/bdp_estimator.h', - 'src/core/lib/transport/byte_stream.h', - 'src/core/lib/transport/connectivity_state.h', - 'src/core/lib/transport/error_utils.h', - 'src/core/lib/transport/http2_errors.h', - 'src/core/lib/transport/metadata.h', - 'src/core/lib/transport/metadata_batch.h', - 'src/core/lib/transport/pid_controller.h', - 'src/core/lib/transport/service_config.h', - 'src/core/lib/transport/static_metadata.h', - 'src/core/lib/transport/status_conversion.h', - 'src/core/lib/transport/status_metadata.h', - 'src/core/lib/transport/timeout_encoding.h', - 'src/core/lib/transport/transport.h', - 'src/core/lib/transport/transport_impl.h', - 'src/core/lib/debug/trace.h' end s.subspec 'Cronet-Interface' do |ss| diff --git a/grpc.gemspec b/grpc.gemspec index f4f31f8d65..cd1490df50 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -322,6 +322,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/endpoint.h ) s.files += %w( src/core/lib/iomgr/endpoint_pair.h ) s.files += %w( src/core/lib/iomgr/error.h ) + s.files += %w( src/core/lib/iomgr/error_apple.h ) s.files += %w( src/core/lib/iomgr/error_internal.h ) s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.h ) s.files += %w( src/core/lib/iomgr/ev_epollex_linux.h ) @@ -333,7 +334,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/gethostname.h ) s.files += %w( src/core/lib/iomgr/iocp_windows.h ) s.files += %w( src/core/lib/iomgr/iomgr.h ) - s.files += %w( src/core/lib/iomgr/iomgr_cfstream.h ) s.files += %w( src/core/lib/iomgr/iomgr_custom.h ) s.files += %w( src/core/lib/iomgr/iomgr_internal.h ) s.files += %w( src/core/lib/iomgr/iomgr_posix.h ) @@ -364,6 +364,8 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/socket_utils_posix.h ) s.files += %w( src/core/lib/iomgr/socket_windows.h ) s.files += %w( src/core/lib/iomgr/sys_epoll_wrapper.h ) + s.files += %w( src/core/lib/iomgr/tcp_cfstream.h ) + s.files += %w( src/core/lib/iomgr/tcp_cfstream_sync.h ) s.files += %w( src/core/lib/iomgr/tcp_client.h ) s.files += %w( src/core/lib/iomgr/tcp_client_posix.h ) s.files += %w( src/core/lib/iomgr/tcp_custom.h ) @@ -467,6 +469,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/endpoint_pair_uv.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_windows.cc ) s.files += %w( src/core/lib/iomgr/error.cc ) + s.files += %w( src/core/lib/iomgr/error_apple.cc ) s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.cc ) s.files += %w( src/core/lib/iomgr/ev_epollex_linux.cc ) s.files += %w( src/core/lib/iomgr/ev_epollsig_linux.cc ) @@ -482,7 +485,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/gethostname_sysconf.cc ) s.files += %w( src/core/lib/iomgr/iocp_windows.cc ) s.files += %w( src/core/lib/iomgr/iomgr.cc ) - s.files += %w( src/core/lib/iomgr/iomgr_cfstream.cc ) s.files += %w( src/core/lib/iomgr/iomgr_custom.cc ) s.files += %w( src/core/lib/iomgr/iomgr_internal.cc ) s.files += %w( src/core/lib/iomgr/iomgr_posix.cc ) @@ -514,7 +516,10 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/socket_utils_uv.cc ) s.files += %w( src/core/lib/iomgr/socket_utils_windows.cc ) s.files += %w( src/core/lib/iomgr/socket_windows.cc ) + s.files += %w( src/core/lib/iomgr/tcp_cfstream.cc ) + s.files += %w( src/core/lib/iomgr/tcp_cfstream_sync.cc ) s.files += %w( src/core/lib/iomgr/tcp_client.cc ) + s.files += %w( src/core/lib/iomgr/tcp_client_cfstream.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_custom.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_posix.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_windows.cc ) diff --git a/grpc.gyp b/grpc.gyp index 876f76fa65..f5d7181e5b 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -273,6 +273,7 @@ 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', + 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -288,7 +289,6 @@ 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -320,7 +320,10 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', + 'src/core/lib/iomgr/tcp_cfstream.cc', + 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -624,6 +627,7 @@ 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', + 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -639,7 +643,6 @@ 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -671,7 +674,10 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', + 'src/core/lib/iomgr/tcp_cfstream.cc', + 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -855,6 +861,7 @@ 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', + 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -870,7 +877,6 @@ 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -902,7 +908,10 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', + 'src/core/lib/iomgr/tcp_cfstream.cc', + 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -1065,6 +1074,7 @@ 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', + 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -1080,7 +1090,6 @@ 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -1112,7 +1121,10 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', + 'src/core/lib/iomgr/tcp_cfstream.cc', + 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', diff --git a/package.xml b/package.xml index 7ecfb7d40c..43be471d21 100644 --- a/package.xml +++ b/package.xml @@ -329,6 +329,7 @@ + @@ -340,7 +341,6 @@ - @@ -371,6 +371,8 @@ + + @@ -474,6 +476,7 @@ + @@ -489,7 +492,6 @@ - @@ -521,7 +523,10 @@ + + + diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f1637c9d21..a053609e39 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -88,6 +88,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', + 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -103,7 +104,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/gethostname_sysconf.cc', 'src/core/lib/iomgr/iocp_windows.cc', 'src/core/lib/iomgr/iomgr.cc', - 'src/core/lib/iomgr/iomgr_cfstream.cc', 'src/core/lib/iomgr/iomgr_custom.cc', 'src/core/lib/iomgr/iomgr_internal.cc', 'src/core/lib/iomgr/iomgr_posix.cc', @@ -135,7 +135,10 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', + 'src/core/lib/iomgr/tcp_cfstream.cc', + 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 57693db8a6..f3cec18f99 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1066,6 +1066,7 @@ src/core/lib/iomgr/combiner.h \ src/core/lib/iomgr/endpoint.h \ src/core/lib/iomgr/endpoint_pair.h \ src/core/lib/iomgr/error.h \ +src/core/lib/iomgr/error_apple.h \ src/core/lib/iomgr/error_internal.h \ src/core/lib/iomgr/ev_epoll1_linux.h \ src/core/lib/iomgr/ev_epollex_linux.h \ @@ -1077,7 +1078,6 @@ src/core/lib/iomgr/executor.h \ src/core/lib/iomgr/gethostname.h \ src/core/lib/iomgr/iocp_windows.h \ src/core/lib/iomgr/iomgr.h \ -src/core/lib/iomgr/iomgr_cfstream.h \ src/core/lib/iomgr/iomgr_custom.h \ src/core/lib/iomgr/iomgr_internal.h \ src/core/lib/iomgr/iomgr_posix.h \ @@ -1108,6 +1108,8 @@ src/core/lib/iomgr/socket_utils.h \ src/core/lib/iomgr/socket_utils_posix.h \ src/core/lib/iomgr/socket_windows.h \ src/core/lib/iomgr/sys_epoll_wrapper.h \ +src/core/lib/iomgr/tcp_cfstream.h \ +src/core/lib/iomgr/tcp_cfstream_sync.h \ src/core/lib/iomgr/tcp_client.h \ src/core/lib/iomgr/tcp_client_posix.h \ src/core/lib/iomgr/tcp_custom.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index ab508dd30b..ad9a28ffd2 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1158,6 +1158,8 @@ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ src/core/lib/iomgr/error.h \ +src/core/lib/iomgr/error_apple.cc \ +src/core/lib/iomgr/error_apple.h \ src/core/lib/iomgr/error_internal.h \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epoll1_linux.h \ @@ -1184,8 +1186,6 @@ src/core/lib/iomgr/iocp_windows.cc \ src/core/lib/iomgr/iocp_windows.h \ src/core/lib/iomgr/iomgr.cc \ src/core/lib/iomgr/iomgr.h \ -src/core/lib/iomgr/iomgr_cfstream.cc \ -src/core/lib/iomgr/iomgr_cfstream.h \ src/core/lib/iomgr/iomgr_custom.cc \ src/core/lib/iomgr/iomgr_custom.h \ src/core/lib/iomgr/iomgr_internal.cc \ @@ -1247,8 +1247,13 @@ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/socket_windows.h \ src/core/lib/iomgr/sys_epoll_wrapper.h \ +src/core/lib/iomgr/tcp_cfstream.cc \ +src/core/lib/iomgr/tcp_cfstream.h \ +src/core/lib/iomgr/tcp_cfstream_sync.cc \ +src/core/lib/iomgr/tcp_cfstream_sync.h \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client.h \ +src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_posix.h \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 58a096f61b..1ba59273b3 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -9140,6 +9140,7 @@ "src/core/lib/iomgr/endpoint_pair_uv.cc", "src/core/lib/iomgr/endpoint_pair_windows.cc", "src/core/lib/iomgr/error.cc", + "src/core/lib/iomgr/error_apple.cc", "src/core/lib/iomgr/ev_epoll1_linux.cc", "src/core/lib/iomgr/ev_epollex_linux.cc", "src/core/lib/iomgr/ev_epollsig_linux.cc", @@ -9155,7 +9156,6 @@ "src/core/lib/iomgr/gethostname_sysconf.cc", "src/core/lib/iomgr/iocp_windows.cc", "src/core/lib/iomgr/iomgr.cc", - "src/core/lib/iomgr/iomgr_cfstream.cc", "src/core/lib/iomgr/iomgr_custom.cc", "src/core/lib/iomgr/iomgr_internal.cc", "src/core/lib/iomgr/iomgr_posix.cc", @@ -9187,7 +9187,10 @@ "src/core/lib/iomgr/socket_utils_uv.cc", "src/core/lib/iomgr/socket_utils_windows.cc", "src/core/lib/iomgr/socket_windows.cc", + "src/core/lib/iomgr/tcp_cfstream.cc", + "src/core/lib/iomgr/tcp_cfstream_sync.cc", "src/core/lib/iomgr/tcp_client.cc", + "src/core/lib/iomgr/tcp_client_cfstream.cc", "src/core/lib/iomgr/tcp_client_custom.cc", "src/core/lib/iomgr/tcp_client_posix.cc", "src/core/lib/iomgr/tcp_client_windows.cc", @@ -9318,6 +9321,7 @@ "src/core/lib/iomgr/endpoint.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", + "src/core/lib/iomgr/error_apple.h", "src/core/lib/iomgr/error_internal.h", "src/core/lib/iomgr/ev_epoll1_linux.h", "src/core/lib/iomgr/ev_epollex_linux.h", @@ -9329,7 +9333,6 @@ "src/core/lib/iomgr/gethostname.h", "src/core/lib/iomgr/iocp_windows.h", "src/core/lib/iomgr/iomgr.h", - "src/core/lib/iomgr/iomgr_cfstream.h", "src/core/lib/iomgr/iomgr_custom.h", "src/core/lib/iomgr/iomgr_internal.h", "src/core/lib/iomgr/iomgr_posix.h", @@ -9360,6 +9363,8 @@ "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", "src/core/lib/iomgr/sys_epoll_wrapper.h", + "src/core/lib/iomgr/tcp_cfstream.h", + "src/core/lib/iomgr/tcp_cfstream_sync.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_custom.h", @@ -9468,6 +9473,7 @@ "src/core/lib/iomgr/endpoint.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", + "src/core/lib/iomgr/error_apple.h", "src/core/lib/iomgr/error_internal.h", "src/core/lib/iomgr/ev_epoll1_linux.h", "src/core/lib/iomgr/ev_epollex_linux.h", @@ -9479,7 +9485,6 @@ "src/core/lib/iomgr/gethostname.h", "src/core/lib/iomgr/iocp_windows.h", "src/core/lib/iomgr/iomgr.h", - "src/core/lib/iomgr/iomgr_cfstream.h", "src/core/lib/iomgr/iomgr_custom.h", "src/core/lib/iomgr/iomgr_internal.h", "src/core/lib/iomgr/iomgr_posix.h", @@ -9510,6 +9515,8 @@ "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", "src/core/lib/iomgr/sys_epoll_wrapper.h", + "src/core/lib/iomgr/tcp_cfstream.h", + "src/core/lib/iomgr/tcp_cfstream_sync.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_custom.h", @@ -11089,31 +11096,5 @@ ], "third_party": false, "type": "filegroup" - }, - { - "deps": [ - "gpr", - "gpr_base_headers", - "grpc_base_headers" - ], - "headers": [ - "src/core/lib/iomgr/error_apple.h", - "src/core/lib/iomgr/tcp_cfstream.h", - "src/core/lib/iomgr/tcp_cfstream_sync.h" - ], - "is_filegroup": true, - "language": "objc++", - "name": "grpc_cfstream", - "src": [ - "src/core/lib/iomgr/error_apple.h", - "src/core/lib/iomgr/error_apple.mm", - "src/core/lib/iomgr/tcp_cfstream.h", - "src/core/lib/iomgr/tcp_cfstream.mm", - "src/core/lib/iomgr/tcp_cfstream_sync.h", - "src/core/lib/iomgr/tcp_cfstream_sync.mm", - "src/core/lib/iomgr/tcp_client_cfstream.mm" - ], - "third_party": false, - "type": "filegroup" } ] -- cgit v1.2.3 From 142cbb59480794980e53062c846bcc2d7512548a Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 30 May 2018 15:42:31 -0700 Subject: Address comments on names and comments --- BUILD | 8 +- CMakeLists.txt | 24 +- Makefile | 24 +- build.yaml | 8 +- config.m4 | 4 +- config.w32 | 4 +- gRPC-C++.podspec | 8 +- gRPC-Core.podspec | 12 +- grpc.gemspec | 8 +- grpc.gyp | 16 +- package.xml | 8 +- src/core/lib/iomgr/cfstream_handle.cc | 185 ++++++++++ src/core/lib/iomgr/cfstream_handle.h | 82 +++++ src/core/lib/iomgr/endpoint_cfstream.cc | 372 +++++++++++++++++++++ src/core/lib/iomgr/endpoint_cfstream.h | 49 +++ src/core/lib/iomgr/error_apple.cc | 3 +- src/core/lib/iomgr/polling_entity.cc | 2 + src/core/lib/iomgr/port.h | 4 +- src/core/lib/iomgr/tcp_cfstream.cc | 368 -------------------- src/core/lib/iomgr/tcp_cfstream.h | 52 --- src/core/lib/iomgr/tcp_cfstream_sync.cc | 183 ---------- src/core/lib/iomgr/tcp_cfstream_sync.h | 79 ----- src/core/lib/iomgr/tcp_client_cfstream.cc | 48 +-- src/core/lib/transport/transport.cc | 3 +- src/python/grpcio/grpc_core_dependencies.py | 4 +- tools/doxygen/Doxyfile.c++.internal | 4 +- tools/doxygen/Doxyfile.core.internal | 8 +- tools/run_tests/generated/sources_and_headers.json | 12 +- 28 files changed, 796 insertions(+), 786 deletions(-) create mode 100644 src/core/lib/iomgr/cfstream_handle.cc create mode 100644 src/core/lib/iomgr/cfstream_handle.h create mode 100644 src/core/lib/iomgr/endpoint_cfstream.cc create mode 100644 src/core/lib/iomgr/endpoint_cfstream.h delete mode 100644 src/core/lib/iomgr/tcp_cfstream.cc delete mode 100644 src/core/lib/iomgr/tcp_cfstream.h delete mode 100644 src/core/lib/iomgr/tcp_cfstream_sync.cc delete mode 100644 src/core/lib/iomgr/tcp_cfstream_sync.h (limited to 'gRPC-Core.podspec') diff --git a/BUILD b/BUILD index 77b7987167..3ea3973469 100644 --- a/BUILD +++ b/BUILD @@ -696,8 +696,10 @@ grpc_cc_library( "src/core/lib/http/httpcli.cc", "src/core/lib/http/parser.cc", "src/core/lib/iomgr/call_combiner.cc", + "src/core/lib/iomgr/cfstream_handle.cc", "src/core/lib/iomgr/combiner.cc", "src/core/lib/iomgr/endpoint.cc", + "src/core/lib/iomgr/endpoint_cfstream.cc", "src/core/lib/iomgr/endpoint_pair_posix.cc", "src/core/lib/iomgr/endpoint_pair_uv.cc", "src/core/lib/iomgr/endpoint_pair_windows.cc", @@ -747,8 +749,6 @@ grpc_cc_library( "src/core/lib/iomgr/socket_utils_posix.cc", "src/core/lib/iomgr/socket_utils_windows.cc", "src/core/lib/iomgr/socket_windows.cc", - "src/core/lib/iomgr/tcp_cfstream.cc", - "src/core/lib/iomgr/tcp_cfstream_sync.cc", "src/core/lib/iomgr/tcp_client.cc", "src/core/lib/iomgr/tcp_client_cfstream.cc", "src/core/lib/iomgr/tcp_client_custom.cc", @@ -849,9 +849,11 @@ grpc_cc_library( "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", + "src/core/lib/iomgr/cfstream_handle.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", "src/core/lib/iomgr/endpoint.h", + "src/core/lib/iomgr/endpoint_cfstream.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", "src/core/lib/iomgr/error_apple.h", @@ -897,8 +899,6 @@ grpc_cc_library( "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", "src/core/lib/iomgr/sys_epoll_wrapper.h", - "src/core/lib/iomgr/tcp_cfstream.h", - "src/core/lib/iomgr/tcp_cfstream_sync.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_custom.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 07d008343a..0f66a716e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -941,8 +941,10 @@ add_library(grpc src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc + src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc + src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc @@ -994,8 +996,6 @@ add_library(grpc src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_cfstream.cc - src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc @@ -1338,8 +1338,10 @@ add_library(grpc_cronet src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc + src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc + src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc @@ -1391,8 +1393,6 @@ add_library(grpc_cronet src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_cfstream.cc - src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc @@ -1727,8 +1727,10 @@ add_library(grpc_test_util src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc + src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc + src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc @@ -1780,8 +1782,6 @@ add_library(grpc_test_util src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_cfstream.cc - src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc @@ -2035,8 +2035,10 @@ add_library(grpc_test_util_unsecure src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc + src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc + src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc @@ -2088,8 +2090,6 @@ add_library(grpc_test_util_unsecure src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_cfstream.cc - src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc @@ -2322,8 +2322,10 @@ add_library(grpc_unsecure src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc + src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc + src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc @@ -2375,8 +2377,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_cfstream.cc - src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc @@ -3152,8 +3152,10 @@ add_library(grpc++_cronet src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc + src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc + src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc @@ -3205,8 +3207,6 @@ add_library(grpc++_cronet src/core/lib/iomgr/socket_utils_uv.cc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_cfstream.cc - src/core/lib/iomgr/tcp_cfstream_sync.cc src/core/lib/iomgr/tcp_client.cc src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc diff --git a/Makefile b/Makefile index 644c040fa4..8a9b0fdb73 100644 --- a/Makefile +++ b/Makefile @@ -3335,8 +3335,10 @@ LIBGRPC_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -3388,8 +3390,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ @@ -3732,8 +3732,10 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -3785,8 +3787,6 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ @@ -4120,8 +4120,10 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -4173,8 +4175,6 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ @@ -4420,8 +4420,10 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -4473,8 +4475,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ @@ -4686,8 +4686,10 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -4739,8 +4741,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ @@ -5509,8 +5509,10 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -5562,8 +5564,6 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ diff --git a/build.yaml b/build.yaml index 425d72fd17..7f2fad758e 100644 --- a/build.yaml +++ b/build.yaml @@ -253,8 +253,10 @@ filegroups: - src/core/lib/http/httpcli.cc - src/core/lib/http/parser.cc - src/core/lib/iomgr/call_combiner.cc + - src/core/lib/iomgr/cfstream_handle.cc - src/core/lib/iomgr/combiner.cc - src/core/lib/iomgr/endpoint.cc + - src/core/lib/iomgr/endpoint_cfstream.cc - src/core/lib/iomgr/endpoint_pair_posix.cc - src/core/lib/iomgr/endpoint_pair_uv.cc - src/core/lib/iomgr/endpoint_pair_windows.cc @@ -306,8 +308,6 @@ filegroups: - src/core/lib/iomgr/socket_utils_uv.cc - src/core/lib/iomgr/socket_utils_windows.cc - src/core/lib/iomgr/socket_windows.cc - - src/core/lib/iomgr/tcp_cfstream.cc - - src/core/lib/iomgr/tcp_cfstream_sync.cc - src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc - src/core/lib/iomgr/tcp_client_custom.cc @@ -434,9 +434,11 @@ filegroups: - src/core/lib/http/parser.h - src/core/lib/iomgr/block_annotate.h - src/core/lib/iomgr/call_combiner.h + - src/core/lib/iomgr/cfstream_handle.h - src/core/lib/iomgr/closure.h - src/core/lib/iomgr/combiner.h - src/core/lib/iomgr/endpoint.h + - src/core/lib/iomgr/endpoint_cfstream.h - src/core/lib/iomgr/endpoint_pair.h - src/core/lib/iomgr/error.h - src/core/lib/iomgr/error_apple.h @@ -481,8 +483,6 @@ filegroups: - src/core/lib/iomgr/socket_utils_posix.h - src/core/lib/iomgr/socket_windows.h - src/core/lib/iomgr/sys_epoll_wrapper.h - - src/core/lib/iomgr/tcp_cfstream.h - - src/core/lib/iomgr/tcp_cfstream_sync.h - src/core/lib/iomgr/tcp_client.h - src/core/lib/iomgr/tcp_client_posix.h - src/core/lib/iomgr/tcp_custom.h diff --git a/config.m4 b/config.m4 index efb36ad9cd..35181eb0cd 100644 --- a/config.m4 +++ b/config.m4 @@ -107,8 +107,10 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ + src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ + src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ @@ -160,8 +162,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/socket_utils_uv.cc \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ - src/core/lib/iomgr/tcp_cfstream.cc \ - src/core/lib/iomgr/tcp_cfstream_sync.cc \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ diff --git a/config.w32 b/config.w32 index c8df14eb38..376293dd4b 100644 --- a/config.w32 +++ b/config.w32 @@ -83,8 +83,10 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\http\\httpcli.cc " + "src\\core\\lib\\http\\parser.cc " + "src\\core\\lib\\iomgr\\call_combiner.cc " + + "src\\core\\lib\\iomgr\\cfstream_handle.cc " + "src\\core\\lib\\iomgr\\combiner.cc " + "src\\core\\lib\\iomgr\\endpoint.cc " + + "src\\core\\lib\\iomgr\\endpoint_cfstream.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_posix.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_uv.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_windows.cc " + @@ -136,8 +138,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\socket_utils_uv.cc " + "src\\core\\lib\\iomgr\\socket_utils_windows.cc " + "src\\core\\lib\\iomgr\\socket_windows.cc " + - "src\\core\\lib\\iomgr\\tcp_cfstream.cc " + - "src\\core\\lib\\iomgr\\tcp_cfstream_sync.cc " + "src\\core\\lib\\iomgr\\tcp_client.cc " + "src\\core\\lib\\iomgr\\tcp_client_cfstream.cc " + "src\\core\\lib\\iomgr\\tcp_client_custom.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 2f38ecc6b0..790ec3bd26 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -372,9 +372,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', + 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', + 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', 'src/core/lib/iomgr/error_apple.h', @@ -419,8 +421,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_cfstream.h', - 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', @@ -560,9 +560,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', + 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', + 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', 'src/core/lib/iomgr/error_apple.h', @@ -607,8 +609,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_cfstream.h', - 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 71ff31dc43..6eb5fb2ae9 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -382,9 +382,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', + 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', + 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', 'src/core/lib/iomgr/error_apple.h', @@ -429,8 +431,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_cfstream.h', - 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', @@ -528,8 +528,10 @@ Pod::Spec.new do |s| 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', + 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', @@ -581,8 +583,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_cfstream.cc', - 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', @@ -967,9 +967,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', + 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', + 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', 'src/core/lib/iomgr/error_apple.h', @@ -1014,8 +1016,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_posix.h', 'src/core/lib/iomgr/socket_windows.h', 'src/core/lib/iomgr/sys_epoll_wrapper.h', - 'src/core/lib/iomgr/tcp_cfstream.h', - 'src/core/lib/iomgr/tcp_cfstream_sync.h', 'src/core/lib/iomgr/tcp_client.h', 'src/core/lib/iomgr/tcp_client_posix.h', 'src/core/lib/iomgr/tcp_custom.h', diff --git a/grpc.gemspec b/grpc.gemspec index e807b1ba70..e768a214d6 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -317,9 +317,11 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/http/parser.h ) s.files += %w( src/core/lib/iomgr/block_annotate.h ) s.files += %w( src/core/lib/iomgr/call_combiner.h ) + s.files += %w( src/core/lib/iomgr/cfstream_handle.h ) s.files += %w( src/core/lib/iomgr/closure.h ) s.files += %w( src/core/lib/iomgr/combiner.h ) s.files += %w( src/core/lib/iomgr/endpoint.h ) + s.files += %w( src/core/lib/iomgr/endpoint_cfstream.h ) s.files += %w( src/core/lib/iomgr/endpoint_pair.h ) s.files += %w( src/core/lib/iomgr/error.h ) s.files += %w( src/core/lib/iomgr/error_apple.h ) @@ -364,8 +366,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/socket_utils_posix.h ) s.files += %w( src/core/lib/iomgr/socket_windows.h ) s.files += %w( src/core/lib/iomgr/sys_epoll_wrapper.h ) - s.files += %w( src/core/lib/iomgr/tcp_cfstream.h ) - s.files += %w( src/core/lib/iomgr/tcp_cfstream_sync.h ) s.files += %w( src/core/lib/iomgr/tcp_client.h ) s.files += %w( src/core/lib/iomgr/tcp_client_posix.h ) s.files += %w( src/core/lib/iomgr/tcp_custom.h ) @@ -463,8 +463,10 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/http/httpcli.cc ) s.files += %w( src/core/lib/http/parser.cc ) s.files += %w( src/core/lib/iomgr/call_combiner.cc ) + s.files += %w( src/core/lib/iomgr/cfstream_handle.cc ) s.files += %w( src/core/lib/iomgr/combiner.cc ) s.files += %w( src/core/lib/iomgr/endpoint.cc ) + s.files += %w( src/core/lib/iomgr/endpoint_cfstream.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_posix.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_uv.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_windows.cc ) @@ -516,8 +518,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/socket_utils_uv.cc ) s.files += %w( src/core/lib/iomgr/socket_utils_windows.cc ) s.files += %w( src/core/lib/iomgr/socket_windows.cc ) - s.files += %w( src/core/lib/iomgr/tcp_cfstream.cc ) - s.files += %w( src/core/lib/iomgr/tcp_cfstream_sync.cc ) s.files += %w( src/core/lib/iomgr/tcp_client.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_cfstream.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_custom.cc ) diff --git a/grpc.gyp b/grpc.gyp index 85dd75ddf6..3aacc85dcc 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -271,8 +271,10 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', + 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', @@ -324,8 +326,6 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_cfstream.cc', - 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', @@ -624,8 +624,10 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', + 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', @@ -677,8 +679,6 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_cfstream.cc', - 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', @@ -859,8 +859,10 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', + 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', @@ -912,8 +914,6 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_cfstream.cc', - 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', @@ -1072,8 +1072,10 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', + 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', @@ -1125,8 +1127,6 @@ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_cfstream.cc', - 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', diff --git a/package.xml b/package.xml index d1794f7eed..f02bf85068 100644 --- a/package.xml +++ b/package.xml @@ -324,9 +324,11 @@ + + @@ -371,8 +373,6 @@ - - @@ -470,8 +470,10 @@ + + @@ -523,8 +525,6 @@ - - diff --git a/src/core/lib/iomgr/cfstream_handle.cc b/src/core/lib/iomgr/cfstream_handle.cc new file mode 100644 index 0000000000..543179d93e --- /dev/null +++ b/src/core/lib/iomgr/cfstream_handle.cc @@ -0,0 +1,185 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include "src/core/lib/iomgr/port.h" + +#ifdef GRPC_CFSTREAM +#import +#import "src/core/lib/iomgr/cfstream_handle.h" + +#include +#include + +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/exec_ctx.h" + +extern grpc_core::TraceFlag grpc_tcp_trace; + +void* CFStreamHandle::Retain(void* info) { + CFStreamHandle* handle = static_cast(info); + CFSTREAM_SYNC_REF(handle, "retain"); + return info; +} + +void CFStreamHandle::Release(void* info) { + CFStreamHandle* handle = static_cast(info); + CFSTREAM_SYNC_UNREF(handle, "release"); +} + +CFStreamHandle* CFStreamHandle::CreateStreamSync( + CFReadStreamRef read_stream, CFWriteStreamRef write_stream) { + return new CFStreamHandle(read_stream, write_stream); +} + +void CFStreamHandle::ReadCallback(CFReadStreamRef stream, + CFStreamEventType type, + void* client_callback_info) { + CFStreamHandle* handle = static_cast(client_callback_info); + CFSTREAM_SYNC_REF(handle, "read callback"); + dispatch_async( + dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + grpc_core::ExecCtx exec_ctx; + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream ReadCallback (%p, %p, %lu, %p)", handle, + stream, type, client_callback_info); + } + switch (type) { + case kCFStreamEventOpenCompleted: + handle->open_event_.SetReady(); + break; + case kCFStreamEventHasBytesAvailable: + case kCFStreamEventEndEncountered: + handle->read_event_.SetReady(); + break; + case kCFStreamEventErrorOccurred: + handle->open_event_.SetReady(); + handle->read_event_.SetReady(); + break; + default: + // Impossible + abort(); + } + CFSTREAM_SYNC_UNREF(handle, "read callback"); + }); +} +void CFStreamHandle::WriteCallback(CFWriteStreamRef stream, + CFStreamEventType type, + void* clientCallBackInfo) { + CFStreamHandle* handle = static_cast(clientCallBackInfo); + CFSTREAM_SYNC_REF(handle, "write callback"); + dispatch_async( + dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + grpc_core::ExecCtx exec_ctx; + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream WriteCallback (%p, %p, %lu, %p)", handle, + stream, type, clientCallBackInfo); + } + switch (type) { + case kCFStreamEventOpenCompleted: + handle->open_event_.SetReady(); + break; + case kCFStreamEventCanAcceptBytes: + case kCFStreamEventEndEncountered: + handle->write_event_.SetReady(); + break; + case kCFStreamEventErrorOccurred: + handle->open_event_.SetReady(); + handle->write_event_.SetReady(); + break; + default: + // Impossible + abort(); + } + CFSTREAM_SYNC_UNREF(handle, "write callback"); + }); +} + +CFStreamHandle::CFStreamHandle(CFReadStreamRef read_stream, + CFWriteStreamRef write_stream) { + gpr_ref_init(&refcount_, 1); + open_event_.InitEvent(); + read_event_.InitEvent(); + write_event_.InitEvent(); + CFStreamClientContext ctx = {0, static_cast(this), nil, nil, nil}; + CFReadStreamSetClient( + read_stream, + kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable | + kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered, + CFStreamHandle::ReadCallback, &ctx); + CFWriteStreamSetClient( + write_stream, + kCFStreamEventOpenCompleted | kCFStreamEventCanAcceptBytes | + kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered, + CFStreamHandle::WriteCallback, &ctx); + CFReadStreamScheduleWithRunLoop(read_stream, CFRunLoopGetMain(), + kCFRunLoopCommonModes); + CFWriteStreamScheduleWithRunLoop(write_stream, CFRunLoopGetMain(), + kCFRunLoopCommonModes); +} + +CFStreamHandle::~CFStreamHandle() { + open_event_.DestroyEvent(); + read_event_.DestroyEvent(); + write_event_.DestroyEvent(); +} + +void CFStreamHandle::NotifyOnOpen(grpc_closure* closure) { + open_event_.NotifyOn(closure); +} + +void CFStreamHandle::NotifyOnRead(grpc_closure* closure) { + read_event_.NotifyOn(closure); +} + +void CFStreamHandle::NotifyOnWrite(grpc_closure* closure) { + write_event_.NotifyOn(closure); +} + +void CFStreamHandle::Shutdown(grpc_error* error) { + open_event_.SetShutdown(GRPC_ERROR_REF(error)); + read_event_.SetShutdown(GRPC_ERROR_REF(error)); + write_event_.SetShutdown(GRPC_ERROR_REF(error)); + GRPC_ERROR_UNREF(error); +} + +void CFStreamHandle::Ref(const char* file, int line, const char* reason) { + if (grpc_tcp_trace.enabled()) { + gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count); + gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, + "CFStream Handle ref %p : %s %" PRIdPTR " -> %" PRIdPTR, this, + reason, val, val + 1); + } + gpr_ref(&refcount_); +} + +void CFStreamHandle::Unref(const char* file, int line, const char* reason) { + if (grpc_tcp_trace.enabled()) { + gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count); + gpr_log(GPR_ERROR, + "CFStream Handle unref %p : %s %" PRIdPTR " -> %" PRIdPTR, this, + reason, val, val - 1); + } + if (gpr_unref(&refcount_)) { + delete this; + } +} + +#endif diff --git a/src/core/lib/iomgr/cfstream_handle.h b/src/core/lib/iomgr/cfstream_handle.h new file mode 100644 index 0000000000..f6f7ae54ed --- /dev/null +++ b/src/core/lib/iomgr/cfstream_handle.h @@ -0,0 +1,82 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* The CFStream handle acts as an event synchronization entity for + * read/write/open/error/eos events happening on CFStream streams. */ + +#ifndef GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H +#define GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H + +#include + +#include "src/core/lib/iomgr/port.h" + +#ifdef GRPC_CFSTREAM +#import + +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/lockfree_event.h" + +class CFStreamHandle final { + public: + static CFStreamHandle* CreateStreamSync(CFReadStreamRef read_stream, + CFWriteStreamRef write_stream); + ~CFStreamHandle(); + CFStreamHandle(const CFReadStreamRef& ref) = delete; + CFStreamHandle(CFReadStreamRef&& ref) = delete; + CFStreamHandle& operator=(const CFStreamHandle& rhs) = delete; + + void NotifyOnOpen(grpc_closure* closure); + void NotifyOnRead(grpc_closure* closure); + void NotifyOnWrite(grpc_closure* closure); + void Shutdown(grpc_error* error); + + void Ref(const char* file = nullptr, int line = 0, + const char* reason = nullptr); + void Unref(const char* file = nullptr, int line = 0, + const char* reason = nullptr); + + private: + CFStreamHandle(CFReadStreamRef read_stream, CFWriteStreamRef write_stream); + static void ReadCallback(CFReadStreamRef stream, CFStreamEventType type, + void* client_callback_info); + static void WriteCallback(CFWriteStreamRef stream, CFStreamEventType type, + void* client_callback_info); + static void* Retain(void* info); + static void Release(void* info); + + grpc_core::LockfreeEvent open_event_; + grpc_core::LockfreeEvent read_event_; + grpc_core::LockfreeEvent write_event_; + + gpr_refcount refcount_; +}; + +#ifndef NDEBUG +#define CFSTREAM_SYNC_REF(sync, reason) \ + (sync)->Ref(__FILE__, __LINE__, (reason)) +#define CFSTREAM_SYNC_UNREF(sync, reason) \ + (sync)->Unref(__FILE__, __LINE__, (reason)) +#else +#define CFSTREAM_SYNC_REF(sync, reason) (sync)->Ref() +#define CFSTREAM_SYNC_UNREF(sync, reason) (sync)->Unref() +#endif + +#endif + +#endif /* GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H */ diff --git a/src/core/lib/iomgr/endpoint_cfstream.cc b/src/core/lib/iomgr/endpoint_cfstream.cc new file mode 100644 index 0000000000..aa4359dfb2 --- /dev/null +++ b/src/core/lib/iomgr/endpoint_cfstream.cc @@ -0,0 +1,372 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#include "src/core/lib/iomgr/port.h" + +#ifdef GRPC_CFSTREAM_ENDPOINT + +#import +#import "src/core/lib/iomgr/endpoint_cfstream.h" + +#include +#include +#include + +#include "src/core/lib/gpr/string.h" +#include "src/core/lib/iomgr/cfstream_handle.h" +#include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/endpoint.h" +#include "src/core/lib/iomgr/error_apple.h" +#include "src/core/lib/slice/slice_internal.h" +#include "src/core/lib/slice/slice_string_helpers.h" + +extern grpc_core::TraceFlag grpc_tcp_trace; + +typedef struct { + grpc_endpoint base; + gpr_refcount refcount; + + CFReadStreamRef read_stream; + CFWriteStreamRef write_stream; + CFStreamHandle* stream_sync; + + grpc_closure* read_cb; + grpc_closure* write_cb; + grpc_slice_buffer* read_slices; + grpc_slice_buffer* write_slices; + + grpc_closure read_action; + grpc_closure write_action; + + char* peer_string; + grpc_resource_user* resource_user; + grpc_resource_user_slice_allocator slice_allocator; +} CFStreamEndpoint; + +static void CFStreamFree(CFStreamEndpoint* ep) { + grpc_resource_user_unref(ep->resource_user); + CFRelease(ep->read_stream); + CFRelease(ep->write_stream); + CFSTREAM_SYNC_UNREF(ep->stream_sync, "free"); + gpr_free(ep->peer_string); + gpr_free(ep); +} + +#ifndef NDEBUG +#define EP_REF(ep, reason) CFStreamRef((ep), (reason), __FILE__, __LINE__) +#define EP_UNREF(ep, reason) CFStreamUnref((ep), (reason), __FILE__, __LINE__) +static void CFStreamUnref(CFStreamEndpoint* ep, const char* reason, + const char* file, int line) { + if (grpc_tcp_trace.enabled()) { + gpr_atm val = gpr_atm_no_barrier_load(&ep->refcount.count); + gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, + "CFStream endpoint unref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, + reason, val, val - 1); + } + if (gpr_unref(&ep->refcount)) { + CFStreamFree(ep); + } +} +static void CFStreamRef(CFStreamEndpoint* ep, const char* reason, + const char* file, int line) { + if (grpc_tcp_trace.enabled()) { + gpr_atm val = gpr_atm_no_barrier_load(&ep->refcount.count); + gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, + "CFStream endpoint ref %p : %s %" PRIdPTR " -> %" PRIdPTR, ep, + reason, val, val + 1); + } + gpr_ref(&ep->refcount); +} +#else +#define EP_REF(ep, reason) CFStreamRef((ep)) +#define EP_UNREF(ep, reason) CFStreamUnref((ep)) +static void CFStreamUnref(CFStreamEndpoint* ep) { + if (gpr_unref(&ep->refcount)) { + CFStreamFree(ep); + } +} +static void CFStreamRef(CFStreamEndpoint* ep) { gpr_ref(&ep->refcount); } +#endif + +static grpc_error* CFStreamAnnotateError(grpc_error* src_error, + CFStreamEndpoint* ep) { + return grpc_error_set_str( + grpc_error_set_int(src_error, GRPC_ERROR_INT_GRPC_STATUS, + GRPC_STATUS_UNAVAILABLE), + GRPC_ERROR_STR_TARGET_ADDRESS, + grpc_slice_from_copied_string(ep->peer_string)); +} + +static void CallReadCb(CFStreamEndpoint* ep, grpc_error* error) { + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_read_cb %p %p:%p", ep, + ep->read_cb, ep->read_cb->cb, ep->read_cb->cb_arg); + size_t i; + const char* str = grpc_error_string(error); + gpr_log(GPR_DEBUG, "read: error=%s", str); + + for (i = 0; i < ep->read_slices->count; i++) { + char* dump = grpc_dump_slice(ep->read_slices->slices[i], + GPR_DUMP_HEX | GPR_DUMP_ASCII); + gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", ep, ep->peer_string, dump); + gpr_free(dump); + } + } + grpc_closure* cb = ep->read_cb; + ep->read_cb = nullptr; + ep->read_slices = nullptr; + GRPC_CLOSURE_SCHED(cb, error); +} + +static void CallWriteCb(CFStreamEndpoint* ep, grpc_error* error) { + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_write_cb %p %p:%p", ep, + ep->write_cb, ep->write_cb->cb, ep->write_cb->cb_arg); + const char* str = grpc_error_string(error); + gpr_log(GPR_DEBUG, "write: error=%s", str); + } + grpc_closure* cb = ep->write_cb; + ep->write_cb = nullptr; + ep->write_slices = nullptr; + GRPC_CLOSURE_SCHED(cb, error); +} + +static void ReadAction(void* arg, grpc_error* error) { + CFStreamEndpoint* ep = static_cast(arg); + GPR_ASSERT(ep->read_cb != nullptr); + if (error) { + grpc_slice_buffer_reset_and_unref_internal(ep->read_slices); + CallReadCb(ep, GRPC_ERROR_REF(error)); + EP_UNREF(ep, "read"); + return; + } + + GPR_ASSERT(ep->read_slices->count == 1); + grpc_slice slice = ep->read_slices->slices[0]; + size_t len = GRPC_SLICE_LENGTH(slice); + CFIndex read_size = + CFReadStreamRead(ep->read_stream, GRPC_SLICE_START_PTR(slice), len); + if (read_size == -1) { + grpc_slice_buffer_reset_and_unref_internal(ep->read_slices); + CFErrorRef stream_error = CFReadStreamCopyError(ep->read_stream); + if (stream_error != nullptr) { + error = CFStreamAnnotateError( + GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "Read error"), ep); + CFRelease(stream_error); + } else { + error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Read error"); + } + CallReadCb(ep, error); + EP_UNREF(ep, "read"); + } else if (read_size == 0) { + grpc_slice_buffer_reset_and_unref_internal(ep->read_slices); + CallReadCb(ep, + CFStreamAnnotateError( + GRPC_ERROR_CREATE_FROM_STATIC_STRING("Socket closed"), ep)); + EP_UNREF(ep, "read"); + } else { + if (read_size < len) { + grpc_slice_buffer_trim_end(ep->read_slices, len - read_size, nullptr); + } + CallReadCb(ep, GRPC_ERROR_NONE); + EP_UNREF(ep, "read"); + } +} + +static void WriteAction(void* arg, grpc_error* error) { + CFStreamEndpoint* ep = static_cast(arg); + GPR_ASSERT(ep->write_cb != nullptr); + if (error) { + grpc_slice_buffer_reset_and_unref_internal(ep->write_slices); + CallWriteCb(ep, GRPC_ERROR_REF(error)); + EP_UNREF(ep, "write"); + return; + } + + grpc_slice slice = grpc_slice_buffer_take_first(ep->write_slices); + size_t slice_len = GRPC_SLICE_LENGTH(slice); + CFIndex write_size = CFWriteStreamWrite( + ep->write_stream, GRPC_SLICE_START_PTR(slice), slice_len); + if (write_size == -1) { + grpc_slice_buffer_reset_and_unref_internal(ep->write_slices); + CFErrorRef stream_error = CFWriteStreamCopyError(ep->write_stream); + if (stream_error != nullptr) { + error = CFStreamAnnotateError( + GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "write failed."), ep); + CFRelease(stream_error); + } else { + error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("write failed."); + } + CallWriteCb(ep, error); + EP_UNREF(ep, "write"); + } else { + if (write_size < GRPC_SLICE_LENGTH(slice)) { + grpc_slice_buffer_undo_take_first( + ep->write_slices, grpc_slice_sub(slice, write_size, slice_len)); + } + if (ep->write_slices->length > 0) { + ep->stream_sync->NotifyOnWrite(&ep->write_action); + } else { + CallWriteCb(ep, GRPC_ERROR_NONE); + EP_UNREF(ep, "write"); + } + + if (grpc_tcp_trace.enabled()) { + grpc_slice trace_slice = grpc_slice_sub(slice, 0, write_size); + char* dump = grpc_dump_slice(trace_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); + gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", ep, ep->peer_string, dump); + gpr_free(dump); + grpc_slice_unref_internal(trace_slice); + } + } + grpc_slice_unref_internal(slice); +} + +static void CFStreamReadAllocationDone(void* arg, grpc_error* error) { + CFStreamEndpoint* ep = static_cast(arg); + if (error == GRPC_ERROR_NONE) { + ep->stream_sync->NotifyOnRead(&ep->read_action); + } else { + grpc_slice_buffer_reset_and_unref_internal(ep->read_slices); + CallReadCb(ep, error); + EP_UNREF(ep, "read"); + } +} + +static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices, + grpc_closure* cb) { + CFStreamEndpoint* ep_impl = reinterpret_cast(ep); + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p read (%p, %p) length:%zu", ep_impl, + slices, cb, slices->length); + } + GPR_ASSERT(ep_impl->read_cb == nullptr); + ep_impl->read_cb = cb; + ep_impl->read_slices = slices; + grpc_slice_buffer_reset_and_unref_internal(slices); + grpc_resource_user_alloc_slices(&ep_impl->slice_allocator, + GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1, + ep_impl->read_slices); + EP_REF(ep_impl, "read"); +} + +static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices, + grpc_closure* cb) { + CFStreamEndpoint* ep_impl = reinterpret_cast(ep); + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p write (%p, %p) length:%zu", + ep_impl, slices, cb, slices->length); + } + GPR_ASSERT(ep_impl->write_cb == nullptr); + ep_impl->write_cb = cb; + ep_impl->write_slices = slices; + EP_REF(ep_impl, "write"); + ep_impl->stream_sync->NotifyOnWrite(&ep_impl->write_action); +} + +void CFStreamShutdown(grpc_endpoint* ep, grpc_error* why) { + CFStreamEndpoint* ep_impl = reinterpret_cast(ep); + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown (%p)", ep_impl, why); + } + CFReadStreamClose(ep_impl->read_stream); + CFWriteStreamClose(ep_impl->write_stream); + ep_impl->stream_sync->Shutdown(why); + grpc_resource_user_shutdown(ep_impl->resource_user); + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown DONE (%p)", ep_impl, why); + } +} + +void CFStreamDestroy(grpc_endpoint* ep) { + CFStreamEndpoint* ep_impl = reinterpret_cast(ep); + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, "CFStream endpoint:%p destroy", ep_impl); + } + EP_UNREF(ep_impl, "destroy"); +} + +grpc_resource_user* CFStreamGetResourceUser(grpc_endpoint* ep) { + CFStreamEndpoint* ep_impl = reinterpret_cast(ep); + return ep_impl->resource_user; +} + +char* CFStreamGetPeer(grpc_endpoint* ep) { + CFStreamEndpoint* ep_impl = reinterpret_cast(ep); + return gpr_strdup(ep_impl->peer_string); +} + +int CFStreamGetFD(grpc_endpoint* ep) { return 0; } + +void CFStreamAddToPollset(grpc_endpoint* ep, grpc_pollset* pollset) {} +void CFStreamAddToPollsetSet(grpc_endpoint* ep, grpc_pollset_set* pollset) {} +void CFStreamDeleteFromPollsetSet(grpc_endpoint* ep, + grpc_pollset_set* pollset) {} + +static const grpc_endpoint_vtable vtable = {CFStreamRead, + CFStreamWrite, + CFStreamAddToPollset, + CFStreamAddToPollsetSet, + CFStreamDeleteFromPollsetSet, + CFStreamShutdown, + CFStreamDestroy, + CFStreamGetResourceUser, + CFStreamGetPeer, + CFStreamGetFD}; + +grpc_endpoint* grpc_cfstream_endpoint_create( + CFReadStreamRef read_stream, CFWriteStreamRef write_stream, + const char* peer_string, grpc_resource_quota* resource_quota, + CFStreamHandle* stream_sync) { + CFStreamEndpoint* ep_impl = + static_cast(gpr_malloc(sizeof(CFStreamEndpoint))); + if (grpc_tcp_trace.enabled()) { + gpr_log(GPR_DEBUG, + "CFStream endpoint:%p create readStream:%p writeStream: %p", + ep_impl, read_stream, write_stream); + } + ep_impl->base.vtable = &vtable; + gpr_ref_init(&ep_impl->refcount, 1); + ep_impl->read_stream = read_stream; + ep_impl->write_stream = write_stream; + CFRetain(read_stream); + CFRetain(write_stream); + ep_impl->stream_sync = stream_sync; + CFSTREAM_SYNC_REF(ep_impl->stream_sync, "endpoint create"); + + ep_impl->peer_string = gpr_strdup(peer_string); + ep_impl->read_cb = nil; + ep_impl->write_cb = nil; + ep_impl->read_slices = nil; + ep_impl->write_slices = nil; + GRPC_CLOSURE_INIT(&ep_impl->read_action, ReadAction, + static_cast(ep_impl), grpc_schedule_on_exec_ctx); + GRPC_CLOSURE_INIT(&ep_impl->write_action, WriteAction, + static_cast(ep_impl), grpc_schedule_on_exec_ctx); + ep_impl->resource_user = + grpc_resource_user_create(resource_quota, peer_string); + grpc_resource_user_slice_allocator_init(&ep_impl->slice_allocator, + ep_impl->resource_user, + CFStreamReadAllocationDone, ep_impl); + + return &ep_impl->base; +} + +#endif /* GRPC_CFSTREAM_ENDPOINT */ diff --git a/src/core/lib/iomgr/endpoint_cfstream.h b/src/core/lib/iomgr/endpoint_cfstream.h new file mode 100644 index 0000000000..ef957c1f11 --- /dev/null +++ b/src/core/lib/iomgr/endpoint_cfstream.h @@ -0,0 +1,49 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H +#define GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H +/* + Low level TCP "bottom half" implementation, for use by transports built on + top of a TCP connection. + + Note that this file does not (yet) include APIs for creating the socket in + the first place. + + All calls passing slice transfer ownership of a slice refcount unless + otherwise specified. +*/ + +#include + +#ifdef GRPC_CFSTREAM + +#import + +#include "src/core/lib/debug/trace.h" +#include "src/core/lib/iomgr/cfstream_handle.h" +#include "src/core/lib/iomgr/endpoint.h" + +grpc_endpoint* grpc_cfstream_endpoint_create( + CFReadStreamRef read_stream, CFWriteStreamRef write_stream, + const char* peer_string, grpc_resource_quota* resource_quota, + CFStreamHandle* stream_sync); + +#endif /* GRPC_CFSTREAM */ + +#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H */ diff --git a/src/core/lib/iomgr/error_apple.cc b/src/core/lib/iomgr/error_apple.cc index 95d69ecee9..d7af8c377f 100644 --- a/src/core/lib/iomgr/error_apple.cc +++ b/src/core/lib/iomgr/error_apple.cc @@ -31,7 +31,8 @@ grpc_error* grpc_error_create_from_cferror(const char* file, int line, void* arg, const char* custom_desc) { CFErrorRef error = static_cast(arg); - char buf_domain[MAX_ERROR_DESCRIPTION], buf_desc[MAX_ERROR_DESCRIPTION]; + char buf_domain[MAX_ERROR_DESCRIPTION]; + char buf_desc[MAX_ERROR_DESCRIPTION]; char* error_msg; CFErrorDomain domain = CFErrorGetDomain((error)); CFIndex code = CFErrorGetCode((error)); diff --git a/src/core/lib/iomgr/polling_entity.cc b/src/core/lib/iomgr/polling_entity.cc index 9c21e1f488..1ca3d9f31f 100644 --- a/src/core/lib/iomgr/polling_entity.cc +++ b/src/core/lib/iomgr/polling_entity.cc @@ -62,6 +62,8 @@ void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent, grpc_pollset_set* pss_dst) { if (pollent->tag == GRPC_POLLS_POLLSET) { #ifdef GRPC_CFSTREAM + // CFStream does not use file destriptors. When CFStream is used, the fd + // pollset is possible to be null. if (pollent->pollent.pollset != nullptr) { grpc_pollset_set_add_pollset(pss_dst, pollent->pollent.pollset); } diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h index a1a029e1bf..80d8e63cdd 100644 --- a/src/core/lib/iomgr/port.h +++ b/src/core/lib/iomgr/port.h @@ -99,8 +99,8 @@ #define GRPC_POSIX_NO_SPECIAL_WAKEUP_FD 1 #ifdef GRPC_CFSTREAM #define GRPC_POSIX_SOCKET_IOMGR 1 -#define GRPC_CFSTREAM_TCP 1 -#define GRPC_CFSTREAM_TCP_CLIENT 1 +#define GRPC_CFSTREAM_ENDPOINT 1 +#define GRPC_CFSTREAM_CLIENT 1 #define GRPC_POSIX_SOCKET_ARES_EV_DRIVER 1 #define GRPC_POSIX_SOCKET_EV 1 #define GRPC_POSIX_SOCKET_EV_EPOLL1 1 diff --git a/src/core/lib/iomgr/tcp_cfstream.cc b/src/core/lib/iomgr/tcp_cfstream.cc deleted file mode 100644 index d232e78513..0000000000 --- a/src/core/lib/iomgr/tcp_cfstream.cc +++ /dev/null @@ -1,368 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include "src/core/lib/iomgr/port.h" - -#ifdef GRPC_CFSTREAM_TCP - -#import -#import "src/core/lib/iomgr/tcp_cfstream.h" - -#include -#include -#include - -#include "src/core/lib/gpr/string.h" -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/endpoint.h" -#include "src/core/lib/iomgr/error_apple.h" -#include "src/core/lib/iomgr/tcp_cfstream_sync.h" -#include "src/core/lib/slice/slice_internal.h" -#include "src/core/lib/slice/slice_string_helpers.h" - -extern grpc_core::TraceFlag grpc_tcp_trace; - -typedef struct { - grpc_endpoint base; - gpr_refcount refcount; - - CFReadStreamRef read_stream; - CFWriteStreamRef write_stream; - CFStreamSync* stream_sync; - - grpc_closure* read_cb; - grpc_closure* write_cb; - grpc_slice_buffer* read_slices; - grpc_slice_buffer* write_slices; - - grpc_closure read_action; - grpc_closure write_action; - CFStreamEventType read_type; - - char* peer_string; - grpc_resource_user* resource_user; - grpc_resource_user_slice_allocator slice_allocator; -} CFStreamTCP; - -static void TCPFree(CFStreamTCP* tcp) { - grpc_resource_user_unref(tcp->resource_user); - CFRelease(tcp->read_stream); - CFRelease(tcp->write_stream); - CFSTREAM_SYNC_UNREF(tcp->stream_sync, "free"); - gpr_free(tcp->peer_string); - gpr_free(tcp); -} - -#ifndef NDEBUG -#define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__) -#define TCP_UNREF(tcp, reason) tcp_unref((tcp), (reason), __FILE__, __LINE__) -static void tcp_unref(CFStreamTCP* tcp, const char* reason, const char* file, - int line) { - if (grpc_tcp_trace.enabled()) { - gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "TCP unref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val, - val - 1); - } - if (gpr_unref(&tcp->refcount)) { - TCPFree(tcp); - } -} -static void tcp_ref(CFStreamTCP* tcp, const char* reason, const char* file, - int line) { - if (grpc_tcp_trace.enabled()) { - gpr_atm val = gpr_atm_no_barrier_load(&tcp->refcount.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "TCP ref %p : %s %" PRIdPTR " -> %" PRIdPTR, tcp, reason, val, - val + 1); - } - gpr_ref(&tcp->refcount); -} -#else -#define TCP_REF(tcp, reason) tcp_ref((tcp)) -#define TCP_UNREF(tcp, reason) tcp_unref((tcp)) -static void tcp_unref(CFStreamTCP* tcp) { - if (gpr_unref(&tcp->refcount)) { - TCPFree(tcp); - } -} -static void tcp_ref(CFStreamTCP* tcp) { gpr_ref(&tcp->refcount); } -#endif - -static grpc_error* TCPAnnotateError(grpc_error* src_error, CFStreamTCP* tcp) { - return grpc_error_set_str( - grpc_error_set_int(src_error, GRPC_ERROR_INT_GRPC_STATUS, - GRPC_STATUS_UNAVAILABLE), - GRPC_ERROR_STR_TARGET_ADDRESS, - grpc_slice_from_copied_string(tcp->peer_string)); -} - -static void CallReadCB(CFStreamTCP* tcp, grpc_error* error) { - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p call_read_cb %p %p:%p", tcp, tcp->read_cb, - tcp->read_cb->cb, tcp->read_cb->cb_arg); - size_t i; - const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "read: error=%s", str); - - for (i = 0; i < tcp->read_slices->count; i++) { - char* dump = grpc_dump_slice(tcp->read_slices->slices[i], - GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "READ %p (peer=%s): %s", tcp, tcp->peer_string, dump); - gpr_free(dump); - } - } - grpc_closure* cb = tcp->read_cb; - tcp->read_cb = nullptr; - tcp->read_slices = nullptr; - GRPC_CLOSURE_SCHED(cb, error); -} - -static void CallWriteCB(CFStreamTCP* tcp, grpc_error* error) { - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP:%p call_write_cb %p %p:%p", tcp, tcp->write_cb, - tcp->write_cb->cb, tcp->write_cb->cb_arg); - const char* str = grpc_error_string(error); - gpr_log(GPR_DEBUG, "write: error=%s", str); - } - grpc_closure* cb = tcp->write_cb; - tcp->write_cb = nullptr; - tcp->write_slices = nullptr; - GRPC_CLOSURE_SCHED(cb, error); -} - -static void ReadAction(void* arg, grpc_error* error) { - CFStreamTCP* tcp = static_cast(arg); - GPR_ASSERT(tcp->read_cb != nullptr); - if (error) { - grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices); - CallReadCB(tcp, GRPC_ERROR_REF(error)); - TCP_UNREF(tcp, "read"); - return; - } - - GPR_ASSERT(tcp->read_slices->count == 1); - grpc_slice slice = tcp->read_slices->slices[0]; - size_t len = GRPC_SLICE_LENGTH(slice); - CFIndex read_size = - CFReadStreamRead(tcp->read_stream, GRPC_SLICE_START_PTR(slice), len); - if (read_size == -1) { - grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices); - CFErrorRef stream_error = CFReadStreamCopyError(tcp->read_stream); - if (stream_error != nullptr) { - error = TCPAnnotateError( - GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "Read error"), tcp); - CFRelease(stream_error); - } else { - error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Read error"); - } - CallReadCB(tcp, error); - TCP_UNREF(tcp, "read"); - } else if (read_size == 0) { - grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices); - CallReadCB(tcp, - TCPAnnotateError( - GRPC_ERROR_CREATE_FROM_STATIC_STRING("Socket closed"), tcp)); - TCP_UNREF(tcp, "read"); - } else { - if (read_size < len) { - grpc_slice_buffer_trim_end(tcp->read_slices, len - read_size, nullptr); - } - CallReadCB(tcp, GRPC_ERROR_NONE); - TCP_UNREF(tcp, "read"); - } -} - -static void WriteAction(void* arg, grpc_error* error) { - CFStreamTCP* tcp = static_cast(arg); - GPR_ASSERT(tcp->write_cb != nullptr); - if (error) { - grpc_slice_buffer_reset_and_unref_internal(tcp->write_slices); - CallWriteCB(tcp, GRPC_ERROR_REF(error)); - TCP_UNREF(tcp, "write"); - return; - } - - grpc_slice slice = grpc_slice_buffer_take_first(tcp->write_slices); - size_t slice_len = GRPC_SLICE_LENGTH(slice); - CFIndex write_size = CFWriteStreamWrite( - tcp->write_stream, GRPC_SLICE_START_PTR(slice), slice_len); - if (write_size == -1) { - grpc_slice_buffer_reset_and_unref_internal(tcp->write_slices); - CFErrorRef stream_error = CFWriteStreamCopyError(tcp->write_stream); - if (stream_error != nullptr) { - error = TCPAnnotateError( - GRPC_ERROR_CREATE_FROM_CFERROR(stream_error, "write failed."), tcp); - CFRelease(stream_error); - } else { - error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("write failed."); - } - CallWriteCB(tcp, error); - TCP_UNREF(tcp, "write"); - } else { - if (write_size < GRPC_SLICE_LENGTH(slice)) { - grpc_slice_buffer_undo_take_first( - tcp->write_slices, grpc_slice_sub(slice, write_size, slice_len)); - } - if (tcp->write_slices->length > 0) { - tcp->stream_sync->NotifyOnWrite(&tcp->write_action); - } else { - CallWriteCB(tcp, GRPC_ERROR_NONE); - TCP_UNREF(tcp, "write"); - } - - if (grpc_tcp_trace.enabled()) { - grpc_slice trace_slice = grpc_slice_sub(slice, 0, write_size); - char* dump = grpc_dump_slice(trace_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_DEBUG, "WRITE %p (peer=%s): %s", tcp, tcp->peer_string, dump); - gpr_free(dump); - grpc_slice_unref_internal(trace_slice); - } - } - grpc_slice_unref_internal(slice); -} - -static void TCPReadAllocationDone(void* arg, grpc_error* error) { - CFStreamTCP* tcp = static_cast(arg); - if (error == GRPC_ERROR_NONE) { - tcp->stream_sync->NotifyOnRead(&tcp->read_action); - } else { - grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices); - CallReadCB(tcp, error); - TCP_UNREF(tcp, "read"); - } -} - -static void TCPRead(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb) { - CFStreamTCP* tcp = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "tcp:%p read (%p, %p) length:%zu", tcp, slices, cb, - slices->length); - } - GPR_ASSERT(tcp->read_cb == nullptr); - tcp->read_cb = cb; - tcp->read_slices = slices; - grpc_slice_buffer_reset_and_unref_internal(slices); - grpc_resource_user_alloc_slices(&tcp->slice_allocator, - GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1, - tcp->read_slices); - TCP_REF(tcp, "read"); -} - -static void TCPWrite(grpc_endpoint* ep, grpc_slice_buffer* slices, - grpc_closure* cb) { - CFStreamTCP* tcp = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "tcp:%p write (%p, %p) length:%zu", tcp, slices, cb, - slices->length); - } - GPR_ASSERT(tcp->write_cb == nullptr); - tcp->write_cb = cb; - tcp->write_slices = slices; - TCP_REF(tcp, "write"); - tcp->stream_sync->NotifyOnWrite(&tcp->write_action); -} - -void TCPShutdown(grpc_endpoint* ep, grpc_error* why) { - CFStreamTCP* tcp = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "tcp:%p shutdown (%p)", tcp, why); - } - CFReadStreamClose(tcp->read_stream); - CFWriteStreamClose(tcp->write_stream); - tcp->stream_sync->Shutdown(why); - grpc_resource_user_shutdown(tcp->resource_user); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "tcp:%p shutdown DONE (%p)", tcp, why); - } -} - -void TCPDestroy(grpc_endpoint* ep) { - CFStreamTCP* tcp = reinterpret_cast(ep); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "tcp:%p destroy", tcp); - } - TCP_UNREF(tcp, "destroy"); -} - -grpc_resource_user* TCPGetResourceUser(grpc_endpoint* ep) { - CFStreamTCP* tcp = reinterpret_cast(ep); - return tcp->resource_user; -} - -char* TCPGetPeer(grpc_endpoint* ep) { - CFStreamTCP* tcp = reinterpret_cast(ep); - return gpr_strdup(tcp->peer_string); -} - -int TCPGetFD(grpc_endpoint* ep) { return 0; } - -void TCPAddToPollset(grpc_endpoint* ep, grpc_pollset* pollset) {} -void TCPAddToPollsetSet(grpc_endpoint* ep, grpc_pollset_set* pollset) {} -void TCPDeleteFromPollsetSet(grpc_endpoint* ep, grpc_pollset_set* pollset) {} - -static const grpc_endpoint_vtable vtable = {TCPRead, - TCPWrite, - TCPAddToPollset, - TCPAddToPollsetSet, - TCPDeleteFromPollsetSet, - TCPShutdown, - TCPDestroy, - TCPGetResourceUser, - TCPGetPeer, - TCPGetFD}; - -grpc_endpoint* grpc_tcp_create(CFReadStreamRef read_stream, - CFWriteStreamRef write_stream, - const char* peer_string, - grpc_resource_quota* resource_quota, - CFStreamSync* stream_sync) { - CFStreamTCP* tcp = static_cast(gpr_malloc(sizeof(CFStreamTCP))); - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "tcp:%p create readStream:%p writeStream: %p", tcp, - read_stream, write_stream); - } - tcp->base.vtable = &vtable; - gpr_ref_init(&tcp->refcount, 1); - tcp->read_stream = read_stream; - tcp->write_stream = write_stream; - CFRetain(read_stream); - CFRetain(write_stream); - tcp->stream_sync = stream_sync; - CFSTREAM_SYNC_REF(tcp->stream_sync, "endpoint create"); - - tcp->peer_string = gpr_strdup(peer_string); - tcp->read_cb = nil; - tcp->write_cb = nil; - tcp->read_slices = nil; - tcp->write_slices = nil; - GRPC_CLOSURE_INIT(&tcp->read_action, ReadAction, static_cast(tcp), - grpc_schedule_on_exec_ctx); - GRPC_CLOSURE_INIT(&tcp->write_action, WriteAction, static_cast(tcp), - grpc_schedule_on_exec_ctx); - tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string); - grpc_resource_user_slice_allocator_init( - &tcp->slice_allocator, tcp->resource_user, TCPReadAllocationDone, tcp); - - return &tcp->base; -} - -#endif /* GRPC_CFSTREAM_TCP */ diff --git a/src/core/lib/iomgr/tcp_cfstream.h b/src/core/lib/iomgr/tcp_cfstream.h deleted file mode 100644 index 9f52f6a5de..0000000000 --- a/src/core/lib/iomgr/tcp_cfstream.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_TCP_CFSTREAM_H -#define GRPC_CORE_LIB_IOMGR_TCP_CFSTREAM_H -/* - Low level TCP "bottom half" implementation, for use by transports built on - top of a TCP connection. - - Note that this file does not (yet) include APIs for creating the socket in - the first place. - - All calls passing slice transfer ownership of a slice refcount unless - otherwise specified. -*/ - -#include - -#ifdef GRPC_CFSTREAM - -#import - -#include "src/core/lib/debug/trace.h" -#include "src/core/lib/iomgr/endpoint.h" -#include "src/core/lib/iomgr/tcp_cfstream_sync.h" - -extern grpc_core::TraceFlag grpc_tcp_trace; - -grpc_endpoint* grpc_tcp_create(CFReadStreamRef read_stream, - CFWriteStreamRef write_stream, - const char* peer_string, - grpc_resource_quota* resource_quota, - CFStreamSync* stream_sync); - -#endif /* GRPC_CFSTREAM */ - -#endif /* GRPC_CORE_LIB_IOMGR_TCP_CFSTREAM_H */ diff --git a/src/core/lib/iomgr/tcp_cfstream_sync.cc b/src/core/lib/iomgr/tcp_cfstream_sync.cc deleted file mode 100644 index 07ee53311c..0000000000 --- a/src/core/lib/iomgr/tcp_cfstream_sync.cc +++ /dev/null @@ -1,183 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#include "src/core/lib/iomgr/port.h" - -#ifdef GRPC_CFSTREAM -#import -#import "src/core/lib/iomgr/tcp_cfstream_sync.h" - -#include -#include - -#include "src/core/lib/debug/trace.h" -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/exec_ctx.h" - -extern grpc_core::TraceFlag grpc_tcp_trace; - -void* CFStreamSync::Retain(void* info) { - CFStreamSync* sync = static_cast(info); - CFSTREAM_SYNC_REF(sync, "retain"); - return info; -} - -void CFStreamSync::Release(void* info) { - CFStreamSync* sync = static_cast(info); - CFSTREAM_SYNC_UNREF(sync, "release"); -} - -CFStreamSync* CFStreamSync::CreateStreamSync(CFReadStreamRef read_stream, - CFWriteStreamRef write_stream) { - return new CFStreamSync(read_stream, write_stream); -} - -void CFStreamSync::ReadCallback(CFReadStreamRef stream, CFStreamEventType type, - void* client_callback_info) { - CFStreamSync* sync = static_cast(client_callback_info); - CFSTREAM_SYNC_REF(sync, "read callback"); - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), - ^{ - grpc_core::ExecCtx exec_ctx; - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP ReadCallback (%p, %p, %lu, %p)", - sync, stream, type, client_callback_info); - } - switch (type) { - case kCFStreamEventOpenCompleted: - sync->open_event_.SetReady(); - break; - case kCFStreamEventHasBytesAvailable: - case kCFStreamEventEndEncountered: - sync->read_event_.SetReady(); - break; - case kCFStreamEventErrorOccurred: - sync->open_event_.SetReady(); - sync->read_event_.SetReady(); - break; - default: - // Impossible - abort(); - } - CFSTREAM_SYNC_UNREF(sync, "read callback"); - }); -} -void CFStreamSync::WriteCallback(CFWriteStreamRef stream, - CFStreamEventType type, - void* clientCallBackInfo) { - CFStreamSync* sync = static_cast(clientCallBackInfo); - CFSTREAM_SYNC_REF(sync, "write callback"); - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), - ^{ - grpc_core::ExecCtx exec_ctx; - if (grpc_tcp_trace.enabled()) { - gpr_log(GPR_DEBUG, "TCP WriteCallback (%p, %p, %lu, %p)", - sync, stream, type, clientCallBackInfo); - } - switch (type) { - case kCFStreamEventOpenCompleted: - sync->open_event_.SetReady(); - break; - case kCFStreamEventCanAcceptBytes: - case kCFStreamEventEndEncountered: - sync->write_event_.SetReady(); - break; - case kCFStreamEventErrorOccurred: - sync->open_event_.SetReady(); - sync->write_event_.SetReady(); - break; - default: - // Impossible - abort(); - } - CFSTREAM_SYNC_UNREF(sync, "write callback"); - }); -} - -CFStreamSync::CFStreamSync(CFReadStreamRef read_stream, - CFWriteStreamRef write_stream) { - gpr_ref_init(&refcount_, 1); - open_event_.InitEvent(); - read_event_.InitEvent(); - write_event_.InitEvent(); - CFStreamClientContext ctx = {0, static_cast(this), nil, nil, nil}; - CFReadStreamSetClient( - read_stream, - kCFStreamEventOpenCompleted | kCFStreamEventHasBytesAvailable | - kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered, - CFStreamSync::ReadCallback, &ctx); - CFWriteStreamSetClient( - write_stream, - kCFStreamEventOpenCompleted | kCFStreamEventCanAcceptBytes | - kCFStreamEventErrorOccurred | kCFStreamEventEndEncountered, - CFStreamSync::WriteCallback, &ctx); - CFReadStreamScheduleWithRunLoop(read_stream, CFRunLoopGetMain(), - kCFRunLoopCommonModes); - CFWriteStreamScheduleWithRunLoop(write_stream, CFRunLoopGetMain(), - kCFRunLoopCommonModes); -} - -CFStreamSync::~CFStreamSync() { - open_event_.DestroyEvent(); - read_event_.DestroyEvent(); - write_event_.DestroyEvent(); -} - -void CFStreamSync::NotifyOnOpen(grpc_closure* closure) { - open_event_.NotifyOn(closure); -} - -void CFStreamSync::NotifyOnRead(grpc_closure* closure) { - read_event_.NotifyOn(closure); -} - -void CFStreamSync::NotifyOnWrite(grpc_closure* closure) { - write_event_.NotifyOn(closure); -} - -void CFStreamSync::Shutdown(grpc_error* error) { - open_event_.SetShutdown(GRPC_ERROR_REF(error)); - read_event_.SetShutdown(GRPC_ERROR_REF(error)); - write_event_.SetShutdown(GRPC_ERROR_REF(error)); - GRPC_ERROR_UNREF(error); -} - -void CFStreamSync::Ref(const char* file, int line, const char* reason) { - if (grpc_tcp_trace.enabled()) { - gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count); - gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "TCP SYNC ref %p : %s %" PRIdPTR " -> %" PRIdPTR, this, reason, val, - val + 1); - } - gpr_ref(&refcount_); -} - -void CFStreamSync::Unref(const char* file, int line, const char* reason) { - if (grpc_tcp_trace.enabled()) { - gpr_atm val = gpr_atm_no_barrier_load(&refcount_.count); - gpr_log(GPR_ERROR, "TCP SYNC unref %p : %s %" PRIdPTR " -> %" PRIdPTR, this, - reason, val, val - 1); - } - if (gpr_unref(&refcount_)) { - delete this; - } -} - -#endif diff --git a/src/core/lib/iomgr/tcp_cfstream_sync.h b/src/core/lib/iomgr/tcp_cfstream_sync.h deleted file mode 100644 index 9e1d8fbed9..0000000000 --- a/src/core/lib/iomgr/tcp_cfstream_sync.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_TCP_CFSTREAM_SYNC_H -#define GRPC_CORE_LIB_IOMGR_TCP_CFSTREAM_SYNC_H - -#include - -#include "src/core/lib/iomgr/port.h" - -#ifdef GRPC_CFSTREAM -#import - -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/iomgr/lockfree_event.h" - -class CFStreamSync final { - public: - static CFStreamSync* CreateStreamSync(CFReadStreamRef read_stream, - CFWriteStreamRef write_stream); - ~CFStreamSync(); - CFStreamSync(const CFReadStreamRef& ref) = delete; - CFStreamSync(CFReadStreamRef&& ref) = delete; - CFStreamSync& operator=(const CFStreamSync& rhs) = delete; - - void NotifyOnOpen(grpc_closure* closure); - void NotifyOnRead(grpc_closure* closure); - void NotifyOnWrite(grpc_closure* closure); - void Shutdown(grpc_error* error); - - void Ref(const char* file = nullptr, int line = 0, - const char* reason = nullptr); - void Unref(const char* file = nullptr, int line = 0, - const char* reason = nullptr); - - private: - CFStreamSync(CFReadStreamRef read_stream, CFWriteStreamRef write_stream); - static void ReadCallback(CFReadStreamRef stream, CFStreamEventType type, - void* client_callback_info); - static void WriteCallback(CFWriteStreamRef stream, CFStreamEventType type, - void* client_callback_info); - static void* Retain(void* info); - static void Release(void* info); - - grpc_core::LockfreeEvent open_event_; - grpc_core::LockfreeEvent read_event_; - grpc_core::LockfreeEvent write_event_; - - gpr_refcount refcount_; -}; - -#ifndef NDEBUG -#define CFSTREAM_SYNC_REF(sync, reason) \ - (sync)->Ref(__FILE__, __LINE__, (reason)) -#define CFSTREAM_SYNC_UNREF(sync, reason) \ - (sync)->Unref(__FILE__, __LINE__, (reason)) -#else -#define CFSTREAM_SYNC_REF(sync, reason) (sync)->Ref() -#define CFSTREAM_SYNC_UNREF(sync, reason) (sync)->Unref() -#endif - -#endif - -#endif /* GRPC_CORE_LIB_IOMGR_TCP_CFSTREAM_SYNC_H */ diff --git a/src/core/lib/iomgr/tcp_client_cfstream.cc b/src/core/lib/iomgr/tcp_client_cfstream.cc index 7deaece904..552f81a506 100644 --- a/src/core/lib/iomgr/tcp_client_cfstream.cc +++ b/src/core/lib/iomgr/tcp_client_cfstream.cc @@ -21,7 +21,7 @@ #include "src/core/lib/iomgr/port.h" -#ifdef GRPC_CFSTREAM_TCP_CLIENT +#ifdef GRPC_CFSTREAM_CLIENT #include @@ -35,24 +35,24 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/gpr/host_port.h" +#include "src/core/lib/iomgr/cfstream_handle.h" #include "src/core/lib/iomgr/closure.h" +#include "src/core/lib/iomgr/endpoint_cfstream.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/error_apple.h" #include "src/core/lib/iomgr/sockaddr_utils.h" -#include "src/core/lib/iomgr/tcp_cfstream.h" -#include "src/core/lib/iomgr/tcp_cfstream_sync.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/iomgr/timer.h" extern grpc_core::TraceFlag grpc_tcp_trace; -typedef struct CFStreamTCPConnect { +typedef struct CFStreamConnect { gpr_mu mu; gpr_refcount refcount; CFReadStreamRef read_stream; CFWriteStreamRef write_stream; - CFStreamSync* stream_sync; + CFStreamHandle* stream_sync; grpc_timer alarm; grpc_closure on_alarm; @@ -67,9 +67,9 @@ typedef struct CFStreamTCPConnect { int refs; char* addr_name; grpc_resource_quota* resource_quota; -} CFStreamTCPConnect; +} CFStreamConnect; -static void TCPConnectCleanup(CFStreamTCPConnect* connect) { +static void CFStreamConnectCleanup(CFStreamConnect* connect) { grpc_resource_quota_unref_internal(connect->resource_quota); CFSTREAM_SYNC_UNREF(connect->stream_sync, "async connect clean up"); CFRelease(connect->read_stream); @@ -80,7 +80,7 @@ static void TCPConnectCleanup(CFStreamTCPConnect* connect) { } static void OnAlarm(void* arg, grpc_error* error) { - CFStreamTCPConnect* connect = static_cast(arg); + CFStreamConnect* connect = static_cast(arg); if (grpc_tcp_trace.enabled()) { gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%p", connect, error); } @@ -92,7 +92,7 @@ static void OnAlarm(void* arg, grpc_error* error) { // Only schedule a callback once, by either on_timer or on_connected. The // first one issues callback while the second one does cleanup. if (done) { - TCPConnectCleanup(connect); + CFStreamConnectCleanup(connect); } else { grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("connect() timed out"); @@ -101,7 +101,7 @@ static void OnAlarm(void* arg, grpc_error* error) { } static void OnOpen(void* arg, grpc_error* error) { - CFStreamTCPConnect* connect = static_cast(arg); + CFStreamConnect* connect = static_cast(arg); if (grpc_tcp_trace.enabled()) { gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%p", connect, error); } @@ -115,7 +115,7 @@ static void OnOpen(void* arg, grpc_error* error) { if (done) { gpr_mu_unlock(&connect->mu); - TCPConnectCleanup(connect); + CFStreamConnectCleanup(connect); } else { if (error == GRPC_ERROR_NONE) { CFErrorRef stream_error = CFReadStreamCopyError(connect->read_stream); @@ -127,9 +127,9 @@ static void OnOpen(void* arg, grpc_error* error) { CFRelease(stream_error); } if (error == GRPC_ERROR_NONE) { - *endpoint = grpc_tcp_create(connect->read_stream, connect->write_stream, - connect->addr_name, connect->resource_quota, - connect->stream_sync); + *endpoint = grpc_cfstream_endpoint_create( + connect->read_stream, connect->write_stream, connect->addr_name, + connect->resource_quota, connect->stream_sync); } } gpr_mu_unlock(&connect->mu); @@ -149,14 +149,14 @@ static void ParseResolvedAddress(const grpc_resolved_address* addr, *port = grpc_sockaddr_get_port(addr); } -static void TCPClientConnect(grpc_closure* closure, grpc_endpoint** ep, - grpc_pollset_set* interested_parties, - const grpc_channel_args* channel_args, - const grpc_resolved_address* resolved_addr, - grpc_millis deadline) { - CFStreamTCPConnect* connect; +static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep, + grpc_pollset_set* interested_parties, + const grpc_channel_args* channel_args, + const grpc_resolved_address* resolved_addr, + grpc_millis deadline) { + CFStreamConnect* connect; - connect = (CFStreamTCPConnect*)gpr_zalloc(sizeof(CFStreamTCPConnect)); + connect = (CFStreamConnect*)gpr_zalloc(sizeof(CFStreamConnect)); connect->closure = closure; connect->endpoint = ep; connect->addr_name = grpc_sockaddr_to_uri(resolved_addr); @@ -194,7 +194,7 @@ static void TCPClientConnect(grpc_closure* closure, grpc_endpoint** ep, connect->read_stream = read_stream; connect->write_stream = write_stream; connect->stream_sync = - CFStreamSync::CreateStreamSync(read_stream, write_stream); + CFStreamHandle::CreateStreamSync(read_stream, write_stream); GRPC_CLOSURE_INIT(&connect->on_open, OnOpen, static_cast(connect), grpc_schedule_on_exec_ctx); connect->stream_sync->NotifyOnOpen(&connect->on_open); @@ -207,6 +207,6 @@ static void TCPClientConnect(grpc_closure* closure, grpc_endpoint** ep, gpr_mu_unlock(&connect->mu); } -grpc_tcp_client_vtable grpc_posix_tcp_client_vtable = {TCPClientConnect}; +grpc_tcp_client_vtable grpc_posix_tcp_client_vtable = {CFStreamClientConnect}; -#endif /* GRPC_CFSTREAM_TCP_CLIENT */ +#endif /* GRPC_CFSTREAM_CLIENT */ diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc index 9b633efc57..c9f5def40d 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -185,7 +185,8 @@ void grpc_transport_set_pops(grpc_transport* transport, grpc_stream* stream, transport->vtable->set_pollset_set(transport, stream, pollset_set); } else { #ifdef GRPC_CFSTREAM - // No-op for empty pollset + // No-op for empty pollset. CFStream does not use file destriptors. When + // CFStream is used, the fd pollset is possible to be null. #else abort(); #endif diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 6dee3b81f1..92864b2559 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -82,8 +82,10 @@ CORE_SOURCE_FILES = [ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', + 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', @@ -135,8 +137,6 @@ CORE_SOURCE_FILES = [ 'src/core/lib/iomgr/socket_utils_uv.cc', 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', - 'src/core/lib/iomgr/tcp_cfstream.cc', - 'src/core/lib/iomgr/tcp_cfstream_sync.cc', 'src/core/lib/iomgr/tcp_client.cc', 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index e593c9d736..cb1c75b988 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1061,9 +1061,11 @@ src/core/lib/http/httpcli.h \ src/core/lib/http/parser.h \ src/core/lib/iomgr/block_annotate.h \ src/core/lib/iomgr/call_combiner.h \ +src/core/lib/iomgr/cfstream_handle.h \ src/core/lib/iomgr/closure.h \ src/core/lib/iomgr/combiner.h \ src/core/lib/iomgr/endpoint.h \ +src/core/lib/iomgr/endpoint_cfstream.h \ src/core/lib/iomgr/endpoint_pair.h \ src/core/lib/iomgr/error.h \ src/core/lib/iomgr/error_apple.h \ @@ -1108,8 +1110,6 @@ src/core/lib/iomgr/socket_utils.h \ src/core/lib/iomgr/socket_utils_posix.h \ src/core/lib/iomgr/socket_windows.h \ src/core/lib/iomgr/sys_epoll_wrapper.h \ -src/core/lib/iomgr/tcp_cfstream.h \ -src/core/lib/iomgr/tcp_cfstream_sync.h \ src/core/lib/iomgr/tcp_client.h \ src/core/lib/iomgr/tcp_client_posix.h \ src/core/lib/iomgr/tcp_custom.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 4c68e33d43..be32966025 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1147,11 +1147,15 @@ src/core/lib/iomgr/README.md \ src/core/lib/iomgr/block_annotate.h \ src/core/lib/iomgr/call_combiner.cc \ src/core/lib/iomgr/call_combiner.h \ +src/core/lib/iomgr/cfstream_handle.cc \ +src/core/lib/iomgr/cfstream_handle.h \ src/core/lib/iomgr/closure.h \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/combiner.h \ src/core/lib/iomgr/endpoint.cc \ src/core/lib/iomgr/endpoint.h \ +src/core/lib/iomgr/endpoint_cfstream.cc \ +src/core/lib/iomgr/endpoint_cfstream.h \ src/core/lib/iomgr/endpoint_pair.h \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ @@ -1247,10 +1251,6 @@ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/socket_windows.h \ src/core/lib/iomgr/sys_epoll_wrapper.h \ -src/core/lib/iomgr/tcp_cfstream.cc \ -src/core/lib/iomgr/tcp_cfstream.h \ -src/core/lib/iomgr/tcp_cfstream_sync.cc \ -src/core/lib/iomgr/tcp_cfstream_sync.h \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client.h \ src/core/lib/iomgr/tcp_client_cfstream.cc \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 3de860c3c7..adb36bb182 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -9280,8 +9280,10 @@ "src/core/lib/http/httpcli.cc", "src/core/lib/http/parser.cc", "src/core/lib/iomgr/call_combiner.cc", + "src/core/lib/iomgr/cfstream_handle.cc", "src/core/lib/iomgr/combiner.cc", "src/core/lib/iomgr/endpoint.cc", + "src/core/lib/iomgr/endpoint_cfstream.cc", "src/core/lib/iomgr/endpoint_pair_posix.cc", "src/core/lib/iomgr/endpoint_pair_uv.cc", "src/core/lib/iomgr/endpoint_pair_windows.cc", @@ -9333,8 +9335,6 @@ "src/core/lib/iomgr/socket_utils_uv.cc", "src/core/lib/iomgr/socket_utils_windows.cc", "src/core/lib/iomgr/socket_windows.cc", - "src/core/lib/iomgr/tcp_cfstream.cc", - "src/core/lib/iomgr/tcp_cfstream_sync.cc", "src/core/lib/iomgr/tcp_client.cc", "src/core/lib/iomgr/tcp_client_cfstream.cc", "src/core/lib/iomgr/tcp_client_custom.cc", @@ -9462,9 +9462,11 @@ "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", + "src/core/lib/iomgr/cfstream_handle.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", "src/core/lib/iomgr/endpoint.h", + "src/core/lib/iomgr/endpoint_cfstream.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", "src/core/lib/iomgr/error_apple.h", @@ -9509,8 +9511,6 @@ "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", "src/core/lib/iomgr/sys_epoll_wrapper.h", - "src/core/lib/iomgr/tcp_cfstream.h", - "src/core/lib/iomgr/tcp_cfstream_sync.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_custom.h", @@ -9614,9 +9614,11 @@ "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", + "src/core/lib/iomgr/cfstream_handle.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", "src/core/lib/iomgr/endpoint.h", + "src/core/lib/iomgr/endpoint_cfstream.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", "src/core/lib/iomgr/error_apple.h", @@ -9661,8 +9663,6 @@ "src/core/lib/iomgr/socket_utils_posix.h", "src/core/lib/iomgr/socket_windows.h", "src/core/lib/iomgr/sys_epoll_wrapper.h", - "src/core/lib/iomgr/tcp_cfstream.h", - "src/core/lib/iomgr/tcp_cfstream_sync.h", "src/core/lib/iomgr/tcp_client.h", "src/core/lib/iomgr/tcp_client_posix.h", "src/core/lib/iomgr/tcp_custom.h", -- cgit v1.2.3 From c512b4f039f0c5cb503b9aa130c617969dd741ce Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 5 Jun 2018 09:42:33 -0700 Subject: revert -framework CoreFoundation Make error CFStream only --- BUILD | 26 ++++++++--- CMakeLists.txt | 24 ---------- Makefile | 26 +---------- build.yaml | 22 +++++---- config.m4 | 4 -- config.w32 | 4 -- gRPC-C++.podspec | 6 --- gRPC-Core.podspec | 20 ++++----- grpc.gemspec | 7 --- grpc.gyp | 20 --------- package.xml | 7 --- src/core/lib/iomgr/endpoint_cfstream.cc | 2 +- src/core/lib/iomgr/error_apple.cc | 52 ---------------------- src/core/lib/iomgr/error_apple.h | 31 ------------- src/core/lib/iomgr/error_cfstream.cc | 52 ++++++++++++++++++++++ src/core/lib/iomgr/error_cfstream.h | 31 +++++++++++++ src/core/lib/iomgr/tcp_client_cfstream.cc | 2 +- .../tests/Tests.xcodeproj/project.pbxproj | 6 +-- .../xcschemes/InteropTestsRemoteCFStream.xcscheme | 2 - src/python/grpcio/grpc_core_dependencies.py | 4 -- templates/gRPC-Core.podspec.template | 10 +++++ tools/doxygen/Doxyfile.c++.internal | 3 -- tools/doxygen/Doxyfile.core.internal | 7 --- tools/run_tests/generated/sources_and_headers.json | 36 ++++++++++----- tools/run_tests/sanity/core_banned_functions.py | 2 +- 25 files changed, 169 insertions(+), 237 deletions(-) delete mode 100644 src/core/lib/iomgr/error_apple.cc delete mode 100644 src/core/lib/iomgr/error_apple.h create mode 100644 src/core/lib/iomgr/error_cfstream.cc create mode 100644 src/core/lib/iomgr/error_cfstream.h (limited to 'gRPC-Core.podspec') diff --git a/BUILD b/BUILD index 3ea3973469..ea8cf50587 100644 --- a/BUILD +++ b/BUILD @@ -696,15 +696,12 @@ grpc_cc_library( "src/core/lib/http/httpcli.cc", "src/core/lib/http/parser.cc", "src/core/lib/iomgr/call_combiner.cc", - "src/core/lib/iomgr/cfstream_handle.cc", "src/core/lib/iomgr/combiner.cc", "src/core/lib/iomgr/endpoint.cc", - "src/core/lib/iomgr/endpoint_cfstream.cc", "src/core/lib/iomgr/endpoint_pair_posix.cc", "src/core/lib/iomgr/endpoint_pair_uv.cc", "src/core/lib/iomgr/endpoint_pair_windows.cc", "src/core/lib/iomgr/error.cc", - "src/core/lib/iomgr/error_apple.cc", "src/core/lib/iomgr/ev_epoll1_linux.cc", "src/core/lib/iomgr/ev_epollex_linux.cc", "src/core/lib/iomgr/ev_epollsig_linux.cc", @@ -750,7 +747,6 @@ grpc_cc_library( "src/core/lib/iomgr/socket_utils_windows.cc", "src/core/lib/iomgr/socket_windows.cc", "src/core/lib/iomgr/tcp_client.cc", - "src/core/lib/iomgr/tcp_client_cfstream.cc", "src/core/lib/iomgr/tcp_client_custom.cc", "src/core/lib/iomgr/tcp_client_posix.cc", "src/core/lib/iomgr/tcp_client_windows.cc", @@ -849,14 +845,11 @@ grpc_cc_library( "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", - "src/core/lib/iomgr/cfstream_handle.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", "src/core/lib/iomgr/endpoint.h", - "src/core/lib/iomgr/endpoint_cfstream.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", - "src/core/lib/iomgr/error_apple.h", "src/core/lib/iomgr/error_internal.h", "src/core/lib/iomgr/ev_epoll1_linux.h", "src/core/lib/iomgr/ev_epollex_linux.h", @@ -1010,6 +1003,25 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "grpc_cfstream", + srcs = [ + "src/core/lib/iomgr/cfstream_handle.cc", + "src/core/lib/iomgr/endpoint_cfstream.cc", + "src/core/lib/iomgr/error_cfstream.cc", + "src/core/lib/iomgr/tcp_client_cfstream.cc", + ], + hdrs = [ + "src/core/lib/iomgr/cfstream_handle.h", + "src/core/lib/iomgr/endpoint_cfstream.h", + "src/core/lib/iomgr/error_cfstream.h", + ], + deps = [ + ":gpr_base", + ":grpc_base", + ], +) + grpc_cc_library( name = "grpc_client_channel", srcs = [ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f66a716e2..af56886cd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -941,15 +941,12 @@ add_library(grpc src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc - src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc - src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -997,7 +994,6 @@ add_library(grpc src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -1338,15 +1334,12 @@ add_library(grpc_cronet src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc - src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc - src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -1394,7 +1387,6 @@ add_library(grpc_cronet src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -1727,15 +1719,12 @@ add_library(grpc_test_util src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc - src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc - src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -1783,7 +1772,6 @@ add_library(grpc_test_util src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -2035,15 +2023,12 @@ add_library(grpc_test_util_unsecure src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc - src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc - src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -2091,7 +2076,6 @@ add_library(grpc_test_util_unsecure src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -2322,15 +2306,12 @@ add_library(grpc_unsecure src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc - src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc - src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -2378,7 +2359,6 @@ add_library(grpc_unsecure src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc @@ -3152,15 +3132,12 @@ add_library(grpc++_cronet src/core/lib/http/httpcli.cc src/core/lib/http/parser.cc src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc src/core/lib/iomgr/combiner.cc src/core/lib/iomgr/endpoint.cc - src/core/lib/iomgr/endpoint_cfstream.cc src/core/lib/iomgr/endpoint_pair_posix.cc src/core/lib/iomgr/endpoint_pair_uv.cc src/core/lib/iomgr/endpoint_pair_windows.cc src/core/lib/iomgr/error.cc - src/core/lib/iomgr/error_apple.cc src/core/lib/iomgr/ev_epoll1_linux.cc src/core/lib/iomgr/ev_epollex_linux.cc src/core/lib/iomgr/ev_epollsig_linux.cc @@ -3208,7 +3185,6 @@ add_library(grpc++_cronet src/core/lib/iomgr/socket_utils_windows.cc src/core/lib/iomgr/socket_windows.cc src/core/lib/iomgr/tcp_client.cc - src/core/lib/iomgr/tcp_client_cfstream.cc src/core/lib/iomgr/tcp_client_custom.cc src/core/lib/iomgr/tcp_client_posix.cc src/core/lib/iomgr/tcp_client_windows.cc diff --git a/Makefile b/Makefile index 8a9b0fdb73..1d1597e326 100644 --- a/Makefile +++ b/Makefile @@ -336,7 +336,7 @@ CXXFLAGS += -stdlib=libc++ endif CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations COREFLAGS += -fno-rtti -fno-exceptions -LDFLAGS += -g $(if $(subst Darwin,,$(SYSTEM)),,-framework CoreFoundation) +LDFLAGS += -g DEFINES += PB_FIELD_16BIT @@ -3335,15 +3335,12 @@ LIBGRPC_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -3391,7 +3388,6 @@ LIBGRPC_SRC = \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -3732,15 +3728,12 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -3788,7 +3781,6 @@ LIBGRPC_CRONET_SRC = \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -4120,15 +4112,12 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -4176,7 +4165,6 @@ LIBGRPC_TEST_UTIL_SRC = \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -4420,15 +4408,12 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -4476,7 +4461,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -4686,15 +4670,12 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -4742,7 +4723,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ @@ -5509,15 +5489,12 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -5565,7 +5542,6 @@ LIBGRPC++_CRONET_SRC = \ src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ diff --git a/build.yaml b/build.yaml index 7f2fad758e..c41d87d476 100644 --- a/build.yaml +++ b/build.yaml @@ -253,15 +253,12 @@ filegroups: - src/core/lib/http/httpcli.cc - src/core/lib/http/parser.cc - src/core/lib/iomgr/call_combiner.cc - - src/core/lib/iomgr/cfstream_handle.cc - src/core/lib/iomgr/combiner.cc - src/core/lib/iomgr/endpoint.cc - - src/core/lib/iomgr/endpoint_cfstream.cc - src/core/lib/iomgr/endpoint_pair_posix.cc - src/core/lib/iomgr/endpoint_pair_uv.cc - src/core/lib/iomgr/endpoint_pair_windows.cc - src/core/lib/iomgr/error.cc - - src/core/lib/iomgr/error_apple.cc - src/core/lib/iomgr/ev_epoll1_linux.cc - src/core/lib/iomgr/ev_epollex_linux.cc - src/core/lib/iomgr/ev_epollsig_linux.cc @@ -309,7 +306,6 @@ filegroups: - src/core/lib/iomgr/socket_utils_windows.cc - src/core/lib/iomgr/socket_windows.cc - src/core/lib/iomgr/tcp_client.cc - - src/core/lib/iomgr/tcp_client_cfstream.cc - src/core/lib/iomgr/tcp_client_custom.cc - src/core/lib/iomgr/tcp_client_posix.cc - src/core/lib/iomgr/tcp_client_windows.cc @@ -434,14 +430,11 @@ filegroups: - src/core/lib/http/parser.h - src/core/lib/iomgr/block_annotate.h - src/core/lib/iomgr/call_combiner.h - - src/core/lib/iomgr/cfstream_handle.h - src/core/lib/iomgr/closure.h - src/core/lib/iomgr/combiner.h - src/core/lib/iomgr/endpoint.h - - src/core/lib/iomgr/endpoint_cfstream.h - src/core/lib/iomgr/endpoint_pair.h - src/core/lib/iomgr/error.h - - src/core/lib/iomgr/error_apple.h - src/core/lib/iomgr/error_internal.h - src/core/lib/iomgr/ev_epoll1_linux.h - src/core/lib/iomgr/ev_epollex_linux.h @@ -543,6 +536,19 @@ filegroups: uses: - grpc_codegen - grpc_trace_headers +- name: grpc_cfstream + headers: + - src/core/lib/iomgr/cfstream_handle.h + - src/core/lib/iomgr/endpoint_cfstream.h + - src/core/lib/iomgr/error_cfstream.h + src: + - src/core/lib/iomgr/cfstream_handle.cc + - src/core/lib/iomgr/endpoint_cfstream.cc + - src/core/lib/iomgr/error_cfstream.cc + - src/core/lib/iomgr/tcp_client_cfstream.cc + uses: + - grpc_base_headers + - gpr_base_headers - name: grpc_client_authority_filter headers: - src/core/ext/filters/http/client_authority_filter.h @@ -5618,7 +5624,7 @@ defaults: COREFLAGS: -fno-rtti -fno-exceptions CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -Wno-deprecated-declarations - LDFLAGS: -g $(if $(subst Darwin,,$(SYSTEM)),,-framework CoreFoundation) + LDFLAGS: -g zlib: CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration -Wno-implicit-fallthrough $(W_NO_SHIFT_NEGATIVE_VALUE) -fvisibility=hidden diff --git a/config.m4 b/config.m4 index 35181eb0cd..ad3df85794 100644 --- a/config.m4 +++ b/config.m4 @@ -107,15 +107,12 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/http/httpcli.cc \ src/core/lib/http/parser.cc \ src/core/lib/iomgr/call_combiner.cc \ - src/core/lib/iomgr/cfstream_handle.cc \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/endpoint.cc \ - src/core/lib/iomgr/endpoint_cfstream.cc \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ - src/core/lib/iomgr/error_apple.cc \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epollex_linux.cc \ src/core/lib/iomgr/ev_epollsig_linux.cc \ @@ -163,7 +160,6 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/iomgr/socket_utils_windows.cc \ src/core/lib/iomgr/socket_windows.cc \ src/core/lib/iomgr/tcp_client.cc \ - src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_windows.cc \ diff --git a/config.w32 b/config.w32 index 376293dd4b..c09fb93005 100644 --- a/config.w32 +++ b/config.w32 @@ -83,15 +83,12 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\http\\httpcli.cc " + "src\\core\\lib\\http\\parser.cc " + "src\\core\\lib\\iomgr\\call_combiner.cc " + - "src\\core\\lib\\iomgr\\cfstream_handle.cc " + "src\\core\\lib\\iomgr\\combiner.cc " + "src\\core\\lib\\iomgr\\endpoint.cc " + - "src\\core\\lib\\iomgr\\endpoint_cfstream.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_posix.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_uv.cc " + "src\\core\\lib\\iomgr\\endpoint_pair_windows.cc " + "src\\core\\lib\\iomgr\\error.cc " + - "src\\core\\lib\\iomgr\\error_apple.cc " + "src\\core\\lib\\iomgr\\ev_epoll1_linux.cc " + "src\\core\\lib\\iomgr\\ev_epollex_linux.cc " + "src\\core\\lib\\iomgr\\ev_epollsig_linux.cc " + @@ -139,7 +136,6 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\iomgr\\socket_utils_windows.cc " + "src\\core\\lib\\iomgr\\socket_windows.cc " + "src\\core\\lib\\iomgr\\tcp_client.cc " + - "src\\core\\lib\\iomgr\\tcp_client_cfstream.cc " + "src\\core\\lib\\iomgr\\tcp_client_custom.cc " + "src\\core\\lib\\iomgr\\tcp_client_posix.cc " + "src\\core\\lib\\iomgr\\tcp_client_windows.cc " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 790ec3bd26..262de72971 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -372,14 +372,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -560,14 +557,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 6eb5fb2ae9..5a111c2d3f 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -382,14 +382,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -528,15 +525,12 @@ Pod::Spec.new do |s| 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -584,7 +578,6 @@ Pod::Spec.new do |s| 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -967,14 +960,11 @@ Pod::Spec.new do |s| 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/call_combiner.h', - 'src/core/lib/iomgr/cfstream_handle.h', 'src/core/lib/iomgr/closure.h', 'src/core/lib/iomgr/combiner.h', 'src/core/lib/iomgr/endpoint.h', - 'src/core/lib/iomgr/endpoint_cfstream.h', 'src/core/lib/iomgr/endpoint_pair.h', 'src/core/lib/iomgr/error.h', - 'src/core/lib/iomgr/error_apple.h', 'src/core/lib/iomgr/error_internal.h', 'src/core/lib/iomgr/ev_epoll1_linux.h', 'src/core/lib/iomgr/ev_epollex_linux.h', @@ -1096,6 +1086,16 @@ Pod::Spec.new do |s| ss.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1' } + ss.source_files = 'src/core/lib/iomgr/cfstream_handle.cc', + 'src/core/lib/iomgr/endpoint_cfstream.cc', + 'src/core/lib/iomgr/error_cfstream.cc', + 'src/core/lib/iomgr/tcp_client_cfstream.cc', + 'src/core/lib/iomgr/cfstream_handle.h', + 'src/core/lib/iomgr/endpoint_cfstream.h', + 'src/core/lib/iomgr/error_cfstream.h' + ss.private_header_files = 'src/core/lib/iomgr/cfstream_handle.h', + 'src/core/lib/iomgr/endpoint_cfstream.h', + 'src/core/lib/iomgr/error_cfstream.h' end s.subspec 'Cronet-Interface' do |ss| diff --git a/grpc.gemspec b/grpc.gemspec index e768a214d6..21e83e26ad 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -317,14 +317,11 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/http/parser.h ) s.files += %w( src/core/lib/iomgr/block_annotate.h ) s.files += %w( src/core/lib/iomgr/call_combiner.h ) - s.files += %w( src/core/lib/iomgr/cfstream_handle.h ) s.files += %w( src/core/lib/iomgr/closure.h ) s.files += %w( src/core/lib/iomgr/combiner.h ) s.files += %w( src/core/lib/iomgr/endpoint.h ) - s.files += %w( src/core/lib/iomgr/endpoint_cfstream.h ) s.files += %w( src/core/lib/iomgr/endpoint_pair.h ) s.files += %w( src/core/lib/iomgr/error.h ) - s.files += %w( src/core/lib/iomgr/error_apple.h ) s.files += %w( src/core/lib/iomgr/error_internal.h ) s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.h ) s.files += %w( src/core/lib/iomgr/ev_epollex_linux.h ) @@ -463,15 +460,12 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/http/httpcli.cc ) s.files += %w( src/core/lib/http/parser.cc ) s.files += %w( src/core/lib/iomgr/call_combiner.cc ) - s.files += %w( src/core/lib/iomgr/cfstream_handle.cc ) s.files += %w( src/core/lib/iomgr/combiner.cc ) s.files += %w( src/core/lib/iomgr/endpoint.cc ) - s.files += %w( src/core/lib/iomgr/endpoint_cfstream.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_posix.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_uv.cc ) s.files += %w( src/core/lib/iomgr/endpoint_pair_windows.cc ) s.files += %w( src/core/lib/iomgr/error.cc ) - s.files += %w( src/core/lib/iomgr/error_apple.cc ) s.files += %w( src/core/lib/iomgr/ev_epoll1_linux.cc ) s.files += %w( src/core/lib/iomgr/ev_epollex_linux.cc ) s.files += %w( src/core/lib/iomgr/ev_epollsig_linux.cc ) @@ -519,7 +513,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/iomgr/socket_utils_windows.cc ) s.files += %w( src/core/lib/iomgr/socket_windows.cc ) s.files += %w( src/core/lib/iomgr/tcp_client.cc ) - s.files += %w( src/core/lib/iomgr/tcp_client_cfstream.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_custom.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_posix.cc ) s.files += %w( src/core/lib/iomgr/tcp_client_windows.cc ) diff --git a/grpc.gyp b/grpc.gyp index 3aacc85dcc..3edfe55f5b 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -62,10 +62,6 @@ ], 'ldflags': [ '-g', - '$(if', - '$(subst', - 'Darwin,,$(SYSTEM)),,-framework', - 'CoreFoundation)', ], 'cflags_c': [ '-Werror', @@ -271,15 +267,12 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -327,7 +320,6 @@ 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -624,15 +616,12 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -680,7 +669,6 @@ 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -859,15 +847,12 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -915,7 +900,6 @@ 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', @@ -1072,15 +1056,12 @@ 'src/core/lib/http/httpcli.cc', 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/call_combiner.cc', - 'src/core/lib/iomgr/cfstream_handle.cc', 'src/core/lib/iomgr/combiner.cc', 'src/core/lib/iomgr/endpoint.cc', - 'src/core/lib/iomgr/endpoint_cfstream.cc', 'src/core/lib/iomgr/endpoint_pair_posix.cc', 'src/core/lib/iomgr/endpoint_pair_uv.cc', 'src/core/lib/iomgr/endpoint_pair_windows.cc', 'src/core/lib/iomgr/error.cc', - 'src/core/lib/iomgr/error_apple.cc', 'src/core/lib/iomgr/ev_epoll1_linux.cc', 'src/core/lib/iomgr/ev_epollex_linux.cc', 'src/core/lib/iomgr/ev_epollsig_linux.cc', @@ -1128,7 +1109,6 @@ 'src/core/lib/iomgr/socket_utils_windows.cc', 'src/core/lib/iomgr/socket_windows.cc', 'src/core/lib/iomgr/tcp_client.cc', - 'src/core/lib/iomgr/tcp_client_cfstream.cc', 'src/core/lib/iomgr/tcp_client_custom.cc', 'src/core/lib/iomgr/tcp_client_posix.cc', 'src/core/lib/iomgr/tcp_client_windows.cc', diff --git a/package.xml b/package.xml index f02bf85068..9bfe1e33e5 100644 --- a/package.xml +++ b/package.xml @@ -324,14 +324,11 @@ - - - @@ -470,15 +467,12 @@ - - - @@ -526,7 +520,6 @@ - diff --git a/src/core/lib/iomgr/endpoint_cfstream.cc b/src/core/lib/iomgr/endpoint_cfstream.cc index 6525a02fbb..c3bc0cc8fd 100644 --- a/src/core/lib/iomgr/endpoint_cfstream.cc +++ b/src/core/lib/iomgr/endpoint_cfstream.cc @@ -33,7 +33,7 @@ #include "src/core/lib/iomgr/cfstream_handle.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" -#include "src/core/lib/iomgr/error_apple.h" +#include "src/core/lib/iomgr/error_cfstream.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" diff --git a/src/core/lib/iomgr/error_apple.cc b/src/core/lib/iomgr/error_apple.cc deleted file mode 100644 index bc375bae88..0000000000 --- a/src/core/lib/iomgr/error_apple.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include - -#ifdef GPR_APPLE -#include - -#include -#include - -#include "src/core/lib/iomgr/error.h" - -#define MAX_ERROR_DESCRIPTION 256 - -grpc_error* grpc_error_create_from_cferror(const char* file, int line, - void* arg, const char* custom_desc) { - CFErrorRef error = static_cast(arg); - char buf_domain[MAX_ERROR_DESCRIPTION]; - char buf_desc[MAX_ERROR_DESCRIPTION]; - char* error_msg; - CFErrorDomain domain = CFErrorGetDomain((error)); - CFIndex code = CFErrorGetCode((error)); - CFStringRef desc = CFErrorCopyDescription((error)); - CFStringGetCString(domain, buf_domain, MAX_ERROR_DESCRIPTION, - kCFStringEncodingUTF8); - CFStringGetCString(desc, buf_desc, MAX_ERROR_DESCRIPTION, - kCFStringEncodingUTF8); - gpr_asprintf(&error_msg, "%s (error domain:%s, code:%ld, description:%s)", - custom_desc, buf_domain, code, buf_desc); - CFRelease(desc); - grpc_error* return_error = grpc_error_create( - file, line, grpc_slice_from_copied_string(error_msg), NULL, 0); - gpr_free(error_msg); - return return_error; -} -#endif /* GPR_APPLE */ diff --git a/src/core/lib/iomgr/error_apple.h b/src/core/lib/iomgr/error_apple.h deleted file mode 100644 index 276ec77d35..0000000000 --- a/src/core/lib/iomgr/error_apple.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * Copyright 2018 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#ifndef GRPC_CORE_LIB_IOMGR_ERROR_APPLE_H -#define GRPC_CORE_LIB_IOMGR_ERROR_APPLE_H - -#ifdef GRPC_CFSTREAM -// Create an error from Apple Core Foundation CFError object -#define GRPC_ERROR_CREATE_FROM_CFERROR(error, desc) \ - grpc_error_create_from_cferror(__FILE__, __LINE__, \ - static_cast((error)), (desc)) -grpc_error* grpc_error_create_from_cferror(const char* file, int line, - void* arg, const char* desc); -#endif /* GRPC_CFSTREAM */ - -#endif /* GRPC_CORE_LIB_IOMGR_ERROR_APPLE_H */ diff --git a/src/core/lib/iomgr/error_cfstream.cc b/src/core/lib/iomgr/error_cfstream.cc new file mode 100644 index 0000000000..d7af8c377f --- /dev/null +++ b/src/core/lib/iomgr/error_cfstream.cc @@ -0,0 +1,52 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include + +#ifdef GRPC_CFSTREAM +#include + +#include +#include + +#include "src/core/lib/iomgr/error.h" + +#define MAX_ERROR_DESCRIPTION 256 + +grpc_error* grpc_error_create_from_cferror(const char* file, int line, + void* arg, const char* custom_desc) { + CFErrorRef error = static_cast(arg); + char buf_domain[MAX_ERROR_DESCRIPTION]; + char buf_desc[MAX_ERROR_DESCRIPTION]; + char* error_msg; + CFErrorDomain domain = CFErrorGetDomain((error)); + CFIndex code = CFErrorGetCode((error)); + CFStringRef desc = CFErrorCopyDescription((error)); + CFStringGetCString(domain, buf_domain, MAX_ERROR_DESCRIPTION, + kCFStringEncodingUTF8); + CFStringGetCString(desc, buf_desc, MAX_ERROR_DESCRIPTION, + kCFStringEncodingUTF8); + gpr_asprintf(&error_msg, "%s (error domain:%s, code:%ld, description:%s)", + custom_desc, buf_domain, code, buf_desc); + CFRelease(desc); + grpc_error* return_error = grpc_error_create( + file, line, grpc_slice_from_copied_string(error_msg), NULL, 0); + gpr_free(error_msg); + return return_error; +} +#endif /* GRPC_CFSTREAM */ diff --git a/src/core/lib/iomgr/error_cfstream.h b/src/core/lib/iomgr/error_cfstream.h new file mode 100644 index 0000000000..06ab751329 --- /dev/null +++ b/src/core/lib/iomgr/error_cfstream.h @@ -0,0 +1,31 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H +#define GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H + +#ifdef GRPC_CFSTREAM +// Create an error from Apple Core Foundation CFError object +#define GRPC_ERROR_CREATE_FROM_CFERROR(error, desc) \ + grpc_error_create_from_cferror(__FILE__, __LINE__, \ + static_cast((error)), (desc)) +grpc_error* grpc_error_create_from_cferror(const char* file, int line, + void* arg, const char* desc); +#endif /* GRPC_CFSTREAM */ + +#endif /* GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H */ diff --git a/src/core/lib/iomgr/tcp_client_cfstream.cc b/src/core/lib/iomgr/tcp_client_cfstream.cc index b1a40f7a30..ffed3bbef6 100644 --- a/src/core/lib/iomgr/tcp_client_cfstream.cc +++ b/src/core/lib/iomgr/tcp_client_cfstream.cc @@ -39,7 +39,7 @@ #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint_cfstream.h" #include "src/core/lib/iomgr/error.h" -#include "src/core/lib/iomgr/error_apple.h" +#include "src/core/lib/iomgr/error_cfstream.h" #include "src/core/lib/iomgr/sockaddr_utils.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/iomgr/timer.h" diff --git a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj index 6ac7600a76..8ff4633582 100644 --- a/src/objective-c/tests/Tests.xcodeproj/project.pbxproj +++ b/src/objective-c/tests/Tests.xcodeproj/project.pbxproj @@ -961,7 +961,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalSSLCFStream/Pods-InteropTestsLocalSSLCFStream-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/gRPC.default-CFStream/gRPCCertificates.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -1087,7 +1087,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsRemoteCFStream/Pods-InteropTestsRemoteCFStream-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/gRPC.default-CFStream/gRPCCertificates.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -1105,7 +1105,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-InteropTestsLocalCleartextCFStream/Pods-InteropTestsLocalCleartextCFStream-resources.sh", - "${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/gRPC.default-CFStream/gRPCCertificates.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( diff --git a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme index 554078d66d..33a5ded038 100644 --- a/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme +++ b/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteCFStream.xcscheme @@ -10,7 +10,6 @@ buildConfiguration = "Test" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -181,6 +189,8 @@ ss.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1' } + ss.source_files = ${ruby_multiline_list(cfstream_private_files(filegroups), 22)} + ss.private_header_files = ${ruby_multiline_list(cfstream_private_headers(filegroups), 30)} end s.subspec 'Cronet-Interface' do |ss| diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index cb1c75b988..ea2f377c91 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1061,14 +1061,11 @@ src/core/lib/http/httpcli.h \ src/core/lib/http/parser.h \ src/core/lib/iomgr/block_annotate.h \ src/core/lib/iomgr/call_combiner.h \ -src/core/lib/iomgr/cfstream_handle.h \ src/core/lib/iomgr/closure.h \ src/core/lib/iomgr/combiner.h \ src/core/lib/iomgr/endpoint.h \ -src/core/lib/iomgr/endpoint_cfstream.h \ src/core/lib/iomgr/endpoint_pair.h \ src/core/lib/iomgr/error.h \ -src/core/lib/iomgr/error_apple.h \ src/core/lib/iomgr/error_internal.h \ src/core/lib/iomgr/ev_epoll1_linux.h \ src/core/lib/iomgr/ev_epollex_linux.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index be32966025..589e862b9a 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -1147,23 +1147,17 @@ src/core/lib/iomgr/README.md \ src/core/lib/iomgr/block_annotate.h \ src/core/lib/iomgr/call_combiner.cc \ src/core/lib/iomgr/call_combiner.h \ -src/core/lib/iomgr/cfstream_handle.cc \ -src/core/lib/iomgr/cfstream_handle.h \ src/core/lib/iomgr/closure.h \ src/core/lib/iomgr/combiner.cc \ src/core/lib/iomgr/combiner.h \ src/core/lib/iomgr/endpoint.cc \ src/core/lib/iomgr/endpoint.h \ -src/core/lib/iomgr/endpoint_cfstream.cc \ -src/core/lib/iomgr/endpoint_cfstream.h \ src/core/lib/iomgr/endpoint_pair.h \ src/core/lib/iomgr/endpoint_pair_posix.cc \ src/core/lib/iomgr/endpoint_pair_uv.cc \ src/core/lib/iomgr/endpoint_pair_windows.cc \ src/core/lib/iomgr/error.cc \ src/core/lib/iomgr/error.h \ -src/core/lib/iomgr/error_apple.cc \ -src/core/lib/iomgr/error_apple.h \ src/core/lib/iomgr/error_internal.h \ src/core/lib/iomgr/ev_epoll1_linux.cc \ src/core/lib/iomgr/ev_epoll1_linux.h \ @@ -1253,7 +1247,6 @@ src/core/lib/iomgr/socket_windows.h \ src/core/lib/iomgr/sys_epoll_wrapper.h \ src/core/lib/iomgr/tcp_client.cc \ src/core/lib/iomgr/tcp_client.h \ -src/core/lib/iomgr/tcp_client_cfstream.cc \ src/core/lib/iomgr/tcp_client_custom.cc \ src/core/lib/iomgr/tcp_client_posix.cc \ src/core/lib/iomgr/tcp_client_posix.h \ diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index adb36bb182..0d6508c772 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -9280,15 +9280,12 @@ "src/core/lib/http/httpcli.cc", "src/core/lib/http/parser.cc", "src/core/lib/iomgr/call_combiner.cc", - "src/core/lib/iomgr/cfstream_handle.cc", "src/core/lib/iomgr/combiner.cc", "src/core/lib/iomgr/endpoint.cc", - "src/core/lib/iomgr/endpoint_cfstream.cc", "src/core/lib/iomgr/endpoint_pair_posix.cc", "src/core/lib/iomgr/endpoint_pair_uv.cc", "src/core/lib/iomgr/endpoint_pair_windows.cc", "src/core/lib/iomgr/error.cc", - "src/core/lib/iomgr/error_apple.cc", "src/core/lib/iomgr/ev_epoll1_linux.cc", "src/core/lib/iomgr/ev_epollex_linux.cc", "src/core/lib/iomgr/ev_epollsig_linux.cc", @@ -9336,7 +9333,6 @@ "src/core/lib/iomgr/socket_utils_windows.cc", "src/core/lib/iomgr/socket_windows.cc", "src/core/lib/iomgr/tcp_client.cc", - "src/core/lib/iomgr/tcp_client_cfstream.cc", "src/core/lib/iomgr/tcp_client_custom.cc", "src/core/lib/iomgr/tcp_client_posix.cc", "src/core/lib/iomgr/tcp_client_windows.cc", @@ -9462,14 +9458,11 @@ "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", - "src/core/lib/iomgr/cfstream_handle.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", "src/core/lib/iomgr/endpoint.h", - "src/core/lib/iomgr/endpoint_cfstream.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", - "src/core/lib/iomgr/error_apple.h", "src/core/lib/iomgr/error_internal.h", "src/core/lib/iomgr/ev_epoll1_linux.h", "src/core/lib/iomgr/ev_epollex_linux.h", @@ -9614,14 +9607,11 @@ "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/call_combiner.h", - "src/core/lib/iomgr/cfstream_handle.h", "src/core/lib/iomgr/closure.h", "src/core/lib/iomgr/combiner.h", "src/core/lib/iomgr/endpoint.h", - "src/core/lib/iomgr/endpoint_cfstream.h", "src/core/lib/iomgr/endpoint_pair.h", "src/core/lib/iomgr/error.h", - "src/core/lib/iomgr/error_apple.h", "src/core/lib/iomgr/error_internal.h", "src/core/lib/iomgr/ev_epoll1_linux.h", "src/core/lib/iomgr/ev_epollex_linux.h", @@ -9722,6 +9712,32 @@ "third_party": false, "type": "filegroup" }, + { + "deps": [ + "gpr", + "gpr_base_headers", + "grpc_base_headers" + ], + "headers": [ + "src/core/lib/iomgr/cfstream_handle.h", + "src/core/lib/iomgr/endpoint_cfstream.h", + "src/core/lib/iomgr/error_cfstream.h" + ], + "is_filegroup": true, + "language": "c", + "name": "grpc_cfstream", + "src": [ + "src/core/lib/iomgr/cfstream_handle.cc", + "src/core/lib/iomgr/cfstream_handle.h", + "src/core/lib/iomgr/endpoint_cfstream.cc", + "src/core/lib/iomgr/endpoint_cfstream.h", + "src/core/lib/iomgr/error_cfstream.cc", + "src/core/lib/iomgr/error_cfstream.h", + "src/core/lib/iomgr/tcp_client_cfstream.cc" + ], + "third_party": false, + "type": "filegroup" + }, { "deps": [ "gpr", diff --git a/tools/run_tests/sanity/core_banned_functions.py b/tools/run_tests/sanity/core_banned_functions.py index ae79340975..8afd826453 100755 --- a/tools/run_tests/sanity/core_banned_functions.py +++ b/tools/run_tests/sanity/core_banned_functions.py @@ -31,7 +31,7 @@ BANNED_EXCEPT = { 'grpc_slice_ref(': ['src/core/lib/slice/slice.cc'], 'grpc_slice_unref(': ['src/core/lib/slice/slice.cc'], 'grpc_error_create(': - ['src/core/lib/iomgr/error.cc', 'src/core/lib/iomgr/error_apple.cc'], + ['src/core/lib/iomgr/error.cc', 'src/core/lib/iomgr/error_cfstream.cc'], 'grpc_error_ref(': ['src/core/lib/iomgr/error.cc'], 'grpc_error_unref(': ['src/core/lib/iomgr/error.cc'], 'grpc_os_error(': ['src/core/lib/iomgr/error.cc'], -- cgit v1.2.3