aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-07-06 14:05:54 -0700
committerGravatar yang-g <yangg@google.com>2015-07-06 14:05:54 -0700
commit5ea46ab2482c3724fbc7fd0aab55f324fb65999c (patch)
tree55eebc4aae8f06f931c8f75ddf84d56595f99fa1
parent3abe60b9d08ff5a784a39f7c4a10c631547c3526 (diff)
parentd426864934ac60f46e538ba81932e405fa8949b1 (diff)
merge with upstream and resolve conflicts
-rw-r--r--.travis.yml2
-rw-r--r--BUILD458
-rw-r--r--Makefile650
-rw-r--r--build.json178
-rw-r--r--gRPC.podspec527
-rw-r--r--include/grpc++/async_unary_call.h56
-rw-r--r--include/grpc++/byte_buffer.h29
-rw-r--r--include/grpc++/client_context.h10
-rw-r--r--include/grpc++/completion_queue.h30
-rw-r--r--include/grpc++/config.h43
-rw-r--r--include/grpc++/config_protobuf.h72
-rw-r--r--include/grpc++/impl/call.h428
-rw-r--r--include/grpc++/impl/client_unary_call.h26
-rw-r--r--include/grpc++/impl/proto_utils.h (renamed from src/core/iomgr/pollset_kick.h)68
-rw-r--r--include/grpc++/impl/rpc_service_method.h111
-rw-r--r--include/grpc++/impl/serialization_traits.h68
-rw-r--r--include/grpc++/impl/service_type.h41
-rw-r--r--include/grpc++/server.h126
-rw-r--r--include/grpc++/server_context.h16
-rw-r--r--include/grpc++/stream.h466
-rw-r--r--include/grpc/byte_buffer.h7
-rw-r--r--include/grpc/byte_buffer_reader.h2
-rw-r--r--include/grpc/compression.h2
-rw-r--r--include/grpc/grpc.h67
-rw-r--r--include/grpc/grpc_security.h5
-rw-r--r--include/grpc/support/port_platform.h26
-rw-r--r--include/grpc/support/slice.h6
-rw-r--r--include/grpc/support/slice_buffer.h2
-rw-r--r--include/grpc/support/tls_pthread.h5
-rw-r--r--src/compiler/config.h7
-rw-r--r--src/compiler/cpp_generator.cc194
-rw-r--r--src/compiler/objective_c_generator.cc23
-rw-r--r--src/compiler/objective_c_plugin.cc12
-rw-r--r--src/compiler/python_generator.cc2
-rw-r--r--src/core/census/context.c2
-rw-r--r--src/core/channel/channel_stack.c6
-rw-r--r--src/core/channel/child_channel.c7
-rw-r--r--src/core/channel/client_channel.c51
-rw-r--r--src/core/channel/client_setup.c95
-rw-r--r--src/core/channel/client_setup.h12
-rw-r--r--src/core/channel/http_client_filter.c17
-rw-r--r--src/core/channel/http_server_filter.c15
-rw-r--r--src/core/compression/message_compress.h2
-rw-r--r--src/core/httpcli/httpcli.c38
-rw-r--r--src/core/httpcli/httpcli.h38
-rw-r--r--src/core/iomgr/fd_posix.c97
-rw-r--r--src/core/iomgr/fd_posix.h22
-rw-r--r--src/core/iomgr/iomgr.c40
-rw-r--r--src/core/iomgr/iomgr.h4
-rw-r--r--src/core/iomgr/pollset.h11
-rw-r--r--src/core/iomgr/pollset_kick_posix.c (renamed from src/core/iomgr/pollset_kick.c)41
-rw-r--r--src/core/iomgr/pollset_kick_posix.h46
-rw-r--r--src/core/iomgr/pollset_multipoller_with_epoll.c52
-rw-r--r--src/core/iomgr/pollset_multipoller_with_poll_posix.c67
-rw-r--r--src/core/iomgr/pollset_posix.c290
-rw-r--r--src/core/iomgr/pollset_posix.h23
-rw-r--r--src/core/iomgr/pollset_set.h59
-rw-r--r--src/core/iomgr/pollset_set_posix.c125
-rw-r--r--src/core/iomgr/pollset_set_posix.h55
-rw-r--r--src/core/iomgr/pollset_set_windows.c (renamed from src/core/iomgr/pollset_kick_windows.h)22
-rw-r--r--src/core/iomgr/pollset_set_windows.h (renamed from src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m)15
-rw-r--r--src/core/iomgr/pollset_windows.c21
-rw-r--r--src/core/iomgr/pollset_windows.h8
-rw-r--r--src/core/iomgr/resolve_address_posix.c2
-rw-r--r--src/core/iomgr/tcp_client.h12
-rw-r--r--src/core/iomgr/tcp_client_posix.c26
-rw-r--r--src/core/iomgr/tcp_client_windows.c25
-rw-r--r--src/core/iomgr/tcp_posix.c7
-rw-r--r--src/core/iomgr/tcp_server_posix.c89
-rw-r--r--src/core/iomgr/tcp_windows.c2
-rw-r--r--src/core/json/json.h2
-rw-r--r--src/core/json/json_reader.c12
-rw-r--r--src/core/json/json_string.c22
-rw-r--r--src/core/json/json_writer.c14
-rw-r--r--src/core/security/base64.c103
-rw-r--r--src/core/security/base64.h4
-rw-r--r--src/core/security/client_auth_filter.c30
-rw-r--r--src/core/security/credentials.c64
-rw-r--r--src/core/security/credentials.h11
-rw-r--r--src/core/security/google_default_credentials.c33
-rw-r--r--src/core/security/secure_endpoint.c14
-rw-r--r--src/core/security/secure_transport_setup.c2
-rw-r--r--src/core/security/security_connector.c54
-rw-r--r--src/core/security/security_connector.h3
-rw-r--r--src/core/security/security_context.c31
-rw-r--r--src/core/security/security_context.h19
-rw-r--r--src/core/security/server_auth_filter.c8
-rw-r--r--src/core/security/server_secure_chttp2.c16
-rw-r--r--src/core/support/cmdline.c6
-rw-r--r--src/core/support/cpu_linux.c8
-rw-r--r--src/core/support/file.c3
-rw-r--r--src/core/support/histogram.c10
-rw-r--r--src/core/support/host_port.c4
-rw-r--r--src/core/support/log_win32.c17
-rw-r--r--src/core/support/murmur_hash.c14
-rw-r--r--src/core/support/slice.c28
-rw-r--r--src/core/support/slice_buffer.c24
-rw-r--r--src/core/support/string.c6
-rw-r--r--src/core/support/subprocess_posix.c4
-rw-r--r--src/core/support/time.c16
-rw-r--r--src/core/support/time_posix.c2
-rw-r--r--src/core/surface/byte_buffer.c14
-rw-r--r--src/core/surface/byte_buffer_reader.c8
-rw-r--r--src/core/surface/call.c247
-rw-r--r--src/core/surface/call.h25
-rw-r--r--src/core/surface/channel.c29
-rw-r--r--src/core/surface/channel.h14
-rw-r--r--src/core/surface/channel_create.c16
-rw-r--r--src/core/surface/completion_queue.c65
-rw-r--r--src/core/surface/completion_queue.h19
-rw-r--r--src/core/surface/lame_client.c13
-rw-r--r--src/core/surface/secure_channel_create.c18
-rw-r--r--src/core/surface/server.c286
-rw-r--r--src/core/transport/chttp2/alpn.h2
-rw-r--r--src/core/transport/chttp2/bin_encoder.c76
-rw-r--r--src/core/transport/chttp2/bin_encoder.h2
-rw-r--r--src/core/transport/chttp2/frame.h22
-rw-r--r--src/core/transport/chttp2/frame_data.c27
-rw-r--r--src/core/transport/chttp2/frame_data.h5
-rw-r--r--src/core/transport/chttp2/frame_goaway.c30
-rw-r--r--src/core/transport/chttp2/frame_goaway.h5
-rw-r--r--src/core/transport/chttp2/frame_ping.c20
-rw-r--r--src/core/transport/chttp2/frame_ping.h5
-rw-r--r--src/core/transport/chttp2/frame_rst_stream.c21
-rw-r--r--src/core/transport/chttp2/frame_rst_stream.h5
-rw-r--r--src/core/transport/chttp2/frame_settings.c15
-rw-r--r--src/core/transport/chttp2/frame_settings.h5
-rw-r--r--src/core/transport/chttp2/frame_window_update.c23
-rw-r--r--src/core/transport/chttp2/frame_window_update.h5
-rw-r--r--src/core/transport/chttp2/hpack_parser.c52
-rw-r--r--src/core/transport/chttp2/hpack_parser.h6
-rw-r--r--src/core/transport/chttp2/hpack_table.c125
-rw-r--r--src/core/transport/chttp2/hpack_table.h2
-rw-r--r--src/core/transport/chttp2/http2_errors.h2
-rw-r--r--src/core/transport/chttp2/huffsyms.c323
-rw-r--r--src/core/transport/chttp2/huffsyms.h2
-rw-r--r--src/core/transport/chttp2/incoming_metadata.c181
-rw-r--r--src/core/transport/chttp2/incoming_metadata.h80
-rw-r--r--src/core/transport/chttp2/internal.h609
-rw-r--r--src/core/transport/chttp2/parsing.c810
-rw-r--r--src/core/transport/chttp2/status_conversion.h2
-rw-r--r--src/core/transport/chttp2/stream_encoder.h2
-rw-r--r--src/core/transport/chttp2/stream_lists.c352
-rw-r--r--src/core/transport/chttp2/stream_map.c44
-rw-r--r--src/core/transport/chttp2/stream_map.h6
-rw-r--r--src/core/transport/chttp2/timeout_encoding.h2
-rw-r--r--src/core/transport/chttp2/varint.h25
-rw-r--r--src/core/transport/chttp2/writing.c215
-rw-r--r--src/core/transport/chttp2_transport.c2401
-rw-r--r--src/core/transport/chttp2_transport.h2
-rw-r--r--src/core/transport/metadata.c2
-rw-r--r--src/core/transport/stream_op.c72
-rw-r--r--src/core/transport/stream_op.h49
-rw-r--r--src/core/transport/transport.c26
-rw-r--r--src/core/transport/transport.h27
-rw-r--r--src/core/transport/transport_impl.h3
-rw-r--r--src/core/transport/transport_op_string.c5
-rw-r--r--src/core/tsi/ssl_transport_security.c130
-rw-r--r--src/cpp/client/channel.cc12
-rw-r--r--src/cpp/client/channel.h10
-rw-r--r--src/cpp/client/channel_arguments.cc14
-rw-r--r--src/cpp/client/secure_channel_arguments.cc54
-rw-r--r--src/cpp/common/call.cc307
-rw-r--r--src/cpp/proto/proto_utils.cc30
-rw-r--r--src/cpp/server/insecure_server_credentials.cc3
-rw-r--r--src/cpp/server/server.cc256
-rw-r--r--src/cpp/server/server_context.cc22
-rw-r--r--src/cpp/server/server_credentials.cc2
-rw-r--r--src/cpp/util/byte_buffer.cc8
-rw-r--r--src/csharp/Grpc.Core.Tests/ClientServerTest.cs32
-rw-r--r--src/csharp/Grpc.Core/Internal/AsyncCallServer.cs1
-rw-r--r--src/csharp/Grpc.Core/Internal/ServerCallHandler.cs2
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.h6
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m12
-rw-r--r--src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m2
-rw-r--r--src/objective-c/GRPCClient/private/GRPCSecureChannel.m8
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.h34
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.m200
-rw-r--r--src/objective-c/GRPCClient/private/NSError+GRPC.m2
-rw-r--r--src/objective-c/ProtoRPC/ProtoMethod.h (renamed from src/objective-c/GRPCClient/GRPCMethodName.h)17
-rw-r--r--src/objective-c/ProtoRPC/ProtoMethod.m (renamed from src/objective-c/GRPCClient/GRPCMethodName.m)16
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.h6
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.m27
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.m12
-rw-r--r--src/objective-c/RxLibrary/transformations/GRXMappingWriter.h2
-rw-r--r--src/objective-c/examples/Sample/Sample/ViewController.m8
-rw-r--r--src/objective-c/tests/GRPCClientTests.m40
-rw-r--r--src/objective-c/tests/InteropTests.m14
-rw-r--r--src/objective-c/tests/LocalClearTextTests.m24
-rw-r--r--src/objective-c/tests/RxLibraryUnitTests.m6
-rw-r--r--src/php/README.md33
-rwxr-xr-xsrc/php/bin/determine_extension_dir.sh49
-rwxr-xr-xsrc/php/bin/interop_client.sh11
-rwxr-xr-xsrc/php/bin/run_gen_code_test.sh11
-rwxr-xr-xsrc/php/bin/run_tests.sh19
-rw-r--r--src/php/ext/grpc/CREDITS3
-rw-r--r--src/php/ext/grpc/LICENSE (renamed from src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h)8
-rw-r--r--src/php/ext/grpc/README.md72
-rwxr-xr-xsrc/php/ext/grpc/config.m49
-rw-r--r--src/php/ext/grpc/package.xml82
-rw-r--r--src/python/src/grpc/_adapter/_c/types.h6
-rw-r--r--src/python/src/grpc/_adapter/_c/types/server.c1
-rw-r--r--src/python/src/grpc/_adapter/_c/utility.c53
-rw-r--r--src/python/src/grpc/_adapter/_intermediary_low.py3
-rw-r--r--src/python/src/grpc/_adapter/_intermediary_low_test.py98
-rw-r--r--src/python/src/grpc/_adapter/_low_test.py34
-rw-r--r--src/ruby/.rubocop_todo.yml2
-rwxr-xr-xsrc/ruby/bin/interop/interop_client.rb3
-rw-r--r--src/ruby/ext/grpc/extconf.rb2
-rw-r--r--src/ruby/lib/grpc/generic/active_call.rb21
-rw-r--r--src/ruby/lib/grpc/generic/bidi_call.rb14
-rw-r--r--src/ruby/lib/grpc/logconfig.rb2
-rw-r--r--src/ruby/lib/grpc/version.rb2
-rw-r--r--src/ruby/spec/client_server_spec.rb60
-rw-r--r--templates/BUILD.template113
-rw-r--r--templates/Makefile.template239
-rw-r--r--templates/gRPC.podspec.template166
-rw-r--r--templates/tools/doxygen/Doxyfile.include2
-rw-r--r--templates/tools/run_tests/sources_and_headers.json.template33
-rw-r--r--test/core/bad_client/bad_client.c3
-rwxr-xr-xtest/core/bad_client/gen_build_json.py9
-rw-r--r--test/core/end2end/cq_verifier.c3
-rw-r--r--test/core/end2end/dualstack_socket_test.c59
-rw-r--r--test/core/end2end/end2end_tests.h5
-rw-r--r--test/core/end2end/fixtures/chttp2_fake_security.c8
-rw-r--r--test/core/end2end/fixtures/chttp2_fullstack.c5
-rw-r--r--test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c5
-rw-r--r--test/core/end2end/fixtures/chttp2_fullstack_with_poll.c7
-rw-r--r--test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c8
-rw-r--r--test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c5
-rw-r--r--test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c8
-rw-r--r--test/core/end2end/fixtures/chttp2_socket_pair.c5
-rw-r--r--test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c5
-rw-r--r--test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c5
-rwxr-xr-xtest/core/end2end/gen_build_json.py38
-rw-r--r--test/core/end2end/multiple_server_queues_test.c62
-rw-r--r--test/core/end2end/tests/bad_hostname.c27
-rw-r--r--test/core/end2end/tests/cancel_after_accept.c47
-rw-r--r--test/core/end2end/tests/cancel_after_accept_and_writes_closed.c47
-rw-r--r--test/core/end2end/tests/cancel_after_invoke.c27
-rw-r--r--test/core/end2end/tests/cancel_before_invoke.c30
-rw-r--r--test/core/end2end/tests/cancel_in_a_vacuum.c24
-rw-r--r--test/core/end2end/tests/census_simple_request.c44
-rw-r--r--test/core/end2end/tests/disappearing_server.c50
-rw-r--r--test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c45
-rw-r--r--test/core/end2end/tests/early_server_shutdown_finishes_tags.c31
-rw-r--r--test/core/end2end/tests/empty_batch.c27
-rw-r--r--test/core/end2end/tests/graceful_server_shutdown.c49
-rw-r--r--test/core/end2end/tests/invoke_large_request.c67
-rw-r--r--test/core/end2end/tests/max_concurrent_streams.c131
-rw-r--r--test/core/end2end/tests/max_message_length.c45
-rw-r--r--test/core/end2end/tests/no_op.c15
-rw-r--r--test/core/end2end/tests/ping_pong_streaming.c61
-rw-r--r--test/core/end2end/tests/registered_call.c50
-rw-r--r--test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c51
-rw-r--r--test/core/end2end/tests/request_response_with_metadata_and_payload.c51
-rw-r--r--test/core/end2end/tests/request_response_with_payload.c54
-rw-r--r--test/core/end2end/tests/request_response_with_payload_and_call_creds.c74
-rw-r--r--test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c61
-rw-r--r--test/core/end2end/tests/request_with_flags.c34
-rw-r--r--test/core/end2end/tests/request_with_large_metadata.c51
-rw-r--r--test/core/end2end/tests/request_with_payload.c51
-rw-r--r--test/core/end2end/tests/server_finishes_request.c44
-rw-r--r--test/core/end2end/tests/simple_delayed_request.c47
-rw-r--r--test/core/end2end/tests/simple_request.c52
-rw-r--r--test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c47
-rw-r--r--test/core/fling/server.c4
-rw-r--r--test/core/httpcli/httpcli_test.c56
-rw-r--r--test/core/iomgr/endpoint_tests.c90
-rw-r--r--test/core/iomgr/endpoint_tests.h5
-rw-r--r--test/core/iomgr/fd_conservation_posix_test.c (renamed from src/cpp/proto/proto_utils.h)52
-rw-r--r--test/core/iomgr/fd_posix_test.c103
-rw-r--r--test/core/iomgr/poll_kick_posix_test.c44
-rw-r--r--test/core/iomgr/tcp_client_posix_test.c96
-rw-r--r--test/core/iomgr/tcp_posix_test.c88
-rw-r--r--test/core/iomgr/tcp_server_posix_test.c49
-rw-r--r--test/core/json/json_rewrite_test.c5
-rw-r--r--test/core/security/auth_context_test.c8
-rw-r--r--test/core/security/base64_test.c38
-rw-r--r--test/core/security/credentials_test.c107
-rw-r--r--test/core/security/fetch_oauth2.c23
-rw-r--r--test/core/security/print_google_default_creds_token.c23
-rw-r--r--test/core/security/secure_endpoint_test.c10
-rw-r--r--test/core/security/security_connector_test.c256
-rw-r--r--test/core/surface/byte_buffer_reader_test.c31
-rw-r--r--test/core/surface/completion_queue_test.c28
-rw-r--r--test/cpp/end2end/async_end2end_test.cc230
-rw-r--r--test/cpp/end2end/client_crash_test.cc29
-rw-r--r--test/cpp/end2end/end2end_test.cc39
-rw-r--r--test/cpp/end2end/generic_end2end_test.cc2
-rw-r--r--test/cpp/qps/client_async.cc28
-rw-r--r--test/cpp/qps/perf_db.proto71
-rw-r--r--test/cpp/qps/perf_db_client.cc143
-rw-r--r--test/cpp/qps/perf_db_client.h115
-rw-r--r--test/cpp/qps/qps_test_openloop.cc2
-rw-r--r--test/cpp/qps/qps_test_with_poll.cc90
-rw-r--r--test/cpp/qps/qps_worker.cc2
-rw-r--r--test/cpp/qps/report.cc90
-rw-r--r--test/cpp/qps/report.h54
-rw-r--r--test/cpp/qps/server_async.cc35
-rw-r--r--test/cpp/qps/worker.cc2
-rw-r--r--test/cpp/util/benchmark_config.cc18
-rw-r--r--test/cpp/util/byte_buffer_test.cc115
-rw-r--r--test/cpp/util/grpc_cli.cc2
-rw-r--r--test/cpp/util/slice_test.cc (renamed from src/cpp/client/client_unary_call.cc)63
-rw-r--r--test/proto/messages.proto27
-rw-r--r--test/proto/test.proto8
-rw-r--r--tools/codegen/core/gen_hpack_tables.c (renamed from src/core/transport/chttp2/gen_hpack_tables.c)33
-rw-r--r--tools/doxygen/Doxyfile.c++39
-rw-r--r--tools/doxygen/Doxyfile.c++.internal74
-rw-r--r--tools/doxygen/Doxyfile.core36
-rw-r--r--tools/doxygen/Doxyfile.core.internal303
-rwxr-xr-xtools/jenkins/docker_run_jenkins.sh45
-rw-r--r--tools/jenkins/grpc_jenkins_slave/Dockerfile11
-rwxr-xr-xtools/jenkins/run_jenkins.sh35
-rwxr-xr-xtools/run_tests/check_sources_and_headers.py55
-rwxr-xr-xtools/run_tests/jobset.py31
-rwxr-xr-xtools/run_tests/run_tests.py58
-rw-r--r--tools/run_tests/sources_and_headers.json10648
-rw-r--r--tools/run_tests/tests.json84
-rw-r--r--vsprojects/Grpc.mak20
-rw-r--r--vsprojects/grpc++/grpc++.vcxproj8
-rw-r--r--vsprojects/grpc++/grpc++.vcxproj.filters18
-rw-r--r--vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj6
-rw-r--r--vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters15
-rw-r--r--vsprojects/grpc/grpc.vcxproj23
-rw-r--r--vsprojects/grpc/grpc.vcxproj.filters43
-rw-r--r--vsprojects/grpc_plugin_support/grpc_plugin_support.vcxproj2
-rw-r--r--vsprojects/grpc_test_util/grpc_test_util.vcxproj9
-rw-r--r--vsprojects/grpc_unsecure/grpc_unsecure.vcxproj23
-rw-r--r--vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters43
331 files changed, 23660 insertions, 6669 deletions
diff --git a/.travis.yml b/.travis.yml
index c626242557..97cf99d71e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,7 +34,7 @@ script:
- if [ ! -z "$USE_GCC" ] ; then export CC=gcc-$USE_GCC ; export CXX=g++-$USE_GCC ; fi
- ./tools/run_tests/run_tests.py -l $TEST -t -j $JOBS -c $CONFIG -s 4.0
after_success:
- - if [ "$CONFIG" = "gcov" ] ; then coveralls --exclude third_party --exclude gens --exclude test --exclude src/compiler -b. --gcov-options '\-p' ; fi
+ - if [ "$CONFIG" = "gcov" ] ; then coveralls --exclude third_party --exclude gens --exclude test --exclude tools --exclude src/compiler -b. --gcov-options '\-p' ; fi
notifications:
email: false
webhooks:
diff --git a/BUILD b/BUILD
index 48879036bc..8502935d50 100644
--- a/BUILD
+++ b/BUILD
@@ -2,6 +2,8 @@
# This currently builds C and C++ code.
# This file has been automatically generated from a template file.
# Please look at the templates directory instead.
+# This file can be regenerated from the template by running
+# tools/buildgen/generate_projects.sh
# Copyright 2015, Google Inc.
# All rights reserved.
@@ -145,12 +147,14 @@ cc_library(
"src/core/tsi/transport_security.h",
"src/core/tsi/transport_security_interface.h",
"src/core/census/grpc_context.h",
+ "src/core/channel/census_filter.h",
"src/core/channel/channel_args.h",
"src/core/channel/channel_stack.h",
"src/core/channel/child_channel.h",
"src/core/channel/client_channel.h",
"src/core/channel/client_setup.h",
"src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
@@ -167,10 +171,11 @@ cc_library(
"src/core/iomgr/iomgr_internal.h",
"src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h",
- "src/core/iomgr/pollset_kick.h",
"src/core/iomgr/pollset_kick_posix.h",
- "src/core/iomgr/pollset_kick_windows.h",
"src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h",
"src/core/iomgr/sockaddr.h",
@@ -214,6 +219,8 @@ cc_library(
"src/core/transport/chttp2/hpack_table.h",
"src/core/transport/chttp2/http2_errors.h",
"src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
"src/core/transport/chttp2/status_conversion.h",
"src/core/transport/chttp2/stream_encoder.h",
"src/core/transport/chttp2/stream_map.h",
@@ -271,10 +278,12 @@ cc_library(
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
"src/core/iomgr/iomgr_windows.c",
- "src/core/iomgr/pollset_kick.c",
+ "src/core/iomgr/pollset_kick_posix.c",
"src/core/iomgr/pollset_multipoller_with_epoll.c",
"src/core/iomgr/pollset_multipoller_with_poll_posix.c",
"src/core/iomgr/pollset_posix.c",
+ "src/core/iomgr/pollset_set_posix.c",
+ "src/core/iomgr/pollset_set_windows.c",
"src/core/iomgr/pollset_windows.c",
"src/core/iomgr/resolve_address_posix.c",
"src/core/iomgr/resolve_address_windows.c",
@@ -329,11 +338,15 @@ cc_library(
"src/core/transport/chttp2/hpack_parser.c",
"src/core/transport/chttp2/hpack_table.c",
"src/core/transport/chttp2/huffsyms.c",
+ "src/core/transport/chttp2/incoming_metadata.c",
+ "src/core/transport/chttp2/parsing.c",
"src/core/transport/chttp2/status_conversion.c",
"src/core/transport/chttp2/stream_encoder.c",
+ "src/core/transport/chttp2/stream_lists.c",
"src/core/transport/chttp2/stream_map.c",
"src/core/transport/chttp2/timeout_encoding.c",
"src/core/transport/chttp2/varint.c",
+ "src/core/transport/chttp2/writing.c",
"src/core/transport/chttp2_transport.c",
"src/core/transport/metadata.c",
"src/core/transport/stream_op.c",
@@ -366,12 +379,14 @@ cc_library(
name = "grpc_unsecure",
srcs = [
"src/core/census/grpc_context.h",
+ "src/core/channel/census_filter.h",
"src/core/channel/channel_args.h",
"src/core/channel/channel_stack.h",
"src/core/channel/child_channel.h",
"src/core/channel/client_channel.h",
"src/core/channel/client_setup.h",
"src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
@@ -388,10 +403,11 @@ cc_library(
"src/core/iomgr/iomgr_internal.h",
"src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h",
- "src/core/iomgr/pollset_kick.h",
"src/core/iomgr/pollset_kick_posix.h",
- "src/core/iomgr/pollset_kick_windows.h",
"src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h",
"src/core/iomgr/sockaddr.h",
@@ -435,6 +451,8 @@ cc_library(
"src/core/transport/chttp2/hpack_table.h",
"src/core/transport/chttp2/http2_errors.h",
"src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
"src/core/transport/chttp2/status_conversion.h",
"src/core/transport/chttp2/stream_encoder.h",
"src/core/transport/chttp2/stream_map.h",
@@ -470,10 +488,12 @@ cc_library(
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
"src/core/iomgr/iomgr_windows.c",
- "src/core/iomgr/pollset_kick.c",
+ "src/core/iomgr/pollset_kick_posix.c",
"src/core/iomgr/pollset_multipoller_with_epoll.c",
"src/core/iomgr/pollset_multipoller_with_poll_posix.c",
"src/core/iomgr/pollset_posix.c",
+ "src/core/iomgr/pollset_set_posix.c",
+ "src/core/iomgr/pollset_set_windows.c",
"src/core/iomgr/pollset_windows.c",
"src/core/iomgr/resolve_address_posix.c",
"src/core/iomgr/resolve_address_windows.c",
@@ -528,11 +548,15 @@ cc_library(
"src/core/transport/chttp2/hpack_parser.c",
"src/core/transport/chttp2/hpack_table.c",
"src/core/transport/chttp2/huffsyms.c",
+ "src/core/transport/chttp2/incoming_metadata.c",
+ "src/core/transport/chttp2/parsing.c",
"src/core/transport/chttp2/status_conversion.c",
"src/core/transport/chttp2/stream_encoder.c",
+ "src/core/transport/chttp2/stream_lists.c",
"src/core/transport/chttp2/stream_map.c",
"src/core/transport/chttp2/timeout_encoding.c",
"src/core/transport/chttp2/varint.c",
+ "src/core/transport/chttp2/writing.c",
"src/core/transport/chttp2_transport.c",
"src/core/transport/metadata.c",
"src/core/transport/stream_op.c",
@@ -567,8 +591,8 @@ cc_library(
"src/cpp/server/secure_server_credentials.h",
"src/cpp/client/channel.h",
"src/cpp/common/create_auth_context.h",
- "src/cpp/proto/proto_utils.h",
"src/cpp/server/thread_pool.h",
+ "src/cpp/client/secure_channel_arguments.cc",
"src/cpp/client/secure_credentials.cc",
"src/cpp/common/secure_auth_context.cc",
"src/cpp/common/secure_create_auth_context.cc",
@@ -576,7 +600,6 @@ cc_library(
"src/cpp/client/channel.cc",
"src/cpp/client/channel_arguments.cc",
"src/cpp/client/client_context.cc",
- "src/cpp/client/client_unary_call.cc",
"src/cpp/client/create_channel.cc",
"src/cpp/client/credentials.cc",
"src/cpp/client/generic_stub.cc",
@@ -609,6 +632,7 @@ cc_library(
"include/grpc++/client_context.h",
"include/grpc++/completion_queue.h",
"include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
"include/grpc++/create_channel.h",
"include/grpc++/credentials.h",
"include/grpc++/generic_stub.h",
@@ -616,8 +640,10 @@ cc_library(
"include/grpc++/impl/client_unary_call.h",
"include/grpc++/impl/grpc_library.h",
"include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
"include/grpc++/impl/rpc_method.h",
"include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
"include/grpc++/impl/service_type.h",
"include/grpc++/impl/sync.h",
"include/grpc++/impl/sync_cxx11.h",
@@ -654,13 +680,11 @@ cc_library(
"src/cpp/common/insecure_auth_context.h",
"src/cpp/client/channel.h",
"src/cpp/common/create_auth_context.h",
- "src/cpp/proto/proto_utils.h",
"src/cpp/server/thread_pool.h",
"src/cpp/common/insecure_create_auth_context.cc",
"src/cpp/client/channel.cc",
"src/cpp/client/channel_arguments.cc",
"src/cpp/client/client_context.cc",
- "src/cpp/client/client_unary_call.cc",
"src/cpp/client/create_channel.cc",
"src/cpp/client/credentials.cc",
"src/cpp/client/generic_stub.cc",
@@ -693,6 +717,7 @@ cc_library(
"include/grpc++/client_context.h",
"include/grpc++/completion_queue.h",
"include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
"include/grpc++/create_channel.h",
"include/grpc++/credentials.h",
"include/grpc++/generic_stub.h",
@@ -700,8 +725,10 @@ cc_library(
"include/grpc++/impl/client_unary_call.h",
"include/grpc++/impl/grpc_library.h",
"include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
"include/grpc++/impl/rpc_method.h",
"include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
"include/grpc++/impl/service_type.h",
"include/grpc++/impl/sync.h",
"include/grpc++/impl/sync_cxx11.h",
@@ -735,6 +762,8 @@ cc_library(
cc_library(
name = "grpc_plugin_support",
srcs = [
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
"src/compiler/config.h",
"src/compiler/cpp_generator.h",
"src/compiler/cpp_generator_helpers.h",
@@ -785,6 +814,342 @@ cc_library(
+objc_library(
+ name = "gpr_objc",
+ srcs = [
+ "src/core/support/alloc.c",
+ "src/core/support/cancellable.c",
+ "src/core/support/cmdline.c",
+ "src/core/support/cpu_iphone.c",
+ "src/core/support/cpu_linux.c",
+ "src/core/support/cpu_posix.c",
+ "src/core/support/cpu_windows.c",
+ "src/core/support/env_linux.c",
+ "src/core/support/env_posix.c",
+ "src/core/support/env_win32.c",
+ "src/core/support/file.c",
+ "src/core/support/file_posix.c",
+ "src/core/support/file_win32.c",
+ "src/core/support/histogram.c",
+ "src/core/support/host_port.c",
+ "src/core/support/log.c",
+ "src/core/support/log_android.c",
+ "src/core/support/log_linux.c",
+ "src/core/support/log_posix.c",
+ "src/core/support/log_win32.c",
+ "src/core/support/murmur_hash.c",
+ "src/core/support/slice.c",
+ "src/core/support/slice_buffer.c",
+ "src/core/support/string.c",
+ "src/core/support/string_posix.c",
+ "src/core/support/string_win32.c",
+ "src/core/support/subprocess_posix.c",
+ "src/core/support/sync.c",
+ "src/core/support/sync_posix.c",
+ "src/core/support/sync_win32.c",
+ "src/core/support/thd.c",
+ "src/core/support/thd_posix.c",
+ "src/core/support/thd_win32.c",
+ "src/core/support/time.c",
+ "src/core/support/time_posix.c",
+ "src/core/support/time_win32.c",
+ "src/core/support/tls_pthread.c",
+ ],
+ hdrs = [
+ "include/grpc/support/alloc.h",
+ "include/grpc/support/atm.h",
+ "include/grpc/support/atm_gcc_atomic.h",
+ "include/grpc/support/atm_gcc_sync.h",
+ "include/grpc/support/atm_win32.h",
+ "include/grpc/support/cancellable_platform.h",
+ "include/grpc/support/cmdline.h",
+ "include/grpc/support/cpu.h",
+ "include/grpc/support/histogram.h",
+ "include/grpc/support/host_port.h",
+ "include/grpc/support/log.h",
+ "include/grpc/support/log_win32.h",
+ "include/grpc/support/port_platform.h",
+ "include/grpc/support/slice.h",
+ "include/grpc/support/slice_buffer.h",
+ "include/grpc/support/string_util.h",
+ "include/grpc/support/subprocess.h",
+ "include/grpc/support/sync.h",
+ "include/grpc/support/sync_generic.h",
+ "include/grpc/support/sync_posix.h",
+ "include/grpc/support/sync_win32.h",
+ "include/grpc/support/thd.h",
+ "include/grpc/support/time.h",
+ "include/grpc/support/tls.h",
+ "include/grpc/support/tls_gcc.h",
+ "include/grpc/support/tls_msvc.h",
+ "include/grpc/support/tls_pthread.h",
+ "include/grpc/support/useful.h",
+ "src/core/support/env.h",
+ "src/core/support/file.h",
+ "src/core/support/murmur_hash.h",
+ "src/core/support/string.h",
+ "src/core/support/string_win32.h",
+ "src/core/support/thd_internal.h",
+ ],
+ includes = [
+ "include",
+ ".",
+ ],
+ deps = [
+ ],
+)
+
+
+objc_library(
+ name = "grpc_objc",
+ srcs = [
+ "src/core/httpcli/format_request.c",
+ "src/core/httpcli/httpcli.c",
+ "src/core/httpcli/httpcli_security_connector.c",
+ "src/core/httpcli/parser.c",
+ "src/core/security/base64.c",
+ "src/core/security/client_auth_filter.c",
+ "src/core/security/credentials.c",
+ "src/core/security/credentials_metadata.c",
+ "src/core/security/credentials_posix.c",
+ "src/core/security/credentials_win32.c",
+ "src/core/security/google_default_credentials.c",
+ "src/core/security/json_token.c",
+ "src/core/security/secure_endpoint.c",
+ "src/core/security/secure_transport_setup.c",
+ "src/core/security/security_connector.c",
+ "src/core/security/security_context.c",
+ "src/core/security/server_auth_filter.c",
+ "src/core/security/server_secure_chttp2.c",
+ "src/core/surface/init_secure.c",
+ "src/core/surface/secure_channel_create.c",
+ "src/core/tsi/fake_transport_security.c",
+ "src/core/tsi/ssl_transport_security.c",
+ "src/core/tsi/transport_security.c",
+ "src/core/census/grpc_context.c",
+ "src/core/channel/channel_args.c",
+ "src/core/channel/channel_stack.c",
+ "src/core/channel/child_channel.c",
+ "src/core/channel/client_channel.c",
+ "src/core/channel/client_setup.c",
+ "src/core/channel/connected_channel.c",
+ "src/core/channel/http_client_filter.c",
+ "src/core/channel/http_server_filter.c",
+ "src/core/channel/noop_filter.c",
+ "src/core/compression/algorithm.c",
+ "src/core/compression/message_compress.c",
+ "src/core/debug/trace.c",
+ "src/core/iomgr/alarm.c",
+ "src/core/iomgr/alarm_heap.c",
+ "src/core/iomgr/endpoint.c",
+ "src/core/iomgr/endpoint_pair_posix.c",
+ "src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/fd_posix.c",
+ "src/core/iomgr/iocp_windows.c",
+ "src/core/iomgr/iomgr.c",
+ "src/core/iomgr/iomgr_posix.c",
+ "src/core/iomgr/iomgr_windows.c",
+ "src/core/iomgr/pollset_kick_posix.c",
+ "src/core/iomgr/pollset_multipoller_with_epoll.c",
+ "src/core/iomgr/pollset_multipoller_with_poll_posix.c",
+ "src/core/iomgr/pollset_posix.c",
+ "src/core/iomgr/pollset_set_posix.c",
+ "src/core/iomgr/pollset_set_windows.c",
+ "src/core/iomgr/pollset_windows.c",
+ "src/core/iomgr/resolve_address_posix.c",
+ "src/core/iomgr/resolve_address_windows.c",
+ "src/core/iomgr/sockaddr_utils.c",
+ "src/core/iomgr/socket_utils_common_posix.c",
+ "src/core/iomgr/socket_utils_linux.c",
+ "src/core/iomgr/socket_utils_posix.c",
+ "src/core/iomgr/socket_windows.c",
+ "src/core/iomgr/tcp_client_posix.c",
+ "src/core/iomgr/tcp_client_windows.c",
+ "src/core/iomgr/tcp_posix.c",
+ "src/core/iomgr/tcp_server_posix.c",
+ "src/core/iomgr/tcp_server_windows.c",
+ "src/core/iomgr/tcp_windows.c",
+ "src/core/iomgr/time_averaged_stats.c",
+ "src/core/iomgr/wakeup_fd_eventfd.c",
+ "src/core/iomgr/wakeup_fd_nospecial.c",
+ "src/core/iomgr/wakeup_fd_pipe.c",
+ "src/core/iomgr/wakeup_fd_posix.c",
+ "src/core/json/json.c",
+ "src/core/json/json_reader.c",
+ "src/core/json/json_string.c",
+ "src/core/json/json_writer.c",
+ "src/core/profiling/basic_timers.c",
+ "src/core/profiling/stap_timers.c",
+ "src/core/surface/byte_buffer.c",
+ "src/core/surface/byte_buffer_queue.c",
+ "src/core/surface/byte_buffer_reader.c",
+ "src/core/surface/call.c",
+ "src/core/surface/call_details.c",
+ "src/core/surface/call_log_batch.c",
+ "src/core/surface/channel.c",
+ "src/core/surface/channel_create.c",
+ "src/core/surface/client.c",
+ "src/core/surface/completion_queue.c",
+ "src/core/surface/event_string.c",
+ "src/core/surface/init.c",
+ "src/core/surface/lame_client.c",
+ "src/core/surface/metadata_array.c",
+ "src/core/surface/server.c",
+ "src/core/surface/server_chttp2.c",
+ "src/core/surface/server_create.c",
+ "src/core/surface/surface_trace.c",
+ "src/core/transport/chttp2/alpn.c",
+ "src/core/transport/chttp2/bin_encoder.c",
+ "src/core/transport/chttp2/frame_data.c",
+ "src/core/transport/chttp2/frame_goaway.c",
+ "src/core/transport/chttp2/frame_ping.c",
+ "src/core/transport/chttp2/frame_rst_stream.c",
+ "src/core/transport/chttp2/frame_settings.c",
+ "src/core/transport/chttp2/frame_window_update.c",
+ "src/core/transport/chttp2/hpack_parser.c",
+ "src/core/transport/chttp2/hpack_table.c",
+ "src/core/transport/chttp2/huffsyms.c",
+ "src/core/transport/chttp2/incoming_metadata.c",
+ "src/core/transport/chttp2/parsing.c",
+ "src/core/transport/chttp2/status_conversion.c",
+ "src/core/transport/chttp2/stream_encoder.c",
+ "src/core/transport/chttp2/stream_lists.c",
+ "src/core/transport/chttp2/stream_map.c",
+ "src/core/transport/chttp2/timeout_encoding.c",
+ "src/core/transport/chttp2/varint.c",
+ "src/core/transport/chttp2/writing.c",
+ "src/core/transport/chttp2_transport.c",
+ "src/core/transport/metadata.c",
+ "src/core/transport/stream_op.c",
+ "src/core/transport/transport.c",
+ "src/core/transport/transport_op_string.c",
+ "src/core/census/context.c",
+ "src/core/census/initialize.c",
+ ],
+ hdrs = [
+ "include/grpc/grpc_security.h",
+ "include/grpc/byte_buffer.h",
+ "include/grpc/byte_buffer_reader.h",
+ "include/grpc/compression.h",
+ "include/grpc/grpc.h",
+ "include/grpc/status.h",
+ "include/grpc/census.h",
+ "src/core/httpcli/format_request.h",
+ "src/core/httpcli/httpcli.h",
+ "src/core/httpcli/httpcli_security_connector.h",
+ "src/core/httpcli/parser.h",
+ "src/core/security/auth_filters.h",
+ "src/core/security/base64.h",
+ "src/core/security/credentials.h",
+ "src/core/security/json_token.h",
+ "src/core/security/secure_endpoint.h",
+ "src/core/security/secure_transport_setup.h",
+ "src/core/security/security_connector.h",
+ "src/core/security/security_context.h",
+ "src/core/tsi/fake_transport_security.h",
+ "src/core/tsi/ssl_transport_security.h",
+ "src/core/tsi/transport_security.h",
+ "src/core/tsi/transport_security_interface.h",
+ "src/core/census/grpc_context.h",
+ "src/core/channel/census_filter.h",
+ "src/core/channel/channel_args.h",
+ "src/core/channel/channel_stack.h",
+ "src/core/channel/child_channel.h",
+ "src/core/channel/client_channel.h",
+ "src/core/channel/client_setup.h",
+ "src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
+ "src/core/channel/http_client_filter.h",
+ "src/core/channel/http_server_filter.h",
+ "src/core/channel/noop_filter.h",
+ "src/core/compression/message_compress.h",
+ "src/core/debug/trace.h",
+ "src/core/iomgr/alarm.h",
+ "src/core/iomgr/alarm_heap.h",
+ "src/core/iomgr/alarm_internal.h",
+ "src/core/iomgr/endpoint.h",
+ "src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/fd_posix.h",
+ "src/core/iomgr/iocp_windows.h",
+ "src/core/iomgr/iomgr.h",
+ "src/core/iomgr/iomgr_internal.h",
+ "src/core/iomgr/iomgr_posix.h",
+ "src/core/iomgr/pollset.h",
+ "src/core/iomgr/pollset_kick_posix.h",
+ "src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.h",
+ "src/core/iomgr/pollset_windows.h",
+ "src/core/iomgr/resolve_address.h",
+ "src/core/iomgr/sockaddr.h",
+ "src/core/iomgr/sockaddr_posix.h",
+ "src/core/iomgr/sockaddr_utils.h",
+ "src/core/iomgr/sockaddr_win32.h",
+ "src/core/iomgr/socket_utils_posix.h",
+ "src/core/iomgr/socket_windows.h",
+ "src/core/iomgr/tcp_client.h",
+ "src/core/iomgr/tcp_posix.h",
+ "src/core/iomgr/tcp_server.h",
+ "src/core/iomgr/tcp_windows.h",
+ "src/core/iomgr/time_averaged_stats.h",
+ "src/core/iomgr/wakeup_fd_pipe.h",
+ "src/core/iomgr/wakeup_fd_posix.h",
+ "src/core/json/json.h",
+ "src/core/json/json_common.h",
+ "src/core/json/json_reader.h",
+ "src/core/json/json_writer.h",
+ "src/core/profiling/timers.h",
+ "src/core/profiling/timers_preciseclock.h",
+ "src/core/surface/byte_buffer_queue.h",
+ "src/core/surface/call.h",
+ "src/core/surface/channel.h",
+ "src/core/surface/client.h",
+ "src/core/surface/completion_queue.h",
+ "src/core/surface/event_string.h",
+ "src/core/surface/init.h",
+ "src/core/surface/server.h",
+ "src/core/surface/surface_trace.h",
+ "src/core/transport/chttp2/alpn.h",
+ "src/core/transport/chttp2/bin_encoder.h",
+ "src/core/transport/chttp2/frame.h",
+ "src/core/transport/chttp2/frame_data.h",
+ "src/core/transport/chttp2/frame_goaway.h",
+ "src/core/transport/chttp2/frame_ping.h",
+ "src/core/transport/chttp2/frame_rst_stream.h",
+ "src/core/transport/chttp2/frame_settings.h",
+ "src/core/transport/chttp2/frame_window_update.h",
+ "src/core/transport/chttp2/hpack_parser.h",
+ "src/core/transport/chttp2/hpack_table.h",
+ "src/core/transport/chttp2/http2_errors.h",
+ "src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
+ "src/core/transport/chttp2/status_conversion.h",
+ "src/core/transport/chttp2/stream_encoder.h",
+ "src/core/transport/chttp2/stream_map.h",
+ "src/core/transport/chttp2/timeout_encoding.h",
+ "src/core/transport/chttp2/varint.h",
+ "src/core/transport/chttp2_transport.h",
+ "src/core/transport/metadata.h",
+ "src/core/transport/stream_op.h",
+ "src/core/transport/transport.h",
+ "src/core/transport/transport_impl.h",
+ "src/core/census/context.h",
+ ],
+ includes = [
+ "include",
+ ".",
+ ],
+ deps = [
+ ":gpr_objc",
+ "//external:libssl_objc",
+ ],
+ sdk_dylibs = ["libz"],
+)
+
+
+
cc_binary(
name = "grpc_cpp_plugin",
srcs = [
@@ -848,3 +1213,76 @@ cc_binary(
+
+
+
+objc_path = "src/objective-c"
+
+rx_library_path = objc_path + "/RxLibrary"
+
+objc_library(
+ name = "rx_library",
+ hdrs = glob([
+ rx_library_path + "/*.h",
+ rx_library_path + "/transformations/*.h",
+ ]),
+ srcs = glob([
+ rx_library_path + "/*.m",
+ rx_library_path + "/transformations/*.m",
+ ]),
+ includes = [objc_path],
+ deps = [
+ ":rx_library_private",
+ ],
+)
+
+objc_library(
+ name = "rx_library_private",
+ hdrs = glob([rx_library_path + "/private/*.h"]),
+ srcs = glob([rx_library_path + "/private/*.m"]),
+ visibility = ["//visibility:private"],
+)
+
+objc_client_path = objc_path + "/GRPCClient"
+
+objc_library(
+ name = "grpc_client",
+ hdrs = glob([
+ objc_client_path + "/*.h",
+ objc_client_path + "/private/*.h",
+ ]),
+ srcs = glob([
+ objc_client_path + "/*.m",
+ objc_client_path + "/private/*.m",
+ ]),
+ includes = [objc_path],
+ bundles = [":gRPCCertificates"],
+ deps = [
+ ":grpc_objc",
+ ":rx_library",
+ ],
+)
+
+objc_bundle_library(
+ # The choice of name is signicant here, since it determines the bundle name.
+ name = "gRPCCertificates",
+ resources = ["etc/roots.pem"],
+)
+
+proto_objc_rpc_path = objc_path + "/ProtoRPC"
+
+objc_library(
+ name = "proto_objc_rpc",
+ hdrs = glob([
+ proto_objc_rpc_path + "/*.h",
+ ]),
+ srcs = glob([
+ proto_objc_rpc_path + "/*.m",
+ ]),
+ includes = [objc_path],
+ deps = [
+ ":grpc_client",
+ ":rx_library",
+ "//external:protobuf_objc",
+ ],
+)
diff --git a/Makefile b/Makefile
index 2be4c38d79..d80c8bf995 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,8 @@
# This currently builds C and C++ code.
# This file has been automatically generated from a template file.
# Please look at the templates directory instead.
+# This file can be regenerated from the template by running
+# tools/buildgen/generate_projects.sh
# Copyright 2015, Google Inc.
# All rights reserved.
@@ -143,7 +145,7 @@ CC_tsan = clang
CXX_tsan = clang++
LD_tsan = clang
LDXX_tsan = clang++
-CPPFLAGS_tsan = -O1 -fsanitize=thread -fno-omit-frame-pointer
+CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer
LDFLAGS_tsan = -fsanitize=thread
DEFINES_tsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
@@ -155,7 +157,7 @@ LD_asan = clang
LDXX_asan = clang++
CPPFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer
LDFLAGS_asan = -fsanitize=address
-DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5
+DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3
VALID_CONFIG_msan = 1
REQUIRE_CUSTOM_LIBRARIES_msan = 1
@@ -166,7 +168,7 @@ LDXX_msan = clang++-libc++
CPPFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
OPENSSL_CFLAGS_msan = -DPURIFY
LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
-DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20
+DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=4
VALID_CONFIG_ubsan = 1
REQUIRE_CUSTOM_LIBRARIES_ubsan = 1
@@ -177,7 +179,7 @@ LDXX_ubsan = clang++
CPPFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer
OPENSSL_CFLAGS_ubsan = -DPURIFY
LDFLAGS_ubsan = -fsanitize=undefined
-DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
+DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3
VALID_CONFIG_gcov = 1
CC_gcov = gcc
@@ -329,6 +331,21 @@ HOST_LDLIBS = $(LDLIBS)
# These are automatically computed variables.
# There shouldn't be any need to change anything from now on.
+HAS_PKG_CONFIG = $(shell command -v pkg-config >/dev/null 2>&1 && echo true || echo false)
+
+PC_TEMPLATE = prefix=$(prefix)\nexec_prefix=\$${prefix}\nincludedir=\$${prefix}/include\nlibdir=\$${exec_prefix}/lib\n\nName: $(PC_NAME)\nDescription: $(PC_DESCRIPTION)\nVersion: $(VERSION)\nCflags: -I\$${includedir} $(PC_CFLAGS)\nRequires.private: $(PC_REQUIRES_PRIVATE)\nLibs: -L\$${libdir}\nLibs.private: $(PC_LIBS_PRIVATE)
+
+# gpr .pc file
+PC_NAME = gRPC Portable Runtime
+PC_DESCRIPTION = gRPC Portable Runtime
+PC_CFLAGS = -pthread
+PC_REQUIRES_PRIVATE =
+PC_LIBS_PRIVATE = -lpthread
+ifeq ($(SYSTEM),Darwin)
+PC_LIBS_PRIVATE += -lrt
+endif
+GPR_PC_FILE := $(PC_TEMPLATE)
+
ifeq ($(SYSTEM),MINGW32)
SHARED_EXT = dll
endif
@@ -353,6 +370,13 @@ ifeq ($(SYSTEM),Darwin)
OPENSSL_REQUIRES_DL = true
endif
+ifeq ($(HAS_PKG_CONFIG),true)
+OPENSSL_ALPN_CHECK_CMD = pkg-config --atleast-version=1.0.2 openssl
+ZLIB_CHECK_CMD = pkg-config --exists zlib
+PERFTOOLS_CHECK_CMD = pkg-config --exists profiler
+PROTOBUF_CHECK_CMD = pkg-config --atleast-version=3.0.0-alpha-3 protobuf
+else # HAS_PKG_CONFIG
+
ifeq ($(SYSTEM),MINGW32)
OPENSSL_LIBS = ssl32 eay32
else
@@ -363,15 +387,18 @@ OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/ope
ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS)
PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS)
PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS)
-PROTOC_CHECK_CMD = which protoc > /dev/null
-PROTOC_CHECK_VERSION_CMD = protoc --version | grep -q libprotoc.3
-DTRACE_CHECK_CMD = which dtrace > /dev/null
-SYSTEMTAP_HEADERS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/systemtap.c $(LDFLAGS)
ifeq ($(OPENSSL_REQUIRES_DL),true)
OPENSSL_ALPN_CHECK_CMD += -ldl
endif
+endif # HAS_PKG_CONFIG
+
+PROTOC_CHECK_CMD = which protoc > /dev/null
+PROTOC_CHECK_VERSION_CMD = protoc --version | grep -q libprotoc.3
+DTRACE_CHECK_CMD = which dtrace > /dev/null
+SYSTEMTAP_HEADERS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/systemtap.c $(LDFLAGS)
+
ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
@@ -432,6 +459,9 @@ else
HAS_EMBEDDED_PROTOBUF = true
endif
+PC_REQUIRES_GRPC = gpr
+PC_LIBS_GRPC =
+
ifeq ($(HAS_SYSTEM_ZLIB),false)
ifeq ($(HAS_EMBEDDED_ZLIB),true)
ZLIB_DEP = $(LIBDIR)/$(CONFIG)/zlib/libz.a
@@ -440,9 +470,41 @@ LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib
else
DEP_MISSING += zlib
endif
+else
+ifeq ($(HAS_PKG_CONFIG),true)
+CPPFLAGS += $(shell pkg-config --cflags zlib)
+LDFLAGS += $(shell pkg-config --libs-only-L zlib)
+PC_REQUIRES_GRPC += zlib
+else
+PC_LIBS_GRPC += -lz
+endif
endif
-ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),false)
+OPENSSL_PKG_CONFIG = false
+
+PC_REQUIRES_SECURE =
+PC_LIBS_SECURE =
+
+ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true)
+ifeq ($(HAS_PKG_CONFIG),true)
+OPENSSL_PKG_CONFIG = true
+PC_REQUIRES_SECURE = openssl
+CPPFLAGS := $(shell pkg-config --cflags openssl) $(CPPFLAGS)
+LDFLAGS_OPENSSL_PKG_CONFIG = $(shell pkg-config --libs-only-L openssl)
+ifeq ($(SYSTEM),Linux)
+ifneq ($(LDFLAGS_OPENSSL_PKG_CONFIG),)
+LDFLAGS_OPENSSL_PKG_CONFIG += $(shell pkg-config --libs-only-L openssl | sed s/L/Wl,-rpath,/)
+endif
+endif
+LDFLAGS := $(LDFLAGS_OPENSSL_PKG_CONFIG) $(LDFLAGS)
+else
+LIBS_SECURE = $(OPENSSL_LIBS)
+ifeq ($(OPENSSL_REQUIRES_DL),true)
+LIBS_SECURE += dl
+PC_LIBS_SECURE = $(addprefix -l, $(LIBS_SECURE))
+endif
+endif
+else
ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true)
OPENSSL_DEP = $(LIBDIR)/$(CONFIG)/openssl/libssl.a
OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/openssl/libcrypto.a
@@ -455,16 +517,50 @@ endif
else
NO_SECURE = true
endif
-else
-LIBS_SECURE = $(OPENSSL_LIBS)
-ifeq ($(OPENSSL_REQUIRES_DL),true)
-LIBS_SECURE += dl
-endif
endif
+ifeq ($(OPENSSL_PKG_CONFIG),true)
+LDLIBS_SECURE += $(shell pkg-config --libs-only-l openssl)
+else
LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
+endif
-ifeq ($(HAS_SYSTEM_PROTOBUF),false)
+# grpc .pc file
+PC_NAME = gRPC
+PC_DESCRIPTION = high performance general RPC framework
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) $(PC_LIBS_SECURE)
+GRPC_PC_FILE := $(PC_TEMPLATE)
+
+# gprc_unsecure .pc file
+PC_NAME = gRPC unsecure
+PC_DESCRIPTION = high performance general RPC framework without SSL
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPC)
+GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE)
+
+PROTOBUF_PKG_CONFIG = false
+
+PC_REQUIRES_GRPCXX =
+PC_LIBS_GRPCXX =
+
+ifeq ($(HAS_SYSTEM_PROTOBUF),true)
+ifeq ($(HAS_PKG_CONFIG),true)
+PROTOBUF_PKG_CONFIG = true
+PC_REQUIRES_GRPCXX = protobuf
+CPPFLAGS := $(shell pkg-config --cflags protobuf) $(CPPFLAGS)
+LDFLAGS_PROTOBUF_PKG_CONFIG = $(shell pkg-config --libs-only-L protobuf)
+ifeq ($(SYSTEM),Linux)
+ifneq ($(LDFLAGS_PROTOBUF_PKG_CONFIG),)
+LDFLAGS_PROTOBUF_PKG_CONFIG += $(shell pkg-config --libs-only-L protobuf | sed s/L/Wl,-rpath,/)
+endif
+endif
+else
+PC_LIBS_GRPCXX = -lprotobuf
+endif
+else
ifeq ($(HAS_EMBEDDED_PROTOBUF),true)
PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a
CPPFLAGS := -Ithird_party/protobuf/src $(CPPFLAGS)
@@ -473,15 +569,35 @@ PROTOC = $(BINDIR)/$(CONFIG)/protobuf/protoc
else
NO_PROTOBUF = true
endif
-else
endif
LIBS_PROTOBUF = protobuf
LIBS_PROTOC = protoc protobuf
-LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF))
HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC))
+ifeq ($(PROTOBUF_PKG_CONFIG),true)
+LDLIBS_PROTOBUF += $(shell pkg-config --libs-only-l protobuf)
+else
+LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF))
+endif
+
+# grpc++ .pc file
+PC_NAME = gRPC++
+PC_DESCRIPTION = C++ wrapper for gRPC
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = grpc $(PC_REQUIRES_GRPCXX)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX)
+GRPCXX_PC_FILE := $(PC_TEMPLATE)
+
+# grpc++_unsecure .pc file
+PC_NAME = gRPC++ unsecure
+PC_DESCRIPTION = C++ wrapper for gRPC without SSL
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = grpc_unsecure $(PC_REQUIRES_GRPCXX)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX)
+GRPCXX_UNSECURE_PC_FILE := $(PC_TEMPLATE)
+
ifeq ($(MAKECMDGOALS),clean)
NO_DEPS = true
endif
@@ -601,6 +717,7 @@ chttp2_status_conversion_test: $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test
chttp2_stream_encoder_test: $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test
chttp2_stream_map_test: $(BINDIR)/$(CONFIG)/chttp2_stream_map_test
dualstack_socket_test: $(BINDIR)/$(CONFIG)/dualstack_socket_test
+fd_conservation_posix_test: $(BINDIR)/$(CONFIG)/fd_conservation_posix_test
fd_posix_test: $(BINDIR)/$(CONFIG)/fd_posix_test
fling_client: $(BINDIR)/$(CONFIG)/fling_client
fling_server: $(BINDIR)/$(CONFIG)/fling_server
@@ -632,6 +749,7 @@ grpc_credentials_test: $(BINDIR)/$(CONFIG)/grpc_credentials_test
grpc_fetch_oauth2: $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2
grpc_json_token_test: $(BINDIR)/$(CONFIG)/grpc_json_token_test
grpc_print_google_default_creds_token: $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token
+grpc_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_security_connector_test
grpc_stream_op_test: $(BINDIR)/$(CONFIG)/grpc_stream_op_test
hpack_parser_test: $(BINDIR)/$(CONFIG)/hpack_parser_test
hpack_table_test: $(BINDIR)/$(CONFIG)/hpack_table_test
@@ -645,6 +763,7 @@ lame_client_test: $(BINDIR)/$(CONFIG)/lame_client_test
low_level_ping_pong_benchmark: $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark
message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test
multi_init_test: $(BINDIR)/$(CONFIG)/multi_init_test
+multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test
murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test
no_server_test: $(BINDIR)/$(CONFIG)/no_server_test
poll_kick_posix_test: $(BINDIR)/$(CONFIG)/poll_kick_posix_test
@@ -668,6 +787,8 @@ cli_call_test: $(BINDIR)/$(CONFIG)/cli_call_test
client_crash_test: $(BINDIR)/$(CONFIG)/client_crash_test
client_crash_test_server: $(BINDIR)/$(CONFIG)/client_crash_test_server
credentials_test: $(BINDIR)/$(CONFIG)/credentials_test
+cxx_byte_buffer_test: $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test
+cxx_slice_test: $(BINDIR)/$(CONFIG)/cxx_slice_test
cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test
end2end_test: $(BINDIR)/$(CONFIG)/end2end_test
generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test
@@ -1237,15 +1358,15 @@ $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
static: static_c static_cxx
-static_c: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
+static_c: pc_c pc_c_unsecure $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
-static_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
+static_cxx: pc_cxx pc_cxx_unsecure pc_gpr $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
shared: shared_c shared_cxx
-shared_c: $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.$(SHARED_EXT)
+shared_c: pc_c pc_c_unsecure pc_gpr $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.$(SHARED_EXT)
-shared_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.$(SHARED_EXT)
+shared_cxx: pc_cxx pc_cxx_unsecure $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.$(SHARED_EXT)
shared_csharp: shared_c $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.$(SHARED_EXT)
grpc_csharp_ext: shared_csharp
@@ -1255,14 +1376,23 @@ plugins: $(PROTOC_PLUGINS)
privatelibs: privatelibs_c privatelibs_cxx
privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fake_security.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_uds_posix.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_fullstack_with_poll.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_fullstack_with_poll.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time.a $(LIBDIR)/$(CONFIG)/libend2end_fixture_chttp2_socket_pair_with_grpc_trace.a $(LIBDIR)/$(CONFIG)/libend2end_test_bad_hostname.a $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept.a $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_accept_and_writes_closed.a $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_after_invoke.a $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_before_invoke.a $(LIBDIR)/$(CONFIG)/libend2end_test_cancel_in_a_vacuum.a $(LIBDIR)/$(CONFIG)/libend2end_test_census_simple_request.a $(LIBDIR)/$(CONFIG)/libend2end_test_disappearing_server.a $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_inflight_calls.a $(LIBDIR)/$(CONFIG)/libend2end_test_early_server_shutdown_finishes_tags.a $(LIBDIR)/$(CONFIG)/libend2end_test_empty_batch.a $(LIBDIR)/$(CONFIG)/libend2end_test_graceful_server_shutdown.a $(LIBDIR)/$(CONFIG)/libend2end_test_invoke_large_request.a $(LIBDIR)/$(CONFIG)/libend2end_test_max_concurrent_streams.a $(LIBDIR)/$(CONFIG)/libend2end_test_max_message_length.a $(LIBDIR)/$(CONFIG)/libend2end_test_no_op.a $(LIBDIR)/$(CONFIG)/libend2end_test_ping_pong_streaming.a $(LIBDIR)/$(CONFIG)/libend2end_test_registered_call.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_binary_metadata_and_payload.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_metadata_and_payload.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_payload_and_call_creds.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_response_with_trailing_metadata_and_payload.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_flags.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_large_metadata.a $(LIBDIR)/$(CONFIG)/libend2end_test_request_with_payload.a $(LIBDIR)/$(CONFIG)/libend2end_test_server_finishes_request.a $(LIBDIR)/$(CONFIG)/libend2end_test_simple_delayed_request.a $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request.a $(LIBDIR)/$(CONFIG)/libend2end_test_simple_request_with_high_initial_sequence_number.a $(LIBDIR)/$(CONFIG)/libend2end_certs.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a
+pc_gpr: $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc
+
+pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc
+
+pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc
-privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a
+pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc
+
+pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc
+
+privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a
buildtests: buildtests_c buildtests_cxx
-buildtests_c: privatelibs_c $(BINDIR)/$(CONFIG)/alarm_heap_test $(BINDIR)/$(CONFIG)/alarm_list_test $(BINDIR)/$(CONFIG)/alarm_test $(BINDIR)/$(CONFIG)/alpn_test $(BINDIR)/$(CONFIG)/bin_encoder_test $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test $(BINDIR)/$(CONFIG)/chttp2_stream_map_test $(BINDIR)/$(CONFIG)/dualstack_socket_test $(BINDIR)/$(CONFIG)/fd_posix_test $(BINDIR)/$(CONFIG)/fling_client $(BINDIR)/$(CONFIG)/fling_server $(BINDIR)/$(CONFIG)/fling_stream_test $(BINDIR)/$(CONFIG)/fling_test $(BINDIR)/$(CONFIG)/gpr_cancellable_test $(BINDIR)/$(CONFIG)/gpr_cmdline_test $(BINDIR)/$(CONFIG)/gpr_env_test $(BINDIR)/$(CONFIG)/gpr_file_test $(BINDIR)/$(CONFIG)/gpr_histogram_test $(BINDIR)/$(CONFIG)/gpr_host_port_test $(BINDIR)/$(CONFIG)/gpr_log_test $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test $(BINDIR)/$(CONFIG)/gpr_slice_test $(BINDIR)/$(CONFIG)/gpr_string_test $(BINDIR)/$(CONFIG)/gpr_sync_test $(BINDIR)/$(CONFIG)/gpr_thd_test $(BINDIR)/$(CONFIG)/gpr_time_test $(BINDIR)/$(CONFIG)/gpr_tls_test $(BINDIR)/$(CONFIG)/gpr_useful_test $(BINDIR)/$(CONFIG)/grpc_auth_context_test $(BINDIR)/$(CONFIG)/grpc_base64_test $(BINDIR)/$(CONFIG)/grpc_byte_buffer_reader_test $(BINDIR)/$(CONFIG)/grpc_channel_stack_test $(BINDIR)/$(CONFIG)/grpc_completion_queue_test $(BINDIR)/$(CONFIG)/grpc_credentials_test $(BINDIR)/$(CONFIG)/grpc_json_token_test $(BINDIR)/$(CONFIG)/grpc_stream_op_test $(BINDIR)/$(CONFIG)/hpack_parser_test $(BINDIR)/$(CONFIG)/hpack_table_test $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(BINDIR)/$(CONFIG)/httpcli_parser_test $(BINDIR)/$(CONFIG)/httpcli_test $(BINDIR)/$(CONFIG)/json_rewrite $(BINDIR)/$(CONFIG)/json_rewrite_test $(BINDIR)/$(CONFIG)/json_test $(BINDIR)/$(CONFIG)/lame_client_test $(BINDIR)/$(CONFIG)/message_compress_test $(BINDIR)/$(CONFIG)/multi_init_test $(BINDIR)/$(CONFIG)/murmur_hash_test $(BINDIR)/$(CONFIG)/no_server_test $(BINDIR)/$(CONFIG)/poll_kick_posix_test $(BINDIR)/$(CONFIG)/resolve_address_test $(BINDIR)/$(CONFIG)/secure_endpoint_test $(BINDIR)/$(CONFIG)/sockaddr_utils_test $(BINDIR)/$(CONFIG)/tcp_client_posix_test $(BINDIR)/$(CONFIG)/tcp_posix_test $(BINDIR)/$(CONFIG)/tcp_server_posix_test $(BINDIR)/$(CONFIG)/time_averaged_stats_test $(BINDIR)/$(CONFIG)/time_test $(BINDIR)/$(CONFIG)/timeout_encoding_test $(BINDIR)/$(CONFIG)/timers_test $(BINDIR)/$(CONFIG)/transport_metadata_test $(BINDIR)/$(CONFIG)/transport_security_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/connection_prefix_bad_client_test $(BINDIR)/$(CONFIG)/initial_settings_frame_bad_client_test
+buildtests_c: privatelibs_c $(BINDIR)/$(CONFIG)/alarm_heap_test $(BINDIR)/$(CONFIG)/alarm_list_test $(BINDIR)/$(CONFIG)/alarm_test $(BINDIR)/$(CONFIG)/alpn_test $(BINDIR)/$(CONFIG)/bin_encoder_test $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test $(BINDIR)/$(CONFIG)/chttp2_stream_map_test $(BINDIR)/$(CONFIG)/dualstack_socket_test $(BINDIR)/$(CONFIG)/fd_conservation_posix_test $(BINDIR)/$(CONFIG)/fd_posix_test $(BINDIR)/$(CONFIG)/fling_client $(BINDIR)/$(CONFIG)/fling_server $(BINDIR)/$(CONFIG)/fling_stream_test $(BINDIR)/$(CONFIG)/fling_test $(BINDIR)/$(CONFIG)/gpr_cancellable_test $(BINDIR)/$(CONFIG)/gpr_cmdline_test $(BINDIR)/$(CONFIG)/gpr_env_test $(BINDIR)/$(CONFIG)/gpr_file_test $(BINDIR)/$(CONFIG)/gpr_histogram_test $(BINDIR)/$(CONFIG)/gpr_host_port_test $(BINDIR)/$(CONFIG)/gpr_log_test $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test $(BINDIR)/$(CONFIG)/gpr_slice_test $(BINDIR)/$(CONFIG)/gpr_string_test $(BINDIR)/$(CONFIG)/gpr_sync_test $(BINDIR)/$(CONFIG)/gpr_thd_test $(BINDIR)/$(CONFIG)/gpr_time_test $(BINDIR)/$(CONFIG)/gpr_tls_test $(BINDIR)/$(CONFIG)/gpr_useful_test $(BINDIR)/$(CONFIG)/grpc_auth_context_test $(BINDIR)/$(CONFIG)/grpc_base64_test $(BINDIR)/$(CONFIG)/grpc_byte_buffer_reader_test $(BINDIR)/$(CONFIG)/grpc_channel_stack_test $(BINDIR)/$(CONFIG)/grpc_completion_queue_test $(BINDIR)/$(CONFIG)/grpc_credentials_test $(BINDIR)/$(CONFIG)/grpc_json_token_test $(BINDIR)/$(CONFIG)/grpc_security_connector_test $(BINDIR)/$(CONFIG)/grpc_stream_op_test $(BINDIR)/$(CONFIG)/hpack_parser_test $(BINDIR)/$(CONFIG)/hpack_table_test $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(BINDIR)/$(CONFIG)/httpcli_parser_test $(BINDIR)/$(CONFIG)/httpcli_test $(BINDIR)/$(CONFIG)/json_rewrite $(BINDIR)/$(CONFIG)/json_rewrite_test $(BINDIR)/$(CONFIG)/json_test $(BINDIR)/$(CONFIG)/lame_client_test $(BINDIR)/$(CONFIG)/message_compress_test $(BINDIR)/$(CONFIG)/multi_init_test $(BINDIR)/$(CONFIG)/multiple_server_queues_test $(BINDIR)/$(CONFIG)/murmur_hash_test $(BINDIR)/$(CONFIG)/no_server_test $(BINDIR)/$(CONFIG)/poll_kick_posix_test $(BINDIR)/$(CONFIG)/resolve_address_test $(BINDIR)/$(CONFIG)/secure_endpoint_test $(BINDIR)/$(CONFIG)/sockaddr_utils_test $(BINDIR)/$(CONFIG)/tcp_client_posix_test $(BINDIR)/$(CONFIG)/tcp_posix_test $(BINDIR)/$(CONFIG)/tcp_server_posix_test $(BINDIR)/$(CONFIG)/time_averaged_stats_test $(BINDIR)/$(CONFIG)/time_test $(BINDIR)/$(CONFIG)/timeout_encoding_test $(BINDIR)/$(CONFIG)/timers_test $(BINDIR)/$(CONFIG)/transport_metadata_test $(BINDIR)/$(CONFIG)/transport_security_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_message_length_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_registered_call_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_flags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_server_finishes_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_flags_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test $(BINDIR)/$(CONFIG)/connection_prefix_bad_client_test $(BINDIR)/$(CONFIG)/initial_settings_frame_bad_client_test
-buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test $(BINDIR)/$(CONFIG)/async_unary_ping_pong_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/cli_call_test $(BINDIR)/$(CONFIG)/client_crash_test $(BINDIR)/$(CONFIG)/client_crash_test_server $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/cxx_time_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/generic_end2end_test $(BINDIR)/$(CONFIG)/grpc_cli $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/mock_test $(BINDIR)/$(CONFIG)/qps_interarrival_test $(BINDIR)/$(CONFIG)/qps_test $(BINDIR)/$(CONFIG)/qps_test_openloop $(BINDIR)/$(CONFIG)/server_crash_test $(BINDIR)/$(CONFIG)/server_crash_test_client $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test $(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test $(BINDIR)/$(CONFIG)/thread_pool_test $(BINDIR)/$(CONFIG)/thread_stress_test
+buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test $(BINDIR)/$(CONFIG)/async_unary_ping_pong_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/cli_call_test $(BINDIR)/$(CONFIG)/client_crash_test $(BINDIR)/$(CONFIG)/client_crash_test_server $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test $(BINDIR)/$(CONFIG)/cxx_slice_test $(BINDIR)/$(CONFIG)/cxx_time_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/generic_end2end_test $(BINDIR)/$(CONFIG)/grpc_cli $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/mock_test $(BINDIR)/$(CONFIG)/qps_interarrival_test $(BINDIR)/$(CONFIG)/qps_test $(BINDIR)/$(CONFIG)/qps_test_openloop $(BINDIR)/$(CONFIG)/server_crash_test $(BINDIR)/$(CONFIG)/server_crash_test_client $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test $(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test $(BINDIR)/$(CONFIG)/thread_pool_test $(BINDIR)/$(CONFIG)/thread_stress_test
test: test_c test_cxx
@@ -1287,6 +1417,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_stream_map_test || ( echo test chttp2_stream_map_test failed ; exit 1 )
$(E) "[RUN] Testing dualstack_socket_test"
$(Q) $(BINDIR)/$(CONFIG)/dualstack_socket_test || ( echo test dualstack_socket_test failed ; exit 1 )
+ $(E) "[RUN] Testing fd_conservation_posix_test"
+ $(Q) $(BINDIR)/$(CONFIG)/fd_conservation_posix_test || ( echo test fd_conservation_posix_test failed ; exit 1 )
$(E) "[RUN] Testing fd_posix_test"
$(Q) $(BINDIR)/$(CONFIG)/fd_posix_test || ( echo test fd_posix_test failed ; exit 1 )
$(E) "[RUN] Testing fling_stream_test"
@@ -1337,6 +1469,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/grpc_credentials_test || ( echo test grpc_credentials_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_json_token_test"
$(Q) $(BINDIR)/$(CONFIG)/grpc_json_token_test || ( echo test grpc_json_token_test failed ; exit 1 )
+ $(E) "[RUN] Testing grpc_security_connector_test"
+ $(Q) $(BINDIR)/$(CONFIG)/grpc_security_connector_test || ( echo test grpc_security_connector_test failed ; exit 1 )
$(E) "[RUN] Testing grpc_stream_op_test"
$(Q) $(BINDIR)/$(CONFIG)/grpc_stream_op_test || ( echo test grpc_stream_op_test failed ; exit 1 )
$(E) "[RUN] Testing hpack_parser_test"
@@ -1359,6 +1493,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 )
$(E) "[RUN] Testing multi_init_test"
$(Q) $(BINDIR)/$(CONFIG)/multi_init_test || ( echo test multi_init_test failed ; exit 1 )
+ $(E) "[RUN] Testing multiple_server_queues_test"
+ $(Q) $(BINDIR)/$(CONFIG)/multiple_server_queues_test || ( echo test multiple_server_queues_test failed ; exit 1 )
$(E) "[RUN] Testing murmur_hash_test"
$(Q) $(BINDIR)/$(CONFIG)/murmur_hash_test || ( echo test murmur_hash_test failed ; exit 1 )
$(E) "[RUN] Testing no_server_test"
@@ -1391,6 +1527,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/transport_security_test || ( echo test transport_security_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fake_security_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test || ( echo test chttp2_fake_security_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fake_security_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test || ( echo test chttp2_fake_security_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fake_security_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fake_security_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fake_security_cancel_after_invoke_test"
@@ -1411,6 +1549,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test || ( echo test chttp2_fake_security_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fake_security_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test || ( echo test chttp2_fake_security_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fake_security_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test || ( echo test chttp2_fake_security_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fake_security_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test || ( echo test chttp2_fake_security_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fake_security_max_message_length_test"
@@ -1447,6 +1587,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fake_security_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test || ( echo test chttp2_fullstack_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fullstack_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test || ( echo test chttp2_fullstack_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fullstack_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_cancel_after_invoke_test"
@@ -1467,6 +1609,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test || ( echo test chttp2_fullstack_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test || ( echo test chttp2_fullstack_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test || ( echo test chttp2_fullstack_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test || ( echo test chttp2_fullstack_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_max_message_length_test"
@@ -1503,6 +1647,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fullstack_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_bad_hostname_test || ( echo test chttp2_fullstack_uds_posix_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_test || ( echo test chttp2_fullstack_uds_posix_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_invoke_test"
@@ -1523,6 +1669,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_empty_batch_test || ( echo test chttp2_fullstack_uds_posix_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_graceful_server_shutdown_test || ( echo test chttp2_fullstack_uds_posix_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_test || ( echo test chttp2_fullstack_uds_posix_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_max_concurrent_streams_test || ( echo test chttp2_fullstack_uds_posix_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_max_message_length_test"
@@ -1559,6 +1707,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_with_poll_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_bad_hostname_test || ( echo test chttp2_fullstack_with_poll_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fullstack_with_poll_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_test || ( echo test chttp2_fullstack_with_poll_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_with_poll_cancel_after_invoke_test"
@@ -1579,6 +1729,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_empty_batch_test || ( echo test chttp2_fullstack_with_poll_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_with_poll_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_graceful_server_shutdown_test || ( echo test chttp2_fullstack_with_poll_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_fullstack_with_poll_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_invoke_large_request_test || ( echo test chttp2_fullstack_with_poll_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_with_poll_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_max_concurrent_streams_test || ( echo test chttp2_fullstack_with_poll_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_with_poll_max_message_length_test"
@@ -1615,6 +1767,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test || ( echo test chttp2_simple_ssl_fullstack_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_fullstack_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_invoke_test"
@@ -1635,6 +1789,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test || ( echo test chttp2_simple_ssl_fullstack_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test || ( echo test chttp2_simple_ssl_fullstack_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_fullstack_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test || ( echo test chttp2_simple_ssl_fullstack_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_max_message_length_test"
@@ -1671,6 +1827,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_bad_hostname_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_cancel_after_invoke_test"
@@ -1691,6 +1849,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_empty_batch_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_max_message_length_test"
@@ -1727,6 +1887,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test"
@@ -1747,6 +1909,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test"
@@ -1783,6 +1947,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test || ( echo test chttp2_socket_pair_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_socket_pair_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test || ( echo test chttp2_socket_pair_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_socket_pair_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_cancel_after_invoke_test"
@@ -1803,6 +1969,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test || ( echo test chttp2_socket_pair_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test || ( echo test chttp2_socket_pair_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_socket_pair_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test || ( echo test chttp2_socket_pair_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test || ( echo test chttp2_socket_pair_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_max_message_length_test"
@@ -1839,6 +2007,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test"
@@ -1859,6 +2029,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_max_message_length_test"
@@ -1895,6 +2067,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_bad_hostname_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_bad_hostname_test || ( echo test chttp2_socket_pair_with_grpc_trace_bad_hostname_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test || ( echo test chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test || ( echo test chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test"
@@ -1915,6 +2089,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_empty_batch_test || ( echo test chttp2_socket_pair_with_grpc_trace_empty_batch_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test || ( echo test chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test failed ; exit 1 )
+ $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_invoke_large_request_test"
+ $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_test || ( echo test chttp2_socket_pair_with_grpc_trace_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test || ( echo test chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_max_message_length_test"
@@ -2292,46 +2468,6 @@ test_c: buildtests_c
flaky_test_c: buildtests_c
- $(E) "[RUN] Testing chttp2_fake_security_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test || ( echo test chttp2_fake_security_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fake_security_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test || ( echo test chttp2_fake_security_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fullstack_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test || ( echo test chttp2_fullstack_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test || ( echo test chttp2_fullstack_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fullstack_uds_posix_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_cancel_after_accept_test || ( echo test chttp2_fullstack_uds_posix_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_posix_invoke_large_request_test || ( echo test chttp2_fullstack_uds_posix_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fullstack_with_poll_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_cancel_after_accept_test || ( echo test chttp2_fullstack_with_poll_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_fullstack_with_poll_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_with_poll_invoke_large_request_test || ( echo test chttp2_fullstack_with_poll_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_fullstack_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_fullstack_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test || ( echo test chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test || ( echo test chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_socket_pair_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test || ( echo test chttp2_socket_pair_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_socket_pair_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test || ( echo test chttp2_socket_pair_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test || ( echo test chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test || ( echo test chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test failed ; exit 1 )
- $(E) "[RUN] Testing chttp2_socket_pair_with_grpc_trace_invoke_large_request_test"
- $(Q) $(BINDIR)/$(CONFIG)/chttp2_socket_pair_with_grpc_trace_invoke_large_request_test || ( echo test chttp2_socket_pair_with_grpc_trace_invoke_large_request_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_invoke_large_request_unsecure_test"
$(Q) $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_unsecure_test || ( echo test chttp2_fullstack_invoke_large_request_unsecure_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test"
@@ -2361,6 +2497,10 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/client_crash_test || ( echo test client_crash_test failed ; exit 1 )
$(E) "[RUN] Testing credentials_test"
$(Q) $(BINDIR)/$(CONFIG)/credentials_test || ( echo test credentials_test failed ; exit 1 )
+ $(E) "[RUN] Testing cxx_byte_buffer_test"
+ $(Q) $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test || ( echo test cxx_byte_buffer_test failed ; exit 1 )
+ $(E) "[RUN] Testing cxx_slice_test"
+ $(Q) $(BINDIR)/$(CONFIG)/cxx_slice_test || ( echo test cxx_slice_test failed ; exit 1 )
$(E) "[RUN] Testing cxx_time_test"
$(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 )
$(E) "[RUN] Testing end2end_test"
@@ -2397,7 +2537,12 @@ test_python: static_c
$(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG)
-tools: privatelibs $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token
+tools: tools_c tools_cxx
+
+
+tools_c: privatelibs_c $(BINDIR)/$(CONFIG)/gen_hpack_tables $(BINDIR)/$(CONFIG)/grpc_create_jwt $(BINDIR)/$(CONFIG)/grpc_fetch_oauth2 $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token
+
+tools_cxx: privatelibs_cxx
buildbenchmarks: privatelibs $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker
@@ -2456,6 +2601,31 @@ ifeq ($(CONFIG),opt)
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext.$(SHARED_EXT)
endif
+$(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GPR_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPC_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPC_UNSECURE_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPCXX_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPCXX_UNSECURE_PC_FILE)" >$@
+
ifeq ($(NO_PROTOC),true)
$(GENDIR)/examples/pubsub/empty.pb.cc: protoc_dep_error
$(GENDIR)/examples/pubsub/empty.grpc.pb.cc: protoc_dep_error
@@ -2502,6 +2672,21 @@ $(GENDIR)/examples/pubsub/pubsub.grpc.pb.cc: examples/pubsub/pubsub.proto $(PROT
endif
ifeq ($(NO_PROTOC),true)
+$(GENDIR)/test/cpp/qps/perf_db.pb.cc: protoc_dep_error
+$(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc: protoc_dep_error
+else
+$(GENDIR)/test/cpp/qps/perf_db.pb.cc: test/cpp/qps/perf_db.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
+ $(E) "[PROTOC] Generating protobuf CC file from $<"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(PROTOC) --cpp_out=$(GENDIR) $<
+
+$(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc: test/cpp/qps/perf_db.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
+ $(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
+endif
+
+ifeq ($(NO_PROTOC),true)
$(GENDIR)/test/cpp/qps/qpstest.pb.cc: protoc_dep_error
$(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc: protoc_dep_error
else
@@ -2663,7 +2848,7 @@ install-headers_cxx:
install-static: install-static_c install-static_cxx
-install-static_c: static_c strip-static_c
+install-static_c: static_c strip-static_c install-pkg-config_c
$(E) "[INSTALL] Installing libgpr.a"
$(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr.a $(prefix)/lib/libgpr.a
@@ -2674,7 +2859,7 @@ install-static_c: static_c strip-static_c
$(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(prefix)/lib/libgrpc_unsecure.a
-install-static_cxx: static_cxx strip-static_cxx
+install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx
$(E) "[INSTALL] Installing libgrpc++.a"
$(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(prefix)/lib/libgrpc++.a
@@ -2684,7 +2869,7 @@ install-static_cxx: static_cxx strip-static_cxx
-install-shared_c: shared_c strip-shared_c
+install-shared_c: shared_c strip-shared_c install-pkg-config_c
ifeq ($(SYSTEM),MINGW32)
$(E) "[INSTALL] Installing gpr.$(SHARED_EXT)"
$(Q) $(INSTALL) -d $(prefix)/lib
@@ -2734,7 +2919,7 @@ endif
endif
-install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c
+install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx
ifeq ($(SYSTEM),MINGW32)
$(E) "[INSTALL] Installing grpc++.$(SHARED_EXT)"
$(Q) $(INSTALL) -d $(prefix)/lib
@@ -2809,6 +2994,19 @@ else
$(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_ruby_plugin $(prefix)/bin/grpc_ruby_plugin
endif
+install-pkg-config_c: pc_gpr pc_c pc_c_unsecure
+ $(E) "[INSTALL] Installing C pkg-config files"
+ $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc $(prefix)/lib/pkgconfig/gpr.pc
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(prefix)/lib/pkgconfig/grpc.pc
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(prefix)/lib/pkgconfig/grpc_unsecure.pc
+
+install-pkg-config_cxx: pc_cxx pc_cxx_unsecure
+ $(E) "[INSTALL] Installing C++ pkg-config files"
+ $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc $(prefix)/lib/pkgconfig/grpc++.pc
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc $(prefix)/lib/pkgconfig/grpc++_unsecure.pc
+
install-certs: etc/roots.pem
$(E) "[INSTALL] Installing root certificates"
$(Q) $(INSTALL) -d $(prefix)/share/grpc
@@ -3017,10 +3215,12 @@ LIBGRPC_SRC = \
src/core/iomgr/iomgr.c \
src/core/iomgr/iomgr_posix.c \
src/core/iomgr/iomgr_windows.c \
- src/core/iomgr/pollset_kick.c \
+ src/core/iomgr/pollset_kick_posix.c \
src/core/iomgr/pollset_multipoller_with_epoll.c \
src/core/iomgr/pollset_multipoller_with_poll_posix.c \
src/core/iomgr/pollset_posix.c \
+ src/core/iomgr/pollset_set_posix.c \
+ src/core/iomgr/pollset_set_windows.c \
src/core/iomgr/pollset_windows.c \
src/core/iomgr/resolve_address_posix.c \
src/core/iomgr/resolve_address_windows.c \
@@ -3075,11 +3275,15 @@ LIBGRPC_SRC = \
src/core/transport/chttp2/hpack_parser.c \
src/core/transport/chttp2/hpack_table.c \
src/core/transport/chttp2/huffsyms.c \
+ src/core/transport/chttp2/incoming_metadata.c \
+ src/core/transport/chttp2/parsing.c \
src/core/transport/chttp2/status_conversion.c \
src/core/transport/chttp2/stream_encoder.c \
+ src/core/transport/chttp2/stream_lists.c \
src/core/transport/chttp2/stream_map.c \
src/core/transport/chttp2/timeout_encoding.c \
src/core/transport/chttp2/varint.c \
+ src/core/transport/chttp2/writing.c \
src/core/transport/chttp2_transport.c \
src/core/transport/metadata.c \
src/core/transport/stream_op.c \
@@ -3261,10 +3465,12 @@ LIBGRPC_UNSECURE_SRC = \
src/core/iomgr/iomgr.c \
src/core/iomgr/iomgr_posix.c \
src/core/iomgr/iomgr_windows.c \
- src/core/iomgr/pollset_kick.c \
+ src/core/iomgr/pollset_kick_posix.c \
src/core/iomgr/pollset_multipoller_with_epoll.c \
src/core/iomgr/pollset_multipoller_with_poll_posix.c \
src/core/iomgr/pollset_posix.c \
+ src/core/iomgr/pollset_set_posix.c \
+ src/core/iomgr/pollset_set_windows.c \
src/core/iomgr/pollset_windows.c \
src/core/iomgr/resolve_address_posix.c \
src/core/iomgr/resolve_address_windows.c \
@@ -3319,11 +3525,15 @@ LIBGRPC_UNSECURE_SRC = \
src/core/transport/chttp2/hpack_parser.c \
src/core/transport/chttp2/hpack_table.c \
src/core/transport/chttp2/huffsyms.c \
+ src/core/transport/chttp2/incoming_metadata.c \
+ src/core/transport/chttp2/parsing.c \
src/core/transport/chttp2/status_conversion.c \
src/core/transport/chttp2/stream_encoder.c \
+ src/core/transport/chttp2/stream_lists.c \
src/core/transport/chttp2/stream_map.c \
src/core/transport/chttp2/timeout_encoding.c \
src/core/transport/chttp2/varint.c \
+ src/core/transport/chttp2/writing.c \
src/core/transport/chttp2_transport.c \
src/core/transport/metadata.c \
src/core/transport/stream_op.c \
@@ -3377,6 +3587,7 @@ endif
LIBGRPC++_SRC = \
+ src/cpp/client/secure_channel_arguments.cc \
src/cpp/client/secure_credentials.cc \
src/cpp/common/secure_auth_context.cc \
src/cpp/common/secure_create_auth_context.cc \
@@ -3384,7 +3595,6 @@ LIBGRPC++_SRC = \
src/cpp/client/channel.cc \
src/cpp/client/channel_arguments.cc \
src/cpp/client/client_context.cc \
- src/cpp/client/client_unary_call.cc \
src/cpp/client/create_channel.cc \
src/cpp/client/credentials.cc \
src/cpp/client/generic_stub.cc \
@@ -3417,6 +3627,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/client_context.h \
include/grpc++/completion_queue.h \
include/grpc++/config.h \
+ include/grpc++/config_protobuf.h \
include/grpc++/create_channel.h \
include/grpc++/credentials.h \
include/grpc++/generic_stub.h \
@@ -3424,8 +3635,10 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/client_unary_call.h \
include/grpc++/impl/grpc_library.h \
include/grpc++/impl/internal_stub.h \
+ include/grpc++/impl/proto_utils.h \
include/grpc++/impl/rpc_method.h \
include/grpc++/impl/rpc_service_method.h \
+ include/grpc++/impl/serialization_traits.h \
include/grpc++/impl/service_type.h \
include/grpc++/impl/sync.h \
include/grpc++/impl/sync_cxx11.h \
@@ -3514,57 +3727,6 @@ endif
endif
-LIBGRPC++_BENCHMARK_CONFIG_SRC = \
- $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc \
- test/cpp/qps/report.cc \
- test/cpp/util/benchmark_config.cc \
-
-
-LIBGRPC++_BENCHMARK_CONFIG_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_BENCHMARK_CONFIG_SRC))))
-
-ifeq ($(NO_SECURE),true)
-
-# You can't build secure libraries if you don't have OpenSSL with ALPN.
-
-$(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a: openssl_dep_error
-
-
-else
-
-ifeq ($(NO_PROTOBUF),true)
-
-# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
-
-$(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a: protobuf_dep_error
-
-
-else
-
-$(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LIBGRPC++_BENCHMARK_CONFIG_OBJS)
- $(E) "[AR] Creating $@"
- $(Q) mkdir -p `dirname $@`
- $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a
- $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBGRPC++_BENCHMARK_CONFIG_OBJS)
-ifeq ($(SYSTEM),Darwin)
- $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a
-endif
-
-
-
-
-endif
-
-endif
-
-ifneq ($(NO_SECURE),true)
-ifneq ($(NO_DEPS),true)
--include $(LIBGRPC++_BENCHMARK_CONFIG_OBJS:.o=.dep)
-endif
-endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-
-
LIBGRPC++_TEST_CONFIG_SRC = \
test/cpp/util/test_config.cc \
@@ -3674,7 +3836,6 @@ LIBGRPC++_UNSECURE_SRC = \
src/cpp/client/channel.cc \
src/cpp/client/channel_arguments.cc \
src/cpp/client/client_context.cc \
- src/cpp/client/client_unary_call.cc \
src/cpp/client/create_channel.cc \
src/cpp/client/credentials.cc \
src/cpp/client/generic_stub.cc \
@@ -3707,6 +3868,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/client_context.h \
include/grpc++/completion_queue.h \
include/grpc++/config.h \
+ include/grpc++/config_protobuf.h \
include/grpc++/create_channel.h \
include/grpc++/credentials.h \
include/grpc++/generic_stub.h \
@@ -3714,8 +3876,10 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/impl/client_unary_call.h \
include/grpc++/impl/grpc_library.h \
include/grpc++/impl/internal_stub.h \
+ include/grpc++/impl/proto_utils.h \
include/grpc++/impl/rpc_method.h \
include/grpc++/impl/rpc_service_method.h \
+ include/grpc++/impl/serialization_traits.h \
include/grpc++/impl/service_type.h \
include/grpc++/impl/sync.h \
include/grpc++/impl/sync_cxx11.h \
@@ -4077,13 +4241,17 @@ $(OBJDIR)/$(CONFIG)/examples/pubsub/subscriber.o: $(GENDIR)/examples/pubsub/labe
LIBQPS_SRC = \
$(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc \
+ $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc \
test/cpp/qps/client_async.cc \
test/cpp/qps/client_sync.cc \
test/cpp/qps/driver.cc \
+ test/cpp/qps/perf_db_client.cc \
test/cpp/qps/qps_worker.cc \
+ test/cpp/qps/report.cc \
test/cpp/qps/server_async.cc \
test/cpp/qps/server_sync.cc \
test/cpp/qps/timer.cc \
+ test/cpp/util/benchmark_config.cc \
LIBQPS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBQPS_SRC))))
@@ -4127,13 +4295,16 @@ ifneq ($(NO_DEPS),true)
-include $(LIBQPS_OBJS:.o=.dep)
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/timer.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/perf_db_client.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_async.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/server_sync.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/timer.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
+$(OBJDIR)/$(CONFIG)/test/cpp/util/benchmark_config.o: $(GENDIR)/test/cpp/qps/qpstest.pb.cc $(GENDIR)/test/cpp/qps/qpstest.grpc.pb.cc $(GENDIR)/test/cpp/qps/perf_db.pb.cc $(GENDIR)/test/cpp/qps/perf_db.grpc.pb.cc
LIBGRPC_CSHARP_EXT_SRC = \
@@ -5526,6 +5697,35 @@ endif
endif
+FD_CONSERVATION_POSIX_TEST_SRC = \
+ test/core/iomgr/fd_conservation_posix_test.c \
+
+FD_CONSERVATION_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FD_CONSERVATION_POSIX_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL with ALPN.
+
+$(BINDIR)/$(CONFIG)/fd_conservation_posix_test: openssl_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/fd_conservation_posix_test: $(FD_CONSERVATION_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LD) $(LDFLAGS) $(FD_CONSERVATION_POSIX_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/fd_conservation_posix_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/iomgr/fd_conservation_posix_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+deps_fd_conservation_posix_test: $(FD_CONSERVATION_POSIX_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(FD_CONSERVATION_POSIX_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
FD_POSIX_TEST_SRC = \
test/core/iomgr/fd_posix_test.c \
@@ -5672,7 +5872,7 @@ endif
GEN_HPACK_TABLES_SRC = \
- src/core/transport/chttp2/gen_hpack_tables.c \
+ tools/codegen/core/gen_hpack_tables.c \
GEN_HPACK_TABLES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GEN_HPACK_TABLES_SRC))))
ifeq ($(NO_SECURE),true)
@@ -5683,14 +5883,14 @@ $(BINDIR)/$(CONFIG)/gen_hpack_tables: openssl_dep_error
else
-$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a
+$(BINDIR)/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables
+ $(Q) $(LD) $(LDFLAGS) $(GEN_HPACK_TABLES_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/gen_hpack_tables
endif
-$(OBJDIR)/$(CONFIG)/src/core/transport/chttp2/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a
+$(OBJDIR)/$(CONFIG)/tools/codegen/core/gen_hpack_tables.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a
deps_gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -6425,6 +6625,35 @@ endif
endif
+GRPC_SECURITY_CONNECTOR_TEST_SRC = \
+ test/core/security/security_connector_test.c \
+
+GRPC_SECURITY_CONNECTOR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_SECURITY_CONNECTOR_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL with ALPN.
+
+$(BINDIR)/$(CONFIG)/grpc_security_connector_test: openssl_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/grpc_security_connector_test: $(GRPC_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LD) $(LDFLAGS) $(GRPC_SECURITY_CONNECTOR_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/grpc_security_connector_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/security/security_connector_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+deps_grpc_security_connector_test: $(GRPC_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(GRPC_SECURITY_CONNECTOR_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
GRPC_STREAM_OP_TEST_SRC = \
test/core/transport/stream_op_test.c \
@@ -6802,6 +7031,35 @@ endif
endif
+MULTIPLE_SERVER_QUEUES_TEST_SRC = \
+ test/core/end2end/multiple_server_queues_test.c \
+
+MULTIPLE_SERVER_QUEUES_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MULTIPLE_SERVER_QUEUES_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL with ALPN.
+
+$(BINDIR)/$(CONFIG)/multiple_server_queues_test: openssl_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/multiple_server_queues_test: $(MULTIPLE_SERVER_QUEUES_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LD) $(LDFLAGS) $(MULTIPLE_SERVER_QUEUES_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/multiple_server_queues_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/end2end/multiple_server_queues_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+deps_multiple_server_queues_test: $(MULTIPLE_SERVER_QUEUES_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(MULTIPLE_SERVER_QUEUES_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
MURMUR_HASH_TEST_SRC = \
test/core/support/murmur_hash_test.c \
@@ -7298,16 +7556,16 @@ $(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test: $(PROTOBUF_DEP) $(ASYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test: $(PROTOBUF_DEP) $(ASYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(ASYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test
+ $(Q) $(LDXX) $(LDFLAGS) $(ASYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/async_streaming_ping_pong_test
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/async_streaming_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/async_streaming_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_async_streaming_ping_pong_test: $(ASYNC_STREAMING_PING_PONG_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -7338,16 +7596,16 @@ $(BINDIR)/$(CONFIG)/async_unary_ping_pong_test: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/async_unary_ping_pong_test: $(PROTOBUF_DEP) $(ASYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/async_unary_ping_pong_test: $(PROTOBUF_DEP) $(ASYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(ASYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/async_unary_ping_pong_test
+ $(Q) $(LDXX) $(LDFLAGS) $(ASYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/async_unary_ping_pong_test
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/async_unary_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/async_unary_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_async_unary_ping_pong_test: $(ASYNC_UNARY_PING_PONG_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -7557,6 +7815,86 @@ endif
endif
+CXX_BYTE_BUFFER_TEST_SRC = \
+ test/cpp/util/byte_buffer_test.cc \
+
+CXX_BYTE_BUFFER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CXX_BYTE_BUFFER_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL with ALPN.
+
+$(BINDIR)/$(CONFIG)/cxx_byte_buffer_test: openssl_dep_error
+
+else
+
+
+ifeq ($(NO_PROTOBUF),true)
+
+# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
+
+$(BINDIR)/$(CONFIG)/cxx_byte_buffer_test: protobuf_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/cxx_byte_buffer_test: $(PROTOBUF_DEP) $(CXX_BYTE_BUFFER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LDXX) $(LDFLAGS) $(CXX_BYTE_BUFFER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cxx_byte_buffer_test
+
+endif
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/cpp/util/byte_buffer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+deps_cxx_byte_buffer_test: $(CXX_BYTE_BUFFER_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(CXX_BYTE_BUFFER_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
+CXX_SLICE_TEST_SRC = \
+ test/cpp/util/slice_test.cc \
+
+CXX_SLICE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CXX_SLICE_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL with ALPN.
+
+$(BINDIR)/$(CONFIG)/cxx_slice_test: openssl_dep_error
+
+else
+
+
+ifeq ($(NO_PROTOBUF),true)
+
+# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
+
+$(BINDIR)/$(CONFIG)/cxx_slice_test: protobuf_dep_error
+
+else
+
+$(BINDIR)/$(CONFIG)/cxx_slice_test: $(PROTOBUF_DEP) $(CXX_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LDXX) $(LDFLAGS) $(CXX_SLICE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/cxx_slice_test
+
+endif
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/cpp/util/slice_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+deps_cxx_slice_test: $(CXX_SLICE_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(CXX_SLICE_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
CXX_TIME_TEST_SRC = \
test/cpp/util/time_test.cc \
@@ -8136,16 +8474,16 @@ $(BINDIR)/$(CONFIG)/qps_driver: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/qps_driver: $(PROTOBUF_DEP) $(QPS_DRIVER_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a
+$(BINDIR)/$(CONFIG)/qps_driver: $(PROTOBUF_DEP) $(QPS_DRIVER_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(QPS_DRIVER_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_driver
+ $(Q) $(LDXX) $(LDFLAGS) $(QPS_DRIVER_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_driver
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_driver.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_driver.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_qps_driver: $(QPS_DRIVER_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -8216,16 +8554,16 @@ $(BINDIR)/$(CONFIG)/qps_test: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/qps_test: $(PROTOBUF_DEP) $(QPS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+$(BINDIR)/$(CONFIG)/qps_test: $(PROTOBUF_DEP) $(QPS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(QPS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_test
+ $(Q) $(LDXX) $(LDFLAGS) $(QPS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_test
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_qps_test: $(QPS_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -8256,16 +8594,16 @@ $(BINDIR)/$(CONFIG)/qps_test_openloop: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/qps_test_openloop: $(PROTOBUF_DEP) $(QPS_TEST_OPENLOOP_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+$(BINDIR)/$(CONFIG)/qps_test_openloop: $(PROTOBUF_DEP) $(QPS_TEST_OPENLOOP_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(QPS_TEST_OPENLOOP_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_test_openloop
+ $(Q) $(LDXX) $(LDFLAGS) $(QPS_TEST_OPENLOOP_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/qps_test_openloop
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_test_openloop.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_test_openloop.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_qps_test_openloop: $(QPS_TEST_OPENLOOP_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -8456,16 +8794,16 @@ $(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test: $(PROTOBUF_DEP) $(SYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test: $(PROTOBUF_DEP) $(SYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(SYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test
+ $(Q) $(LDXX) $(LDFLAGS) $(SYNC_STREAMING_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/sync_streaming_ping_pong_test
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/sync_streaming_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/sync_streaming_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_sync_streaming_ping_pong_test: $(SYNC_STREAMING_PING_PONG_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
@@ -8496,16 +8834,16 @@ $(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test: protobuf_dep_error
else
-$(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test: $(PROTOBUF_DEP) $(SYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test: $(PROTOBUF_DEP) $(SYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) $(LDXX) $(LDFLAGS) $(SYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test
+ $(Q) $(LDXX) $(LDFLAGS) $(SYNC_UNARY_PING_PONG_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/sync_unary_ping_pong_test
endif
endif
-$(OBJDIR)/$(CONFIG)/test/cpp/qps/sync_unary_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++_benchmark_config.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+$(OBJDIR)/$(CONFIG)/test/cpp/qps/sync_unary_ping_pong_test.o: $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_sync_unary_ping_pong_test: $(SYNC_UNARY_PING_PONG_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
diff --git a/build.json b/build.json
index 89607e1a6e..a0ef745244 100644
--- a/build.json
+++ b/build.json
@@ -37,6 +37,7 @@
"include/grpc++/client_context.h",
"include/grpc++/completion_queue.h",
"include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
"include/grpc++/create_channel.h",
"include/grpc++/credentials.h",
"include/grpc++/generic_stub.h",
@@ -44,8 +45,10 @@
"include/grpc++/impl/client_unary_call.h",
"include/grpc++/impl/grpc_library.h",
"include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
"include/grpc++/impl/rpc_method.h",
"include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
"include/grpc++/impl/service_type.h",
"include/grpc++/impl/sync.h",
"include/grpc++/impl/sync_cxx11.h",
@@ -67,14 +70,12 @@
"headers": [
"src/cpp/client/channel.h",
"src/cpp/common/create_auth_context.h",
- "src/cpp/proto/proto_utils.h",
"src/cpp/server/thread_pool.h"
],
"src": [
"src/cpp/client/channel.cc",
"src/cpp/client/channel_arguments.cc",
"src/cpp/client/client_context.cc",
- "src/cpp/client/client_unary_call.cc",
"src/cpp/client/create_channel.cc",
"src/cpp/client/credentials.cc",
"src/cpp/client/generic_stub.cc",
@@ -109,12 +110,14 @@
],
"headers": [
"src/core/census/grpc_context.h",
+ "src/core/channel/census_filter.h",
"src/core/channel/channel_args.h",
"src/core/channel/channel_stack.h",
"src/core/channel/child_channel.h",
"src/core/channel/client_channel.h",
"src/core/channel/client_setup.h",
"src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
"src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
@@ -131,10 +134,11 @@
"src/core/iomgr/iomgr_internal.h",
"src/core/iomgr/iomgr_posix.h",
"src/core/iomgr/pollset.h",
- "src/core/iomgr/pollset_kick.h",
"src/core/iomgr/pollset_kick_posix.h",
- "src/core/iomgr/pollset_kick_windows.h",
"src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.h",
"src/core/iomgr/pollset_windows.h",
"src/core/iomgr/resolve_address.h",
"src/core/iomgr/sockaddr.h",
@@ -178,6 +182,8 @@
"src/core/transport/chttp2/hpack_table.h",
"src/core/transport/chttp2/http2_errors.h",
"src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
"src/core/transport/chttp2/status_conversion.h",
"src/core/transport/chttp2/stream_encoder.h",
"src/core/transport/chttp2/stream_map.h",
@@ -213,10 +219,12 @@
"src/core/iomgr/iomgr.c",
"src/core/iomgr/iomgr_posix.c",
"src/core/iomgr/iomgr_windows.c",
- "src/core/iomgr/pollset_kick.c",
+ "src/core/iomgr/pollset_kick_posix.c",
"src/core/iomgr/pollset_multipoller_with_epoll.c",
"src/core/iomgr/pollset_multipoller_with_poll_posix.c",
"src/core/iomgr/pollset_posix.c",
+ "src/core/iomgr/pollset_set_posix.c",
+ "src/core/iomgr/pollset_set_windows.c",
"src/core/iomgr/pollset_windows.c",
"src/core/iomgr/resolve_address_posix.c",
"src/core/iomgr/resolve_address_windows.c",
@@ -271,11 +279,15 @@
"src/core/transport/chttp2/hpack_parser.c",
"src/core/transport/chttp2/hpack_table.c",
"src/core/transport/chttp2/huffsyms.c",
+ "src/core/transport/chttp2/incoming_metadata.c",
+ "src/core/transport/chttp2/parsing.c",
"src/core/transport/chttp2/status_conversion.c",
"src/core/transport/chttp2/stream_encoder.c",
+ "src/core/transport/chttp2/stream_lists.c",
"src/core/transport/chttp2/stream_map.c",
"src/core/transport/chttp2/timeout_encoding.c",
"src/core/transport/chttp2/varint.c",
+ "src/core/transport/chttp2/writing.c",
"src/core/transport/chttp2_transport.c",
"src/core/transport/metadata.c",
"src/core/transport/stream_op.c",
@@ -285,6 +297,14 @@
},
{
"name": "grpc_test_util_base",
+ "headers": [
+ "test/core/end2end/cq_verifier.h",
+ "test/core/iomgr/endpoint_tests.h",
+ "test/core/util/grpc_profiler.h",
+ "test/core/util/parse_hexstring.h",
+ "test/core/util/port.h",
+ "test/core/util/slice_splitter.h"
+ ],
"src": [
"test/core/end2end/cq_verifier.c",
"test/core/iomgr/endpoint_tests.c",
@@ -462,6 +482,9 @@
"name": "grpc_test_util",
"build": "private",
"language": "c",
+ "headers": [
+ "test/core/end2end/data/ssl_test_data.h"
+ ],
"src": [
"test/core/end2end/data/server1_cert.c",
"test/core/end2end/data/server1_key.c",
@@ -520,6 +543,7 @@
"src/cpp/server/secure_server_credentials.h"
],
"src": [
+ "src/cpp/client/secure_channel_arguments.cc",
"src/cpp/client/secure_credentials.cc",
"src/cpp/common/secure_auth_context.cc",
"src/cpp/common/secure_create_auth_context.cc",
@@ -537,19 +561,12 @@
"vs_project_guid": "{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}"
},
{
- "name": "grpc++_benchmark_config",
- "build": "private",
- "language": "c++",
- "src": [
- "test/cpp/qps/qpstest.proto",
- "test/cpp/qps/report.cc",
- "test/cpp/util/benchmark_config.cc"
- ]
- },
- {
"name": "grpc++_test_config",
"build": "private",
"language": "c++",
+ "headers": [
+ "test/cpp/util/test_config.h"
+ ],
"src": [
"test/cpp/util/test_config.cc"
]
@@ -558,6 +575,12 @@
"name": "grpc++_test_util",
"build": "private",
"language": "c++",
+ "headers": [
+ "test/cpp/util/cli_call.h",
+ "test/cpp/util/create_test_channel.h",
+ "test/cpp/util/fake_credentials.h",
+ "test/cpp/util/subprocess.h"
+ ],
"src": [
"test/cpp/util/messages.proto",
"test/cpp/util/echo.proto",
@@ -566,6 +589,10 @@
"test/cpp/util/create_test_channel.cc",
"test/cpp/util/fake_credentials.cc",
"test/cpp/util/subprocess.cc"
+ ],
+ "deps": [
+ "grpc++",
+ "grpc_test_util"
]
},
{
@@ -594,6 +621,8 @@
"build": "protoc",
"language": "c++",
"headers": [
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
"src/compiler/config.h",
"src/compiler/cpp_generator.h",
"src/compiler/cpp_generator_helpers.h",
@@ -623,6 +652,9 @@
"name": "interop_client_helper",
"build": "private",
"language": "c++",
+ "headers": [
+ "test/cpp/interop/client_helper.h"
+ ],
"src": [
"test/cpp/interop/client_helper.cc"
],
@@ -638,6 +670,9 @@
"name": "interop_client_main",
"build": "private",
"language": "c++",
+ "headers": [
+ "test/cpp/interop/interop_client.h"
+ ],
"src": [
"test/proto/empty.proto",
"test/proto/messages.proto",
@@ -646,6 +681,7 @@
"test/cpp/interop/interop_client.cc"
],
"deps": [
+ "interop_client_helper",
"grpc++_test_util",
"grpc_test_util",
"grpc++",
@@ -659,6 +695,9 @@
"name": "interop_server_helper",
"build": "private",
"language": "c++",
+ "headers": [
+ "test/cpp/interop/server_helper.h"
+ ],
"src": [
"test/cpp/interop/server_helper.cc"
],
@@ -680,6 +719,7 @@
"test/cpp/interop/server.cc"
],
"deps": [
+ "interop_server_helper",
"grpc++_test_util",
"grpc_test_util",
"grpc++",
@@ -693,6 +733,10 @@
"name": "pubsub_client_lib",
"build": "do_not_build",
"language": "c++",
+ "headers": [
+ "examples/pubsub/publisher.h",
+ "examples/pubsub/subscriber.h"
+ ],
"src": [
"examples/pubsub/label.proto",
"examples/pubsub/empty.proto",
@@ -711,25 +755,36 @@
"build": "private",
"language": "c++",
"headers": [
+ "test/cpp/qps/client.h",
"test/cpp/qps/driver.h",
+ "test/cpp/qps/histogram.h",
"test/cpp/qps/interarrival.h",
+ "test/cpp/qps/perf_db_client.h",
"test/cpp/qps/qps_worker.h",
"test/cpp/qps/report.h",
- "test/cpp/qps/timer.h"
+ "test/cpp/qps/server.h",
+ "test/cpp/qps/stats.h",
+ "test/cpp/qps/timer.h",
+ "test/cpp/util/benchmark_config.h"
],
"src": [
"test/cpp/qps/qpstest.proto",
+ "test/cpp/qps/perf_db.proto",
"test/cpp/qps/client_async.cc",
"test/cpp/qps/client_sync.cc",
"test/cpp/qps/driver.cc",
+ "test/cpp/qps/perf_db_client.cc",
"test/cpp/qps/qps_worker.cc",
+ "test/cpp/qps/report.cc",
"test/cpp/qps/server_async.cc",
"test/cpp/qps/server_sync.cc",
- "test/cpp/qps/timer.cc"
+ "test/cpp/qps/timer.cc",
+ "test/cpp/util/benchmark_config.cc"
],
"deps": [
"grpc_test_util",
- "grpc++_test_util"
+ "grpc++_test_util",
+ "grpc++"
]
},
{
@@ -877,6 +932,23 @@
]
},
{
+ "name": "fd_conservation_posix_test",
+ "build": "test",
+ "language": "c",
+ "src": [
+ "test/core/iomgr/fd_conservation_posix_test.c"
+ ],
+ "deps": [
+ "grpc_test_util",
+ "grpc",
+ "gpr_test_util",
+ "gpr"
+ ],
+ "platforms": [
+ "posix"
+ ]
+ },
+ {
"name": "fd_posix_test",
"build": "test",
"language": "c",
@@ -962,10 +1034,9 @@
"build": "tool",
"language": "c",
"src": [
- "src/core/transport/chttp2/gen_hpack_tables.c"
+ "tools/codegen/core/gen_hpack_tables.c"
],
"deps": [
- "grpc_test_util",
"gpr",
"grpc"
]
@@ -1291,6 +1362,20 @@
]
},
{
+ "name": "grpc_security_connector_test",
+ "build": "test",
+ "language": "c",
+ "src": [
+ "test/core/security/security_connector_test.c"
+ ],
+ "deps": [
+ "grpc_test_util",
+ "grpc",
+ "gpr_test_util",
+ "gpr"
+ ]
+ },
+ {
"name": "grpc_stream_op_test",
"build": "test",
"language": "c",
@@ -1475,6 +1560,20 @@
]
},
{
+ "name": "multiple_server_queues_test",
+ "build": "test",
+ "language": "c",
+ "src": [
+ "test/core/end2end/multiple_server_queues_test.c"
+ ],
+ "deps": [
+ "grpc_test_util",
+ "grpc",
+ "gpr_test_util",
+ "gpr"
+ ]
+ },
+ {
"name": "murmur_hash_test",
"build": "test",
"language": "c",
@@ -1720,7 +1819,6 @@
"deps": [
"qps",
"grpc++_test_util",
- "grpc++_benchmark_config",
"grpc_test_util",
"grpc++",
"grpc",
@@ -1738,7 +1836,6 @@
"deps": [
"qps",
"grpc++_test_util",
- "grpc++_benchmark_config",
"grpc_test_util",
"grpc++",
"grpc",
@@ -1822,6 +1919,36 @@
]
},
{
+ "name": "cxx_byte_buffer_test",
+ "build": "test",
+ "language": "c++",
+ "src": [
+ "test/cpp/util/byte_buffer_test.cc"
+ ],
+ "deps": [
+ "grpc_test_util",
+ "grpc++",
+ "grpc",
+ "gpr_test_util",
+ "gpr"
+ ]
+ },
+ {
+ "name": "cxx_slice_test",
+ "build": "test",
+ "language": "c++",
+ "src": [
+ "test/cpp/util/slice_test.cc"
+ ],
+ "deps": [
+ "grpc_test_util",
+ "grpc++",
+ "grpc",
+ "gpr_test_util",
+ "gpr"
+ ]
+ },
+ {
"name": "cxx_time_test",
"build": "test",
"language": "c++",
@@ -2084,8 +2211,7 @@
"grpc",
"gpr_test_util",
"gpr",
- "grpc++_test_config",
- "grpc++_benchmark_config"
+ "grpc++_test_config"
]
},
{
@@ -2116,7 +2242,6 @@
"deps": [
"qps",
"grpc++_test_util",
- "grpc++_benchmark_config",
"grpc_test_util",
"grpc++",
"grpc",
@@ -2135,7 +2260,6 @@
"deps": [
"qps",
"grpc++_test_util",
- "grpc++_benchmark_config",
"grpc_test_util",
"grpc++",
"grpc",
@@ -2224,7 +2348,6 @@
"deps": [
"qps",
"grpc++_test_util",
- "grpc++_benchmark_config",
"grpc_test_util",
"grpc++",
"grpc",
@@ -2242,7 +2365,6 @@
"deps": [
"qps",
"grpc++_test_util",
- "grpc++_benchmark_config",
"grpc_test_util",
"grpc++",
"grpc",
diff --git a/gRPC.podspec b/gRPC.podspec
index 19f69d308a..138cf96fd0 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -1,3 +1,37 @@
+# GRPC CocoaPods podspec
+# This file has been automatically generated from a template file.
+# Please look at the templates directory instead.
+# This file can be regenerated from the template by running
+# tools/buildgen/generate_projects.sh
+
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Pod::Spec.new do |s|
@@ -15,32 +49,435 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.8'
s.requires_arc = true
+ objc_dir = 'src/objective-c'
+
# Reactive Extensions library for iOS.
- s.subspec 'RxLibrary' do |rs|
- rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
- 'src/objective-c/RxLibrary/transformations/*.{h,m}',
- 'src/objective-c/RxLibrary/private/*.{h,m}'
- rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
+ s.subspec 'RxLibrary' do |ss|
+ src_dir = "#{objc_dir}/RxLibrary"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
end
# Core cross-platform gRPC library, written in C.
- s.subspec 'C-Core' do |cs|
- cs.source_files = 'src/core/support/env.h', 'src/core/support/file.h', 'src/core/support/murmur_hash.h', 'src/core/support/grpc_string.h', 'src/core/support/string_win32.h', 'src/core/support/thd_internal.h', 'include/grpc/support/alloc.h', 'include/grpc/support/atm.h', 'include/grpc/support/atm_gcc_atomic.h', 'include/grpc/support/atm_gcc_sync.h', 'include/grpc/support/atm_win32.h', 'include/grpc/support/cancellable_platform.h', 'include/grpc/support/cmdline.h', 'include/grpc/support/cpu.h', 'include/grpc/support/histogram.h', 'include/grpc/support/host_port.h', 'include/grpc/support/log.h', 'include/grpc/support/log_win32.h', 'include/grpc/support/port_platform.h', 'include/grpc/support/slice.h', 'include/grpc/support/slice_buffer.h', 'include/grpc/support/string_util.h', 'include/grpc/support/subprocess.h', 'include/grpc/support/sync.h', 'include/grpc/support/sync_generic.h', 'include/grpc/support/sync_posix.h', 'include/grpc/support/sync_win32.h', 'include/grpc/support/thd.h', 'include/grpc/support/grpc_time.h', 'include/grpc/support/tls.h', 'include/grpc/support/tls_gcc.h', 'include/grpc/support/tls_msvc.h', 'include/grpc/support/tls_pthread.h', 'include/grpc/support/useful.h', 'src/core/support/alloc.c', 'src/core/support/cancellable.c', 'src/core/support/cmdline.c', 'src/core/support/cpu_iphone.c', 'src/core/support/cpu_linux.c', 'src/core/support/cpu_posix.c', 'src/core/support/cpu_windows.c', 'src/core/support/env_linux.c', 'src/core/support/env_posix.c', 'src/core/support/env_win32.c', 'src/core/support/file.c', 'src/core/support/file_posix.c', 'src/core/support/file_win32.c', 'src/core/support/histogram.c', 'src/core/support/host_port.c', 'src/core/support/log.c', 'src/core/support/log_android.c', 'src/core/support/log_linux.c', 'src/core/support/log_posix.c', 'src/core/support/log_win32.c', 'src/core/support/murmur_hash.c', 'src/core/support/slice.c', 'src/core/support/slice_buffer.c', 'src/core/support/string.c', 'src/core/support/string_posix.c', 'src/core/support/string_win32.c', 'src/core/support/subprocess_posix.c', 'src/core/support/sync.c', 'src/core/support/sync_posix.c', 'src/core/support/sync_win32.c', 'src/core/support/thd.c', 'src/core/support/thd_posix.c', 'src/core/support/thd_win32.c', 'src/core/support/time.c', 'src/core/support/time_posix.c', 'src/core/support/time_win32.c', 'src/core/support/tls_pthread.c', 'src/core/httpcli/format_request.h', 'src/core/httpcli/httpcli.h', 'src/core/httpcli/httpcli_security_connector.h', 'src/core/httpcli/parser.h', 'src/core/security/auth_filters.h', 'src/core/security/base64.h', 'src/core/security/credentials.h', 'src/core/security/json_token.h', 'src/core/security/secure_endpoint.h', 'src/core/security/secure_transport_setup.h', 'src/core/security/security_connector.h', 'src/core/security/security_context.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/census/grpc_context.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', 'src/core/channel/child_channel.h', 'src/core/channel/client_channel.h', 'src/core/channel/client_setup.h', 'src/core/channel/connected_channel.h', 'src/core/channel/http_client_filter.h', 'src/core/channel/http_server_filter.h', 'src/core/channel/noop_filter.h', 'src/core/compression/message_compress.h', 'src/core/debug/trace.h', 'src/core/iomgr/alarm.h', 'src/core/iomgr/alarm_heap.h', 'src/core/iomgr/alarm_internal.h', 'src/core/iomgr/endpoint.h', 'src/core/iomgr/endpoint_pair.h', 'src/core/iomgr/fd_posix.h', 'src/core/iomgr/iocp_windows.h', 'src/core/iomgr/iomgr.h', 'src/core/iomgr/iomgr_internal.h', 'src/core/iomgr/iomgr_posix.h', 'src/core/iomgr/pollset.h', 'src/core/iomgr/pollset_kick.h', 'src/core/iomgr/pollset_kick_posix.h', 'src/core/iomgr/pollset_kick_windows.h', 'src/core/iomgr/pollset_posix.h', 'src/core/iomgr/pollset_windows.h', 'src/core/iomgr/resolve_address.h', 'src/core/iomgr/sockaddr.h', 'src/core/iomgr/sockaddr_posix.h', 'src/core/iomgr/sockaddr_utils.h', 'src/core/iomgr/sockaddr_win32.h', 'src/core/iomgr/socket_utils_posix.h', 'src/core/iomgr/socket_windows.h', 'src/core/iomgr/tcp_client.h', 'src/core/iomgr/tcp_posix.h', 'src/core/iomgr/tcp_server.h', 'src/core/iomgr/tcp_windows.h', 'src/core/iomgr/time_averaged_stats.h', 'src/core/iomgr/wakeup_fd_pipe.h', 'src/core/iomgr/wakeup_fd_posix.h', 'src/core/json/json.h', 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', 'src/core/profiling/timers.h', 'src/core/profiling/timers_preciseclock.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', 'src/core/surface/client.h', 'src/core/surface/completion_queue.h', 'src/core/surface/event_string.h', 'src/core/surface/init.h', 'src/core/surface/server.h', 'src/core/surface/surface_trace.h', 'src/core/transport/chttp2/alpn.h', 'src/core/transport/chttp2/bin_encoder.h', 'src/core/transport/chttp2/frame.h', 'src/core/transport/chttp2/frame_data.h', 'src/core/transport/chttp2/frame_goaway.h', 'src/core/transport/chttp2/frame_ping.h', 'src/core/transport/chttp2/frame_rst_stream.h', 'src/core/transport/chttp2/frame_settings.h', 'src/core/transport/chttp2/frame_window_update.h', 'src/core/transport/chttp2/hpack_parser.h', 'src/core/transport/chttp2/hpack_table.h', 'src/core/transport/chttp2/http2_errors.h', 'src/core/transport/chttp2/huffsyms.h', 'src/core/transport/chttp2/status_conversion.h', 'src/core/transport/chttp2/stream_encoder.h', 'src/core/transport/chttp2/stream_map.h', 'src/core/transport/chttp2/timeout_encoding.h', 'src/core/transport/chttp2/varint.h', 'src/core/transport/chttp2_transport.h', 'src/core/transport/metadata.h', 'src/core/transport/stream_op.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', 'src/core/census/context.h', 'include/grpc/grpc_security.h', 'include/grpc/byte_buffer.h', 'include/grpc/byte_buffer_reader.h', 'include/grpc/compression.h', 'include/grpc/grpc.h', 'include/grpc/status.h', 'include/grpc/census.h', 'src/core/httpcli/format_request.c', 'src/core/httpcli/httpcli.c', 'src/core/httpcli/httpcli_security_connector.c', 'src/core/httpcli/parser.c', 'src/core/security/base64.c', 'src/core/security/client_auth_filter.c', 'src/core/security/credentials.c', 'src/core/security/credentials_metadata.c', 'src/core/security/credentials_posix.c', 'src/core/security/credentials_win32.c', 'src/core/security/google_default_credentials.c', 'src/core/security/json_token.c', 'src/core/security/secure_endpoint.c', 'src/core/security/secure_transport_setup.c', 'src/core/security/security_connector.c', 'src/core/security/security_context.c', 'src/core/security/server_auth_filter.c', 'src/core/security/server_secure_chttp2.c', 'src/core/surface/init_secure.c', 'src/core/surface/secure_channel_create.c', 'src/core/tsi/fake_transport_security.c', 'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/transport_security.c', 'src/core/census/grpc_context.c', 'src/core/channel/channel_args.c', 'src/core/channel/channel_stack.c', 'src/core/channel/child_channel.c', 'src/core/channel/client_channel.c', 'src/core/channel/client_setup.c', 'src/core/channel/connected_channel.c', 'src/core/channel/http_client_filter.c', 'src/core/channel/http_server_filter.c', 'src/core/channel/noop_filter.c', 'src/core/compression/algorithm.c', 'src/core/compression/message_compress.c', 'src/core/debug/trace.c', 'src/core/iomgr/alarm.c', 'src/core/iomgr/alarm_heap.c', 'src/core/iomgr/endpoint.c', 'src/core/iomgr/endpoint_pair_posix.c', 'src/core/iomgr/endpoint_pair_windows.c', 'src/core/iomgr/fd_posix.c', 'src/core/iomgr/iocp_windows.c', 'src/core/iomgr/iomgr.c', 'src/core/iomgr/iomgr_posix.c', 'src/core/iomgr/iomgr_windows.c', 'src/core/iomgr/pollset_kick.c', 'src/core/iomgr/pollset_multipoller_with_epoll.c', 'src/core/iomgr/pollset_multipoller_with_poll_posix.c', 'src/core/iomgr/pollset_posix.c', 'src/core/iomgr/pollset_windows.c', 'src/core/iomgr/resolve_address_posix.c', 'src/core/iomgr/resolve_address_windows.c', 'src/core/iomgr/sockaddr_utils.c', 'src/core/iomgr/socket_utils_common_posix.c', 'src/core/iomgr/socket_utils_linux.c', 'src/core/iomgr/socket_utils_posix.c', 'src/core/iomgr/socket_windows.c', 'src/core/iomgr/tcp_client_posix.c', 'src/core/iomgr/tcp_client_windows.c', 'src/core/iomgr/tcp_posix.c', 'src/core/iomgr/tcp_server_posix.c', 'src/core/iomgr/tcp_server_windows.c', 'src/core/iomgr/tcp_windows.c', 'src/core/iomgr/time_averaged_stats.c', 'src/core/iomgr/wakeup_fd_eventfd.c', 'src/core/iomgr/wakeup_fd_nospecial.c', 'src/core/iomgr/wakeup_fd_pipe.c', 'src/core/iomgr/wakeup_fd_posix.c', 'src/core/json/json.c', 'src/core/json/json_reader.c', 'src/core/json/json_string.c', 'src/core/json/json_writer.c', 'src/core/profiling/basic_timers.c', 'src/core/profiling/stap_timers.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_queue.c', 'src/core/surface/byte_buffer_reader.c', 'src/core/surface/call.c', 'src/core/surface/call_details.c', 'src/core/surface/call_log_batch.c', 'src/core/surface/channel.c', 'src/core/surface/channel_create.c', 'src/core/surface/client.c', 'src/core/surface/completion_queue.c', 'src/core/surface/event_string.c', 'src/core/surface/init.c', 'src/core/surface/lame_client.c', 'src/core/surface/metadata_array.c', 'src/core/surface/server.c', 'src/core/surface/server_chttp2.c', 'src/core/surface/server_create.c', 'src/core/surface/surface_trace.c', 'src/core/transport/chttp2/alpn.c', 'src/core/transport/chttp2/bin_encoder.c', 'src/core/transport/chttp2/frame_data.c', 'src/core/transport/chttp2/frame_goaway.c', 'src/core/transport/chttp2/frame_ping.c', 'src/core/transport/chttp2/frame_rst_stream.c', 'src/core/transport/chttp2/frame_settings.c', 'src/core/transport/chttp2/frame_window_update.c', 'src/core/transport/chttp2/hpack_parser.c', 'src/core/transport/chttp2/hpack_table.c', 'src/core/transport/chttp2/huffsyms.c', 'src/core/transport/chttp2/status_conversion.c', 'src/core/transport/chttp2/stream_encoder.c', 'src/core/transport/chttp2/stream_map.c', 'src/core/transport/chttp2/timeout_encoding.c', 'src/core/transport/chttp2/varint.c', 'src/core/transport/chttp2_transport.c', 'src/core/transport/metadata.c', 'src/core/transport/stream_op.c', 'src/core/transport/transport.c', 'src/core/transport/transport_op_string.c', 'src/core/census/context.c', 'src/core/census/initialize.c',
- cs.private_header_files = 'src/core/support/env.h', 'src/core/support/file.h', 'src/core/support/murmur_hash.h', 'src/core/support/string.h', 'src/core/support/string_win32.h', 'src/core/support/thd_internal.h', 'src/core/httpcli/format_request.h', 'src/core/httpcli/httpcli.h', 'src/core/httpcli/httpcli_security_connector.h', 'src/core/httpcli/parser.h', 'src/core/security/auth_filters.h', 'src/core/security/base64.h', 'src/core/security/credentials.h', 'src/core/security/json_token.h', 'src/core/security/secure_endpoint.h', 'src/core/security/secure_transport_setup.h', 'src/core/security/security_connector.h', 'src/core/security/security_context.h', 'src/core/tsi/fake_transport_security.h', 'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', 'src/core/census/grpc_context.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', 'src/core/channel/child_channel.h', 'src/core/channel/client_channel.h', 'src/core/channel/client_setup.h', 'src/core/channel/connected_channel.h', 'src/core/channel/http_client_filter.h', 'src/core/channel/http_server_filter.h', 'src/core/channel/noop_filter.h', 'src/core/compression/message_compress.h', 'src/core/debug/trace.h', 'src/core/iomgr/alarm.h', 'src/core/iomgr/alarm_heap.h', 'src/core/iomgr/alarm_internal.h', 'src/core/iomgr/endpoint.h', 'src/core/iomgr/endpoint_pair.h', 'src/core/iomgr/fd_posix.h', 'src/core/iomgr/iocp_windows.h', 'src/core/iomgr/iomgr.h', 'src/core/iomgr/iomgr_internal.h', 'src/core/iomgr/iomgr_posix.h', 'src/core/iomgr/pollset.h', 'src/core/iomgr/pollset_kick.h', 'src/core/iomgr/pollset_kick_posix.h', 'src/core/iomgr/pollset_kick_windows.h', 'src/core/iomgr/pollset_posix.h', 'src/core/iomgr/pollset_windows.h', 'src/core/iomgr/resolve_address.h', 'src/core/iomgr/sockaddr.h', 'src/core/iomgr/sockaddr_posix.h', 'src/core/iomgr/sockaddr_utils.h', 'src/core/iomgr/sockaddr_win32.h', 'src/core/iomgr/socket_utils_posix.h', 'src/core/iomgr/socket_windows.h', 'src/core/iomgr/tcp_client.h', 'src/core/iomgr/tcp_posix.h', 'src/core/iomgr/tcp_server.h', 'src/core/iomgr/tcp_windows.h', 'src/core/iomgr/time_averaged_stats.h', 'src/core/iomgr/wakeup_fd_pipe.h', 'src/core/iomgr/wakeup_fd_posix.h', 'src/core/json/json.h', 'src/core/json/json_common.h', 'src/core/json/json_reader.h', 'src/core/json/json_writer.h', 'src/core/profiling/timers.h', 'src/core/profiling/timers_preciseclock.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', 'src/core/surface/client.h', 'src/core/surface/completion_queue.h', 'src/core/surface/event_string.h', 'src/core/surface/init.h', 'src/core/surface/server.h', 'src/core/surface/surface_trace.h', 'src/core/transport/chttp2/alpn.h', 'src/core/transport/chttp2/bin_encoder.h', 'src/core/transport/chttp2/frame.h', 'src/core/transport/chttp2/frame_data.h', 'src/core/transport/chttp2/frame_goaway.h', 'src/core/transport/chttp2/frame_ping.h', 'src/core/transport/chttp2/frame_rst_stream.h', 'src/core/transport/chttp2/frame_settings.h', 'src/core/transport/chttp2/frame_window_update.h', 'src/core/transport/chttp2/hpack_parser.h', 'src/core/transport/chttp2/hpack_table.h', 'src/core/transport/chttp2/http2_errors.h', 'src/core/transport/chttp2/huffsyms.h', 'src/core/transport/chttp2/status_conversion.h', 'src/core/transport/chttp2/stream_encoder.h', 'src/core/transport/chttp2/stream_map.h', 'src/core/transport/chttp2/timeout_encoding.h', 'src/core/transport/chttp2/varint.h', 'src/core/transport/chttp2_transport.h', 'src/core/transport/metadata.h', 'src/core/transport/stream_op.h', 'src/core/transport/transport.h', 'src/core/transport/transport_impl.h', 'src/core/census/context.h',
- cs.header_mappings_dir = '.'
- # The core library includes its headers as either "src/core/..." or "grpc/...", meaning we have
- # to tell XCode to look for headers under the "include" subdirectory too.
- #
- # TODO(jcanizales): Instead of doing this, during installation move everything under
- # "include/grpc" one directory up. The directory names under PODS_ROOT are implementation
- # details of Cocoapods, and have changed in the past, breaking this podspec.
- cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC" ' +
- '"$(PODS_ROOT)/Headers/Private/gRPC/include"' }
- cs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
-
- cs.requires_arc = false
- cs.libraries = 'z'
- cs.dependency 'OpenSSL', '~> 1.0.200'
+ s.subspec 'C-Core' do |ss|
+ ss.source_files = 'src/core/support/env.h',
+ 'src/core/support/file.h',
+ 'src/core/support/murmur_hash.h',
+ 'src/core/support/grpc_string.h',
+ 'src/core/support/string_win32.h',
+ 'src/core/support/thd_internal.h',
+ 'grpc/support/alloc.h',
+ 'grpc/support/atm.h',
+ 'grpc/support/atm_gcc_atomic.h',
+ 'grpc/support/atm_gcc_sync.h',
+ 'grpc/support/atm_win32.h',
+ 'grpc/support/cancellable_platform.h',
+ 'grpc/support/cmdline.h',
+ 'grpc/support/cpu.h',
+ 'grpc/support/histogram.h',
+ 'grpc/support/host_port.h',
+ 'grpc/support/log.h',
+ 'grpc/support/log_win32.h',
+ 'grpc/support/port_platform.h',
+ 'grpc/support/slice.h',
+ 'grpc/support/slice_buffer.h',
+ 'grpc/support/string_util.h',
+ 'grpc/support/subprocess.h',
+ 'grpc/support/sync.h',
+ 'grpc/support/sync_generic.h',
+ 'grpc/support/sync_posix.h',
+ 'grpc/support/sync_win32.h',
+ 'grpc/support/thd.h',
+ 'grpc/support/grpc_time.h',
+ 'grpc/support/tls.h',
+ 'grpc/support/tls_gcc.h',
+ 'grpc/support/tls_msvc.h',
+ 'grpc/support/tls_pthread.h',
+ 'grpc/support/useful.h',
+ 'src/core/support/alloc.c',
+ 'src/core/support/cancellable.c',
+ 'src/core/support/cmdline.c',
+ 'src/core/support/cpu_iphone.c',
+ 'src/core/support/cpu_linux.c',
+ 'src/core/support/cpu_posix.c',
+ 'src/core/support/cpu_windows.c',
+ 'src/core/support/env_linux.c',
+ 'src/core/support/env_posix.c',
+ 'src/core/support/env_win32.c',
+ 'src/core/support/file.c',
+ 'src/core/support/file_posix.c',
+ 'src/core/support/file_win32.c',
+ 'src/core/support/histogram.c',
+ 'src/core/support/host_port.c',
+ 'src/core/support/log.c',
+ 'src/core/support/log_android.c',
+ 'src/core/support/log_linux.c',
+ 'src/core/support/log_posix.c',
+ 'src/core/support/log_win32.c',
+ 'src/core/support/murmur_hash.c',
+ 'src/core/support/slice.c',
+ 'src/core/support/slice_buffer.c',
+ 'src/core/support/string.c',
+ 'src/core/support/string_posix.c',
+ 'src/core/support/string_win32.c',
+ 'src/core/support/subprocess_posix.c',
+ 'src/core/support/sync.c',
+ 'src/core/support/sync_posix.c',
+ 'src/core/support/sync_win32.c',
+ 'src/core/support/thd.c',
+ 'src/core/support/thd_posix.c',
+ 'src/core/support/thd_win32.c',
+ 'src/core/support/time.c',
+ 'src/core/support/time_posix.c',
+ 'src/core/support/time_win32.c',
+ 'src/core/support/tls_pthread.c',
+ 'src/core/httpcli/format_request.h',
+ 'src/core/httpcli/httpcli.h',
+ 'src/core/httpcli/httpcli_security_connector.h',
+ 'src/core/httpcli/parser.h',
+ 'src/core/security/auth_filters.h',
+ 'src/core/security/base64.h',
+ 'src/core/security/credentials.h',
+ 'src/core/security/json_token.h',
+ 'src/core/security/secure_endpoint.h',
+ 'src/core/security/secure_transport_setup.h',
+ 'src/core/security/security_connector.h',
+ 'src/core/security/security_context.h',
+ 'src/core/tsi/fake_transport_security.h',
+ 'src/core/tsi/ssl_transport_security.h',
+ 'src/core/tsi/transport_security.h',
+ 'src/core/tsi/transport_security_interface.h',
+ 'src/core/census/grpc_context.h',
+ 'src/core/channel/census_filter.h',
+ 'src/core/channel/channel_args.h',
+ 'src/core/channel/channel_stack.h',
+ 'src/core/channel/child_channel.h',
+ 'src/core/channel/client_channel.h',
+ 'src/core/channel/client_setup.h',
+ 'src/core/channel/connected_channel.h',
+ 'src/core/channel/context.h',
+ 'src/core/channel/http_client_filter.h',
+ 'src/core/channel/http_server_filter.h',
+ 'src/core/channel/noop_filter.h',
+ 'src/core/compression/message_compress.h',
+ 'src/core/debug/trace.h',
+ 'src/core/iomgr/alarm.h',
+ 'src/core/iomgr/alarm_heap.h',
+ 'src/core/iomgr/alarm_internal.h',
+ 'src/core/iomgr/endpoint.h',
+ 'src/core/iomgr/endpoint_pair.h',
+ 'src/core/iomgr/fd_posix.h',
+ 'src/core/iomgr/iocp_windows.h',
+ 'src/core/iomgr/iomgr.h',
+ 'src/core/iomgr/iomgr_internal.h',
+ 'src/core/iomgr/iomgr_posix.h',
+ 'src/core/iomgr/pollset.h',
+ 'src/core/iomgr/pollset_kick_posix.h',
+ 'src/core/iomgr/pollset_posix.h',
+ 'src/core/iomgr/pollset_set.h',
+ 'src/core/iomgr/pollset_set_posix.h',
+ 'src/core/iomgr/pollset_set_windows.h',
+ 'src/core/iomgr/pollset_windows.h',
+ 'src/core/iomgr/resolve_address.h',
+ 'src/core/iomgr/sockaddr.h',
+ 'src/core/iomgr/sockaddr_posix.h',
+ 'src/core/iomgr/sockaddr_utils.h',
+ 'src/core/iomgr/sockaddr_win32.h',
+ 'src/core/iomgr/socket_utils_posix.h',
+ 'src/core/iomgr/socket_windows.h',
+ 'src/core/iomgr/tcp_client.h',
+ 'src/core/iomgr/tcp_posix.h',
+ 'src/core/iomgr/tcp_server.h',
+ 'src/core/iomgr/tcp_windows.h',
+ 'src/core/iomgr/time_averaged_stats.h',
+ 'src/core/iomgr/wakeup_fd_pipe.h',
+ 'src/core/iomgr/wakeup_fd_posix.h',
+ 'src/core/json/json.h',
+ 'src/core/json/json_common.h',
+ 'src/core/json/json_reader.h',
+ 'src/core/json/json_writer.h',
+ 'src/core/profiling/timers.h',
+ 'src/core/profiling/timers_preciseclock.h',
+ 'src/core/surface/byte_buffer_queue.h',
+ 'src/core/surface/call.h',
+ 'src/core/surface/channel.h',
+ 'src/core/surface/client.h',
+ 'src/core/surface/completion_queue.h',
+ 'src/core/surface/event_string.h',
+ 'src/core/surface/init.h',
+ 'src/core/surface/server.h',
+ 'src/core/surface/surface_trace.h',
+ 'src/core/transport/chttp2/alpn.h',
+ 'src/core/transport/chttp2/bin_encoder.h',
+ 'src/core/transport/chttp2/frame.h',
+ 'src/core/transport/chttp2/frame_data.h',
+ 'src/core/transport/chttp2/frame_goaway.h',
+ 'src/core/transport/chttp2/frame_ping.h',
+ 'src/core/transport/chttp2/frame_rst_stream.h',
+ 'src/core/transport/chttp2/frame_settings.h',
+ 'src/core/transport/chttp2/frame_window_update.h',
+ 'src/core/transport/chttp2/hpack_parser.h',
+ 'src/core/transport/chttp2/hpack_table.h',
+ 'src/core/transport/chttp2/http2_errors.h',
+ 'src/core/transport/chttp2/huffsyms.h',
+ 'src/core/transport/chttp2/incoming_metadata.h',
+ 'src/core/transport/chttp2/internal.h',
+ 'src/core/transport/chttp2/status_conversion.h',
+ 'src/core/transport/chttp2/stream_encoder.h',
+ 'src/core/transport/chttp2/stream_map.h',
+ 'src/core/transport/chttp2/timeout_encoding.h',
+ 'src/core/transport/chttp2/varint.h',
+ 'src/core/transport/chttp2_transport.h',
+ 'src/core/transport/metadata.h',
+ 'src/core/transport/stream_op.h',
+ 'src/core/transport/transport.h',
+ 'src/core/transport/transport_impl.h',
+ 'src/core/census/context.h',
+ 'grpc/grpc_security.h',
+ 'grpc/byte_buffer.h',
+ 'grpc/byte_buffer_reader.h',
+ 'grpc/compression.h',
+ 'grpc/grpc.h',
+ 'grpc/status.h',
+ 'grpc/census.h',
+ 'src/core/httpcli/format_request.c',
+ 'src/core/httpcli/httpcli.c',
+ 'src/core/httpcli/httpcli_security_connector.c',
+ 'src/core/httpcli/parser.c',
+ 'src/core/security/base64.c',
+ 'src/core/security/client_auth_filter.c',
+ 'src/core/security/credentials.c',
+ 'src/core/security/credentials_metadata.c',
+ 'src/core/security/credentials_posix.c',
+ 'src/core/security/credentials_win32.c',
+ 'src/core/security/google_default_credentials.c',
+ 'src/core/security/json_token.c',
+ 'src/core/security/secure_endpoint.c',
+ 'src/core/security/secure_transport_setup.c',
+ 'src/core/security/security_connector.c',
+ 'src/core/security/security_context.c',
+ 'src/core/security/server_auth_filter.c',
+ 'src/core/security/server_secure_chttp2.c',
+ 'src/core/surface/init_secure.c',
+ 'src/core/surface/secure_channel_create.c',
+ 'src/core/tsi/fake_transport_security.c',
+ 'src/core/tsi/ssl_transport_security.c',
+ 'src/core/tsi/transport_security.c',
+ 'src/core/census/grpc_context.c',
+ 'src/core/channel/channel_args.c',
+ 'src/core/channel/channel_stack.c',
+ 'src/core/channel/child_channel.c',
+ 'src/core/channel/client_channel.c',
+ 'src/core/channel/client_setup.c',
+ 'src/core/channel/connected_channel.c',
+ 'src/core/channel/http_client_filter.c',
+ 'src/core/channel/http_server_filter.c',
+ 'src/core/channel/noop_filter.c',
+ 'src/core/compression/algorithm.c',
+ 'src/core/compression/message_compress.c',
+ 'src/core/debug/trace.c',
+ 'src/core/iomgr/alarm.c',
+ 'src/core/iomgr/alarm_heap.c',
+ 'src/core/iomgr/endpoint.c',
+ 'src/core/iomgr/endpoint_pair_posix.c',
+ 'src/core/iomgr/endpoint_pair_windows.c',
+ 'src/core/iomgr/fd_posix.c',
+ 'src/core/iomgr/iocp_windows.c',
+ 'src/core/iomgr/iomgr.c',
+ 'src/core/iomgr/iomgr_posix.c',
+ 'src/core/iomgr/iomgr_windows.c',
+ 'src/core/iomgr/pollset_kick_posix.c',
+ 'src/core/iomgr/pollset_multipoller_with_epoll.c',
+ 'src/core/iomgr/pollset_multipoller_with_poll_posix.c',
+ 'src/core/iomgr/pollset_posix.c',
+ 'src/core/iomgr/pollset_set_posix.c',
+ 'src/core/iomgr/pollset_set_windows.c',
+ 'src/core/iomgr/pollset_windows.c',
+ 'src/core/iomgr/resolve_address_posix.c',
+ 'src/core/iomgr/resolve_address_windows.c',
+ 'src/core/iomgr/sockaddr_utils.c',
+ 'src/core/iomgr/socket_utils_common_posix.c',
+ 'src/core/iomgr/socket_utils_linux.c',
+ 'src/core/iomgr/socket_utils_posix.c',
+ 'src/core/iomgr/socket_windows.c',
+ 'src/core/iomgr/tcp_client_posix.c',
+ 'src/core/iomgr/tcp_client_windows.c',
+ 'src/core/iomgr/tcp_posix.c',
+ 'src/core/iomgr/tcp_server_posix.c',
+ 'src/core/iomgr/tcp_server_windows.c',
+ 'src/core/iomgr/tcp_windows.c',
+ 'src/core/iomgr/time_averaged_stats.c',
+ 'src/core/iomgr/wakeup_fd_eventfd.c',
+ 'src/core/iomgr/wakeup_fd_nospecial.c',
+ 'src/core/iomgr/wakeup_fd_pipe.c',
+ 'src/core/iomgr/wakeup_fd_posix.c',
+ 'src/core/json/json.c',
+ 'src/core/json/json_reader.c',
+ 'src/core/json/json_string.c',
+ 'src/core/json/json_writer.c',
+ 'src/core/profiling/basic_timers.c',
+ 'src/core/profiling/stap_timers.c',
+ 'src/core/surface/byte_buffer.c',
+ 'src/core/surface/byte_buffer_queue.c',
+ 'src/core/surface/byte_buffer_reader.c',
+ 'src/core/surface/call.c',
+ 'src/core/surface/call_details.c',
+ 'src/core/surface/call_log_batch.c',
+ 'src/core/surface/channel.c',
+ 'src/core/surface/channel_create.c',
+ 'src/core/surface/client.c',
+ 'src/core/surface/completion_queue.c',
+ 'src/core/surface/event_string.c',
+ 'src/core/surface/init.c',
+ 'src/core/surface/lame_client.c',
+ 'src/core/surface/metadata_array.c',
+ 'src/core/surface/server.c',
+ 'src/core/surface/server_chttp2.c',
+ 'src/core/surface/server_create.c',
+ 'src/core/surface/surface_trace.c',
+ 'src/core/transport/chttp2/alpn.c',
+ 'src/core/transport/chttp2/bin_encoder.c',
+ 'src/core/transport/chttp2/frame_data.c',
+ 'src/core/transport/chttp2/frame_goaway.c',
+ 'src/core/transport/chttp2/frame_ping.c',
+ 'src/core/transport/chttp2/frame_rst_stream.c',
+ 'src/core/transport/chttp2/frame_settings.c',
+ 'src/core/transport/chttp2/frame_window_update.c',
+ 'src/core/transport/chttp2/hpack_parser.c',
+ 'src/core/transport/chttp2/hpack_table.c',
+ 'src/core/transport/chttp2/huffsyms.c',
+ 'src/core/transport/chttp2/incoming_metadata.c',
+ 'src/core/transport/chttp2/parsing.c',
+ 'src/core/transport/chttp2/status_conversion.c',
+ 'src/core/transport/chttp2/stream_encoder.c',
+ 'src/core/transport/chttp2/stream_lists.c',
+ 'src/core/transport/chttp2/stream_map.c',
+ 'src/core/transport/chttp2/timeout_encoding.c',
+ 'src/core/transport/chttp2/varint.c',
+ 'src/core/transport/chttp2/writing.c',
+ 'src/core/transport/chttp2_transport.c',
+ 'src/core/transport/metadata.c',
+ 'src/core/transport/stream_op.c',
+ 'src/core/transport/transport.c',
+ 'src/core/transport/transport_op_string.c',
+ 'src/core/census/context.c',
+ 'src/core/census/initialize.c'
+
+ ss.private_header_files = 'src/core/support/env.h',
+ 'src/core/support/file.h',
+ 'src/core/support/murmur_hash.h',
+ 'src/core/support/string.h',
+ 'src/core/support/string_win32.h',
+ 'src/core/support/thd_internal.h',
+ 'src/core/httpcli/format_request.h',
+ 'src/core/httpcli/httpcli.h',
+ 'src/core/httpcli/httpcli_security_connector.h',
+ 'src/core/httpcli/parser.h',
+ 'src/core/security/auth_filters.h',
+ 'src/core/security/base64.h',
+ 'src/core/security/credentials.h',
+ 'src/core/security/json_token.h',
+ 'src/core/security/secure_endpoint.h',
+ 'src/core/security/secure_transport_setup.h',
+ 'src/core/security/security_connector.h',
+ 'src/core/security/security_context.h',
+ 'src/core/tsi/fake_transport_security.h',
+ 'src/core/tsi/ssl_transport_security.h',
+ 'src/core/tsi/transport_security.h',
+ 'src/core/tsi/transport_security_interface.h',
+ 'src/core/census/grpc_context.h',
+ 'src/core/channel/census_filter.h',
+ 'src/core/channel/channel_args.h',
+ 'src/core/channel/channel_stack.h',
+ 'src/core/channel/child_channel.h',
+ 'src/core/channel/client_channel.h',
+ 'src/core/channel/client_setup.h',
+ 'src/core/channel/connected_channel.h',
+ 'src/core/channel/context.h',
+ 'src/core/channel/http_client_filter.h',
+ 'src/core/channel/http_server_filter.h',
+ 'src/core/channel/noop_filter.h',
+ 'src/core/compression/message_compress.h',
+ 'src/core/debug/trace.h',
+ 'src/core/iomgr/alarm.h',
+ 'src/core/iomgr/alarm_heap.h',
+ 'src/core/iomgr/alarm_internal.h',
+ 'src/core/iomgr/endpoint.h',
+ 'src/core/iomgr/endpoint_pair.h',
+ 'src/core/iomgr/fd_posix.h',
+ 'src/core/iomgr/iocp_windows.h',
+ 'src/core/iomgr/iomgr.h',
+ 'src/core/iomgr/iomgr_internal.h',
+ 'src/core/iomgr/iomgr_posix.h',
+ 'src/core/iomgr/pollset.h',
+ 'src/core/iomgr/pollset_kick_posix.h',
+ 'src/core/iomgr/pollset_posix.h',
+ 'src/core/iomgr/pollset_set.h',
+ 'src/core/iomgr/pollset_set_posix.h',
+ 'src/core/iomgr/pollset_set_windows.h',
+ 'src/core/iomgr/pollset_windows.h',
+ 'src/core/iomgr/resolve_address.h',
+ 'src/core/iomgr/sockaddr.h',
+ 'src/core/iomgr/sockaddr_posix.h',
+ 'src/core/iomgr/sockaddr_utils.h',
+ 'src/core/iomgr/sockaddr_win32.h',
+ 'src/core/iomgr/socket_utils_posix.h',
+ 'src/core/iomgr/socket_windows.h',
+ 'src/core/iomgr/tcp_client.h',
+ 'src/core/iomgr/tcp_posix.h',
+ 'src/core/iomgr/tcp_server.h',
+ 'src/core/iomgr/tcp_windows.h',
+ 'src/core/iomgr/time_averaged_stats.h',
+ 'src/core/iomgr/wakeup_fd_pipe.h',
+ 'src/core/iomgr/wakeup_fd_posix.h',
+ 'src/core/json/json.h',
+ 'src/core/json/json_common.h',
+ 'src/core/json/json_reader.h',
+ 'src/core/json/json_writer.h',
+ 'src/core/profiling/timers.h',
+ 'src/core/profiling/timers_preciseclock.h',
+ 'src/core/surface/byte_buffer_queue.h',
+ 'src/core/surface/call.h',
+ 'src/core/surface/channel.h',
+ 'src/core/surface/client.h',
+ 'src/core/surface/completion_queue.h',
+ 'src/core/surface/event_string.h',
+ 'src/core/surface/init.h',
+ 'src/core/surface/server.h',
+ 'src/core/surface/surface_trace.h',
+ 'src/core/transport/chttp2/alpn.h',
+ 'src/core/transport/chttp2/bin_encoder.h',
+ 'src/core/transport/chttp2/frame.h',
+ 'src/core/transport/chttp2/frame_data.h',
+ 'src/core/transport/chttp2/frame_goaway.h',
+ 'src/core/transport/chttp2/frame_ping.h',
+ 'src/core/transport/chttp2/frame_rst_stream.h',
+ 'src/core/transport/chttp2/frame_settings.h',
+ 'src/core/transport/chttp2/frame_window_update.h',
+ 'src/core/transport/chttp2/hpack_parser.h',
+ 'src/core/transport/chttp2/hpack_table.h',
+ 'src/core/transport/chttp2/http2_errors.h',
+ 'src/core/transport/chttp2/huffsyms.h',
+ 'src/core/transport/chttp2/incoming_metadata.h',
+ 'src/core/transport/chttp2/internal.h',
+ 'src/core/transport/chttp2/status_conversion.h',
+ 'src/core/transport/chttp2/stream_encoder.h',
+ 'src/core/transport/chttp2/stream_map.h',
+ 'src/core/transport/chttp2/timeout_encoding.h',
+ 'src/core/transport/chttp2/varint.h',
+ 'src/core/transport/chttp2_transport.h',
+ 'src/core/transport/metadata.h',
+ 'src/core/transport/stream_op.h',
+ 'src/core/transport/transport.h',
+ 'src/core/transport/transport_impl.h',
+ 'src/core/census/context.h'
+
+ ss.header_mappings_dir = '.'
+
+ ss.requires_arc = false
+ ss.libraries = 'z'
+ ss.dependency 'OpenSSL', '~> 1.0.200'
end
# This is a workaround for Cocoapods Issue #1437.
@@ -48,21 +485,24 @@ Pod::Spec.new do |s|
# It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
# prepare_command's of subspecs.
#
- # TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
+ # TODO(jcanizales): Try out others' solutions at Issue #1437.
s.prepare_command = <<-CMD
+ # Move contents of include up a level to avoid manually specifying include paths
+ cp -r "include/grpc" "."
+
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
- grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
- if [ -f "include/$BAD_TIME" ];
+ grep -rl "$BAD_TIME" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
+ if [ -f "$BAD_TIME" ];
then
- mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
+ mv -f "$BAD_TIME" "$GOOD_TIME"
fi
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
- grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
+ grep -rl "$BAD_STRING" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
mv -f "$BAD_STRING" "$GOOD_STRING"
@@ -70,28 +510,27 @@ Pod::Spec.new do |s|
CMD
# Objective-C wrapper around the core gRPC library.
- s.subspec 'GRPCClient' do |gs|
- gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
- 'src/objective-c/GRPCClient/private/*.{h,m}'
- gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
- gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
-
- gs.dependency 'gRPC/C-Core'
- # TODO(jcanizales): Remove this when the prepare_command moves everything under "include/grpc"
- # one directory up.
- gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' }
- gs.dependency 'gRPC/RxLibrary'
+ s.subspec 'GRPCClient' do |ss|
+ src_dir = "#{objc_dir}/GRPCClient"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
+
+ ss.dependency 'gRPC/C-Core'
+ ss.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections:
- gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
+ ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC
- s.subspec 'ProtoRPC' do |ps|
- ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
+ s.subspec 'ProtoRPC' do |ss|
+ src_dir = "#{objc_dir}/ProtoRPC"
+ ss.source_files = "#{src_dir}/*.{h,m}"
+ ss.header_mappings_dir = "#{objc_dir}"
- ps.dependency 'gRPC/GRPCClient'
- ps.dependency 'gRPC/RxLibrary'
- ps.dependency 'Protobuf', '~> 3.0.0-alpha-3'
+ ss.dependency 'gRPC/GRPCClient'
+ ss.dependency 'gRPC/RxLibrary'
+ ss.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end
end
diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h
index abb6308782..d631ccd134 100644
--- a/include/grpc++/async_unary_call.h
+++ b/include/grpc++/async_unary_call.h
@@ -51,47 +51,50 @@ class ClientAsyncResponseReaderInterface {
virtual ~ClientAsyncResponseReaderInterface() {}
virtual void ReadInitialMetadata(void* tag) = 0;
virtual void Finish(R* msg, Status* status, void* tag) = 0;
-
};
template <class R>
class ClientAsyncResponseReader GRPC_FINAL
: public ClientAsyncResponseReaderInterface<R> {
public:
+ template <class W>
ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context,
- const grpc::protobuf::Message& request)
+ const W& request)
: context_(context), call_(channel->CreateCall(method, context, cq)) {
- init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_);
- init_buf_.AddSendMessage(request);
- init_buf_.AddClientSendClose();
+ init_buf_.SendInitialMetadata(context->send_initial_metadata_);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(init_buf_.SendMessage(request).ok());
+ init_buf_.ClientSendClose();
call_.PerformOps(&init_buf_);
}
void ReadInitialMetadata(void* tag) {
GPR_ASSERT(!context_->initial_metadata_received_);
- meta_buf_.Reset(tag);
- meta_buf_.AddRecvInitialMetadata(context_);
+ meta_buf_.set_output_tag(tag);
+ meta_buf_.RecvInitialMetadata(context_);
call_.PerformOps(&meta_buf_);
}
void Finish(R* msg, Status* status, void* tag) {
- finish_buf_.Reset(tag);
+ finish_buf_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
- finish_buf_.AddRecvInitialMetadata(context_);
+ finish_buf_.RecvInitialMetadata(context_);
}
- finish_buf_.AddRecvMessage(msg);
- finish_buf_.AddClientRecvStatus(context_, status);
+ finish_buf_.RecvMessage(msg);
+ finish_buf_.ClientRecvStatus(context_, status);
call_.PerformOps(&finish_buf_);
}
private:
ClientContext* context_;
Call call_;
- SneakyCallOpBuffer init_buf_;
- CallOpBuffer meta_buf_;
- CallOpBuffer finish_buf_;
+ SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpClientSendClose> init_buf_;
+ CallOpSet<CallOpRecvInitialMetadata> meta_buf_;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
+ CallOpClientRecvStatus> finish_buf_;
};
template <class W>
@@ -104,34 +107,36 @@ class ServerAsyncResponseWriter GRPC_FINAL
void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- meta_buf_.Reset(tag);
- meta_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ meta_buf_.set_output_tag(tag);
+ meta_buf_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
call_.PerformOps(&meta_buf_);
}
void Finish(const W& msg, const Status& status, void* tag) {
- finish_buf_.Reset(tag);
+ finish_buf_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- finish_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ finish_buf_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
// The response is dropped if the status is not OK.
if (status.ok()) {
- finish_buf_.AddSendMessage(msg);
+ finish_buf_.ServerSendStatus(
+ ctx_->trailing_metadata_, finish_buf_.SendMessage(msg));
+ } else {
+ finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, status);
}
- finish_buf_.AddServerSendStatus(&ctx_->trailing_metadata_, status);
call_.PerformOps(&finish_buf_);
}
void FinishWithError(const Status& status, void* tag) {
GPR_ASSERT(!status.ok());
- finish_buf_.Reset(tag);
+ finish_buf_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- finish_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ finish_buf_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- finish_buf_.AddServerSendStatus(&ctx_->trailing_metadata_, status);
+ finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, status);
call_.PerformOps(&finish_buf_);
}
@@ -140,8 +145,9 @@ class ServerAsyncResponseWriter GRPC_FINAL
Call call_;
ServerContext* ctx_;
- CallOpBuffer meta_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata> meta_buf_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpServerSendStatus> finish_buf_;
};
} // namespace grpc
diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h
index 3e40eaed1d..cb3c6a1159 100644
--- a/include/grpc++/byte_buffer.h
+++ b/include/grpc++/byte_buffer.h
@@ -39,6 +39,8 @@
#include <grpc/support/log.h>
#include <grpc++/config.h>
#include <grpc++/slice.h>
+#include <grpc++/status.h>
+#include <grpc++/impl/serialization_traits.h>
#include <vector>
@@ -48,7 +50,7 @@ class ByteBuffer GRPC_FINAL {
public:
ByteBuffer() : buffer_(nullptr) {}
- ByteBuffer(Slice* slices, size_t nslices);
+ ByteBuffer(const Slice* slices, size_t nslices);
~ByteBuffer() {
if (buffer_) {
@@ -56,13 +58,16 @@ class ByteBuffer GRPC_FINAL {
}
}
- void Dump(std::vector<Slice>* slices);
+ void Dump(std::vector<Slice>* slices) const;
void Clear();
- size_t Length();
+ size_t Length() const;
private:
- friend class CallOpBuffer;
+ friend class SerializationTraits<ByteBuffer, void>;
+
+ ByteBuffer(const ByteBuffer&);
+ ByteBuffer& operator=(const ByteBuffer&);
// takes ownership
void set_buffer(grpc_byte_buffer* buf) {
@@ -78,6 +83,22 @@ class ByteBuffer GRPC_FINAL {
grpc_byte_buffer* buffer_;
};
+template <>
+class SerializationTraits<ByteBuffer, void> {
+ public:
+ static Status Deserialize(grpc_byte_buffer* byte_buffer, ByteBuffer* dest,
+ int max_message_size) {
+ dest->set_buffer(byte_buffer);
+ return Status::OK;
+ }
+ static Status Serialize(const ByteBuffer& source, grpc_byte_buffer** buffer,
+ bool* own_buffer) {
+ *buffer = source.buffer();
+ *own_buffer = false;
+ return Status::OK;
+ }
+};
+
} // namespace grpc
#endif // GRPCXX_BYTE_BUFFER_H
diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h
index 66d3c249a1..3bf5edc6c0 100644
--- a/include/grpc++/client_context.h
+++ b/include/grpc++/client_context.h
@@ -50,7 +50,6 @@ struct grpc_completion_queue;
namespace grpc {
-class CallOpBuffer;
class ChannelInterface;
class CompletionQueue;
class Credentials;
@@ -118,7 +117,8 @@ class ClientContext {
ClientContext(const ClientContext&);
ClientContext& operator=(const ClientContext&);
- friend class CallOpBuffer;
+ friend class CallOpClientRecvStatus;
+ friend class CallOpRecvInitialMetadata;
friend class Channel;
template <class R>
friend class ::grpc::ClientReader;
@@ -134,6 +134,12 @@ class ClientContext {
friend class ::grpc::ClientAsyncReaderWriter;
template <class R>
friend class ::grpc::ClientAsyncResponseReader;
+ template <class InputMessage, class OutputMessage>
+ friend Status BlockingUnaryCall(ChannelInterface* channel,
+ const RpcMethod& method,
+ ClientContext* context,
+ const InputMessage& request,
+ OutputMessage* result);
grpc_call* call() { return call_; }
void set_call(grpc_call* call,
diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h
index e8429c8f41..f32cbff06c 100644
--- a/include/grpc++/completion_queue.h
+++ b/include/grpc++/completion_queue.h
@@ -35,8 +35,8 @@
#define GRPCXX_COMPLETION_QUEUE_H
#include <grpc/support/time.h>
-#include <grpc++/impl/client_unary_call.h>
#include <grpc++/impl/grpc_library.h>
+#include <grpc++/status.h>
#include <grpc++/time.h>
struct grpc_completion_queue;
@@ -55,8 +55,19 @@ template <class W>
class ServerWriter;
template <class R, class W>
class ServerReaderWriter;
-
+template <class ServiceType, class RequestType, class ResponseType>
+class RpcMethodHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class ClientStreamingHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class ServerStreamingHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class BidiStreamingHandler;
+
+class ChannelInterface;
+class ClientContext;
class CompletionQueue;
+class RpcMethod;
class Server;
class ServerBuilder;
class ServerContext;
@@ -84,7 +95,7 @@ class CompletionQueue : public GrpcLibrary {
// Nonblocking (until deadline) read from queue.
// Cannot rely on result of tag or ok if return is TIMEOUT
- template<typename T>
+ template <typename T>
NextStatus AsyncNext(void** tag, bool* ok, const T& deadline) {
TimePoint<T> deadline_tp(deadline);
return AsyncNextInternal(tag, ok, deadline_tp.raw_time());
@@ -118,13 +129,22 @@ class CompletionQueue : public GrpcLibrary {
friend class ::grpc::ServerWriter;
template <class R, class W>
friend class ::grpc::ServerReaderWriter;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class RpcMethodHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class ClientStreamingHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class ServerStreamingHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class BidiStreamingHandler;
friend class ::grpc::Server;
friend class ::grpc::ServerContext;
+ template <class InputMessage, class OutputMessage>
friend Status BlockingUnaryCall(ChannelInterface* channel,
const RpcMethod& method,
ClientContext* context,
- const grpc::protobuf::Message& request,
- grpc::protobuf::Message* result);
+ const InputMessage& request,
+ OutputMessage* result);
NextStatus AsyncNextInternal(void** tag, bool* ok, gpr_timespec deadline);
diff --git a/include/grpc++/config.h b/include/grpc++/config.h
index ca74064be2..1362c0a1fa 100644
--- a/include/grpc++/config.h
+++ b/include/grpc++/config.h
@@ -77,31 +77,6 @@
#define GRPC_OVERRIDE override
#endif
-#ifndef GRPC_CUSTOM_PROTOBUF_INT64
-#include <google/protobuf/stubs/common.h>
-#define GRPC_CUSTOM_PROTOBUF_INT64 ::google::protobuf::int64
-#endif
-
-#ifndef GRPC_CUSTOM_MESSAGE
-#include <google/protobuf/message.h>
-#define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
-#endif
-
-#ifndef GRPC_CUSTOM_STRING
-#include <string>
-#define GRPC_CUSTOM_STRING std::string
-#endif
-
-#ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
-#include <google/protobuf/io/coded_stream.h>
-#include <google/protobuf/io/zero_copy_stream.h>
-#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \
- ::google::protobuf::io::ZeroCopyOutputStream
-#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \
- ::google::protobuf::io::ZeroCopyInputStream
-#define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream
-#endif
-
#ifdef GRPC_CXX0X_NO_NULLPTR
#include <memory>
const class {
@@ -125,23 +100,15 @@ const class {
} nullptr = {};
#endif
+#ifndef GRPC_CUSTOM_STRING
+#include <string>
+#define GRPC_CUSTOM_STRING std::string
+#endif
+
namespace grpc {
typedef GRPC_CUSTOM_STRING string;
-namespace protobuf {
-
-typedef GRPC_CUSTOM_MESSAGE Message;
-typedef GRPC_CUSTOM_PROTOBUF_INT64 int64;
-
-namespace io {
-typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
-typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
-typedef GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream;
-} // namespace io
-
-} // namespace protobuf
-
} // namespace grpc
#endif // GRPCXX_CONFIG_H
diff --git a/include/grpc++/config_protobuf.h b/include/grpc++/config_protobuf.h
new file mode 100644
index 0000000000..3afc7a58e2
--- /dev/null
+++ b/include/grpc++/config_protobuf.h
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPCXX_CONFIG_PROTOBUF_H
+#define GRPCXX_CONFIG_PROTOBUF_H
+
+#ifndef GRPC_CUSTOM_PROTOBUF_INT64
+#include <google/protobuf/stubs/common.h>
+#define GRPC_CUSTOM_PROTOBUF_INT64 ::google::protobuf::int64
+#endif
+
+#ifndef GRPC_CUSTOM_MESSAGE
+#include <google/protobuf/message.h>
+#define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message
+#endif
+
+#ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream.h>
+#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \
+ ::google::protobuf::io::ZeroCopyOutputStream
+#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \
+ ::google::protobuf::io::ZeroCopyInputStream
+#define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream
+#endif
+
+namespace grpc {
+namespace protobuf {
+
+typedef GRPC_CUSTOM_MESSAGE Message;
+typedef GRPC_CUSTOM_PROTOBUF_INT64 int64;
+
+namespace io {
+typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream;
+typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream;
+typedef GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream;
+} // namespace io
+
+} // namespace protobuf
+} // namespace grpc
+
+#endif // GRPCXX_CONFIG_PROTOBUF_H
diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h
index aae199db1b..64fa5d6efb 100644
--- a/include/grpc++/impl/call.h
+++ b/include/grpc++/impl/call.h
@@ -34,14 +34,19 @@
#ifndef GRPCXX_IMPL_CALL_H
#define GRPCXX_IMPL_CALL_H
-#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc++/client_context.h>
#include <grpc++/completion_queue.h>
#include <grpc++/config.h>
#include <grpc++/status.h>
+#include <grpc++/impl/serialization_traits.h>
+#include <functional>
#include <memory>
#include <map>
+#include <string.h>
+
struct grpc_call;
struct grpc_op;
@@ -50,84 +55,383 @@ namespace grpc {
class ByteBuffer;
class Call;
-class CallOpBuffer : public CompletionQueueTag {
+void FillMetadataMap(grpc_metadata_array* arr,
+ std::multimap<grpc::string, grpc::string>* metadata);
+grpc_metadata* FillMetadataArray(
+ const std::multimap<grpc::string, grpc::string>& metadata);
+
+/// Default argument for CallOpSet. I is unused by the class, but can be
+/// used for generating multiple names for the same thing.
+template <int I>
+class CallNoOp {
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {}
+ void FinishOp(bool* status, int max_message_size) {}
+};
+
+class CallOpSendInitialMetadata {
public:
- CallOpBuffer();
- ~CallOpBuffer();
-
- void Reset(void* next_return_tag);
-
- // Does not take ownership.
- void AddSendInitialMetadata(
- std::multimap<grpc::string, grpc::string>* metadata);
- void AddSendInitialMetadata(ClientContext* ctx);
- void AddRecvInitialMetadata(ClientContext* ctx);
- void AddSendMessage(const grpc::protobuf::Message& message);
- void AddSendMessage(const ByteBuffer& message);
- void AddRecvMessage(grpc::protobuf::Message* message);
- void AddRecvMessage(ByteBuffer* message);
- void AddClientSendClose();
- void AddClientRecvStatus(ClientContext* ctx, Status* status);
- void AddServerSendStatus(std::multimap<grpc::string, grpc::string>* metadata,
- const Status& status);
- void AddServerRecvClose(bool* cancelled);
-
- // INTERNAL API:
-
- // Convert to an array of grpc_op elements
- void FillOps(grpc_op* ops, size_t* nops);
-
- // Called by completion queue just prior to returning from Next() or Pluck()
- bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE;
+ CallOpSendInitialMetadata() : send_(false) {}
- void set_max_message_size(int max_message_size) {
- max_message_size_ = max_message_size;
+ void SendInitialMetadata(
+ const std::multimap<grpc::string, grpc::string>& metadata) {
+ send_ = true;
+ initial_metadata_count_ = metadata.size();
+ initial_metadata_ = FillMetadataArray(metadata);
}
- bool got_message;
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (!send_) return;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ op->flags = 0;
+ op->data.send_initial_metadata.count = initial_metadata_count_;
+ op->data.send_initial_metadata.metadata = initial_metadata_;
+ }
+ void FinishOp(bool* status, int max_message_size) {
+ if (!send_) return;
+ gpr_free(initial_metadata_);
+ send_ = false;
+ }
- private:
- void* return_tag_;
- // Send initial metadata
- bool send_initial_metadata_;
+ bool send_;
size_t initial_metadata_count_;
grpc_metadata* initial_metadata_;
- // Recv initial metadta
- std::multimap<grpc::string, grpc::string>* recv_initial_metadata_;
- grpc_metadata_array recv_initial_metadata_arr_;
- // Send message
- const grpc::protobuf::Message* send_message_;
- const ByteBuffer* send_message_buffer_;
+};
+
+class CallOpSendMessage {
+ public:
+ CallOpSendMessage() : send_buf_(nullptr), own_buf_(false) {}
+
+ template <class M>
+ Status SendMessage(const M& message) GRPC_MUST_USE_RESULT;
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (send_buf_ == nullptr) return;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_SEND_MESSAGE;
+ op->flags = 0;
+ op->data.send_message = send_buf_;
+ }
+ void FinishOp(bool* status, int max_message_size) {
+ if (own_buf_) grpc_byte_buffer_destroy(send_buf_);
+ send_buf_ = nullptr;
+ }
+
+ private:
grpc_byte_buffer* send_buf_;
- // Recv message
- grpc::protobuf::Message* recv_message_;
- ByteBuffer* recv_message_buffer_;
+ bool own_buf_;
+};
+
+template <class M>
+Status CallOpSendMessage::SendMessage(const M& message) {
+ return SerializationTraits<M>::Serialize(message, &send_buf_, &own_buf_);
+}
+
+template <class R>
+class CallOpRecvMessage {
+ public:
+ CallOpRecvMessage() : got_message(false), message_(nullptr) {}
+
+ void RecvMessage(R* message) { message_ = message; }
+
+ bool got_message;
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (message_ == nullptr) return;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->flags = 0;
+ op->data.recv_message = &recv_buf_;
+ }
+
+ void FinishOp(bool* status, int max_message_size) {
+ if (message_ == nullptr) return;
+ if (recv_buf_) {
+ if (*status) {
+ got_message = true;
+ *status = SerializationTraits<R>::Deserialize(recv_buf_, message_,
+ max_message_size)
+ .ok();
+ } else {
+ got_message = false;
+ grpc_byte_buffer_destroy(recv_buf_);
+ }
+ } else {
+ got_message = false;
+ *status = false;
+ }
+ message_ = nullptr;
+ }
+
+ private:
+ R* message_;
grpc_byte_buffer* recv_buf_;
- int max_message_size_;
- // Client send close
- bool client_send_close_;
- // Client recv status
+};
+
+class CallOpGenericRecvMessage {
+ public:
+ CallOpGenericRecvMessage() : got_message(false) {}
+
+ template <class R>
+ void RecvMessage(R* message) {
+ deserialize_ = [message](grpc_byte_buffer* buf,
+ int max_message_size) -> Status {
+ return SerializationTraits<R>::Deserialize(buf, message,
+ max_message_size);
+ };
+ }
+
+ bool got_message;
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (!deserialize_) return;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->flags = 0;
+ op->data.recv_message = &recv_buf_;
+ }
+
+ void FinishOp(bool* status, int max_message_size) {
+ if (!deserialize_) return;
+ if (recv_buf_) {
+ if (*status) {
+ got_message = true;
+ *status = deserialize_(recv_buf_, max_message_size).ok();
+ } else {
+ got_message = false;
+ grpc_byte_buffer_destroy(recv_buf_);
+ }
+ } else {
+ got_message = false;
+ *status = false;
+ }
+ deserialize_ = DeserializeFunc();
+ }
+
+ private:
+ typedef std::function<Status(grpc_byte_buffer*, int)> DeserializeFunc;
+ DeserializeFunc deserialize_;
+ grpc_byte_buffer* recv_buf_;
+};
+
+class CallOpClientSendClose {
+ public:
+ CallOpClientSendClose() : send_(false) {}
+
+ void ClientSendClose() { send_ = true; }
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (!send_) return;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ op->flags = 0;
+ }
+ void FinishOp(bool* status, int max_message_size) { send_ = false; }
+
+ private:
+ bool send_;
+};
+
+class CallOpServerSendStatus {
+ public:
+ CallOpServerSendStatus() : send_status_available_(false) {}
+
+ void ServerSendStatus(
+ const std::multimap<grpc::string, grpc::string>& trailing_metadata,
+ const Status& status) {
+ trailing_metadata_count_ = trailing_metadata.size();
+ trailing_metadata_ = FillMetadataArray(trailing_metadata);
+ send_status_available_ = true;
+ send_status_code_ = static_cast<grpc_status_code>(status.error_code());
+ send_status_details_ = status.error_message();
+ }
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (!send_status_available_) return;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
+ op->data.send_status_from_server.trailing_metadata_count =
+ trailing_metadata_count_;
+ op->data.send_status_from_server.trailing_metadata = trailing_metadata_;
+ op->data.send_status_from_server.status = send_status_code_;
+ op->data.send_status_from_server.status_details =
+ send_status_details_.empty() ? nullptr : send_status_details_.c_str();
+ op->flags = 0;
+ }
+
+ void FinishOp(bool* status, int max_message_size) {
+ if (!send_status_available_) return;
+ gpr_free(trailing_metadata_);
+ send_status_available_ = false;
+ }
+
+ private:
+ bool send_status_available_;
+ grpc_status_code send_status_code_;
+ grpc::string send_status_details_;
+ size_t trailing_metadata_count_;
+ grpc_metadata* trailing_metadata_;
+};
+
+class CallOpRecvInitialMetadata {
+ public:
+ CallOpRecvInitialMetadata() : recv_initial_metadata_(nullptr) {}
+
+ void RecvInitialMetadata(ClientContext* context) {
+ context->initial_metadata_received_ = true;
+ recv_initial_metadata_ = &context->recv_initial_metadata_;
+ }
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (!recv_initial_metadata_) return;
+ memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_));
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata = &recv_initial_metadata_arr_;
+ op->flags = 0;
+ }
+ void FinishOp(bool* status, int max_message_size) {
+ if (recv_initial_metadata_ == nullptr) return;
+ FillMetadataMap(&recv_initial_metadata_arr_, recv_initial_metadata_);
+ recv_initial_metadata_ = nullptr;
+ }
+
+ private:
+ std::multimap<grpc::string, grpc::string>* recv_initial_metadata_;
+ grpc_metadata_array recv_initial_metadata_arr_;
+};
+
+class CallOpClientRecvStatus {
+ public:
+ CallOpClientRecvStatus() : recv_status_(nullptr) {}
+
+ void ClientRecvStatus(ClientContext* context, Status* status) {
+ recv_trailing_metadata_ = &context->trailing_metadata_;
+ recv_status_ = status;
+ }
+
+ protected:
+ void AddOp(grpc_op* ops, size_t* nops) {
+ if (recv_status_ == nullptr) return;
+ memset(&recv_trailing_metadata_arr_, 0,
+ sizeof(recv_trailing_metadata_arr_));
+ status_details_ = nullptr;
+ status_details_capacity_ = 0;
+ grpc_op* op = &ops[(*nops)++];
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata =
+ &recv_trailing_metadata_arr_;
+ op->data.recv_status_on_client.status = &status_code_;
+ op->data.recv_status_on_client.status_details = &status_details_;
+ op->data.recv_status_on_client.status_details_capacity =
+ &status_details_capacity_;
+ op->flags = 0;
+ }
+
+ void FinishOp(bool* status, int max_message_size) {
+ if (recv_status_ == nullptr) return;
+ FillMetadataMap(&recv_trailing_metadata_arr_, recv_trailing_metadata_);
+ *recv_status_ = Status(
+ static_cast<StatusCode>(status_code_),
+ status_details_ ? grpc::string(status_details_) : grpc::string());
+ gpr_free(status_details_);
+ recv_status_ = nullptr;
+ }
+
+ private:
std::multimap<grpc::string, grpc::string>* recv_trailing_metadata_;
Status* recv_status_;
grpc_metadata_array recv_trailing_metadata_arr_;
grpc_status_code status_code_;
char* status_details_;
size_t status_details_capacity_;
- // Server send status
- bool send_status_available_;
- grpc_status_code send_status_code_;
- grpc::string send_status_details_;
- size_t trailing_metadata_count_;
- grpc_metadata* trailing_metadata_;
- int cancelled_buf_;
- bool* recv_closed_;
};
-// SneakyCallOpBuffer does not post completions to the completion queue
-class SneakyCallOpBuffer GRPC_FINAL : public CallOpBuffer {
+/// An abstract collection of call ops, used to generate the
+/// grpc_call_op structure to pass down to the lower layers,
+/// and as it is-a CompletionQueueTag, also massages the final
+/// completion into the correct form for consumption in the C++
+/// API.
+class CallOpSetInterface : public CompletionQueueTag {
+ public:
+ CallOpSetInterface() : max_message_size_(0) {}
+ /// Fills in grpc_op, starting from ops[*nops] and moving
+ /// upwards.
+ virtual void FillOps(grpc_op* ops, size_t* nops) = 0;
+
+ void set_max_message_size(int max_message_size) {
+ max_message_size_ = max_message_size;
+ }
+
+ protected:
+ int max_message_size_;
+};
+
+/// Primary implementaiton of CallOpSetInterface.
+/// Since we cannot use variadic templates, we declare slots up to
+/// the maximum count of ops we'll need in a set. We leverage the
+/// empty base class optimization to slim this class (especially
+/// when there are many unused slots used). To avoid duplicate base classes,
+/// the template parmeter for CallNoOp is varied by argument position.
+template <class Op1 = CallNoOp<1>, class Op2 = CallNoOp<2>,
+ class Op3 = CallNoOp<3>, class Op4 = CallNoOp<4>,
+ class Op5 = CallNoOp<5>, class Op6 = CallNoOp<6>>
+class CallOpSet : public CallOpSetInterface,
+ public Op1,
+ public Op2,
+ public Op3,
+ public Op4,
+ public Op5,
+ public Op6 {
+ public:
+ CallOpSet() : return_tag_(this) {}
+ void FillOps(grpc_op* ops, size_t* nops) GRPC_OVERRIDE {
+ this->Op1::AddOp(ops, nops);
+ this->Op2::AddOp(ops, nops);
+ this->Op3::AddOp(ops, nops);
+ this->Op4::AddOp(ops, nops);
+ this->Op5::AddOp(ops, nops);
+ this->Op6::AddOp(ops, nops);
+ }
+
+ bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
+ this->Op1::FinishOp(status, max_message_size_);
+ this->Op2::FinishOp(status, max_message_size_);
+ this->Op3::FinishOp(status, max_message_size_);
+ this->Op4::FinishOp(status, max_message_size_);
+ this->Op5::FinishOp(status, max_message_size_);
+ this->Op6::FinishOp(status, max_message_size_);
+ *tag = return_tag_;
+ return true;
+ }
+
+ void set_output_tag(void* return_tag) { return_tag_ = return_tag; }
+
+ private:
+ void* return_tag_;
+};
+
+/// A CallOpSet that does not post completions to the completion queue.
+///
+/// Allows hiding some completions that the C core must generate from
+/// C++ users.
+template <class Op1 = CallNoOp<1>, class Op2 = CallNoOp<2>,
+ class Op3 = CallNoOp<3>, class Op4 = CallNoOp<4>,
+ class Op5 = CallNoOp<5>, class Op6 = CallNoOp<6>>
+class SneakyCallOpSet GRPC_FINAL
+ : public CallOpSet<Op1, Op2, Op3, Op4, Op5, Op6> {
public:
bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
- return CallOpBuffer::FinalizeResult(tag, status) && false;
+ typedef CallOpSet<Op1, Op2, Op3, Op4, Op5, Op6> Base;
+ return Base::FinalizeResult(tag, status) && false;
}
};
@@ -135,7 +439,7 @@ class SneakyCallOpBuffer GRPC_FINAL : public CallOpBuffer {
class CallHook {
public:
virtual ~CallHook() {}
- virtual void PerformOpsOnCall(CallOpBuffer* ops, Call* call) = 0;
+ virtual void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) = 0;
};
// Straightforward wrapping of the C call object
@@ -146,7 +450,7 @@ class Call GRPC_FINAL {
Call(grpc_call* call, CallHook* call_hook_, CompletionQueue* cq,
int max_message_size);
- void PerformOps(CallOpBuffer* buffer);
+ void PerformOps(CallOpSetInterface* ops);
grpc_call* call() { return call_; }
CompletionQueue* cq() { return cq_; }
diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h
index 2f234fd3ac..b77ce7d02c 100644
--- a/include/grpc++/impl/client_unary_call.h
+++ b/include/grpc++/impl/client_unary_call.h
@@ -37,6 +37,8 @@
#include <grpc++/config.h>
#include <grpc++/status.h>
+#include <grpc++/impl/call.h>
+
namespace grpc {
class ChannelInterface;
@@ -45,10 +47,28 @@ class CompletionQueue;
class RpcMethod;
// Wrapper that performs a blocking unary call
+template <class InputMessage, class OutputMessage>
Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
- ClientContext* context,
- const grpc::protobuf::Message& request,
- grpc::protobuf::Message* result);
+ ClientContext* context, const InputMessage& request,
+ OutputMessage* result) {
+ CompletionQueue cq;
+ Call call(channel->CreateCall(method, context, &cq));
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
+ CallOpClientSendClose, CallOpClientRecvStatus> ops;
+ Status status = ops.SendMessage(request);
+ if (!status.ok()) {
+ return status;
+ }
+ ops.SendInitialMetadata(context->send_initial_metadata_);
+ ops.RecvInitialMetadata(context);
+ ops.RecvMessage(result);
+ ops.ClientSendClose();
+ ops.ClientRecvStatus(context, &status);
+ call.PerformOps(&ops);
+ GPR_ASSERT((cq.Pluck(&ops) && ops.got_message) || !status.ok());
+ return status;
+}
} // namespace grpc
diff --git a/src/core/iomgr/pollset_kick.h b/include/grpc++/impl/proto_utils.h
index cc9357de1f..ebefa3e1be 100644
--- a/src/core/iomgr/pollset_kick.h
+++ b/include/grpc++/impl/proto_utils.h
@@ -31,44 +31,46 @@
*
*/
-#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_H
-#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_H
+#ifndef GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H
+#define GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H
-#include <grpc/support/port_platform.h>
+#include <type_traits>
-#ifdef GPR_POSIX_SOCKET
-#include "src/core/iomgr/pollset_kick_posix.h"
-#endif
+#include <grpc/grpc.h>
+#include <grpc++/impl/serialization_traits.h>
+#include <grpc++/config_protobuf.h>
+#include <grpc++/status.h>
-#ifdef GPR_WIN32
-#include "src/core/iomgr/pollset_kick_windows.h"
-#endif
+namespace grpc {
-/* This is an abstraction around the typical pipe mechanism for waking up a
- thread sitting in a poll() style call. */
+// Serialize the msg into a buffer created inside the function. The caller
+// should destroy the returned buffer when done with it. If serialization fails,
+// false is returned and buffer is left unchanged.
+Status SerializeProto(const grpc::protobuf::Message& msg,
+ grpc_byte_buffer** buffer);
-void grpc_pollset_kick_global_init(void);
-void grpc_pollset_kick_global_destroy(void);
+// The caller keeps ownership of buffer and msg.
+Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg,
+ int max_message_size);
-void grpc_pollset_kick_init(grpc_pollset_kick_state *kick_state);
-void grpc_pollset_kick_destroy(grpc_pollset_kick_state *kick_state);
+template <class T>
+class SerializationTraits<T, typename std::enable_if<std::is_base_of<
+ grpc::protobuf::Message, T>::value>::type> {
+ public:
+ static Status Serialize(const grpc::protobuf::Message& msg,
+ grpc_byte_buffer** buffer, bool* own_buffer) {
+ *own_buffer = true;
+ return SerializeProto(msg, buffer);
+ }
+ static Status Deserialize(grpc_byte_buffer* buffer,
+ grpc::protobuf::Message* msg,
+ int max_message_size) {
+ auto status = DeserializeProto(buffer, msg, max_message_size);
+ grpc_byte_buffer_destroy(buffer);
+ return status;
+ }
+};
-/* Guarantees a pure posix implementation rather than a specialized one, if
- * applicable. Intended for testing. */
-void grpc_pollset_kick_global_init_fallback_fd(void);
+} // namespace grpc
-/* Must be called before entering poll(). If return value is -1, this consumed
- an existing kick. Otherwise the return value is an FD to add to the poll set.
- */
-int grpc_pollset_kick_pre_poll(grpc_pollset_kick_state *kick_state);
-
-/* Consume an existing kick. Must be called after poll returns that the fd was
- readable, and before calling kick_post_poll. */
-void grpc_pollset_kick_consume(grpc_pollset_kick_state *kick_state);
-
-/* Must be called after pre_poll, and after consume if applicable */
-void grpc_pollset_kick_post_poll(grpc_pollset_kick_state *kick_state);
-
-void grpc_pollset_kick_kick(grpc_pollset_kick_state *kick_state);
-
-#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_H */
+#endif // GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H
diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h
index 50204d2099..3cfbef7806 100644
--- a/include/grpc++/impl/rpc_service_method.h
+++ b/include/grpc++/impl/rpc_service_method.h
@@ -55,16 +55,19 @@ class MethodHandler {
public:
virtual ~MethodHandler() {}
struct HandlerParameter {
- HandlerParameter(Call* c, ServerContext* context,
- const grpc::protobuf::Message* req,
- grpc::protobuf::Message* resp)
- : call(c), server_context(context), request(req), response(resp) {}
+ HandlerParameter(Call* c, ServerContext* context, grpc_byte_buffer* req,
+ int max_size)
+ : call(c),
+ server_context(context),
+ request(req),
+ max_message_size(max_size) {}
Call* call;
ServerContext* server_context;
- const grpc::protobuf::Message* request;
- grpc::protobuf::Message* response;
+ // Handler required to grpc_byte_buffer_destroy this
+ grpc_byte_buffer* request;
+ int max_message_size;
};
- virtual Status RunHandler(const HandlerParameter& param) = 0;
+ virtual void RunHandler(const HandlerParameter& param) = 0;
};
// A wrapper class of an application provided rpc method handler.
@@ -77,11 +80,25 @@ class RpcMethodHandler : public MethodHandler {
ServiceType* service)
: func_(func), service_(service) {}
- Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
- // Invoke application function, cast proto messages to their actual types.
- return func_(service_, param.server_context,
- dynamic_cast<const RequestType*>(param.request),
- dynamic_cast<ResponseType*>(param.response));
+ void RunHandler(const HandlerParameter& param) GRPC_FINAL {
+ RequestType req;
+ Status status = SerializationTraits<RequestType>::Deserialize(
+ param.request, &req, param.max_message_size);
+ ResponseType rsp;
+ if (status.ok()) {
+ status = func_(service_, param.server_context, &req, &rsp);
+ }
+
+ GPR_ASSERT(!param.server_context->sent_initial_metadata_);
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpServerSendStatus> ops;
+ ops.SendInitialMetadata(param.server_context->initial_metadata_);
+ if (status.ok()) {
+ status = ops.SendMessage(rsp);
+ }
+ ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
+ param.call->PerformOps(&ops);
+ param.call->cq()->Pluck(&ops);
}
private:
@@ -102,10 +119,21 @@ class ClientStreamingHandler : public MethodHandler {
ServiceType* service)
: func_(func), service_(service) {}
- Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
+ void RunHandler(const HandlerParameter& param) GRPC_FINAL {
ServerReader<RequestType> reader(param.call, param.server_context);
- return func_(service_, param.server_context, &reader,
- dynamic_cast<ResponseType*>(param.response));
+ ResponseType rsp;
+ Status status = func_(service_, param.server_context, &reader, &rsp);
+
+ GPR_ASSERT(!param.server_context->sent_initial_metadata_);
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpServerSendStatus> ops;
+ ops.SendInitialMetadata(param.server_context->initial_metadata_);
+ if (status.ok()) {
+ status = ops.SendMessage(rsp);
+ }
+ ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
+ param.call->PerformOps(&ops);
+ param.call->cq()->Pluck(&ops);
}
private:
@@ -124,10 +152,23 @@ class ServerStreamingHandler : public MethodHandler {
ServiceType* service)
: func_(func), service_(service) {}
- Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
- ServerWriter<ResponseType> writer(param.call, param.server_context);
- return func_(service_, param.server_context,
- dynamic_cast<const RequestType*>(param.request), &writer);
+ void RunHandler(const HandlerParameter& param) GRPC_FINAL {
+ RequestType req;
+ Status status = SerializationTraits<RequestType>::Deserialize(
+ param.request, &req, param.max_message_size);
+
+ if (status.ok()) {
+ ServerWriter<ResponseType> writer(param.call, param.server_context);
+ status = func_(service_, param.server_context, &req, &writer);
+ }
+
+ CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> ops;
+ if (!param.server_context->sent_initial_metadata_) {
+ ops.SendInitialMetadata(param.server_context->initial_metadata_);
+ }
+ ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
+ param.call->PerformOps(&ops);
+ param.call->cq()->Pluck(&ops);
}
private:
@@ -147,10 +188,18 @@ class BidiStreamingHandler : public MethodHandler {
ServiceType* service)
: func_(func), service_(service) {}
- Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
+ void RunHandler(const HandlerParameter& param) GRPC_FINAL {
ServerReaderWriter<ResponseType, RequestType> stream(param.call,
param.server_context);
- return func_(service_, param.server_context, &stream);
+ Status status = func_(service_, param.server_context, &stream);
+
+ CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> ops;
+ if (!param.server_context->sent_initial_metadata_) {
+ ops.SendInitialMetadata(param.server_context->initial_metadata_);
+ }
+ ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
+ param.call->PerformOps(&ops);
+ param.call->cq()->Pluck(&ops);
}
private:
@@ -162,29 +211,15 @@ class BidiStreamingHandler : public MethodHandler {
// Server side rpc method class
class RpcServiceMethod : public RpcMethod {
public:
- // Takes ownership of the handler and two prototype objects.
+ // Takes ownership of the handler
RpcServiceMethod(const char* name, RpcMethod::RpcType type,
- MethodHandler* handler,
- grpc::protobuf::Message* request_prototype,
- grpc::protobuf::Message* response_prototype)
- : RpcMethod(name, type, nullptr),
- handler_(handler),
- request_prototype_(request_prototype),
- response_prototype_(response_prototype) {}
+ MethodHandler* handler)
+ : RpcMethod(name, type, nullptr), handler_(handler) {}
MethodHandler* handler() { return handler_.get(); }
- grpc::protobuf::Message* AllocateRequestProto() {
- return request_prototype_->New();
- }
- grpc::protobuf::Message* AllocateResponseProto() {
- return response_prototype_->New();
- }
-
private:
std::unique_ptr<MethodHandler> handler_;
- std::unique_ptr<grpc::protobuf::Message> request_prototype_;
- std::unique_ptr<grpc::protobuf::Message> response_prototype_;
};
// This class contains all the method information for an rpc service. It is
diff --git a/include/grpc++/impl/serialization_traits.h b/include/grpc++/impl/serialization_traits.h
new file mode 100644
index 0000000000..1f5c674e4c
--- /dev/null
+++ b/include/grpc++/impl/serialization_traits.h
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPCXX_IMPL_SERIALIZATION_TRAITS_H
+#define GRPCXX_IMPL_SERIALIZATION_TRAITS_H
+
+namespace grpc {
+
+/// Defines how to serialize and deserialize some type.
+///
+/// Used for hooking different message serialization API's into GRPC.
+/// Each SerializationTraits implementation must provide the following
+/// functions:
+/// static Status Serialize(const Message& msg,
+/// grpc_byte_buffer** buffer,
+// bool* own_buffer);
+/// static Status Deserialize(grpc_byte_buffer* buffer,
+/// Message* msg,
+/// int max_message_size);
+///
+/// Serialize is required to convert message to a grpc_byte_buffer, and
+/// to store a pointer to that byte buffer at *buffer. *own_buffer should
+/// be set to true if the caller owns said byte buffer, or false if
+/// ownership is retained elsewhere.
+///
+/// Deserialize is required to convert buffer into the message stored at
+/// msg. max_message_size is passed in as a bound on the maximum number of
+/// message bytes Deserialize should accept.
+///
+/// Both functions return a Status, allowing them to explain what went
+/// wrong if required.
+template <class Message,
+ class UnusedButHereForPartialTemplateSpecialization = void>
+class SerializationTraits;
+
+} // namespace grpc
+
+#endif // GRPCXX_IMPL_SERIALIZATION_TRAITS_H
diff --git a/include/grpc++/impl/service_type.h b/include/grpc++/impl/service_type.h
index 25e437edad..c33a278f5b 100644
--- a/include/grpc++/impl/service_type.h
+++ b/include/grpc++/impl/service_type.h
@@ -35,6 +35,8 @@
#define GRPCXX_IMPL_SERVICE_TYPE_H
#include <grpc++/config.h>
+#include <grpc++/impl/serialization_traits.h>
+#include <grpc++/server.h>
#include <grpc++/status.h>
namespace grpc {
@@ -65,20 +67,8 @@ class ServerAsyncStreamingInterface {
class AsynchronousService {
public:
- // this is Server, but in disguise to avoid a link dependency
- class DispatchImpl {
- public:
- virtual void RequestAsyncCall(void* registered_method,
- ServerContext* context,
- ::grpc::protobuf::Message* request,
- ServerAsyncStreamingInterface* stream,
- CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq,
- void* tag) = 0;
- };
-
AsynchronousService(const char** method_names, size_t method_count)
- : dispatch_impl_(nullptr),
+ : server_(nullptr),
method_names_(method_names),
method_count_(method_count),
request_args_(nullptr) {}
@@ -86,42 +76,43 @@ class AsynchronousService {
~AsynchronousService() { delete[] request_args_; }
protected:
- void RequestAsyncUnary(int index, ServerContext* context,
- grpc::protobuf::Message* request,
+ template <class Message>
+ void RequestAsyncUnary(int index, ServerContext* context, Message* request,
ServerAsyncStreamingInterface* stream,
CompletionQueue* call_cq,
ServerCompletionQueue* notification_cq, void* tag) {
- dispatch_impl_->RequestAsyncCall(request_args_[index], context, request,
- stream, call_cq, notification_cq, tag);
+ server_->RequestAsyncCall(request_args_[index], context, stream, call_cq,
+ notification_cq, tag, request);
}
void RequestClientStreaming(int index, ServerContext* context,
ServerAsyncStreamingInterface* stream,
CompletionQueue* call_cq,
ServerCompletionQueue* notification_cq,
void* tag) {
- dispatch_impl_->RequestAsyncCall(request_args_[index], context, nullptr,
- stream, call_cq, notification_cq, tag);
+ server_->RequestAsyncCall(request_args_[index], context, stream, call_cq,
+ notification_cq, tag);
}
+ template <class Message>
void RequestServerStreaming(int index, ServerContext* context,
- grpc::protobuf::Message* request,
+ Message* request,
ServerAsyncStreamingInterface* stream,
CompletionQueue* call_cq,
ServerCompletionQueue* notification_cq,
void* tag) {
- dispatch_impl_->RequestAsyncCall(request_args_[index], context, request,
- stream, call_cq, notification_cq, tag);
+ server_->RequestAsyncCall(request_args_[index], context, stream, call_cq,
+ notification_cq, tag, request);
}
void RequestBidiStreaming(int index, ServerContext* context,
ServerAsyncStreamingInterface* stream,
CompletionQueue* call_cq,
ServerCompletionQueue* notification_cq, void* tag) {
- dispatch_impl_->RequestAsyncCall(request_args_[index], context, nullptr,
- stream, call_cq, notification_cq, tag);
+ server_->RequestAsyncCall(request_args_[index], context, stream, call_cq,
+ notification_cq, tag);
}
private:
friend class Server;
- DispatchImpl* dispatch_impl_;
+ Server* server_;
const char** const method_names_;
size_t method_count_;
void** request_args_;
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index 2cfeb359fc..6a9e757e77 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -41,25 +41,24 @@
#include <grpc++/config.h>
#include <grpc++/impl/call.h>
#include <grpc++/impl/grpc_library.h>
-#include <grpc++/impl/service_type.h>
#include <grpc++/impl/sync.h>
#include <grpc++/status.h>
struct grpc_server;
namespace grpc {
+
class AsynchronousService;
class GenericServerContext;
class AsyncGenericService;
class RpcService;
class RpcServiceMethod;
+class ServerAsyncStreamingInterface;
class ServerCredentials;
class ThreadPoolInterface;
// Currently it only supports handling rpcs in a single thread.
-class Server GRPC_FINAL : public GrpcLibrary,
- private CallHook,
- private AsynchronousService::DispatchImpl {
+class Server GRPC_FINAL : public GrpcLibrary, private CallHook {
public:
~Server();
@@ -73,6 +72,7 @@ class Server GRPC_FINAL : public GrpcLibrary,
private:
friend class AsyncGenericService;
+ friend class AsynchronousService;
friend class ServerBuilder;
class SyncRequest;
@@ -96,21 +96,123 @@ class Server GRPC_FINAL : public GrpcLibrary,
void RunRpc();
void ScheduleCallback();
- void PerformOpsOnCall(CallOpBuffer* ops, Call* call) GRPC_OVERRIDE;
+ void PerformOpsOnCall(CallOpSetInterface* ops, Call* call) GRPC_OVERRIDE;
+
+ class BaseAsyncRequest : public CompletionQueueTag {
+ public:
+ BaseAsyncRequest(Server* server, ServerContext* context,
+ ServerAsyncStreamingInterface* stream,
+ CompletionQueue* call_cq, void* tag);
+ virtual ~BaseAsyncRequest();
+
+ bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE;
+
+ protected:
+ Server* const server_;
+ ServerContext* const context_;
+ ServerAsyncStreamingInterface* const stream_;
+ CompletionQueue* const call_cq_;
+ void* const tag_;
+ grpc_call* call_;
+ grpc_metadata_array initial_metadata_array_;
+ };
+
+ class RegisteredAsyncRequest : public BaseAsyncRequest {
+ public:
+ RegisteredAsyncRequest(Server* server, ServerContext* context,
+ ServerAsyncStreamingInterface* stream,
+ CompletionQueue* call_cq, void* tag);
+
+ // uses BaseAsyncRequest::FinalizeResult
+
+ protected:
+ void IssueRequest(void* registered_method, grpc_byte_buffer** payload,
+ ServerCompletionQueue* notification_cq);
+ };
+
+ class NoPayloadAsyncRequest GRPC_FINAL : public RegisteredAsyncRequest {
+ public:
+ NoPayloadAsyncRequest(void* registered_method, Server* server,
+ ServerContext* context,
+ ServerAsyncStreamingInterface* stream,
+ CompletionQueue* call_cq,
+ ServerCompletionQueue* notification_cq, void* tag)
+ : RegisteredAsyncRequest(server, context, stream, call_cq, tag) {
+ IssueRequest(registered_method, nullptr, notification_cq);
+ }
+
+ // uses RegisteredAsyncRequest::FinalizeResult
+ };
+
+ template <class Message>
+ class PayloadAsyncRequest GRPC_FINAL : public RegisteredAsyncRequest {
+ public:
+ PayloadAsyncRequest(void* registered_method, Server* server,
+ ServerContext* context,
+ ServerAsyncStreamingInterface* stream,
+ CompletionQueue* call_cq,
+ ServerCompletionQueue* notification_cq, void* tag,
+ Message* request)
+ : RegisteredAsyncRequest(server, context, stream, call_cq, tag),
+ request_(request) {
+ IssueRequest(registered_method, &payload_, notification_cq);
+ }
+
+ bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
+ bool serialization_status =
+ *status && payload_ &&
+ SerializationTraits<Message>::Deserialize(payload_, request_,
+ server_->max_message_size_)
+ .ok();
+ bool ret = RegisteredAsyncRequest::FinalizeResult(tag, status);
+ *status = serialization_status && *status;
+ return ret;
+ }
+
+ private:
+ grpc_byte_buffer* payload_;
+ Message* const request_;
+ };
+
+ class GenericAsyncRequest GRPC_FINAL : public BaseAsyncRequest {
+ public:
+ GenericAsyncRequest(Server* server, GenericServerContext* context,
+ ServerAsyncStreamingInterface* stream,
+ CompletionQueue* call_cq,
+ ServerCompletionQueue* notification_cq, void* tag);
+
+ bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE;
+
+ private:
+ grpc_call_details call_details_;
+ };
+
+ template <class Message>
+ void RequestAsyncCall(void* registered_method, ServerContext* context,
+ ServerAsyncStreamingInterface* stream,
+ CompletionQueue* call_cq,
+ ServerCompletionQueue* notification_cq, void* tag,
+ Message* message) {
+ new PayloadAsyncRequest<Message>(registered_method, this, context, stream,
+ call_cq, notification_cq, tag, message);
+ }
- // DispatchImpl
void RequestAsyncCall(void* registered_method, ServerContext* context,
- grpc::protobuf::Message* request,
ServerAsyncStreamingInterface* stream,
CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq,
- void* tag) GRPC_OVERRIDE;
+ ServerCompletionQueue* notification_cq, void* tag) {
+ new NoPayloadAsyncRequest(registered_method, this, context, stream, call_cq,
+ notification_cq, tag);
+ }
void RequestAsyncGenericCall(GenericServerContext* context,
ServerAsyncStreamingInterface* stream,
- CompletionQueue* cq,
+ CompletionQueue* call_cq,
ServerCompletionQueue* notification_cq,
- void* tag);
+ void* tag) {
+ new GenericAsyncRequest(this, context, stream, call_cq, notification_cq,
+ tag);
+ }
const int max_message_size_;
@@ -133,8 +235,6 @@ class Server GRPC_FINAL : public GrpcLibrary,
ThreadPoolInterface* thread_pool_;
// Whether the thread pool is created and owned by the server.
bool thread_pool_owned_;
- private:
- Server() : max_message_size_(-1), server_(NULL) { abort(); }
};
} // namespace grpc
diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h
index 5a6af299e3..3bf21e02bf 100644
--- a/include/grpc++/server_context.h
+++ b/include/grpc++/server_context.h
@@ -62,6 +62,14 @@ template <class W>
class ServerWriter;
template <class R, class W>
class ServerReaderWriter;
+template <class ServiceType, class RequestType, class ResponseType>
+class RpcMethodHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class ClientStreamingHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class ServerStreamingHandler;
+template <class ServiceType, class RequestType, class ResponseType>
+class BidiStreamingHandler;
class Call;
class CallOpBuffer;
@@ -109,6 +117,14 @@ class ServerContext {
friend class ::grpc::ServerWriter;
template <class R, class W>
friend class ::grpc::ServerReaderWriter;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class RpcMethodHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class ClientStreamingHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class ServerStreamingHandler;
+ template <class ServiceType, class RequestType, class ResponseType>
+ friend class BidiStreamingHandler;
// Prevent copying.
ServerContext(const ServerContext&);
diff --git a/include/grpc++/stream.h b/include/grpc++/stream.h
index 472911e62b..dd5e52d6d3 100644
--- a/include/grpc++/stream.h
+++ b/include/grpc++/stream.h
@@ -93,15 +93,18 @@ template <class R>
class ClientReader GRPC_FINAL : public ClientReaderInterface<R> {
public:
// Blocking create a stream and write the first request out.
+ template <class W>
ClientReader(ChannelInterface* channel, const RpcMethod& method,
- ClientContext* context, const grpc::protobuf::Message& request)
+ ClientContext* context, const W& request)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) {
- CallOpBuffer buf;
- buf.AddSendInitialMetadata(&context->send_initial_metadata_);
- buf.AddSendMessage(request);
- buf.AddClientSendClose();
- call_.PerformOps(&buf);
- cq_.Pluck(&buf);
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpClientSendClose> ops;
+ ops.SendInitialMetadata(context->send_initial_metadata_);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(ops.SendMessage(request).ok());
+ ops.ClientSendClose();
+ call_.PerformOps(&ops);
+ cq_.Pluck(&ops);
}
// Blocking wait for initial metadata from server. The received metadata
@@ -111,28 +114,28 @@ class ClientReader GRPC_FINAL : public ClientReaderInterface<R> {
void WaitForInitialMetadata() {
GPR_ASSERT(!context_->initial_metadata_received_);
- CallOpBuffer buf;
- buf.AddRecvInitialMetadata(context_);
- call_.PerformOps(&buf);
- cq_.Pluck(&buf); // status ignored
+ CallOpSet<CallOpRecvInitialMetadata> ops;
+ ops.RecvInitialMetadata(context_);
+ call_.PerformOps(&ops);
+ cq_.Pluck(&ops); // status ignored
}
bool Read(R* msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops;
if (!context_->initial_metadata_received_) {
- buf.AddRecvInitialMetadata(context_);
+ ops.RecvInitialMetadata(context_);
}
- buf.AddRecvMessage(msg);
- call_.PerformOps(&buf);
- return cq_.Pluck(&buf) && buf.got_message;
+ ops.RecvMessage(msg);
+ call_.PerformOps(&ops);
+ return cq_.Pluck(&ops) && ops.got_message;
}
Status Finish() GRPC_OVERRIDE {
- CallOpBuffer buf;
+ CallOpSet<CallOpClientRecvStatus> ops;
Status status;
- buf.AddClientRecvStatus(context_, &status);
- call_.PerformOps(&buf);
- GPR_ASSERT(cq_.Pluck(&buf));
+ ops.ClientRecvStatus(context_, &status);
+ call_.PerformOps(&ops);
+ GPR_ASSERT(cq_.Pluck(&ops));
return status;
}
@@ -150,48 +153,49 @@ class ClientWriterInterface : public ClientStreamingInterface,
};
template <class W>
-class ClientWriter GRPC_FINAL : public ClientWriterInterface<W> {
+class ClientWriter : public ClientWriterInterface<W> {
public:
// Blocking create a stream.
+ template <class R>
ClientWriter(ChannelInterface* channel, const RpcMethod& method,
- ClientContext* context, grpc::protobuf::Message* response)
- : context_(context),
- response_(response),
- call_(channel->CreateCall(method, context, &cq_)) {
- CallOpBuffer buf;
- buf.AddSendInitialMetadata(&context->send_initial_metadata_);
- call_.PerformOps(&buf);
- cq_.Pluck(&buf);
+ ClientContext* context, R* response)
+ : context_(context), call_(channel->CreateCall(method, context, &cq_)) {
+ finish_ops_.RecvMessage(response);
+
+ CallOpSet<CallOpSendInitialMetadata> ops;
+ ops.SendInitialMetadata(context->send_initial_metadata_);
+ call_.PerformOps(&ops);
+ cq_.Pluck(&ops);
}
bool Write(const W& msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
- buf.AddSendMessage(msg);
- call_.PerformOps(&buf);
- return cq_.Pluck(&buf);
+ CallOpSet<CallOpSendMessage> ops;
+ if (!ops.SendMessage(msg).ok()) {
+ return false;
+ }
+ call_.PerformOps(&ops);
+ return cq_.Pluck(&ops);
}
bool WritesDone() GRPC_OVERRIDE {
- CallOpBuffer buf;
- buf.AddClientSendClose();
- call_.PerformOps(&buf);
- return cq_.Pluck(&buf);
+ CallOpSet<CallOpClientSendClose> ops;
+ ops.ClientSendClose();
+ call_.PerformOps(&ops);
+ return cq_.Pluck(&ops);
}
// Read the final response and wait for the final status.
Status Finish() GRPC_OVERRIDE {
- CallOpBuffer buf;
Status status;
- buf.AddRecvMessage(response_);
- buf.AddClientRecvStatus(context_, &status);
- call_.PerformOps(&buf);
- GPR_ASSERT(cq_.Pluck(&buf));
+ finish_ops_.ClientRecvStatus(context_, &status);
+ call_.PerformOps(&finish_ops_);
+ GPR_ASSERT(cq_.Pluck(&finish_ops_));
return status;
}
private:
ClientContext* context_;
- grpc::protobuf::Message* const response_;
+ CallOpSet<CallOpGenericRecvMessage, CallOpClientRecvStatus> finish_ops_;
CompletionQueue cq_;
Call call_;
};
@@ -213,10 +217,10 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> {
ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) {
- CallOpBuffer buf;
- buf.AddSendInitialMetadata(&context->send_initial_metadata_);
- call_.PerformOps(&buf);
- cq_.Pluck(&buf);
+ CallOpSet<CallOpSendInitialMetadata> ops;
+ ops.SendInitialMetadata(context->send_initial_metadata_);
+ call_.PerformOps(&ops);
+ cq_.Pluck(&ops);
}
// Blocking wait for initial metadata from server. The received metadata
@@ -226,42 +230,42 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> {
void WaitForInitialMetadata() {
GPR_ASSERT(!context_->initial_metadata_received_);
- CallOpBuffer buf;
- buf.AddRecvInitialMetadata(context_);
- call_.PerformOps(&buf);
- cq_.Pluck(&buf); // status ignored
+ CallOpSet<CallOpRecvInitialMetadata> ops;
+ ops.RecvInitialMetadata(context_);
+ call_.PerformOps(&ops);
+ cq_.Pluck(&ops); // status ignored
}
bool Read(R* msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> ops;
if (!context_->initial_metadata_received_) {
- buf.AddRecvInitialMetadata(context_);
+ ops.RecvInitialMetadata(context_);
}
- buf.AddRecvMessage(msg);
- call_.PerformOps(&buf);
- return cq_.Pluck(&buf) && buf.got_message;
+ ops.RecvMessage(msg);
+ call_.PerformOps(&ops);
+ return cq_.Pluck(&ops) && ops.got_message;
}
bool Write(const W& msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
- buf.AddSendMessage(msg);
- call_.PerformOps(&buf);
- return cq_.Pluck(&buf);
+ CallOpSet<CallOpSendMessage> ops;
+ if (!ops.SendMessage(msg).ok()) return false;
+ call_.PerformOps(&ops);
+ return cq_.Pluck(&ops);
}
bool WritesDone() GRPC_OVERRIDE {
- CallOpBuffer buf;
- buf.AddClientSendClose();
- call_.PerformOps(&buf);
- return cq_.Pluck(&buf);
+ CallOpSet<CallOpClientSendClose> ops;
+ ops.ClientSendClose();
+ call_.PerformOps(&ops);
+ return cq_.Pluck(&ops);
}
Status Finish() GRPC_OVERRIDE {
- CallOpBuffer buf;
+ CallOpSet<CallOpClientRecvStatus> ops;
Status status;
- buf.AddClientRecvStatus(context_, &status);
- call_.PerformOps(&buf);
- GPR_ASSERT(cq_.Pluck(&buf));
+ ops.ClientRecvStatus(context_, &status);
+ call_.PerformOps(&ops);
+ GPR_ASSERT(cq_.Pluck(&ops));
return status;
}
@@ -279,18 +283,18 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> {
void SendInitialMetadata() {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- CallOpBuffer buf;
- buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ CallOpSet<CallOpSendInitialMetadata> ops;
+ ops.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
- call_->PerformOps(&buf);
- call_->cq()->Pluck(&buf);
+ call_->PerformOps(&ops);
+ call_->cq()->Pluck(&ops);
}
bool Read(R* msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
- buf.AddRecvMessage(msg);
- call_->PerformOps(&buf);
- return call_->cq()->Pluck(&buf) && buf.got_message;
+ CallOpSet<CallOpRecvMessage<R>> ops;
+ ops.RecvMessage(msg);
+ call_->PerformOps(&ops);
+ return call_->cq()->Pluck(&ops) && ops.got_message;
}
private:
@@ -306,22 +310,24 @@ class ServerWriter GRPC_FINAL : public WriterInterface<W> {
void SendInitialMetadata() {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- CallOpBuffer buf;
- buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ CallOpSet<CallOpSendInitialMetadata> ops;
+ ops.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
- call_->PerformOps(&buf);
- call_->cq()->Pluck(&buf);
+ call_->PerformOps(&ops);
+ call_->cq()->Pluck(&ops);
}
bool Write(const W& msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> ops;
+ if (!ops.SendMessage(msg).ok()) {
+ return false;
+ }
if (!ctx_->sent_initial_metadata_) {
- buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ ops.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- buf.AddSendMessage(msg);
- call_->PerformOps(&buf);
- return call_->cq()->Pluck(&buf);
+ call_->PerformOps(&ops);
+ return call_->cq()->Pluck(&ops);
}
private:
@@ -339,29 +345,31 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface<W>,
void SendInitialMetadata() {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- CallOpBuffer buf;
- buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ CallOpSet<CallOpSendInitialMetadata> ops;
+ ops.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
- call_->PerformOps(&buf);
- call_->cq()->Pluck(&buf);
+ call_->PerformOps(&ops);
+ call_->cq()->Pluck(&ops);
}
bool Read(R* msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
- buf.AddRecvMessage(msg);
- call_->PerformOps(&buf);
- return call_->cq()->Pluck(&buf) && buf.got_message;
+ CallOpSet<CallOpRecvMessage<R>> ops;
+ ops.RecvMessage(msg);
+ call_->PerformOps(&ops);
+ return call_->cq()->Pluck(&ops) && ops.got_message;
}
bool Write(const W& msg) GRPC_OVERRIDE {
- CallOpBuffer buf;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> ops;
+ if (!ops.SendMessage(msg).ok()) {
+ return false;
+ }
if (!ctx_->sent_initial_metadata_) {
- buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ ops.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- buf.AddSendMessage(msg);
- call_->PerformOps(&buf);
- return call_->cq()->Pluck(&buf);
+ call_->PerformOps(&ops);
+ return call_->cq()->Pluck(&ops);
}
private:
@@ -400,57 +408,59 @@ class AsyncWriterInterface {
template <class R>
class ClientAsyncReaderInterface : public ClientAsyncStreamingInterface,
- public AsyncReaderInterface<R> {
-};
+ public AsyncReaderInterface<R> {};
template <class R>
class ClientAsyncReader GRPC_FINAL : public ClientAsyncReaderInterface<R> {
public:
// Create a stream and write the first request out.
+ template <class W>
ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context,
- const grpc::protobuf::Message& request, void* tag)
+ const W& request, void* tag)
: context_(context), call_(channel->CreateCall(method, context, cq)) {
- init_buf_.Reset(tag);
- init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_);
- init_buf_.AddSendMessage(request);
- init_buf_.AddClientSendClose();
- call_.PerformOps(&init_buf_);
+ init_ops_.set_output_tag(tag);
+ init_ops_.SendInitialMetadata(context->send_initial_metadata_);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(init_ops_.SendMessage(request).ok());
+ init_ops_.ClientSendClose();
+ call_.PerformOps(&init_ops_);
}
void ReadInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!context_->initial_metadata_received_);
- meta_buf_.Reset(tag);
- meta_buf_.AddRecvInitialMetadata(context_);
- call_.PerformOps(&meta_buf_);
+ meta_ops_.set_output_tag(tag);
+ meta_ops_.RecvInitialMetadata(context_);
+ call_.PerformOps(&meta_ops_);
}
void Read(R* msg, void* tag) GRPC_OVERRIDE {
- read_buf_.Reset(tag);
+ read_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
- read_buf_.AddRecvInitialMetadata(context_);
+ read_ops_.RecvInitialMetadata(context_);
}
- read_buf_.AddRecvMessage(msg);
- call_.PerformOps(&read_buf_);
+ read_ops_.RecvMessage(msg);
+ call_.PerformOps(&read_ops_);
}
void Finish(Status* status, void* tag) GRPC_OVERRIDE {
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
- finish_buf_.AddRecvInitialMetadata(context_);
+ finish_ops_.RecvInitialMetadata(context_);
}
- finish_buf_.AddClientRecvStatus(context_, status);
- call_.PerformOps(&finish_buf_);
+ finish_ops_.ClientRecvStatus(context_, status);
+ call_.PerformOps(&finish_ops_);
}
private:
ClientContext* context_;
Call call_;
- CallOpBuffer init_buf_;
- CallOpBuffer meta_buf_;
- CallOpBuffer read_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose>
+ init_ops_;
+ CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_;
};
template <class W>
@@ -463,56 +473,57 @@ class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface,
template <class W>
class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> {
public:
+ template <class R>
ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context,
- grpc::protobuf::Message* response, void* tag)
- : context_(context),
- response_(response),
- call_(channel->CreateCall(method, context, cq)) {
- init_buf_.Reset(tag);
- init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_);
- call_.PerformOps(&init_buf_);
+ R* response, void* tag)
+ : context_(context), call_(channel->CreateCall(method, context, cq)) {
+ finish_ops_.RecvMessage(response);
+
+ init_ops_.set_output_tag(tag);
+ init_ops_.SendInitialMetadata(context->send_initial_metadata_);
+ call_.PerformOps(&init_ops_);
}
void ReadInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!context_->initial_metadata_received_);
- meta_buf_.Reset(tag);
- meta_buf_.AddRecvInitialMetadata(context_);
- call_.PerformOps(&meta_buf_);
+ meta_ops_.set_output_tag(tag);
+ meta_ops_.RecvInitialMetadata(context_);
+ call_.PerformOps(&meta_ops_);
}
void Write(const W& msg, void* tag) GRPC_OVERRIDE {
- write_buf_.Reset(tag);
- write_buf_.AddSendMessage(msg);
- call_.PerformOps(&write_buf_);
+ write_ops_.set_output_tag(tag);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(write_ops_.SendMessage(msg).ok());
+ call_.PerformOps(&write_ops_);
}
void WritesDone(void* tag) GRPC_OVERRIDE {
- writes_done_buf_.Reset(tag);
- writes_done_buf_.AddClientSendClose();
- call_.PerformOps(&writes_done_buf_);
+ writes_done_ops_.set_output_tag(tag);
+ writes_done_ops_.ClientSendClose();
+ call_.PerformOps(&writes_done_ops_);
}
void Finish(Status* status, void* tag) GRPC_OVERRIDE {
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
- finish_buf_.AddRecvInitialMetadata(context_);
+ finish_ops_.RecvInitialMetadata(context_);
}
- finish_buf_.AddRecvMessage(response_);
- finish_buf_.AddClientRecvStatus(context_, status);
- call_.PerformOps(&finish_buf_);
+ finish_ops_.ClientRecvStatus(context_, status);
+ call_.PerformOps(&finish_ops_);
}
private:
ClientContext* context_;
- grpc::protobuf::Message* const response_;
Call call_;
- CallOpBuffer init_buf_;
- CallOpBuffer meta_buf_;
- CallOpBuffer write_buf_;
- CallOpBuffer writes_done_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata> init_ops_;
+ CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
+ CallOpSet<CallOpSendMessage> write_ops_;
+ CallOpSet<CallOpClientSendClose> writes_done_ops_;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage,
+ CallOpClientRecvStatus> finish_ops_;
};
// Client-side interface for bi-directional streaming.
@@ -532,58 +543,59 @@ class ClientAsyncReaderWriter GRPC_FINAL
const RpcMethod& method, ClientContext* context,
void* tag)
: context_(context), call_(channel->CreateCall(method, context, cq)) {
- init_buf_.Reset(tag);
- init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_);
- call_.PerformOps(&init_buf_);
+ init_ops_.set_output_tag(tag);
+ init_ops_.SendInitialMetadata(context->send_initial_metadata_);
+ call_.PerformOps(&init_ops_);
}
void ReadInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!context_->initial_metadata_received_);
- meta_buf_.Reset(tag);
- meta_buf_.AddRecvInitialMetadata(context_);
- call_.PerformOps(&meta_buf_);
+ meta_ops_.set_output_tag(tag);
+ meta_ops_.RecvInitialMetadata(context_);
+ call_.PerformOps(&meta_ops_);
}
void Read(R* msg, void* tag) GRPC_OVERRIDE {
- read_buf_.Reset(tag);
+ read_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
- read_buf_.AddRecvInitialMetadata(context_);
+ read_ops_.RecvInitialMetadata(context_);
}
- read_buf_.AddRecvMessage(msg);
- call_.PerformOps(&read_buf_);
+ read_ops_.RecvMessage(msg);
+ call_.PerformOps(&read_ops_);
}
void Write(const W& msg, void* tag) GRPC_OVERRIDE {
- write_buf_.Reset(tag);
- write_buf_.AddSendMessage(msg);
- call_.PerformOps(&write_buf_);
+ write_ops_.set_output_tag(tag);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(write_ops_.SendMessage(msg).ok());
+ call_.PerformOps(&write_ops_);
}
void WritesDone(void* tag) GRPC_OVERRIDE {
- writes_done_buf_.Reset(tag);
- writes_done_buf_.AddClientSendClose();
- call_.PerformOps(&writes_done_buf_);
+ writes_done_ops_.set_output_tag(tag);
+ writes_done_ops_.ClientSendClose();
+ call_.PerformOps(&writes_done_ops_);
}
void Finish(Status* status, void* tag) GRPC_OVERRIDE {
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!context_->initial_metadata_received_) {
- finish_buf_.AddRecvInitialMetadata(context_);
+ finish_ops_.RecvInitialMetadata(context_);
}
- finish_buf_.AddClientRecvStatus(context_, status);
- call_.PerformOps(&finish_buf_);
+ finish_ops_.ClientRecvStatus(context_, status);
+ call_.PerformOps(&finish_ops_);
}
private:
ClientContext* context_;
Call call_;
- CallOpBuffer init_buf_;
- CallOpBuffer meta_buf_;
- CallOpBuffer read_buf_;
- CallOpBuffer write_buf_;
- CallOpBuffer writes_done_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata> init_ops_;
+ CallOpSet<CallOpRecvInitialMetadata> meta_ops_;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_;
+ CallOpSet<CallOpSendMessage> write_ops_;
+ CallOpSet<CallOpClientSendClose> writes_done_ops_;
+ CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_;
};
template <class W, class R>
@@ -596,41 +608,44 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- meta_buf_.Reset(tag);
- meta_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ meta_ops_.set_output_tag(tag);
+ meta_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
- call_.PerformOps(&meta_buf_);
+ call_.PerformOps(&meta_ops_);
}
void Read(R* msg, void* tag) GRPC_OVERRIDE {
- read_buf_.Reset(tag);
- read_buf_.AddRecvMessage(msg);
- call_.PerformOps(&read_buf_);
+ read_ops_.set_output_tag(tag);
+ read_ops_.RecvMessage(msg);
+ call_.PerformOps(&read_ops_);
}
void Finish(const W& msg, const Status& status, void* tag) {
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- finish_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
// The response is dropped if the status is not OK.
if (status.ok()) {
- finish_buf_.AddSendMessage(msg);
+ finish_ops_.ServerSendStatus(
+ ctx_->trailing_metadata_,
+ finish_ops_.SendMessage(msg));
+ } else {
+ finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
}
- finish_buf_.AddServerSendStatus(&ctx_->trailing_metadata_, status);
- call_.PerformOps(&finish_buf_);
+ call_.PerformOps(&finish_ops_);
}
void FinishWithError(const Status& status, void* tag) {
GPR_ASSERT(!status.ok());
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- finish_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- finish_buf_.AddServerSendStatus(&ctx_->trailing_metadata_, status);
- call_.PerformOps(&finish_buf_);
+ finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
+ call_.PerformOps(&finish_ops_);
}
private:
@@ -638,9 +653,10 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
Call call_;
ServerContext* ctx_;
- CallOpBuffer meta_buf_;
- CallOpBuffer read_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata> meta_ops_;
+ CallOpSet<CallOpRecvMessage<R>> read_ops_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
+ CallOpServerSendStatus> finish_ops_;
};
template <class W>
@@ -653,30 +669,31 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- meta_buf_.Reset(tag);
- meta_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ meta_ops_.set_output_tag(tag);
+ meta_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
- call_.PerformOps(&meta_buf_);
+ call_.PerformOps(&meta_ops_);
}
void Write(const W& msg, void* tag) GRPC_OVERRIDE {
- write_buf_.Reset(tag);
+ write_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- write_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ write_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- write_buf_.AddSendMessage(msg);
- call_.PerformOps(&write_buf_);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(write_ops_.SendMessage(msg).ok());
+ call_.PerformOps(&write_ops_);
}
void Finish(const Status& status, void* tag) {
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- finish_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- finish_buf_.AddServerSendStatus(&ctx_->trailing_metadata_, status);
- call_.PerformOps(&finish_buf_);
+ finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
+ call_.PerformOps(&finish_ops_);
}
private:
@@ -684,9 +701,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
Call call_;
ServerContext* ctx_;
- CallOpBuffer meta_buf_;
- CallOpBuffer write_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata> meta_ops_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> write_ops_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
};
// Server-side interface for bi-directional streaming.
@@ -701,36 +718,37 @@ class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_);
- meta_buf_.Reset(tag);
- meta_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ meta_ops_.set_output_tag(tag);
+ meta_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
- call_.PerformOps(&meta_buf_);
+ call_.PerformOps(&meta_ops_);
}
void Read(R* msg, void* tag) GRPC_OVERRIDE {
- read_buf_.Reset(tag);
- read_buf_.AddRecvMessage(msg);
- call_.PerformOps(&read_buf_);
+ read_ops_.set_output_tag(tag);
+ read_ops_.RecvMessage(msg);
+ call_.PerformOps(&read_ops_);
}
void Write(const W& msg, void* tag) GRPC_OVERRIDE {
- write_buf_.Reset(tag);
+ write_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- write_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ write_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- write_buf_.AddSendMessage(msg);
- call_.PerformOps(&write_buf_);
+ // TODO(ctiller): don't assert
+ GPR_ASSERT(write_ops_.SendMessage(msg).ok());
+ call_.PerformOps(&write_ops_);
}
void Finish(const Status& status, void* tag) {
- finish_buf_.Reset(tag);
+ finish_ops_.set_output_tag(tag);
if (!ctx_->sent_initial_metadata_) {
- finish_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
+ finish_ops_.SendInitialMetadata(ctx_->initial_metadata_);
ctx_->sent_initial_metadata_ = true;
}
- finish_buf_.AddServerSendStatus(&ctx_->trailing_metadata_, status);
- call_.PerformOps(&finish_buf_);
+ finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status);
+ call_.PerformOps(&finish_ops_);
}
private:
@@ -738,10 +756,10 @@ class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
Call call_;
ServerContext* ctx_;
- CallOpBuffer meta_buf_;
- CallOpBuffer read_buf_;
- CallOpBuffer write_buf_;
- CallOpBuffer finish_buf_;
+ CallOpSet<CallOpSendInitialMetadata> meta_ops_;
+ CallOpSet<CallOpRecvMessage<R>> read_ops_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> write_ops_;
+ CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_;
};
} // namespace grpc
diff --git a/include/grpc/byte_buffer.h b/include/grpc/byte_buffer.h
index 6d08474d8c..913e2a7697 100644
--- a/include/grpc/byte_buffer.h
+++ b/include/grpc/byte_buffer.h
@@ -85,7 +85,6 @@ size_t grpc_byte_buffer_length(grpc_byte_buffer *bb);
/** Destroys \a byte_buffer deallocating all its memory. */
void grpc_byte_buffer_destroy(grpc_byte_buffer *byte_buffer);
-
/** Reader for byte buffers. Iterates over slices in the byte buffer */
struct grpc_byte_buffer_reader;
typedef struct grpc_byte_buffer_reader grpc_byte_buffer_reader;
@@ -103,8 +102,12 @@ void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader);
int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
gpr_slice *slice);
+/** Returns a RAW byte buffer instance from the output of \a reader. */
+grpc_byte_buffer *grpc_raw_byte_buffer_from_reader(
+ grpc_byte_buffer_reader *reader);
+
#ifdef __cplusplus
}
#endif
-#endif /* GRPC_BYTE_BUFFER_H */
+#endif /* GRPC_BYTE_BUFFER_H */
diff --git a/include/grpc/byte_buffer_reader.h b/include/grpc/byte_buffer_reader.h
index 1ef817cf30..b0e63a6da2 100644
--- a/include/grpc/byte_buffer_reader.h
+++ b/include/grpc/byte_buffer_reader.h
@@ -55,4 +55,4 @@ struct grpc_byte_buffer_reader {
}
#endif
-#endif /* GRPC_BYTE_BUFFER_READER_H */
+#endif /* GRPC_BYTE_BUFFER_READER_H */
diff --git a/include/grpc/compression.h b/include/grpc/compression.h
index 207898f605..61bce05b50 100644
--- a/include/grpc/compression.h
+++ b/include/grpc/compression.h
@@ -59,4 +59,4 @@ const char *grpc_compression_algorithm_name(
grpc_compression_algorithm grpc_compression_algorithm_for_level(
grpc_compression_level level);
-#endif /* GRPC_COMPRESSION_H */
+#endif /* GRPC_COMPRESSION_H */
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 722ce4f365..637f473b82 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -145,7 +145,10 @@ typedef enum grpc_call_error {
/* the flags value was illegal for this call */
GRPC_CALL_ERROR_INVALID_FLAGS,
/* invalid metadata was passed to this call */
- GRPC_CALL_ERROR_INVALID_METADATA
+ GRPC_CALL_ERROR_INVALID_METADATA,
+ /* completion queue for notification has not been registered with the server
+ */
+ GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE
} grpc_call_error;
/* Write Flags: */
@@ -253,7 +256,7 @@ typedef enum {
no arguments) */
typedef struct grpc_op {
grpc_op_type op;
- gpr_uint32 flags; /**< Write flags bitset for grpc_begin_messages */
+ gpr_uint32 flags; /**< Write flags bitset for grpc_begin_messages */
union {
struct {
size_t count;
@@ -338,7 +341,7 @@ void grpc_shutdown(void);
grpc_completion_queue *grpc_completion_queue_create(void);
/** Blocks until an event is available, the completion queue is being shut down,
- or deadline is reached.
+ or deadline is reached.
Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,
otherwise a grpc_event describing the event that occurred.
@@ -349,7 +352,7 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
gpr_timespec deadline);
/** Blocks until an event with tag 'tag' is available, the completion queue is
- being shutdown or deadline is reached.
+ being shutdown or deadline is reached.
Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,
otherwise a grpc_event describing the event that occurred.
@@ -372,10 +375,9 @@ void grpc_completion_queue_shutdown(grpc_completion_queue *cq);
drained and no threads are executing grpc_completion_queue_next */
void grpc_completion_queue_destroy(grpc_completion_queue *cq);
-/* Create a call given a grpc_channel, in order to call 'method'. The request
- is not sent until grpc_call_invoke is called. All completions are sent to
- 'completion_queue'. 'method' and 'host' need only live through the invocation
- of this function. */
+/* Create a call given a grpc_channel, in order to call 'method'. All
+ completions are sent to 'completion_queue'. 'method' and 'host' need only
+ live through the invocation of this function. */
grpc_call *grpc_channel_create_call(grpc_channel *channel,
grpc_completion_queue *completion_queue,
const char *method, const char *host,
@@ -394,7 +396,13 @@ grpc_call *grpc_channel_create_registered_call(
completion of type 'tag' to the completion queue bound to the call.
The order of ops specified in the batch has no significance.
Only one operation of each type can be active at once in any given
- batch. */
+ batch. You must call grpc_completion_queue_next or
+ grpc_completion_queue_pluck on the completion queue associated with 'call'
+ for work to be performed.
+ THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment
+ needs to be synchronized. As an optimization, you may synchronize batches
+ containing just send operations independently from batches containing just
+ receive operations. */
grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
size_t nops, void *tag);
@@ -412,17 +420,6 @@ grpc_channel *grpc_lame_client_channel_create(void);
/* Close and destroy a grpc channel */
void grpc_channel_destroy(grpc_channel *channel);
-/* THREAD-SAFETY for grpc_call
- The following functions are thread-compatible for any given call:
- grpc_call_add_metadata
- grpc_call_invoke
- grpc_call_start_write
- grpc_call_writes_done
- grpc_call_start_read
- grpc_call_destroy
- The function grpc_call_cancel is thread-safe, and can be called at any
- point before grpc_call_destroy is called. */
-
/* Error handling for grpc_call
Most grpc_call functions return a grpc_error. If the error is not GRPC_OK
then the operation failed due to some unsatisfied precondition.
@@ -430,7 +427,10 @@ void grpc_channel_destroy(grpc_channel *channel);
has been made. */
/* Called by clients to cancel an RPC on the server.
- Can be called multiple times, from any thread. */
+ Can be called multiple times, from any thread.
+ THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status
+ are thread-safe, and can be called at any point before grpc_call_destroy
+ is called.*/
grpc_call_error grpc_call_cancel(grpc_call *call);
/* Called by clients to cancel an RPC on the server.
@@ -443,10 +443,13 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call *call,
grpc_status_code status,
const char *description);
-/* Destroy a call. */
+/* Destroy a call.
+ THREAD SAFETY: grpc_call_destroy is thread-compatible */
void grpc_call_destroy(grpc_call *call);
-/* Request notification of a new call */
+/* Request notification of a new call. 'cq_for_notification' must
+ have been registered to the server via grpc_server_register_completion_queue.
+ */
grpc_call_error grpc_server_request_call(
grpc_server *server, grpc_call **call, grpc_call_details *details,
grpc_metadata_array *request_metadata,
@@ -463,7 +466,9 @@ grpc_call_error grpc_server_request_call(
void *grpc_server_register_method(grpc_server *server, const char *method,
const char *host);
-/* Request notification of a new pre-registered call */
+/* Request notification of a new pre-registered call. 'cq_for_notification' must
+ have been registered to the server via grpc_server_register_completion_queue.
+ */
grpc_call_error grpc_server_request_registered_call(
grpc_server *server, void *registered_method, grpc_call **call,
gpr_timespec *deadline, grpc_metadata_array *request_metadata,
@@ -477,9 +482,10 @@ grpc_call_error grpc_server_request_registered_call(
through the invocation of this function. */
grpc_server *grpc_server_create(const grpc_channel_args *args);
-/* Register a completion queue with the server. Must be done for any completion
- queue that is passed to grpc_server_request_* call. Must be performed prior
- to grpc_server_start. */
+/* Register a completion queue with the server. Must be done for any
+ notification completion queue that is passed to grpc_server_request_*_call
+ and to grpc_server_shutdown_and_notify. Must be performed prior to
+ grpc_server_start. */
void grpc_server_register_completion_queue(grpc_server *server,
grpc_completion_queue *cq);
@@ -496,7 +502,8 @@ void grpc_server_start(grpc_server *server);
Existing calls will be allowed to complete.
Send a GRPC_OP_COMPLETE event when there are no more calls being serviced.
Shutdown is idempotent, and all tags will be notified at once if multiple
- grpc_server_shutdown_and_notify calls are made. */
+ grpc_server_shutdown_and_notify calls are made. 'cq' must have been
+ registered to this server via grpc_server_register_completion_queue. */
void grpc_server_shutdown_and_notify(grpc_server *server,
grpc_completion_queue *cq, void *tag);
@@ -514,9 +521,9 @@ void grpc_server_destroy(grpc_server *server);
Tracers (usually controlled by the environment variable GRPC_TRACE)
allow printf-style debugging on GRPC internals, and are useful for
- tracking down problems in the field.
+ tracking down problems in the field.
- Use of this function is not strictly thread-safe, but the
+ Use of this function is not strictly thread-safe, but the
thread-safety issues raised by it should not be of concern. */
int grpc_tracer_set_enabled(const char *name, int enabled);
diff --git a/include/grpc/grpc_security.h b/include/grpc/grpc_security.h
index e104b6952f..7a6aa66670 100644
--- a/include/grpc/grpc_security.h
+++ b/include/grpc/grpc_security.h
@@ -195,8 +195,7 @@ grpc_call_error grpc_call_set_credentials(grpc_call *call,
/* TODO(jboeuf): Define some well-known property names. */
-#define GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME \
- "transport_security_type"
+#define GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME "transport_security_type"
#define GRPC_FAKE_TRANSPORT_SECURITY_TYPE "fake"
#define GRPC_SSL_TRANSPORT_SECURITY_TYPE "ssl"
@@ -251,4 +250,4 @@ const grpc_auth_context *grpc_call_auth_context(grpc_call *call);
}
#endif
-#endif /* GRPC_GRPC_SECURITY_H */
+#endif /* GRPC_GRPC_SECURITY_H */
diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h
index a695acf205..4fbce9c8d9 100644
--- a/include/grpc/support/port_platform.h
+++ b/include/grpc/support/port_platform.h
@@ -223,7 +223,9 @@
#endif
/* Validate platform combinations */
-#if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + defined(GPR_WIN32_ATOMIC) != 1
+#if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + \
+ defined(GPR_WIN32_ATOMIC) != \
+ 1
#error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WIN32_ATOMIC
#endif
@@ -231,7 +233,9 @@
#error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
#endif
-#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) + defined(GPR_CPU_IPHONE) + defined(GPR_CPU_CUSTOM) != 1
+#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) + \
+ defined(GPR_CPU_IPHONE) + defined(GPR_CPU_CUSTOM) != \
+ 1
#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
#endif
@@ -239,11 +243,15 @@
#error Must define GPR_POSIX_SOCKET to use GPR_POSIX_MULTIPOLL_WITH_POLL
#endif
-#if defined(GPR_POSIX_SOCKET) + defined(GPR_WINSOCK_SOCKET) + defined(GPR_CUSTOM_SOCKET) != 1
+#if defined(GPR_POSIX_SOCKET) + defined(GPR_WINSOCK_SOCKET) + \
+ defined(GPR_CUSTOM_SOCKET) != \
+ 1
#error Must define exactly one of GPR_POSIX_SOCKET, GPR_WINSOCK_SOCKET, GPR_CUSTOM_SOCKET
#endif
-#if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + defined(GPR_CUSTOM_TLS) != 1
+#if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + \
+ defined(GPR_CUSTOM_TLS) != \
+ 1
#error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_CUSTOM_TLS
#endif
@@ -266,4 +274,12 @@ typedef uintptr_t gpr_uintptr;
power of two */
#define GPR_MAX_ALIGNMENT 16
-#endif /* GRPC_SUPPORT_PORT_PLATFORM_H */
+#ifndef GRPC_MUST_USE_RESULT
+#ifdef __GNUC__
+#define GRPC_MUST_USE_RESULT __attribute__((warn_unused_result))
+#else
+#define GRPC_MUST_USE_RESULT
+#endif
+#endif
+
+#endif /* GRPC_SUPPORT_PORT_PLATFORM_H */
diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h
index 3ee103bfb9..ec6c117afe 100644
--- a/include/grpc/support/slice.h
+++ b/include/grpc/support/slice.h
@@ -97,8 +97,8 @@ typedef struct gpr_slice {
((slice).refcount ? (slice).data.refcounted.length \
: (slice).data.inlined.length)
#define GPR_SLICE_SET_LENGTH(slice, newlen) \
- ((slice).refcount ? ((slice).data.refcounted.length = (newlen)) \
- : ((slice).data.inlined.length = (newlen)))
+ ((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \
+ : ((slice).data.inlined.length = (gpr_uint8)(newlen)))
#define GPR_SLICE_END_PTR(slice) \
GPR_SLICE_START_PTR(slice) + GPR_SLICE_LENGTH(slice)
#define GPR_SLICE_IS_EMPTY(slice) (GPR_SLICE_LENGTH(slice) == 0)
@@ -176,4 +176,4 @@ int gpr_slice_str_cmp(gpr_slice a, const char *b);
}
#endif
-#endif /* GRPC_SUPPORT_SLICE_H */
+#endif /* GRPC_SUPPORT_SLICE_H */
diff --git a/include/grpc/support/slice_buffer.h b/include/grpc/support/slice_buffer.h
index 1545dbfd76..ec048e8c91 100644
--- a/include/grpc/support/slice_buffer.h
+++ b/include/grpc/support/slice_buffer.h
@@ -84,6 +84,8 @@ void gpr_slice_buffer_pop(gpr_slice_buffer *sb);
void gpr_slice_buffer_reset_and_unref(gpr_slice_buffer *sb);
/* swap the contents of two slice buffers */
void gpr_slice_buffer_swap(gpr_slice_buffer *a, gpr_slice_buffer *b);
+/* move all of the elements of src into dst */
+void gpr_slice_buffer_move_into(gpr_slice_buffer *src, gpr_slice_buffer *dst);
#ifdef __cplusplus
}
diff --git a/include/grpc/support/tls_pthread.h b/include/grpc/support/tls_pthread.h
index c18f247af9..50e55d367d 100644
--- a/include/grpc/support/tls_pthread.h
+++ b/include/grpc/support/tls_pthread.h
@@ -34,7 +34,7 @@
#ifndef GRPC_SUPPORT_TLS_PTHREAD_H
#define GRPC_SUPPORT_TLS_PTHREAD_H
-#include <grpc/support/log.h> /* for GPR_ASSERT */
+#include <grpc/support/log.h> /* for GPR_ASSERT */
#include <pthread.h>
/* Thread local storage based on pthread library calls.
@@ -44,8 +44,7 @@ struct gpr_pthread_thread_local {
pthread_key_t key;
};
-#define GPR_TLS_DECL(name) \
- static struct gpr_pthread_thread_local name = {0}
+#define GPR_TLS_DECL(name) static struct gpr_pthread_thread_local name = {0}
#define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL))
#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key)
diff --git a/src/compiler/config.h b/src/compiler/config.h
index e81de8d6c8..cd52aca57d 100644
--- a/src/compiler/config.h
+++ b/src/compiler/config.h
@@ -35,6 +35,7 @@
#define SRC_COMPILER_CONFIG_H
#include <grpc++/config.h>
+#include <grpc++/config_protobuf.h>
#ifndef GRPC_CUSTOM_DESCRIPTOR
#include <google/protobuf/descriptor.h>
@@ -48,7 +49,8 @@
#ifndef GRPC_CUSTOM_CODEGENERATOR
#include <google/protobuf/compiler/code_generator.h>
#define GRPC_CUSTOM_CODEGENERATOR ::google::protobuf::compiler::CodeGenerator
-#define GRPC_CUSTOM_GENERATORCONTEXT ::google::protobuf::compiler::GeneratorContext
+#define GRPC_CUSTOM_GENERATORCONTEXT \
+ ::google::protobuf::compiler::GeneratorContext
#endif
#ifndef GRPC_CUSTOM_PRINTER
@@ -57,7 +59,8 @@
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
#define GRPC_CUSTOM_PRINTER ::google::protobuf::io::Printer
#define GRPC_CUSTOM_CODEDOUTPUTSTREAM ::google::protobuf::io::CodedOutputStream
-#define GRPC_CUSTOM_STRINGOUTPUTSTREAM ::google::protobuf::io::StringOutputStream
+#define GRPC_CUSTOM_STRINGOUTPUTSTREAM \
+ ::google::protobuf::io::StringOutputStream
#endif
#ifndef GRPC_CUSTOM_PLUGINMAIN
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index 6cd615019b..75659947df 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -97,7 +97,8 @@ grpc::string GetHeaderPrologue(const grpc::protobuf::FileDescriptor *file,
vars["filename_base"] = grpc_generator::StripProto(file->name());
printer.Print(vars, "// Generated by the gRPC protobuf plugin.\n");
- printer.Print(vars, "// If you make any local change, they will be lost.\n");
+ printer.Print(vars,
+ "// If you make any local change, they will be lost.\n");
printer.Print(vars, "// source: $filename$\n");
printer.Print(vars, "#ifndef GRPC_$filename_identifier$__INCLUDED\n");
printer.Print(vars, "#define GRPC_$filename_identifier$__INCLUDED\n");
@@ -113,6 +114,7 @@ grpc::string GetHeaderIncludes(const grpc::protobuf::FileDescriptor *file,
grpc::string temp =
"#include <grpc++/impl/internal_stub.h>\n"
"#include <grpc++/impl/rpc_method.h>\n"
+ "#include <grpc++/impl/proto_utils.h>\n"
"#include <grpc++/impl/service_type.h>\n"
"#include <grpc++/async_unary_call.h>\n"
"#include <grpc++/status.h>\n"
@@ -141,10 +143,10 @@ grpc::string GetHeaderIncludes(const grpc::protobuf::FileDescriptor *file,
return temp;
}
-void PrintHeaderClientMethodInterfaces(grpc::protobuf::io::Printer *printer,
- const grpc::protobuf::MethodDescriptor *method,
- std::map<grpc::string, grpc::string> *vars,
- bool is_public) {
+void PrintHeaderClientMethodInterfaces(
+ grpc::protobuf::io::Printer *printer,
+ const grpc::protobuf::MethodDescriptor *method,
+ std::map<grpc::string, grpc::string> *vars, bool is_public) {
(*vars)["Method"] = method->name();
(*vars)["Request"] =
grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -157,19 +159,17 @@ void PrintHeaderClientMethodInterfaces(grpc::protobuf::io::Printer *printer,
*vars,
"virtual ::grpc::Status $Method$(::grpc::ClientContext* context, "
"const $Request$& request, $Response$* response) = 0;\n");
- printer->Print(
- *vars,
- "std::unique_ptr< "
- "::grpc::ClientAsyncResponseReaderInterface< $Response$>> "
- "Async$Method$(::grpc::ClientContext* context, "
- "const $Request$& request, "
- "::grpc::CompletionQueue* cq) {\n");
+ printer->Print(*vars,
+ "std::unique_ptr< "
+ "::grpc::ClientAsyncResponseReaderInterface< $Response$>> "
+ "Async$Method$(::grpc::ClientContext* context, "
+ "const $Request$& request, "
+ "::grpc::CompletionQueue* cq) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< "
- "::grpc::ClientAsyncResponseReaderInterface< $Response$>>("
- "Async$Method$Raw(context, request, cq));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< "
+ "::grpc::ClientAsyncResponseReaderInterface< $Response$>>("
+ "Async$Method$Raw(context, request, cq));\n");
printer->Outdent();
printer->Print("}\n");
} else if (ClientOnlyStreaming(method)) {
@@ -188,14 +188,14 @@ void PrintHeaderClientMethodInterfaces(grpc::protobuf::io::Printer *printer,
printer->Print(
*vars,
"std::unique_ptr< ::grpc::ClientAsyncWriterInterface< $Request$>>"
- " Async$Method$(::grpc::ClientContext* context, $Response$* response, "
+ " Async$Method$(::grpc::ClientContext* context, $Response$* "
+ "response, "
"::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< "
- "::grpc::ClientAsyncWriterInterface< $Request$>>("
- "Async$Method$Raw(context, response, cq, tag));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< "
+ "::grpc::ClientAsyncWriterInterface< $Request$>>("
+ "Async$Method$Raw(context, response, cq, tag));\n");
printer->Outdent();
printer->Print("}\n");
} else if (ServerOnlyStreaming(method)) {
@@ -218,18 +218,17 @@ void PrintHeaderClientMethodInterfaces(grpc::protobuf::io::Printer *printer,
"::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< "
- "::grpc::ClientAsyncReaderInterface< $Response$>>("
- "Async$Method$Raw(context, request, cq, tag));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< "
+ "::grpc::ClientAsyncReaderInterface< $Response$>>("
+ "Async$Method$Raw(context, request, cq, tag));\n");
printer->Outdent();
printer->Print("}\n");
} else if (BidiStreaming(method)) {
- printer->Print(
- *vars,
- "std::unique_ptr< ::grpc::ClientReaderWriterInterface< $Request$, $Response$>> "
- "$Method$(::grpc::ClientContext* context) {\n");
+ printer->Print(*vars,
+ "std::unique_ptr< ::grpc::ClientReaderWriterInterface< "
+ "$Request$, $Response$>> "
+ "$Method$(::grpc::ClientContext* context) {\n");
printer->Indent();
printer->Print(
*vars,
@@ -267,12 +266,11 @@ void PrintHeaderClientMethodInterfaces(grpc::protobuf::io::Printer *printer,
"virtual ::grpc::ClientWriterInterface< $Request$>*"
" $Method$Raw("
"::grpc::ClientContext* context, $Response$* response) = 0;\n");
- printer->Print(
- *vars,
- "virtual ::grpc::ClientAsyncWriterInterface< $Request$>*"
- " Async$Method$Raw(::grpc::ClientContext* context, "
- "$Response$* response, "
- "::grpc::CompletionQueue* cq, void* tag) = 0;\n");
+ printer->Print(*vars,
+ "virtual ::grpc::ClientAsyncWriterInterface< $Request$>*"
+ " Async$Method$Raw(::grpc::ClientContext* context, "
+ "$Response$* response, "
+ "::grpc::CompletionQueue* cq, void* tag) = 0;\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
@@ -285,16 +283,15 @@ void PrintHeaderClientMethodInterfaces(grpc::protobuf::io::Printer *printer,
"::grpc::ClientContext* context, const $Request$& request, "
"::grpc::CompletionQueue* cq, void* tag) = 0;\n");
} else if (BidiStreaming(method)) {
- printer->Print(
- *vars,
- "virtual ::grpc::ClientReaderWriterInterface< $Request$, $Response$>* "
- "$Method$Raw(::grpc::ClientContext* context) = 0;\n");
- printer->Print(
- *vars,
- "virtual ::grpc::ClientAsyncReaderWriterInterface< "
- "$Request$, $Response$>* "
- "Async$Method$Raw(::grpc::ClientContext* context, "
- "::grpc::CompletionQueue* cq, void* tag) = 0;\n");
+ printer->Print(*vars,
+ "virtual ::grpc::ClientReaderWriterInterface< $Request$, "
+ "$Response$>* "
+ "$Method$Raw(::grpc::ClientContext* context) = 0;\n");
+ printer->Print(*vars,
+ "virtual ::grpc::ClientAsyncReaderWriterInterface< "
+ "$Request$, $Response$>* "
+ "Async$Method$Raw(::grpc::ClientContext* context, "
+ "::grpc::CompletionQueue* cq, void* tag) = 0;\n");
}
}
}
@@ -321,11 +318,10 @@ void PrintHeaderClientMethod(grpc::protobuf::io::Printer *printer,
"const $Request$& request, "
"::grpc::CompletionQueue* cq) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< "
- "::grpc::ClientAsyncResponseReader< $Response$>>("
- "Async$Method$Raw(context, request, cq));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< "
+ "::grpc::ClientAsyncResponseReader< $Response$>>("
+ "Async$Method$Raw(context, request, cq));\n");
printer->Outdent();
printer->Print("}\n");
} else if (ClientOnlyStreaming(method)) {
@@ -335,17 +331,16 @@ void PrintHeaderClientMethod(grpc::protobuf::io::Printer *printer,
" $Method$("
"::grpc::ClientContext* context, $Response$* response) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< ::grpc::ClientWriter< $Request$>>"
- "($Method$Raw(context, response));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< ::grpc::ClientWriter< $Request$>>"
+ "($Method$Raw(context, response));\n");
printer->Outdent();
printer->Print("}\n");
- printer->Print(
- *vars,
- "std::unique_ptr< ::grpc::ClientAsyncWriter< $Request$>>"
- " Async$Method$(::grpc::ClientContext* context, $Response$* response, "
- "::grpc::CompletionQueue* cq, void* tag) {\n");
+ printer->Print(*vars,
+ "std::unique_ptr< ::grpc::ClientAsyncWriter< $Request$>>"
+ " Async$Method$(::grpc::ClientContext* context, "
+ "$Response$* response, "
+ "::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Indent();
printer->Print(
*vars,
@@ -385,53 +380,47 @@ void PrintHeaderClientMethod(grpc::protobuf::io::Printer *printer,
"std::unique_ptr< ::grpc::ClientReaderWriter< $Request$, $Response$>>"
" $Method$(::grpc::ClientContext* context) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< "
- "::grpc::ClientReaderWriter< $Request$, $Response$>>("
- "$Method$Raw(context));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< "
+ "::grpc::ClientReaderWriter< $Request$, $Response$>>("
+ "$Method$Raw(context));\n");
printer->Outdent();
printer->Print("}\n");
- printer->Print(
- *vars,
- "std::unique_ptr< ::grpc::ClientAsyncReaderWriter< "
- "$Request$, $Response$>> "
- "Async$Method$(::grpc::ClientContext* context, "
- "::grpc::CompletionQueue* cq, void* tag) {\n");
+ printer->Print(*vars,
+ "std::unique_ptr< ::grpc::ClientAsyncReaderWriter< "
+ "$Request$, $Response$>> "
+ "Async$Method$(::grpc::ClientContext* context, "
+ "::grpc::CompletionQueue* cq, void* tag) {\n");
printer->Indent();
- printer->Print(
- *vars,
- "return std::unique_ptr< "
- "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>>("
- "Async$Method$Raw(context, cq, tag));\n");
+ printer->Print(*vars,
+ "return std::unique_ptr< "
+ "::grpc::ClientAsyncReaderWriter< $Request$, $Response$>>("
+ "Async$Method$Raw(context, cq, tag));\n");
printer->Outdent();
printer->Print("}\n");
}
} else {
if (NoStreaming(method)) {
- printer->Print(
- *vars,
- "::grpc::ClientAsyncResponseReader< $Response$>* "
- "Async$Method$Raw(::grpc::ClientContext* context, "
- "const $Request$& request, "
- "::grpc::CompletionQueue* cq) GRPC_OVERRIDE;\n");
+ printer->Print(*vars,
+ "::grpc::ClientAsyncResponseReader< $Response$>* "
+ "Async$Method$Raw(::grpc::ClientContext* context, "
+ "const $Request$& request, "
+ "::grpc::CompletionQueue* cq) GRPC_OVERRIDE;\n");
} else if (ClientOnlyStreaming(method)) {
- printer->Print(
- *vars,
- "::grpc::ClientWriter< $Request$>* $Method$Raw("
- "::grpc::ClientContext* context, $Response$* response) "
- "GRPC_OVERRIDE;\n");
+ printer->Print(*vars,
+ "::grpc::ClientWriter< $Request$>* $Method$Raw("
+ "::grpc::ClientContext* context, $Response$* response) "
+ "GRPC_OVERRIDE;\n");
printer->Print(
*vars,
"::grpc::ClientAsyncWriter< $Request$>* Async$Method$Raw("
"::grpc::ClientContext* context, $Response$* response, "
"::grpc::CompletionQueue* cq, void* tag) GRPC_OVERRIDE;\n");
} else if (ServerOnlyStreaming(method)) {
- printer->Print(
- *vars,
- "::grpc::ClientReader< $Response$>* $Method$Raw("
- "::grpc::ClientContext* context, const $Request$& request)"
- " GRPC_OVERRIDE;\n");
+ printer->Print(*vars,
+ "::grpc::ClientReader< $Response$>* $Method$Raw("
+ "::grpc::ClientContext* context, const $Request$& request)"
+ " GRPC_OVERRIDE;\n");
printer->Print(
*vars,
"::grpc::ClientAsyncReader< $Response$>* Async$Method$Raw("
@@ -629,7 +618,7 @@ grpc::string GetHeaderServices(const grpc::protobuf::FileDescriptor *file,
const Parameters &params) {
grpc::string output;
{
- // Scope the output stream so it closes and finalizes output to the string.
+ // Scope the output stream so it closes and finalizes output to the string.
grpc::protobuf::io::StringOutputStream output_stream(&output);
grpc::protobuf::io::Printer printer(&output_stream, '$');
std::map<grpc::string, grpc::string> vars;
@@ -693,7 +682,8 @@ grpc::string GetSourcePrologue(const grpc::protobuf::FileDescriptor *file,
vars["filename_base"] = grpc_generator::StripProto(file->name());
printer.Print(vars, "// Generated by the gRPC protobuf plugin.\n");
- printer.Print(vars, "// If you make any local change, they will be lost.\n");
+ printer.Print(vars,
+ "// If you make any local change, they will be lost.\n");
printer.Print(vars, "// source: $filename$\n\n");
printer.Print(vars, "#include \"$filename_base$.pb.h\"\n");
printer.Print(vars, "#include \"$filename_base$.grpc.pb.h\"\n");
@@ -1056,8 +1046,7 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer,
" new ::grpc::RpcMethodHandler< $ns$$Service$::Service, "
"$Request$, "
"$Response$>(\n"
- " std::mem_fn(&$ns$$Service$::Service::$Method$), this),\n"
- " new $Request$, new $Response$));\n");
+ " std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
@@ -1066,8 +1055,7 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer,
" ::grpc::RpcMethod::CLIENT_STREAMING,\n"
" new ::grpc::ClientStreamingHandler< "
"$ns$$Service$::Service, $Request$, $Response$>(\n"
- " std::mem_fn(&$ns$$Service$::Service::$Method$), this),\n"
- " new $Request$, new $Response$));\n");
+ " std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
@@ -1076,8 +1064,7 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer,
" ::grpc::RpcMethod::SERVER_STREAMING,\n"
" new ::grpc::ServerStreamingHandler< "
"$ns$$Service$::Service, $Request$, $Response$>(\n"
- " std::mem_fn(&$ns$$Service$::Service::$Method$), this),\n"
- " new $Request$, new $Response$));\n");
+ " std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
} else if (BidiStreaming(method)) {
printer->Print(
*vars,
@@ -1086,8 +1073,7 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer,
" ::grpc::RpcMethod::BIDI_STREAMING,\n"
" new ::grpc::BidiStreamingHandler< "
"$ns$$Service$::Service, $Request$, $Response$>(\n"
- " std::mem_fn(&$ns$$Service$::Service::$Method$), this),\n"
- " new $Request$, new $Response$));\n");
+ " std::mem_fn(&$ns$$Service$::Service::$Method$), this)));\n");
}
}
printer->Print("return service_;\n");
diff --git a/src/compiler/objective_c_generator.cc b/src/compiler/objective_c_generator.cc
index b235911479..79a84b4a7a 100644
--- a/src/compiler/objective_c_generator.cc
+++ b/src/compiler/objective_c_generator.cc
@@ -68,18 +68,19 @@ void PrintMethodSignature(Printer *printer,
printer->Print(vars, "- ($return_type$)$method_name$With");
if (method->client_streaming()) {
- printer->Print("RequestsWriter:(id<GRXWriter>)request");
+ printer->Print("RequestsWriter:(id<GRXWriter>)requestWriter");
} else {
printer->Print(vars, "Request:($request_class$ *)request");
}
// TODO(jcanizales): Put this on a new line and align colons.
- // TODO(jcanizales): eventHandler for server streaming?
- printer->Print(" handler:(void(^)(");
if (method->server_streaming()) {
- printer->Print("BOOL done, ");
+ printer->Print(vars, " eventHandler:(void(^)(BOOL done, "
+ "$response_class$ *response, NSError *error))eventHandler");
+ } else {
+ printer->Print(vars, " handler:(void(^)($response_class$ *response, "
+ "NSError *error))handler");
}
- printer->Print(vars, "$response_class$ *response, NSError *error))handler");
}
void PrintSimpleSignature(Printer *printer,
@@ -125,11 +126,15 @@ void PrintSimpleImplementation(Printer *printer,
printer->Print("{\n");
printer->Print(vars, " [[self RPCTo$method_name$With");
if (method->client_streaming()) {
- printer->Print("RequestsWriter:request");
+ printer->Print("RequestsWriter:requestWriter");
} else {
printer->Print("Request:request");
}
- printer->Print(" handler:handler] start];\n");
+ if (method->server_streaming()) {
+ printer->Print(" eventHandler:eventHandler] start];\n");
+ } else {
+ printer->Print(" handler:handler] start];\n");
+ }
printer->Print("}\n");
}
@@ -141,7 +146,7 @@ void PrintAdvancedImplementation(Printer *printer,
printer->Print(" requestsWriter:");
if (method->client_streaming()) {
- printer->Print("request\n");
+ printer->Print("requestWriter\n");
} else {
printer->Print("[GRXWriter writerWithValue:request]\n");
}
@@ -150,7 +155,7 @@ void PrintAdvancedImplementation(Printer *printer,
printer->Print(" responsesWriteable:[GRXWriteable ");
if (method->server_streaming()) {
- printer->Print("writeableWithStreamHandler:handler]];\n");
+ printer->Print("writeableWithStreamHandler:eventHandler]];\n");
} else {
printer->Print("writeableWithSingleValueHandler:handler]];\n");
}
diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc
index b5ac2bafa9..2b5ab758fc 100644
--- a/src/compiler/objective_c_plugin.cc
+++ b/src/compiler/objective_c_plugin.cc
@@ -62,8 +62,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
{
// Generate .pbrpc.h
- string imports = string("#import \"") + file_name + ".pbobjc.h\"\n"
- "#import <gRPC/ProtoService.h>\n";
+ string imports = string("#import \"") + file_name + ".pbobjc.h\"\n\n"
+ "#import <ProtoRPC/ProtoService.h>\n";
// TODO(jcanizales): Instead forward-declare the input and output types
// and import the files in the .pbrpc.m
@@ -87,10 +87,10 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
{
// Generate .pbrpc.m
- string imports = string("#import \"") + file_name + ".pbrpc.h\"\n"
- "#import <gRPC/GRXWriteable.h>\n"
- "#import <gRPC/GRXWriter+Immediate.h>\n"
- "#import <gRPC/ProtoRPC.h>\n";
+ string imports = string("#import \"") + file_name + ".pbrpc.h\"\n\n"
+ "#import <ProtoRPC/ProtoRPC.h>\n"
+ "#import <RxLibrary/GRXWriteable.h>\n"
+ "#import <RxLibrary/GRXWriter+Immediate.h>\n";
string definitions;
for (int i = 0; i < file->service_count(); i++) {
diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc
index 72149bc4e3..724b69c703 100644
--- a/src/compiler/python_generator.cc
+++ b/src/compiler/python_generator.cc
@@ -42,7 +42,7 @@
#include <tuple>
#include <vector>
-#include "grpc++/config.h"
+#include <grpc++/config.h>
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/python_generator.h"
diff --git a/src/core/census/context.c b/src/core/census/context.c
index 1358c5127b..df238ec98c 100644
--- a/src/core/census/context.c
+++ b/src/core/census/context.c
@@ -31,7 +31,7 @@
*
*/
-#include "context.h"
+#include "src/core/census/context.h"
#include <string.h>
#include <grpc/census.h>
diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c
index 311f4f08ce..9eec8163f5 100644
--- a/src/core/channel/channel_stack.c
+++ b/src/core/channel/channel_stack.c
@@ -211,9 +211,3 @@ void grpc_call_element_send_cancel(grpc_call_element *cur_elem) {
op.cancel_with_status = GRPC_STATUS_CANCELLED;
grpc_call_next_op(cur_elem, &op);
}
-
-void grpc_call_element_recv_status(grpc_call_element *cur_elem,
- grpc_status_code status,
- const char *message) {
- abort();
-}
diff --git a/src/core/channel/child_channel.c b/src/core/channel/child_channel.c
index 600f7df1bf..6690265d75 100644
--- a/src/core/channel/child_channel.c
+++ b/src/core/channel/child_channel.c
@@ -157,9 +157,10 @@ static void lb_destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_child_channel_top_filter = {
- lb_start_transport_op, lb_channel_op, sizeof(lb_call_data),
- lb_init_call_elem, lb_destroy_call_elem, sizeof(lb_channel_data),
- lb_init_channel_elem, lb_destroy_channel_elem, "child-channel",
+ lb_start_transport_op, lb_channel_op,
+ sizeof(lb_call_data), lb_init_call_elem, lb_destroy_call_elem,
+ sizeof(lb_channel_data), lb_init_channel_elem, lb_destroy_channel_elem,
+ "child-channel",
};
/* grpc_child_channel proper */
diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c
index 42e242ae81..711e105464 100644
--- a/src/core/channel/client_channel.c
+++ b/src/core/channel/client_channel.c
@@ -39,6 +39,7 @@
#include "src/core/channel/child_channel.h"
#include "src/core/channel/connected_channel.h"
#include "src/core/iomgr/iomgr.h"
+#include "src/core/iomgr/pollset_set.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -101,10 +102,17 @@ struct call_data {
static int prepare_activate(grpc_call_element *elem,
grpc_child_channel *on_child) {
call_data *calld = elem->call_data;
+ channel_data *chand = elem->channel_data;
if (calld->state == CALL_CANCELLED) return 0;
/* no more access to calld->s.waiting allowed */
GPR_ASSERT(calld->state == CALL_WAITING);
+
+ if (calld->s.waiting_op.bind_pollset) {
+ grpc_transport_setup_del_interested_party(chand->transport_setup,
+ calld->s.waiting_op.bind_pollset);
+ }
+
calld->state = CALL_ACTIVE;
/* create a child call */
@@ -131,7 +139,11 @@ static void remove_waiting_child(channel_data *chand, call_data *calld) {
size_t new_count;
size_t i;
for (i = 0, new_count = 0; i < chand->waiting_child_count; i++) {
- if (chand->waiting_children[i] == calld) continue;
+ if (chand->waiting_children[i] == calld) {
+ grpc_transport_setup_del_interested_party(
+ chand->transport_setup, calld->s.waiting_op.bind_pollset);
+ continue;
+ }
chand->waiting_children[new_count++] = chand->waiting_children[i];
}
GPR_ASSERT(new_count == chand->waiting_child_count - 1 ||
@@ -145,7 +157,7 @@ static void handle_op_after_cancellation(grpc_call_element *elem,
channel_data *chand = elem->channel_data;
if (op->send_ops) {
grpc_stream_ops_unref_owned_objects(op->send_ops->ops, op->send_ops->nops);
- op->on_done_send(op->send_user_data, 0);
+ op->on_done_send->cb(op->on_done_send->cb_arg, 0);
}
if (op->recv_ops) {
char status[GPR_LTOA_MIN_BUFSIZE];
@@ -164,7 +176,10 @@ static void handle_op_after_cancellation(grpc_call_element *elem,
mdb.deadline = gpr_inf_future;
grpc_sopb_add_metadata(op->recv_ops, mdb);
*op->recv_state = GRPC_STREAM_CLOSED;
- op->on_done_recv(op->recv_user_data, 1);
+ op->on_done_recv->cb(op->on_done_recv->cb_arg, 1);
+ }
+ if (op->on_consumed) {
+ op->on_consumed->cb(op->on_consumed->cb_arg, 0);
}
}
@@ -191,6 +206,7 @@ static void cc_start_transport_op(grpc_call_element *elem,
handle_op_after_cancellation(elem, op);
} else {
calld->state = CALL_WAITING;
+ calld->s.waiting_op.bind_pollset = NULL;
if (chand->active_child) {
/* channel is connected - use the connected stack */
if (prepare_activate(elem, chand->active_child)) {
@@ -222,6 +238,8 @@ static void cc_start_transport_op(grpc_call_element *elem,
}
calld->s.waiting_op = *op;
chand->waiting_children[chand->waiting_child_count++] = calld;
+ grpc_transport_setup_add_interested_party(chand->transport_setup,
+ op->bind_pollset);
gpr_mu_unlock(&chand->mu);
/* finally initiate transport setup if needed */
@@ -248,15 +266,16 @@ static void cc_start_transport_op(grpc_call_element *elem,
calld->s.waiting_op.send_ops = op->send_ops;
calld->s.waiting_op.is_last_send = op->is_last_send;
calld->s.waiting_op.on_done_send = op->on_done_send;
- calld->s.waiting_op.send_user_data = op->send_user_data;
}
if (op->recv_ops) {
calld->s.waiting_op.recv_ops = op->recv_ops;
calld->s.waiting_op.recv_state = op->recv_state;
calld->s.waiting_op.on_done_recv = op->on_done_recv;
- calld->s.waiting_op.recv_user_data = op->recv_user_data;
}
gpr_mu_unlock(&chand->mu);
+ if (op->on_consumed) {
+ op->on_consumed->cb(op->on_consumed->cb_arg, 0);
+ }
}
break;
case CALL_CANCELLED:
@@ -365,12 +384,24 @@ static void init_call_elem(grpc_call_element *elem,
/* Destructor for call_data */
static void destroy_call_elem(grpc_call_element *elem) {
call_data *calld = elem->call_data;
+ channel_data *chand = elem->channel_data;
/* if the call got activated, we need to destroy the child stack also, and
remove it from the in-flight requests tracked by the child_entry we
picked */
- if (calld->state == CALL_ACTIVE) {
- grpc_child_call_destroy(calld->s.active.child_call);
+ gpr_mu_lock(&chand->mu);
+ switch (calld->state) {
+ case CALL_ACTIVE:
+ gpr_mu_unlock(&chand->mu);
+ grpc_child_call_destroy(calld->s.active.child_call);
+ break;
+ case CALL_WAITING:
+ remove_waiting_child(chand, calld);
+ gpr_mu_unlock(&chand->mu);
+ break;
+ default:
+ gpr_mu_unlock(&chand->mu);
+ break;
}
GPR_ASSERT(calld->state != CALL_WAITING);
}
@@ -416,9 +447,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_client_channel_filter = {
- cc_start_transport_op, channel_op, sizeof(call_data), init_call_elem,
- destroy_call_elem, sizeof(channel_data), init_channel_elem,
- destroy_channel_elem, "client-channel",
+ cc_start_transport_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "client-channel",
};
grpc_transport_setup_result grpc_client_channel_transport_setup_complete(
diff --git a/src/core/channel/client_setup.c b/src/core/channel/client_setup.c
index 6d892d6c92..5be8fa66e9 100644
--- a/src/core/channel/client_setup.c
+++ b/src/core/channel/client_setup.c
@@ -56,6 +56,9 @@ struct grpc_client_setup {
gpr_cv cv;
grpc_client_setup_request *active_request;
int refs;
+ /** The set of pollsets that are currently interested in this
+ connection being established */
+ grpc_pollset_set interested_parties;
};
struct grpc_client_setup_request {
@@ -68,14 +71,22 @@ gpr_timespec grpc_client_setup_request_deadline(grpc_client_setup_request *r) {
return r->deadline;
}
+grpc_pollset_set *grpc_client_setup_get_interested_parties(
+ grpc_client_setup_request *r) {
+ return &r->setup->interested_parties;
+}
+
static void destroy_setup(grpc_client_setup *s) {
gpr_mu_destroy(&s->mu);
gpr_cv_destroy(&s->cv);
s->done(s->user_data);
grpc_channel_args_destroy(s->args);
+ grpc_pollset_set_destroy(&s->interested_parties);
gpr_free(s);
}
+static void destroy_request(grpc_client_setup_request *r) { gpr_free(r); }
+
/* initiate handshaking */
static void setup_initiate(grpc_transport_setup *sp) {
grpc_client_setup *s = (grpc_client_setup *)sp;
@@ -83,8 +94,7 @@ static void setup_initiate(grpc_transport_setup *sp) {
int in_alarm = 0;
r->setup = s;
- /* TODO(klempner): Actually set a deadline */
- r->deadline = gpr_inf_future;
+ r->deadline = gpr_time_add(gpr_now(), gpr_time_from_seconds(60));
gpr_mu_lock(&s->mu);
GPR_ASSERT(s->refs > 0);
@@ -104,10 +114,30 @@ static void setup_initiate(grpc_transport_setup *sp) {
if (!in_alarm) {
s->initiate(s->user_data, r);
} else {
- gpr_free(r);
+ destroy_request(r);
}
}
+/** implementation of add_interested_party for setup vtable */
+static void setup_add_interested_party(grpc_transport_setup *sp,
+ grpc_pollset *pollset) {
+ grpc_client_setup *s = (grpc_client_setup *)sp;
+
+ gpr_mu_lock(&s->mu);
+ grpc_pollset_set_add_pollset(&s->interested_parties, pollset);
+ gpr_mu_unlock(&s->mu);
+}
+
+/** implementation of del_interested_party for setup vtable */
+static void setup_del_interested_party(grpc_transport_setup *sp,
+ grpc_pollset *pollset) {
+ grpc_client_setup *s = (grpc_client_setup *)sp;
+
+ gpr_mu_lock(&s->mu);
+ grpc_pollset_set_del_pollset(&s->interested_parties, pollset);
+ gpr_mu_unlock(&s->mu);
+}
+
/* cancel handshaking: cancel all requests, and shutdown (the caller promises
not to initiate again) */
static void setup_cancel(grpc_transport_setup *sp) {
@@ -137,7 +167,8 @@ static void setup_cancel(grpc_transport_setup *sp) {
}
}
-int grpc_client_setup_cb_begin(grpc_client_setup_request *r) {
+int grpc_client_setup_cb_begin(grpc_client_setup_request *r,
+ const char *reason) {
gpr_mu_lock(&r->setup->mu);
if (r->setup->cancelled) {
gpr_mu_unlock(&r->setup->mu);
@@ -148,7 +179,8 @@ int grpc_client_setup_cb_begin(grpc_client_setup_request *r) {
return 1;
}
-void grpc_client_setup_cb_end(grpc_client_setup_request *r) {
+void grpc_client_setup_cb_end(grpc_client_setup_request *r,
+ const char *reason) {
gpr_mu_lock(&r->setup->mu);
r->setup->in_cb--;
if (r->setup->cancelled) gpr_cv_signal(&r->setup->cv);
@@ -156,8 +188,9 @@ void grpc_client_setup_cb_end(grpc_client_setup_request *r) {
}
/* vtable for transport setup */
-static const grpc_transport_setup_vtable setup_vtable = {setup_initiate,
- setup_cancel};
+static const grpc_transport_setup_vtable setup_vtable = {
+ setup_initiate, setup_add_interested_party, setup_del_interested_party,
+ setup_cancel};
void grpc_client_setup_create_and_attach(
grpc_channel_stack *newly_minted_channel, const grpc_channel_args *args,
@@ -180,42 +213,44 @@ void grpc_client_setup_create_and_attach(
s->in_alarm = 0;
s->in_cb = 0;
s->cancelled = 0;
+ grpc_pollset_set_init(&s->interested_parties);
grpc_client_channel_set_transport_setup(newly_minted_channel, &s->base);
}
-int grpc_client_setup_request_should_continue(grpc_client_setup_request *r) {
+int grpc_client_setup_request_should_continue(grpc_client_setup_request *r,
+ const char *reason) {
int result;
if (gpr_time_cmp(gpr_now(), r->deadline) > 0) {
- return 0;
+ result = 0;
+ } else {
+ gpr_mu_lock(&r->setup->mu);
+ result = r->setup->active_request == r;
+ gpr_mu_unlock(&r->setup->mu);
}
- gpr_mu_lock(&r->setup->mu);
- result = r->setup->active_request == r;
- gpr_mu_unlock(&r->setup->mu);
return result;
}
-static void backoff_alarm_done(void *arg /* grpc_client_setup */, int success) {
- grpc_client_setup *s = arg;
- grpc_client_setup_request *r = gpr_malloc(sizeof(grpc_client_setup_request));
- r->setup = s;
- /* TODO(klempner): Set this to something useful */
- r->deadline = gpr_inf_future;
+static void backoff_alarm_done(void *arg /* grpc_client_setup_request */,
+ int success) {
+ grpc_client_setup_request *r = arg;
+ grpc_client_setup *s = r->setup;
/* Handle status cancelled? */
gpr_mu_lock(&s->mu);
- s->active_request = r;
s->in_alarm = 0;
- if (!success) {
+ if (s->active_request != NULL || !success) {
if (0 == --s->refs) {
gpr_mu_unlock(&s->mu);
destroy_setup(s);
- gpr_free(r);
+ destroy_request(r);
return;
} else {
gpr_mu_unlock(&s->mu);
+ destroy_request(r);
return;
}
}
+ s->active_request = r;
gpr_mu_unlock(&s->mu);
s->initiate(s->user_data, r);
}
@@ -231,16 +266,12 @@ void grpc_client_setup_request_finish(grpc_client_setup_request *r,
} else {
retry = 0;
}
+
if (!retry && 0 == --s->refs) {
gpr_mu_unlock(&s->mu);
destroy_setup(s);
- gpr_free(r);
- return;
- }
-
- gpr_free(r);
-
- if (retry) {
+ destroy_request(r);
+ } else if (retry) {
/* TODO(klempner): Replace these values with further consideration. 2x is
probably too aggressive of a backoff. */
gpr_timespec max_backoff = gpr_time_from_minutes(2);
@@ -248,15 +279,17 @@ void grpc_client_setup_request_finish(grpc_client_setup_request *r,
gpr_timespec deadline = gpr_time_add(s->current_backoff_interval, now);
GPR_ASSERT(!s->in_alarm);
s->in_alarm = 1;
- grpc_alarm_init(&s->backoff_alarm, deadline, backoff_alarm_done, s, now);
+ grpc_alarm_init(&s->backoff_alarm, deadline, backoff_alarm_done, r, now);
s->current_backoff_interval =
gpr_time_add(s->current_backoff_interval, s->current_backoff_interval);
if (gpr_time_cmp(s->current_backoff_interval, max_backoff) > 0) {
s->current_backoff_interval = max_backoff;
}
+ gpr_mu_unlock(&s->mu);
+ } else {
+ gpr_mu_unlock(&s->mu);
+ destroy_request(r);
}
-
- gpr_mu_unlock(&s->mu);
}
const grpc_channel_args *grpc_client_setup_get_channel_args(
diff --git a/src/core/channel/client_setup.h b/src/core/channel/client_setup.h
index 70137e1365..7d40338840 100644
--- a/src/core/channel/client_setup.h
+++ b/src/core/channel/client_setup.h
@@ -52,7 +52,8 @@ void grpc_client_setup_create_and_attach(
/* Check that r is the active request: needs to be performed at each callback.
If this races, we'll have two connection attempts running at once and the
old one will get cleaned up in due course, which is fine. */
-int grpc_client_setup_request_should_continue(grpc_client_setup_request *r);
+int grpc_client_setup_request_should_continue(grpc_client_setup_request *r,
+ const char *reason);
void grpc_client_setup_request_finish(grpc_client_setup_request *r,
int was_successful);
const grpc_channel_args *grpc_client_setup_get_channel_args(
@@ -61,13 +62,16 @@ const grpc_channel_args *grpc_client_setup_get_channel_args(
/* Call before calling back into the setup listener, and call only if
this function returns 1. If it returns 1, also promise to call
grpc_client_setup_cb_end */
-int grpc_client_setup_cb_begin(grpc_client_setup_request *r);
-void grpc_client_setup_cb_end(grpc_client_setup_request *r);
+int grpc_client_setup_cb_begin(grpc_client_setup_request *r,
+ const char *reason);
+void grpc_client_setup_cb_end(grpc_client_setup_request *r, const char *reason);
/* Get the deadline for a request passed in to initiate. Implementations should
make a best effort to honor this deadline. */
gpr_timespec grpc_client_setup_request_deadline(grpc_client_setup_request *r);
+grpc_pollset_set *grpc_client_setup_get_interested_parties(
+ grpc_client_setup_request *r);
grpc_mdctx *grpc_client_setup_get_mdctx(grpc_client_setup_request *r);
-#endif /* GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H */
+#endif /* GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H */
diff --git a/src/core/channel/http_client_filter.c b/src/core/channel/http_client_filter.c
index 9805f325a6..08a2c0df3c 100644
--- a/src/core/channel/http_client_filter.c
+++ b/src/core/channel/http_client_filter.c
@@ -43,8 +43,13 @@ typedef struct call_data {
int got_initial_metadata;
grpc_stream_op_buffer *recv_ops;
- void (*on_done_recv)(void *user_data, int success);
- void *recv_user_data;
+
+ /** Closure to call when finished with the hc_on_recv hook */
+ grpc_iomgr_closure *on_done_recv;
+ /** Receive closures are chained: we inject this closure as the on_done_recv
+ up-call on transport_op, and remember to call our on_done_recv member
+ after handling it. */
+ grpc_iomgr_closure hc_on_recv;
} call_data;
typedef struct channel_data {
@@ -84,7 +89,7 @@ static void hc_on_recv(void *user_data, int success) {
grpc_metadata_batch_filter(&op->data.metadata, client_filter, elem);
}
}
- calld->on_done_recv(calld->recv_user_data, success);
+ calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success);
}
static void hc_mutate_op(grpc_call_element *elem, grpc_transport_op *op) {
@@ -117,9 +122,7 @@ static void hc_mutate_op(grpc_call_element *elem, grpc_transport_op *op) {
/* substitute our callback for the higher callback */
calld->recv_ops = op->recv_ops;
calld->on_done_recv = op->on_done_recv;
- calld->recv_user_data = op->recv_user_data;
- op->on_done_recv = hc_on_recv;
- op->recv_user_data = elem;
+ op->on_done_recv = &calld->hc_on_recv;
}
}
@@ -154,6 +157,8 @@ static void init_call_elem(grpc_call_element *elem,
call_data *calld = elem->call_data;
calld->sent_initial_metadata = 0;
calld->got_initial_metadata = 0;
+ calld->on_done_recv = NULL;
+ grpc_iomgr_closure_init(&calld->hc_on_recv, hc_on_recv, elem);
if (initial_op) hc_mutate_op(elem, initial_op);
}
diff --git a/src/core/channel/http_server_filter.c b/src/core/channel/http_server_filter.c
index 11a53b1e70..d3a01fd1a8 100644
--- a/src/core/channel/http_server_filter.c
+++ b/src/core/channel/http_server_filter.c
@@ -47,8 +47,12 @@ typedef struct call_data {
grpc_linked_mdelem status;
grpc_stream_op_buffer *recv_ops;
- void (*on_done_recv)(void *user_data, int success);
- void *recv_user_data;
+ /** Closure to call when finished with the hs_on_recv hook */
+ grpc_iomgr_closure *on_done_recv;
+ /** Receive closures are chained: we inject this closure as the on_done_recv
+ up-call on transport_op, and remember to call our on_done_recv member
+ after handling it. */
+ grpc_iomgr_closure hs_on_recv;
} call_data;
typedef struct channel_data {
@@ -174,7 +178,7 @@ static void hs_on_recv(void *user_data, int success) {
}
}
}
- calld->on_done_recv(calld->recv_user_data, success);
+ calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success);
}
static void hs_mutate_op(grpc_call_element *elem, grpc_transport_op *op) {
@@ -200,9 +204,7 @@ static void hs_mutate_op(grpc_call_element *elem, grpc_transport_op *op) {
/* substitute our callback for the higher callback */
calld->recv_ops = op->recv_ops;
calld->on_done_recv = op->on_done_recv;
- calld->recv_user_data = op->recv_user_data;
- op->on_done_recv = hs_on_recv;
- op->recv_user_data = elem;
+ op->on_done_recv = &calld->hs_on_recv;
}
}
@@ -238,6 +240,7 @@ static void init_call_elem(grpc_call_element *elem,
call_data *calld = elem->call_data;
/* initialize members */
memset(calld, 0, sizeof(*calld));
+ grpc_iomgr_closure_init(&calld->hs_on_recv, hs_on_recv, elem);
if (initial_op) hs_mutate_op(elem, initial_op);
}
diff --git a/src/core/compression/message_compress.h b/src/core/compression/message_compress.h
index aba701a6ee..b3eb8f579f 100644
--- a/src/core/compression/message_compress.h
+++ b/src/core/compression/message_compress.h
@@ -49,4 +49,4 @@ int grpc_msg_compress(grpc_compression_algorithm algorithm,
int grpc_msg_decompress(grpc_compression_algorithm algorithm,
gpr_slice_buffer *input, gpr_slice_buffer *output);
-#endif /* GRPC_INTERNAL_CORE_COMPRESSION_MESSAGE_COMPRESS_H */
+#endif /* GRPC_INTERNAL_CORE_COMPRESSION_MESSAGE_COMPRESS_H */
diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c
index fa7aabc418..914355a408 100644
--- a/src/core/httpcli/httpcli.c
+++ b/src/core/httpcli/httpcli.c
@@ -60,14 +60,26 @@ typedef struct {
int use_ssl;
grpc_httpcli_response_cb on_response;
void *user_data;
+ grpc_httpcli_context *context;
+ grpc_pollset *pollset;
+ grpc_iomgr_object iomgr_obj;
} internal_request;
static grpc_httpcli_get_override g_get_override = NULL;
static grpc_httpcli_post_override g_post_override = NULL;
+void grpc_httpcli_context_init(grpc_httpcli_context *context) {
+ grpc_pollset_set_init(&context->pollset_set);
+}
+
+void grpc_httpcli_context_destroy(grpc_httpcli_context *context) {
+ grpc_pollset_set_destroy(&context->pollset_set);
+}
+
static void next_address(internal_request *req);
static void finish(internal_request *req, int success) {
+ grpc_pollset_set_del_pollset(&req->context->pollset_set, req->pollset);
req->on_response(req->user_data, success ? &req->parser.r : NULL);
grpc_httpcli_parser_destroy(&req->parser);
if (req->addresses != NULL) {
@@ -78,6 +90,7 @@ static void finish(internal_request *req, int success) {
}
gpr_slice_unref(req->request_text);
gpr_free(req->host);
+ grpc_iomgr_unregister_object(&req->iomgr_obj);
gpr_free(req);
}
@@ -198,8 +211,9 @@ static void next_address(internal_request *req) {
return;
}
addr = &req->addresses->addrs[req->next_address++];
- grpc_tcp_client_connect(on_connected, req, (struct sockaddr *)&addr->addr,
- addr->len, req->deadline);
+ grpc_tcp_client_connect(on_connected, req, &req->context->pollset_set,
+ (struct sockaddr *)&addr->addr, addr->len,
+ req->deadline);
}
static void on_resolved(void *arg, grpc_resolved_addresses *addresses) {
@@ -213,10 +227,12 @@ static void on_resolved(void *arg, grpc_resolved_addresses *addresses) {
next_address(req);
}
-void grpc_httpcli_get(const grpc_httpcli_request *request,
+void grpc_httpcli_get(grpc_httpcli_context *context, grpc_pollset *pollset,
+ const grpc_httpcli_request *request,
gpr_timespec deadline,
grpc_httpcli_response_cb on_response, void *user_data) {
internal_request *req;
+ char *name;
if (g_get_override &&
g_get_override(request, deadline, on_response, user_data)) {
return;
@@ -229,19 +245,27 @@ void grpc_httpcli_get(const grpc_httpcli_request *request,
req->user_data = user_data;
req->deadline = deadline;
req->use_ssl = request->use_ssl;
+ req->context = context;
+ req->pollset = pollset;
+ gpr_asprintf(&name, "HTTP:GET:%s:%s", request->host, request->path);
+ grpc_iomgr_register_object(&req->iomgr_obj, name);
+ gpr_free(name);
if (req->use_ssl) {
req->host = gpr_strdup(request->host);
}
+ grpc_pollset_set_add_pollset(&req->context->pollset_set, req->pollset);
grpc_resolve_address(request->host, req->use_ssl ? "https" : "http",
on_resolved, req);
}
-void grpc_httpcli_post(const grpc_httpcli_request *request,
+void grpc_httpcli_post(grpc_httpcli_context *context, grpc_pollset *pollset,
+ const grpc_httpcli_request *request,
const char *body_bytes, size_t body_size,
gpr_timespec deadline,
grpc_httpcli_response_cb on_response, void *user_data) {
internal_request *req;
+ char *name;
if (g_post_override && g_post_override(request, body_bytes, body_size,
deadline, on_response, user_data)) {
return;
@@ -255,10 +279,16 @@ void grpc_httpcli_post(const grpc_httpcli_request *request,
req->user_data = user_data;
req->deadline = deadline;
req->use_ssl = request->use_ssl;
+ req->context = context;
+ req->pollset = pollset;
+ gpr_asprintf(&name, "HTTP:GET:%s:%s", request->host, request->path);
+ grpc_iomgr_register_object(&req->iomgr_obj, name);
+ gpr_free(name);
if (req->use_ssl) {
req->host = gpr_strdup(request->host);
}
+ grpc_pollset_set_add_pollset(&req->context->pollset_set, req->pollset);
grpc_resolve_address(request->host, req->use_ssl ? "https" : "http",
on_resolved, req);
}
diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h
index 255c5ed90f..06699e88c2 100644
--- a/src/core/httpcli/httpcli.h
+++ b/src/core/httpcli/httpcli.h
@@ -38,6 +38,8 @@
#include <grpc/support/time.h>
+#include "src/core/iomgr/pollset_set.h"
+
/* User agent this library reports */
#define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0"
/* Maximum length of a header string of the form 'Key: Value\r\n' */
@@ -49,6 +51,13 @@ typedef struct grpc_httpcli_header {
char *value;
} grpc_httpcli_header;
+/* Tracks in-progress http requests
+ TODO(ctiller): allow caching and capturing multiple requests for the
+ same content and combining them */
+typedef struct grpc_httpcli_context {
+ grpc_pollset_set pollset_set;
+} grpc_httpcli_context;
+
/* A request */
typedef struct grpc_httpcli_request {
/* The host name to connect to */
@@ -80,7 +89,14 @@ typedef struct grpc_httpcli_response {
typedef void (*grpc_httpcli_response_cb)(void *user_data,
const grpc_httpcli_response *response);
+void grpc_httpcli_context_init(grpc_httpcli_context *context);
+void grpc_httpcli_context_destroy(grpc_httpcli_context *context);
+
/* Asynchronously perform a HTTP GET.
+ 'context' specifies the http context under which to do the get
+ 'pollset' indicates a grpc_pollset that is interested in the result
+ of the get - work on this pollset may be used to progress the get
+ operation
'request' contains request parameters - these are caller owned and can be
destroyed once the call returns
'deadline' contains a deadline for the request (or gpr_inf_future)
@@ -88,14 +104,28 @@ typedef void (*grpc_httpcli_response_cb)(void *user_data,
lifetime of the request
'on_response' is a callback to report results to (and 'user_data' is a user
supplied pointer to pass to said call) */
-void grpc_httpcli_get(const grpc_httpcli_request *request,
+void grpc_httpcli_get(grpc_httpcli_context *context, grpc_pollset *pollset,
+ const grpc_httpcli_request *request,
gpr_timespec deadline,
grpc_httpcli_response_cb on_response, void *user_data);
/* Asynchronously perform a HTTP POST.
- When there is no body, pass in NULL as body_bytes.
+ 'context' specifies the http context under which to do the post
+ 'pollset' indicates a grpc_pollset that is interested in the result
+ of the post - work on this pollset may be used to progress the post
+ operation
+ 'request' contains request parameters - these are caller owned and can be
+ destroyed once the call returns
+ 'body_bytes' and 'body_size' specify the payload for the post.
+ When there is no body, pass in NULL as body_bytes.
+ 'deadline' contains a deadline for the request (or gpr_inf_future)
+ 'em' points to a caller owned event manager that must be alive for the
+ lifetime of the request
+ 'on_response' is a callback to report results to (and 'user_data' is a user
+ supplied pointer to pass to said call)
Does not support ?var1=val1&var2=val2 in the path. */
-void grpc_httpcli_post(const grpc_httpcli_request *request,
+void grpc_httpcli_post(grpc_httpcli_context *context, grpc_pollset *pollset,
+ const grpc_httpcli_request *request,
const char *body_bytes, size_t body_size,
gpr_timespec deadline,
grpc_httpcli_response_cb on_response, void *user_data);
@@ -115,4 +145,4 @@ typedef int (*grpc_httpcli_post_override)(const grpc_httpcli_request *request,
void grpc_httpcli_set_override(grpc_httpcli_get_override get,
grpc_httpcli_post_override post);
-#endif /* GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_H */
+#endif /* GRPC_INTERNAL_CORE_HTTPCLI_HTTPCLI_H */
diff --git a/src/core/iomgr/fd_posix.c b/src/core/iomgr/fd_posix.c
index 28ed7708f7..632d2a4609 100644
--- a/src/core/iomgr/fd_posix.c
+++ b/src/core/iomgr/fd_posix.c
@@ -74,6 +74,7 @@ static void freelist_fd(grpc_fd *fd) {
gpr_mu_lock(&fd_freelist_mu);
fd->freelist_next = fd_freelist;
fd_freelist = fd;
+ grpc_iomgr_unregister_object(&fd->iomgr_object);
gpr_mu_unlock(&fd_freelist_mu);
}
@@ -100,6 +101,7 @@ static grpc_fd *alloc_fd(int fd) {
&r->inactive_watcher_root;
r->freelist_next = NULL;
r->read_watcher = r->write_watcher = NULL;
+ r->on_done_closure = NULL;
return r;
}
@@ -109,16 +111,36 @@ static void destroy(grpc_fd *fd) {
gpr_free(fd);
}
+#ifdef GRPC_FD_REF_COUNT_DEBUG
+#define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__)
+#define UNREF_BY(fd, n, reason) unref_by(fd, n, reason, __FILE__, __LINE__)
+static void ref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+ int line) {
+ gpr_log(GPR_DEBUG, "FD %d %p ref %d %d -> %d [%s; %s:%d]", fd->fd, fd, n,
+ gpr_atm_no_barrier_load(&fd->refst),
+ gpr_atm_no_barrier_load(&fd->refst) + n, reason, file, line);
+#else
+#define REF_BY(fd, n, reason) ref_by(fd, n)
+#define UNREF_BY(fd, n, reason) unref_by(fd, n)
static void ref_by(grpc_fd *fd, int n) {
+#endif
GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&fd->refst, n) > 0);
}
+#ifdef GRPC_FD_REF_COUNT_DEBUG
+static void unref_by(grpc_fd *fd, int n, const char *reason, const char *file,
+ int line) {
+ gpr_atm old;
+ gpr_log(GPR_DEBUG, "FD %d %p unref %d %d -> %d [%s; %s:%d]", fd->fd, fd, n,
+ gpr_atm_no_barrier_load(&fd->refst),
+ gpr_atm_no_barrier_load(&fd->refst) - n, reason, file, line);
+#else
static void unref_by(grpc_fd *fd, int n) {
- gpr_atm old = gpr_atm_full_fetch_add(&fd->refst, -n);
+ gpr_atm old;
+#endif
+ old = gpr_atm_full_fetch_add(&fd->refst, -n);
if (old == n) {
- grpc_iomgr_add_callback(&fd->on_done_closure);
freelist_fd(fd);
- grpc_iomgr_unregister_object(&fd->iomgr_object);
} else {
GPR_ASSERT(old > n);
}
@@ -135,12 +157,9 @@ void grpc_fd_global_shutdown(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-static void do_nothing(void *ignored, int success) {}
-
grpc_fd *grpc_fd_create(int fd, const char *name) {
grpc_fd *r = alloc_fd(fd);
grpc_iomgr_register_object(&r->iomgr_object, name);
- grpc_pollset_add_fd(grpc_backup_pollset(), r);
return r;
}
@@ -178,24 +197,46 @@ static void wake_all_watchers_locked(grpc_fd *fd) {
}
}
-void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_cb_func on_done, void *user_data) {
- grpc_iomgr_closure_init(&fd->on_done_closure, on_done ? on_done : do_nothing,
- user_data);
+static int has_watchers(grpc_fd *fd) {
+ return fd->read_watcher != NULL || fd->write_watcher != NULL || fd->inactive_watcher_root.next != &fd->inactive_watcher_root;
+}
+
+void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_closure *on_done,
+ const char *reason) {
+ fd->on_done_closure = on_done;
shutdown(fd->fd, SHUT_RDWR);
- ref_by(fd, 1); /* remove active status, but keep referenced */
+ REF_BY(fd, 1, reason); /* remove active status, but keep referenced */
gpr_mu_lock(&fd->watcher_mu);
- wake_all_watchers_locked(fd);
+ if (!has_watchers(fd)) {
+ close(fd->fd);
+ if (fd->on_done_closure) {
+ grpc_iomgr_add_callback(fd->on_done_closure);
+ }
+ } else {
+ wake_all_watchers_locked(fd);
+ }
gpr_mu_unlock(&fd->watcher_mu);
- unref_by(fd, 2); /* drop the reference */
+ UNREF_BY(fd, 2, reason); /* drop the reference */
}
/* increment refcount by two to avoid changing the orphan bit */
+#ifdef GRPC_FD_REF_COUNT_DEBUG
+void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line) {
+ ref_by(fd, 2, reason, file, line);
+}
+
+void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file,
+ int line) {
+ unref_by(fd, 2, reason, file, line);
+}
+#else
void grpc_fd_ref(grpc_fd *fd) { ref_by(fd, 2); }
void grpc_fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
+#endif
static void process_callback(grpc_iomgr_closure *closure, int success,
- int allow_synchronous_callback) {
+ int allow_synchronous_callback) {
if (allow_synchronous_callback) {
closure->cb(closure->cb_arg, success);
} else {
@@ -235,7 +276,7 @@ static void notify_on(grpc_fd *fd, gpr_atm *st, grpc_iomgr_closure *closure,
GPR_ASSERT(gpr_atm_no_barrier_load(st) == READY);
gpr_atm_rel_store(st, NOT_READY);
process_callback(closure, !gpr_atm_acq_load(&fd->shutdown),
- allow_synchronous_callback);
+ allow_synchronous_callback);
return;
default: /* WAITING */
/* upcallptr was set to a different closure. This is an error! */
@@ -279,7 +320,7 @@ static void set_ready(grpc_fd *fd, gpr_atm *st,
/* only one set_ready can be active at once (but there may be a racing
notify_on) */
int success;
- grpc_iomgr_closure* closure;
+ grpc_iomgr_closure *closure;
size_t ncb = 0;
gpr_mu_lock(&fd->set_state_mu);
@@ -319,17 +360,25 @@ gpr_uint32 grpc_fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
gpr_uint32 mask = 0;
/* keep track of pollers that have requested our events, in case they change
*/
- grpc_fd_ref(fd);
+ GRPC_FD_REF(fd, "poll");
gpr_mu_lock(&fd->watcher_mu);
+ /* if we are shutdown, then don't add to the watcher set */
+ if (gpr_atm_no_barrier_load(&fd->shutdown)) {
+ watcher->fd = NULL;
+ watcher->pollset = NULL;
+ gpr_mu_unlock(&fd->watcher_mu);
+ GRPC_FD_UNREF(fd, "poll");
+ return 0;
+ }
/* if there is nobody polling for read, but we need to, then start doing so */
- if (!fd->read_watcher && gpr_atm_acq_load(&fd->readst) > READY) {
+ if (read_mask && !fd->read_watcher && gpr_atm_acq_load(&fd->readst) > READY) {
fd->read_watcher = watcher;
mask |= read_mask;
}
/* if there is nobody polling for write, but we need to, then start doing so
*/
- if (!fd->write_watcher && gpr_atm_acq_load(&fd->writest) > READY) {
+ if (write_mask && !fd->write_watcher && gpr_atm_acq_load(&fd->writest) > READY) {
fd->write_watcher = watcher;
mask |= write_mask;
}
@@ -351,6 +400,10 @@ void grpc_fd_end_poll(grpc_fd_watcher *watcher, int got_read, int got_write) {
int kick = 0;
grpc_fd *fd = watcher->fd;
+ if (fd == NULL) {
+ return;
+ }
+
gpr_mu_lock(&fd->watcher_mu);
if (watcher == fd->read_watcher) {
/* remove read watcher, kick if we still need a read */
@@ -372,9 +425,15 @@ void grpc_fd_end_poll(grpc_fd_watcher *watcher, int got_read, int got_write) {
if (kick) {
maybe_wake_one_watcher_locked(fd);
}
+ if (grpc_fd_is_orphaned(fd) && !has_watchers(fd)) {
+ close(fd->fd);
+ if (fd->on_done_closure != NULL) {
+ grpc_iomgr_add_callback(fd->on_done_closure);
+ }
+ }
gpr_mu_unlock(&fd->watcher_mu);
- grpc_fd_unref(fd);
+ GRPC_FD_UNREF(fd, "poll");
}
void grpc_fd_become_readable(grpc_fd *fd, int allow_synchronous_callback) {
diff --git a/src/core/iomgr/fd_posix.h b/src/core/iomgr/fd_posix.h
index 0fa71850e3..94d0019fa4 100644
--- a/src/core/iomgr/fd_posix.h
+++ b/src/core/iomgr/fd_posix.h
@@ -62,12 +62,12 @@ struct grpc_fd {
gpr_atm shutdown;
/* The watcher list.
-
+
The following watcher related fields are protected by watcher_mu.
-
+
An fd_watcher is an ephemeral object created when an fd wants to
begin polling, and destroyed after the poll.
-
+
It denotes the fd's interest in whether to read poll or write poll
or both or neither on this fd.
@@ -93,7 +93,7 @@ struct grpc_fd {
struct grpc_fd *freelist_next;
- grpc_iomgr_closure on_done_closure;
+ grpc_iomgr_closure *on_done_closure;
grpc_iomgr_closure *shutdown_closures[2];
grpc_iomgr_object iomgr_object;
@@ -109,7 +109,8 @@ grpc_fd *grpc_fd_create(int fd, const char *name);
If on_done is NULL, no callback will be made.
Requires: *fd initialized; no outstanding notify_on_read or
notify_on_write. */
-void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_cb_func on_done, void *user_data);
+void grpc_fd_orphan(grpc_fd *fd, grpc_iomgr_closure *on_done,
+ const char *reason);
/* Begin polling on an fd.
Registers that the given pollset is interested in this fd - so that if read
@@ -159,10 +160,19 @@ void grpc_fd_become_readable(grpc_fd *fd, int allow_synchronous_callback);
void grpc_fd_become_writable(grpc_fd *fd, int allow_synchronous_callback);
/* Reference counting for fds */
+#ifdef GRPC_FD_REF_COUNT_DEBUG
+void grpc_fd_ref(grpc_fd *fd, const char *reason, const char *file, int line);
+void grpc_fd_unref(grpc_fd *fd, const char *reason, const char *file, int line);
+#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd, reason, __FILE__, __LINE__)
+#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd, reason, __FILE__, __LINE__)
+#else
void grpc_fd_ref(grpc_fd *fd);
void grpc_fd_unref(grpc_fd *fd);
+#define GRPC_FD_REF(fd, reason) grpc_fd_ref(fd)
+#define GRPC_FD_UNREF(fd, reason) grpc_fd_unref(fd)
+#endif
void grpc_fd_global_init(void);
void grpc_fd_global_shutdown(void);
-#endif /* GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_FD_POSIX_H */
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c
index fa8dcc5b4a..c47528aa94 100644
--- a/src/core/iomgr/iomgr.c
+++ b/src/core/iomgr/iomgr.c
@@ -112,13 +112,20 @@ void grpc_iomgr_shutdown(void) {
gpr_timespec shutdown_deadline =
gpr_time_add(gpr_now(), gpr_time_from_seconds(10));
-
gpr_mu_lock(&g_mu);
g_shutdown = 1;
- while (g_cbs_head || g_root_object.next != &g_root_object) {
- size_t nobjs = count_objects();
- gpr_log(GPR_DEBUG, "Waiting for %d iomgr objects to be destroyed%s", nobjs,
- g_cbs_head ? " and executing final callbacks" : "");
+ while (g_cbs_head != NULL || g_root_object.next != &g_root_object) {
+ if (g_cbs_head != NULL && g_root_object.next != &g_root_object) {
+ gpr_log(GPR_DEBUG,
+ "Waiting for %d iomgr objects to be destroyed and executing "
+ "final callbacks",
+ count_objects());
+ } else if (g_cbs_head != NULL) {
+ gpr_log(GPR_DEBUG, "Executing final iomgr callbacks");
+ } else {
+ gpr_log(GPR_DEBUG, "Waiting for %d iomgr objects to be destroyed",
+ count_objects());
+ }
if (g_cbs_head) {
do {
closure = g_cbs_head;
@@ -131,10 +138,14 @@ void grpc_iomgr_shutdown(void) {
} while (g_cbs_head);
continue;
}
- if (nobjs > 0) {
+ if (grpc_alarm_check(&g_mu, gpr_inf_future, NULL)) {
+ gpr_log(GPR_DEBUG, "got late alarm");
+ continue;
+ }
+ if (g_root_object.next != &g_root_object) {
int timeout = 0;
- gpr_timespec short_deadline = gpr_time_add(gpr_now(),
- gpr_time_from_millis(100));
+ gpr_timespec short_deadline =
+ gpr_time_add(gpr_now(), gpr_time_from_millis(100));
while (gpr_cv_wait(&g_rcv, &g_mu, short_deadline) && g_cbs_head == NULL) {
if (gpr_time_cmp(gpr_now(), shutdown_deadline) > 0) {
timeout = 1;
@@ -158,15 +169,16 @@ void grpc_iomgr_shutdown(void) {
grpc_kick_poller();
gpr_event_wait(&g_background_callback_executor_done, gpr_inf_future);
- grpc_iomgr_platform_shutdown();
grpc_alarm_list_shutdown();
+
+ grpc_iomgr_platform_shutdown();
gpr_mu_destroy(&g_mu);
gpr_cv_destroy(&g_rcv);
}
void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name) {
- obj->name = gpr_strdup(name);
gpr_mu_lock(&g_mu);
+ obj->name = gpr_strdup(name);
obj->next = &g_root_object;
obj->prev = obj->next->prev;
obj->next->prev = obj->prev->next = obj;
@@ -174,15 +186,14 @@ void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name) {
}
void grpc_iomgr_unregister_object(grpc_iomgr_object *obj) {
- gpr_free(obj->name);
gpr_mu_lock(&g_mu);
obj->next->prev = obj->prev;
obj->prev->next = obj->next;
+ gpr_free(obj->name);
gpr_cv_signal(&g_rcv);
gpr_mu_unlock(&g_mu);
}
-
void grpc_iomgr_closure_init(grpc_iomgr_closure *closure, grpc_iomgr_cb_func cb,
void *cb_arg) {
closure->cb = cb;
@@ -200,15 +211,16 @@ void grpc_iomgr_add_delayed_callback(grpc_iomgr_closure *closure, int success) {
g_cbs_tail->next = closure;
g_cbs_tail = closure;
}
+ if (g_shutdown) {
+ gpr_cv_signal(&g_rcv);
+ }
gpr_mu_unlock(&g_mu);
}
-
void grpc_iomgr_add_callback(grpc_iomgr_closure *closure) {
grpc_iomgr_add_delayed_callback(closure, 1 /* GPR_TRUE */);
}
-
int grpc_maybe_call_delayed_callbacks(gpr_mu *drop_mu, int success) {
int n = 0;
gpr_mu *retake_mu = NULL;
diff --git a/src/core/iomgr/iomgr.h b/src/core/iomgr/iomgr.h
index a10e481e48..6d4a82917b 100644
--- a/src/core/iomgr/iomgr.h
+++ b/src/core/iomgr/iomgr.h
@@ -73,4 +73,8 @@ void grpc_iomgr_shutdown(void);
* Can be called from within a callback or from anywhere else */
void grpc_iomgr_add_callback(grpc_iomgr_closure *closure);
+/** As per grpc_iomgr_add_callback, with the ability to set the success
+ argument. */
+void grpc_iomgr_add_delayed_callback(grpc_iomgr_closure *iocb, int success);
+
#endif /* GRPC_INTERNAL_CORE_IOMGR_IOMGR_H */
diff --git a/src/core/iomgr/pollset.h b/src/core/iomgr/pollset.h
index 067af87c93..c40188b3c9 100644
--- a/src/core/iomgr/pollset.h
+++ b/src/core/iomgr/pollset.h
@@ -52,23 +52,24 @@
#include "src/core/iomgr/pollset_windows.h"
#endif
-
void grpc_pollset_init(grpc_pollset *pollset);
void grpc_pollset_shutdown(grpc_pollset *pollset,
void (*shutdown_done)(void *arg),
void *shutdown_done_arg);
void grpc_pollset_destroy(grpc_pollset *pollset);
-
/* Do some work on a pollset.
May involve invoking asynchronous callbacks, or actually polling file
descriptors.
Requires GRPC_POLLSET_MU(pollset) locked.
- May unlock GRPC_POLLSET_MU(pollset) during its execution. */
+ May unlock GRPC_POLLSET_MU(pollset) during its execution.
+
+ Returns true if some work has been done, and false if the deadline
+ got attained. */
int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline);
-/* Break a pollset out of polling work
+/* Break one polling thread out of polling work for this pollset.
Requires GRPC_POLLSET_MU(pollset) locked. */
void grpc_pollset_kick(grpc_pollset *pollset);
-#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_H */
diff --git a/src/core/iomgr/pollset_kick.c b/src/core/iomgr/pollset_kick_posix.c
index f0211b8274..51021784f2 100644
--- a/src/core/iomgr/pollset_kick.c
+++ b/src/core/iomgr/pollset_kick_posix.c
@@ -34,7 +34,7 @@
#include <grpc/support/port_platform.h>
#ifdef GPR_POSIX_SOCKET
-#include "src/core/iomgr/pollset_kick.h"
+#include "src/core/iomgr/pollset_kick_posix.h"
#include <errno.h>
#include <string.h>
@@ -73,7 +73,7 @@ static grpc_kick_fd_info *allocate_wfd(void) {
return info;
}
-static void destroy_wfd(grpc_kick_fd_info* wfd) {
+static void destroy_wfd(grpc_kick_fd_info *wfd) {
grpc_wakeup_fd_destroy(&wfd->wakeup_fd);
gpr_free(wfd);
}
@@ -96,41 +96,49 @@ static void free_wfd(grpc_kick_fd_info *fd_info) {
void grpc_pollset_kick_init(grpc_pollset_kick_state *kick_state) {
gpr_mu_init(&kick_state->mu);
kick_state->kicked = 0;
- kick_state->fd_info = NULL;
+ kick_state->fd_list.next = kick_state->fd_list.prev = &kick_state->fd_list;
}
void grpc_pollset_kick_destroy(grpc_pollset_kick_state *kick_state) {
gpr_mu_destroy(&kick_state->mu);
- GPR_ASSERT(kick_state->fd_info == NULL);
+ GPR_ASSERT(kick_state->fd_list.next == &kick_state->fd_list);
}
-int grpc_pollset_kick_pre_poll(grpc_pollset_kick_state *kick_state) {
+grpc_kick_fd_info *grpc_pollset_kick_pre_poll(
+ grpc_pollset_kick_state *kick_state) {
+ grpc_kick_fd_info *fd_info;
gpr_mu_lock(&kick_state->mu);
if (kick_state->kicked) {
kick_state->kicked = 0;
gpr_mu_unlock(&kick_state->mu);
- return -1;
+ return NULL;
}
- kick_state->fd_info = allocate_wfd();
+ fd_info = allocate_wfd();
+ fd_info->next = &kick_state->fd_list;
+ fd_info->prev = fd_info->next->prev;
+ fd_info->next->prev = fd_info->prev->next = fd_info;
gpr_mu_unlock(&kick_state->mu);
- return GRPC_WAKEUP_FD_GET_READ_FD(&kick_state->fd_info->wakeup_fd);
+ return fd_info;
}
-void grpc_pollset_kick_consume(grpc_pollset_kick_state *kick_state) {
- grpc_wakeup_fd_consume_wakeup(&kick_state->fd_info->wakeup_fd);
+void grpc_pollset_kick_consume(grpc_pollset_kick_state *kick_state,
+ grpc_kick_fd_info *fd_info) {
+ grpc_wakeup_fd_consume_wakeup(&fd_info->wakeup_fd);
}
-void grpc_pollset_kick_post_poll(grpc_pollset_kick_state *kick_state) {
+void grpc_pollset_kick_post_poll(grpc_pollset_kick_state *kick_state,
+ grpc_kick_fd_info *fd_info) {
gpr_mu_lock(&kick_state->mu);
- free_wfd(kick_state->fd_info);
- kick_state->fd_info = NULL;
+ fd_info->next->prev = fd_info->prev;
+ fd_info->prev->next = fd_info->next;
+ free_wfd(fd_info);
gpr_mu_unlock(&kick_state->mu);
}
void grpc_pollset_kick_kick(grpc_pollset_kick_state *kick_state) {
gpr_mu_lock(&kick_state->mu);
- if (kick_state->fd_info != NULL) {
- grpc_wakeup_fd_wakeup(&kick_state->fd_info->wakeup_fd);
+ if (kick_state->fd_list.next != &kick_state->fd_list) {
+ grpc_wakeup_fd_wakeup(&kick_state->fd_list.next->wakeup_fd);
} else {
kick_state->kicked = 1;
}
@@ -157,5 +165,4 @@ void grpc_pollset_kick_global_destroy(void) {
gpr_mu_destroy(&fd_freelist_mu);
}
-
-#endif /* GPR_POSIX_SOCKET */
+#endif /* GPR_POSIX_SOCKET */
diff --git a/src/core/iomgr/pollset_kick_posix.h b/src/core/iomgr/pollset_kick_posix.h
index 427699198c..77e32a8d51 100644
--- a/src/core/iomgr/pollset_kick_posix.h
+++ b/src/core/iomgr/pollset_kick_posix.h
@@ -37,15 +37,57 @@
#include "src/core/iomgr/wakeup_fd_posix.h"
#include <grpc/support/sync.h>
+/* pollset kicking allows breaking a thread out of polling work for
+ a given pollset.
+ writing a byte to a pipe is used as a posix-ly portable base
+ mechanism, and eventfds are utilized on Linux for better performance. */
+
typedef struct grpc_kick_fd_info {
grpc_wakeup_fd_info wakeup_fd;
+ /* used for polling list and free list */
struct grpc_kick_fd_info *next;
+ /* only used when polling */
+ struct grpc_kick_fd_info *prev;
} grpc_kick_fd_info;
typedef struct grpc_pollset_kick_state {
gpr_mu mu;
int kicked;
- struct grpc_kick_fd_info *fd_info;
+ struct grpc_kick_fd_info fd_list;
} grpc_pollset_kick_state;
-#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_POSIX_H */
+#define GRPC_POLLSET_KICK_GET_FD(kick_fd_info) \
+ GRPC_WAKEUP_FD_GET_READ_FD(&(kick_fd_info)->wakeup_fd)
+
+/* This is an abstraction around the typical pipe mechanism for waking up a
+ thread sitting in a poll() style call. */
+
+void grpc_pollset_kick_global_init(void);
+void grpc_pollset_kick_global_destroy(void);
+
+void grpc_pollset_kick_init(grpc_pollset_kick_state *kick_state);
+void grpc_pollset_kick_destroy(grpc_pollset_kick_state *kick_state);
+
+/* Guarantees a pure posix implementation rather than a specialized one, if
+ * applicable. Intended for testing. */
+void grpc_pollset_kick_global_init_fallback_fd(void);
+
+/* Must be called before entering poll(). If return value is NULL, this consumed
+ an existing kick. Otherwise the return value is an FD to add to the poll set.
+ */
+grpc_kick_fd_info *grpc_pollset_kick_pre_poll(
+ grpc_pollset_kick_state *kick_state);
+
+/* Consume an existing kick. Must be called after poll returns that the fd was
+ readable, and before calling kick_post_poll. */
+void grpc_pollset_kick_consume(grpc_pollset_kick_state *kick_state,
+ grpc_kick_fd_info *fd_info);
+
+/* Must be called after pre_poll, and after consume if applicable */
+void grpc_pollset_kick_post_poll(grpc_pollset_kick_state *kick_state,
+ grpc_kick_fd_info *fd_info);
+
+/* Actually kick */
+void grpc_pollset_kick_kick(grpc_pollset_kick_state *kick_state);
+
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_POSIX_H */
diff --git a/src/core/iomgr/pollset_multipoller_with_epoll.c b/src/core/iomgr/pollset_multipoller_with_epoll.c
index 40b7935a57..1900bbf9e1 100644
--- a/src/core/iomgr/pollset_multipoller_with_epoll.c
+++ b/src/core/iomgr/pollset_multipoller_with_epoll.c
@@ -54,17 +54,25 @@ static void multipoll_with_epoll_pollset_add_fd(grpc_pollset *pollset,
pollset_hdr *h = pollset->data.ptr;
struct epoll_event ev;
int err;
-
- ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
- ev.data.ptr = fd;
- err = epoll_ctl(h->epoll_fd, EPOLL_CTL_ADD, fd->fd, &ev);
- if (err < 0) {
- /* FDs may be added to a pollset multiple times, so EEXIST is normal. */
- if (errno != EEXIST) {
- gpr_log(GPR_ERROR, "epoll_ctl add for %d failed: %s", fd->fd,
- strerror(errno));
+ grpc_fd_watcher watcher;
+
+ /* We pretend to be polling whilst adding an fd to keep the fd from being
+ closed during the add. This may result in a spurious wakeup being assigned
+ to this pollset whilst adding, but that should be benign. */
+ GPR_ASSERT(grpc_fd_begin_poll(fd, pollset, 0, 0, &watcher) == 0);
+ if (watcher.fd != NULL) {
+ ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
+ ev.data.ptr = fd;
+ err = epoll_ctl(h->epoll_fd, EPOLL_CTL_ADD, fd->fd, &ev);
+ if (err < 0) {
+ /* FDs may be added to a pollset multiple times, so EEXIST is normal. */
+ if (errno != EEXIST) {
+ gpr_log(GPR_ERROR, "epoll_ctl add for %d failed: %s", fd->fd,
+ strerror(errno));
+ }
}
}
+ grpc_fd_end_poll(&watcher, 0, 0);
}
static void multipoll_with_epoll_pollset_del_fd(grpc_pollset *pollset,
@@ -83,7 +91,7 @@ static void multipoll_with_epoll_pollset_del_fd(grpc_pollset *pollset,
/* TODO(klempner): We probably want to turn this down a bit */
#define GRPC_EPOLL_MAX_EVENTS 1000
-static int multipoll_with_epoll_pollset_maybe_work(
+static void multipoll_with_epoll_pollset_maybe_work(
grpc_pollset *pollset, gpr_timespec deadline, gpr_timespec now,
int allow_synchronous_callback) {
struct epoll_event ep_ev[GRPC_EPOLL_MAX_EVENTS];
@@ -97,14 +105,7 @@ static int multipoll_with_epoll_pollset_maybe_work(
* here.
*/
- if (gpr_time_cmp(deadline, gpr_inf_future) == 0) {
- timeout_ms = -1;
- } else {
- timeout_ms = gpr_time_to_millis(gpr_time_sub(deadline, now));
- if (timeout_ms <= 0) {
- return 1;
- }
- }
+ timeout_ms = grpc_poll_deadline_to_millis_timeout(deadline, now);
pollset->counter += 1;
gpr_mu_unlock(&pollset->mu);
@@ -140,13 +141,11 @@ static int multipoll_with_epoll_pollset_maybe_work(
gpr_mu_lock(&pollset->mu);
pollset->counter -= 1;
- /* TODO(klempner): This should signal once per event rather than broadcast,
- * although it probably doesn't matter because threads will generally be
- * blocked in epoll_wait rather than being blocked on the cv. */
- gpr_cv_broadcast(&pollset->cv);
- return 1;
}
+static void multipoll_with_epoll_pollset_finish_shutdown(
+ grpc_pollset *pollset) {}
+
static void multipoll_with_epoll_pollset_destroy(grpc_pollset *pollset) {
pollset_hdr *h = pollset->data.ptr;
grpc_wakeup_fd_destroy(&h->wakeup_fd);
@@ -160,8 +159,11 @@ static void epoll_kick(grpc_pollset *pollset) {
}
static const grpc_pollset_vtable multipoll_with_epoll_pollset = {
- multipoll_with_epoll_pollset_add_fd, multipoll_with_epoll_pollset_del_fd,
- multipoll_with_epoll_pollset_maybe_work, epoll_kick,
+ multipoll_with_epoll_pollset_add_fd,
+ multipoll_with_epoll_pollset_del_fd,
+ multipoll_with_epoll_pollset_maybe_work,
+ epoll_kick,
+ multipoll_with_epoll_pollset_finish_shutdown,
multipoll_with_epoll_pollset_destroy};
static void epoll_become_multipoller(grpc_pollset *pollset, grpc_fd **fds,
diff --git a/src/core/iomgr/pollset_multipoller_with_poll_posix.c b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
index d781c9b4bb..7b717bd159 100644
--- a/src/core/iomgr/pollset_multipoller_with_poll_posix.c
+++ b/src/core/iomgr/pollset_multipoller_with_poll_posix.c
@@ -78,7 +78,7 @@ static void multipoll_with_poll_pollset_add_fd(grpc_pollset *pollset,
h->fds = gpr_realloc(h->fds, sizeof(grpc_fd *) * h->fd_capacity);
}
h->fds[h->fd_count++] = fd;
- grpc_fd_ref(fd);
+ GRPC_FD_REF(fd, "multipoller");
}
static void multipoll_with_poll_pollset_del_fd(grpc_pollset *pollset,
@@ -90,7 +90,7 @@ static void multipoll_with_poll_pollset_del_fd(grpc_pollset *pollset,
h->dels = gpr_realloc(h->dels, sizeof(grpc_fd *) * h->del_capacity);
}
h->dels[h->del_count++] = fd;
- grpc_fd_ref(fd);
+ GRPC_FD_REF(fd, "multipoller_del");
}
static void end_polling(grpc_pollset *pollset) {
@@ -103,26 +103,17 @@ static void end_polling(grpc_pollset *pollset) {
}
}
-static int multipoll_with_poll_pollset_maybe_work(
+static void multipoll_with_poll_pollset_maybe_work(
grpc_pollset *pollset, gpr_timespec deadline, gpr_timespec now,
int allow_synchronous_callback) {
int timeout;
int r;
size_t i, np, nf, nd;
pollset_hdr *h;
+ grpc_kick_fd_info *kfd;
- if (pollset->counter) {
- return 0;
- }
h = pollset->data.ptr;
- if (gpr_time_cmp(deadline, gpr_inf_future) == 0) {
- timeout = -1;
- } else {
- timeout = gpr_time_to_millis(gpr_time_sub(deadline, now));
- if (timeout <= 0) {
- return 1;
- }
- }
+ timeout = grpc_poll_deadline_to_millis_timeout(deadline, now);
if (h->pfd_capacity < h->fd_count + 1) {
h->pfd_capacity = GPR_MAX(h->pfd_capacity * 3 / 2, h->fd_count + 1);
gpr_free(h->pfds);
@@ -132,11 +123,12 @@ static int multipoll_with_poll_pollset_maybe_work(
}
nf = 0;
np = 1;
- h->pfds[0].fd = grpc_pollset_kick_pre_poll(&pollset->kick_state);
- if (h->pfds[0].fd < 0) {
+ kfd = grpc_pollset_kick_pre_poll(&pollset->kick_state);
+ if (kfd == NULL) {
/* Already kicked */
- return 1;
+ return;
}
+ h->pfds[0].fd = GRPC_POLLSET_KICK_GET_FD(kfd);
h->pfds[0].events = POLLIN;
h->pfds[0].revents = POLLOUT;
for (i = 0; i < h->fd_count; i++) {
@@ -145,7 +137,7 @@ static int multipoll_with_poll_pollset_maybe_work(
if (h->fds[i] == h->dels[nd]) remove = 1;
}
if (remove) {
- grpc_fd_unref(h->fds[i]);
+ GRPC_FD_UNREF(h->fds[i], "multipoller");
} else {
h->fds[nf++] = h->fds[i];
h->watchers[np].fd = h->fds[i];
@@ -157,14 +149,14 @@ static int multipoll_with_poll_pollset_maybe_work(
h->pfd_count = np;
h->fd_count = nf;
for (nd = 0; nd < h->del_count; nd++) {
- grpc_fd_unref(h->dels[nd]);
+ GRPC_FD_UNREF(h->dels[nd], "multipoller_del");
}
h->del_count = 0;
if (h->pfd_count == 0) {
end_polling(pollset);
- return 0;
+ return;
}
- pollset->counter = 1;
+ pollset->counter++;
gpr_mu_unlock(&pollset->mu);
for (i = 1; i < np; i++) {
@@ -184,9 +176,12 @@ static int multipoll_with_poll_pollset_maybe_work(
/* do nothing */
} else {
if (h->pfds[0].revents & POLLIN) {
- grpc_pollset_kick_consume(&pollset->kick_state);
+ grpc_pollset_kick_consume(&pollset->kick_state, kfd);
}
for (i = 1; i < np; i++) {
+ if (h->watchers[i].fd == NULL) {
+ continue;
+ }
if (h->pfds[i].revents & (POLLIN | POLLHUP | POLLERR)) {
grpc_fd_become_readable(h->watchers[i].fd, allow_synchronous_callback);
}
@@ -195,28 +190,33 @@ static int multipoll_with_poll_pollset_maybe_work(
}
}
}
- grpc_pollset_kick_post_poll(&pollset->kick_state);
+ grpc_pollset_kick_post_poll(&pollset->kick_state, kfd);
gpr_mu_lock(&pollset->mu);
- pollset->counter = 0;
- gpr_cv_broadcast(&pollset->cv);
- return 1;
+ pollset->counter--;
}
static void multipoll_with_poll_pollset_kick(grpc_pollset *p) {
grpc_pollset_force_kick(p);
}
-static void multipoll_with_poll_pollset_destroy(grpc_pollset *pollset) {
+static void multipoll_with_poll_pollset_finish_shutdown(grpc_pollset *pollset) {
size_t i;
pollset_hdr *h = pollset->data.ptr;
GPR_ASSERT(pollset->counter == 0);
for (i = 0; i < h->fd_count; i++) {
- grpc_fd_unref(h->fds[i]);
+ GRPC_FD_UNREF(h->fds[i], "multipoller");
}
for (i = 0; i < h->del_count; i++) {
- grpc_fd_unref(h->dels[i]);
+ GRPC_FD_UNREF(h->dels[i], "multipoller_del");
}
+ h->fd_count = 0;
+ h->del_count = 0;
+}
+
+static void multipoll_with_poll_pollset_destroy(grpc_pollset *pollset) {
+ pollset_hdr *h = pollset->data.ptr;
+ multipoll_with_poll_pollset_finish_shutdown(pollset);
gpr_free(h->pfds);
gpr_free(h->watchers);
gpr_free(h->fds);
@@ -225,8 +225,11 @@ static void multipoll_with_poll_pollset_destroy(grpc_pollset *pollset) {
}
static const grpc_pollset_vtable multipoll_with_poll_pollset = {
- multipoll_with_poll_pollset_add_fd, multipoll_with_poll_pollset_del_fd,
- multipoll_with_poll_pollset_maybe_work, multipoll_with_poll_pollset_kick,
+ multipoll_with_poll_pollset_add_fd,
+ multipoll_with_poll_pollset_del_fd,
+ multipoll_with_poll_pollset_maybe_work,
+ multipoll_with_poll_pollset_kick,
+ multipoll_with_poll_pollset_finish_shutdown,
multipoll_with_poll_pollset_destroy};
void grpc_poll_become_multipoller(grpc_pollset *pollset, grpc_fd **fds,
@@ -247,7 +250,7 @@ void grpc_poll_become_multipoller(grpc_pollset *pollset, grpc_fd **fds,
h->dels = NULL;
for (i = 0; i < nfds; i++) {
h->fds[i] = fds[i];
- grpc_fd_ref(fds[i]);
+ GRPC_FD_REF(fds[i], "multipoller");
}
}
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index d2f615271e..15ed8e75e6 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -54,31 +54,8 @@
#include <grpc/support/tls.h>
#include <grpc/support/useful.h>
-static grpc_pollset g_backup_pollset;
-static int g_shutdown_backup_poller;
-static gpr_event g_backup_poller_done;
-static gpr_event g_backup_pollset_shutdown_done;
-
GPR_TLS_DECL(g_current_thread_poller);
-static void backup_poller(void *p) {
- gpr_timespec delta = gpr_time_from_millis(100);
- gpr_timespec last_poll = gpr_now();
-
- gpr_mu_lock(&g_backup_pollset.mu);
- while (g_shutdown_backup_poller == 0) {
- gpr_timespec next_poll = gpr_time_add(last_poll, delta);
- grpc_pollset_work(&g_backup_pollset, gpr_time_add(gpr_now(), gpr_time_from_seconds(1)));
- gpr_mu_unlock(&g_backup_pollset.mu);
- gpr_sleep_until(next_poll);
- gpr_mu_lock(&g_backup_pollset.mu);
- last_poll = next_poll;
- }
- gpr_mu_unlock(&g_backup_pollset.mu);
-
- gpr_event_set(&g_backup_poller_done, (void *)1);
-}
-
void grpc_pollset_kick(grpc_pollset *p) {
if (gpr_tls_get(&g_current_thread_poller) != (gpr_intptr)p && p->counter) {
p->vtable->kick(p);
@@ -99,44 +76,14 @@ static void kick_using_pollset_kick(grpc_pollset *p) {
/* global state management */
-grpc_pollset *grpc_backup_pollset(void) { return &g_backup_pollset; }
-
void grpc_pollset_global_init(void) {
- gpr_thd_id id;
-
gpr_tls_init(&g_current_thread_poller);
/* Initialize kick fd state */
grpc_pollset_kick_global_init();
-
- /* initialize the backup pollset */
- grpc_pollset_init(&g_backup_pollset);
-
- /* start the backup poller thread */
- g_shutdown_backup_poller = 0;
- gpr_event_init(&g_backup_poller_done);
- gpr_event_init(&g_backup_pollset_shutdown_done);
- gpr_thd_new(&id, backup_poller, NULL, NULL);
-}
-
-static void on_backup_pollset_shutdown_done(void *arg) {
- gpr_event_set(&g_backup_pollset_shutdown_done, (void *)1);
}
void grpc_pollset_global_shutdown(void) {
- /* terminate the backup poller thread */
- gpr_mu_lock(&g_backup_pollset.mu);
- g_shutdown_backup_poller = 1;
- gpr_mu_unlock(&g_backup_pollset.mu);
- gpr_event_wait(&g_backup_poller_done, gpr_inf_future);
-
- grpc_pollset_shutdown(&g_backup_pollset, on_backup_pollset_shutdown_done,
- NULL);
- gpr_event_wait(&g_backup_pollset_shutdown_done, gpr_inf_future);
-
- /* destroy the backup pollset */
- grpc_pollset_destroy(&g_backup_pollset);
-
/* destroy the kick pipes */
grpc_pollset_kick_global_destroy();
@@ -145,36 +92,37 @@ void grpc_pollset_global_shutdown(void) {
/* main interface */
-static void become_empty_pollset(grpc_pollset *pollset);
-static void become_unary_pollset(grpc_pollset *pollset, grpc_fd *fd);
+static void become_basic_pollset(grpc_pollset *pollset, grpc_fd *fd_or_null);
void grpc_pollset_init(grpc_pollset *pollset) {
gpr_mu_init(&pollset->mu);
- gpr_cv_init(&pollset->cv);
grpc_pollset_kick_init(&pollset->kick_state);
pollset->in_flight_cbs = 0;
pollset->shutting_down = 0;
- become_empty_pollset(pollset);
+ pollset->called_shutdown = 0;
+ become_basic_pollset(pollset, NULL);
}
void grpc_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) {
gpr_mu_lock(&pollset->mu);
pollset->vtable->add_fd(pollset, fd);
- gpr_cv_broadcast(&pollset->cv);
gpr_mu_unlock(&pollset->mu);
}
void grpc_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) {
gpr_mu_lock(&pollset->mu);
pollset->vtable->del_fd(pollset, fd);
- gpr_cv_broadcast(&pollset->cv);
gpr_mu_unlock(&pollset->mu);
}
+static void finish_shutdown(grpc_pollset *pollset) {
+ pollset->vtable->finish_shutdown(pollset);
+ pollset->shutdown_done_cb(pollset->shutdown_done_arg);
+}
+
int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) {
/* pollset->mu already held */
gpr_timespec now = gpr_now();
- int r;
if (gpr_time_cmp(now, deadline) > 0) {
return 0;
}
@@ -188,14 +136,15 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) {
return 1;
}
gpr_tls_set(&g_current_thread_poller, (gpr_intptr)pollset);
- r = pollset->vtable->maybe_work(pollset, deadline, now, 1);
+ pollset->vtable->maybe_work(pollset, deadline, now, 1);
gpr_tls_set(&g_current_thread_poller, 0);
if (pollset->shutting_down) {
if (pollset->counter > 0) {
grpc_pollset_kick(pollset);
- } else if (pollset->in_flight_cbs == 0) {
+ } else if (!pollset->called_shutdown && pollset->in_flight_cbs == 0) {
+ pollset->called_shutdown = 1;
gpr_mu_unlock(&pollset->mu);
- pollset->shutdown_done_cb(pollset->shutdown_done_arg);
+ finish_shutdown(pollset);
/* Continuing to access pollset here is safe -- it is the caller's
* responsibility to not destroy when it has outstanding calls to
* grpc_pollset_work.
@@ -203,27 +152,30 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) {
gpr_mu_lock(&pollset->mu);
}
}
- return r;
+ return 1;
}
void grpc_pollset_shutdown(grpc_pollset *pollset,
void (*shutdown_done)(void *arg),
void *shutdown_done_arg) {
- int in_flight_cbs;
- int counter;
+ int call_shutdown = 0;
gpr_mu_lock(&pollset->mu);
+ GPR_ASSERT(!pollset->shutting_down);
pollset->shutting_down = 1;
- in_flight_cbs = pollset->in_flight_cbs;
- counter = pollset->counter;
+ if (!pollset->called_shutdown && pollset->in_flight_cbs == 0 &&
+ pollset->counter == 0) {
+ pollset->called_shutdown = 1;
+ call_shutdown = 1;
+ }
pollset->shutdown_done_cb = shutdown_done;
pollset->shutdown_done_arg = shutdown_done_arg;
- if (counter > 0) {
+ if (pollset->counter > 0) {
grpc_pollset_kick(pollset);
}
gpr_mu_unlock(&pollset->mu);
- if (in_flight_cbs == 0 && counter == 0) {
- shutdown_done(shutdown_done_arg);
+ if (call_shutdown) {
+ finish_shutdown(pollset);
}
}
@@ -233,41 +185,29 @@ void grpc_pollset_destroy(grpc_pollset *pollset) {
pollset->vtable->destroy(pollset);
grpc_pollset_kick_destroy(&pollset->kick_state);
gpr_mu_destroy(&pollset->mu);
- gpr_cv_destroy(&pollset->cv);
}
-/*
- * empty_pollset - a vtable that provides polling for NO file descriptors
- */
-
-static void empty_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) {
- become_unary_pollset(pollset, fd);
-}
-
-static void empty_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) {}
-
-static int empty_pollset_maybe_work(grpc_pollset *pollset,
- gpr_timespec deadline, gpr_timespec now,
- int allow_synchronous_callback) {
- return 0;
-}
-
-static void empty_pollset_destroy(grpc_pollset *pollset) {}
-
-static const grpc_pollset_vtable empty_pollset = {
- empty_pollset_add_fd, empty_pollset_del_fd, empty_pollset_maybe_work,
- kick_using_pollset_kick, empty_pollset_destroy};
-
-static void become_empty_pollset(grpc_pollset *pollset) {
- pollset->vtable = &empty_pollset;
+int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline, gpr_timespec now) {
+ gpr_timespec timeout;
+ static const int max_spin_polling_us = 10;
+ if (gpr_time_cmp(deadline, gpr_inf_future) == 0) {
+ return -1;
+ }
+ if (gpr_time_cmp(
+ deadline,
+ gpr_time_add(now, gpr_time_from_micros(max_spin_polling_us))) <= 0) {
+ return 0;
+ }
+ timeout = gpr_time_sub(deadline, now);
+ return gpr_time_to_millis(
+ gpr_time_add(timeout, gpr_time_from_nanos(GPR_NS_PER_SEC - 1)));
}
/*
- * unary_poll_pollset - a vtable that provides polling for one file descriptor
- * via poll()
+ * basic_pollset - a vtable that provides polling for zero or one file
+ * descriptor via poll()
*/
-
typedef struct grpc_unary_promote_args {
const grpc_pollset_vtable *original_vtable;
grpc_pollset *pollset;
@@ -275,7 +215,7 @@ typedef struct grpc_unary_promote_args {
grpc_iomgr_closure promotion_closure;
} grpc_unary_promote_args;
-static void unary_poll_do_promote(void *args, int success) {
+static void basic_do_promote(void *args, int success) {
grpc_unary_promote_args *up_args = args;
const grpc_pollset_vtable *original_vtable = up_args->original_vtable;
grpc_pollset *pollset = up_args->pollset;
@@ -293,7 +233,7 @@ static void unary_poll_do_promote(void *args, int success) {
gpr_mu_lock(&pollset->mu);
/* First we need to ensure that nobody is polling concurrently */
- while (pollset->counter != 0) {
+ if (pollset->counter != 0) {
grpc_pollset_kick(pollset);
grpc_iomgr_add_callback(&up_args->promotion_closure);
gpr_mu_unlock(&pollset->mu);
@@ -321,33 +261,33 @@ static void unary_poll_do_promote(void *args, int success) {
fds[0] = pollset->data.ptr;
fds[1] = fd;
- if (!grpc_fd_is_orphaned(fds[0])) {
+ if (fds[0] && !grpc_fd_is_orphaned(fds[0])) {
grpc_platform_become_multipoller(pollset, fds, GPR_ARRAY_SIZE(fds));
- grpc_fd_unref(fds[0]);
+ GRPC_FD_UNREF(fds[0], "basicpoll");
} else {
/* old fd is orphaned and we haven't cleaned it up until now, so remain a
* unary poller */
/* Note that it is possible that fds[1] is also orphaned at this point.
* That's okay, we'll correct it at the next add or poll. */
- grpc_fd_unref(fds[0]);
+ if (fds[0]) GRPC_FD_UNREF(fds[0], "basicpoll");
pollset->data.ptr = fd;
- grpc_fd_ref(fd);
+ GRPC_FD_REF(fd, "basicpoll");
}
}
- gpr_cv_broadcast(&pollset->cv);
gpr_mu_unlock(&pollset->mu);
if (do_shutdown_cb) {
pollset->shutdown_done_cb(pollset->shutdown_done_arg);
}
- /* Matching ref in unary_poll_pollset_add_fd */
- grpc_fd_unref(fd);
+ /* Matching ref in basic_pollset_add_fd */
+ GRPC_FD_UNREF(fd, "basicpoll_add");
}
-static void unary_poll_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) {
+static void basic_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) {
grpc_unary_promote_args *up_args;
+ GPR_ASSERT(fd);
if (fd == pollset->data.ptr) return;
if (!pollset->counter) {
@@ -358,92 +298,100 @@ static void unary_poll_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) {
fds[0] = pollset->data.ptr;
fds[1] = fd;
- if (!grpc_fd_is_orphaned(fds[0])) {
+ if (fds[0] == NULL) {
+ pollset->data.ptr = fd;
+ GRPC_FD_REF(fd, "basicpoll");
+ } else if (!grpc_fd_is_orphaned(fds[0])) {
grpc_platform_become_multipoller(pollset, fds, GPR_ARRAY_SIZE(fds));
- grpc_fd_unref(fds[0]);
+ GRPC_FD_UNREF(fds[0], "basicpoll");
} else {
/* old fd is orphaned and we haven't cleaned it up until now, so remain a
* unary poller */
- grpc_fd_unref(fds[0]);
+ GRPC_FD_UNREF(fds[0], "basicpoll");
pollset->data.ptr = fd;
- grpc_fd_ref(fd);
+ GRPC_FD_REF(fd, "basicpoll");
}
return;
}
/* Now we need to promote. This needs to happen when we're not polling. Since
* this may be called from poll, the wait needs to happen asynchronously. */
- grpc_fd_ref(fd);
+ GRPC_FD_REF(fd, "basicpoll_add");
pollset->in_flight_cbs++;
up_args = gpr_malloc(sizeof(*up_args));
up_args->pollset = pollset;
up_args->fd = fd;
up_args->original_vtable = pollset->vtable;
- up_args->promotion_closure.cb = unary_poll_do_promote;
+ up_args->promotion_closure.cb = basic_do_promote;
up_args->promotion_closure.cb_arg = up_args;
grpc_iomgr_add_callback(&up_args->promotion_closure);
grpc_pollset_kick(pollset);
}
-static void unary_poll_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) {
+static void basic_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) {
+ GPR_ASSERT(fd);
if (fd == pollset->data.ptr) {
- grpc_fd_unref(pollset->data.ptr);
- become_empty_pollset(pollset);
+ GRPC_FD_UNREF(pollset->data.ptr, "basicpoll");
+ pollset->data.ptr = NULL;
}
}
-static int unary_poll_pollset_maybe_work(grpc_pollset *pollset,
- gpr_timespec deadline,
- gpr_timespec now,
- int allow_synchronous_callback) {
+static void basic_pollset_maybe_work(grpc_pollset *pollset,
+ gpr_timespec deadline, gpr_timespec now,
+ int allow_synchronous_callback) {
struct pollfd pfd[2];
grpc_fd *fd;
grpc_fd_watcher fd_watcher;
+ grpc_kick_fd_info *kfd;
int timeout;
int r;
+ int nfds;
- if (pollset->counter) {
- return 0;
- }
if (pollset->in_flight_cbs) {
/* Give do_promote priority so we don't starve it out */
- return 0;
+ gpr_mu_unlock(&pollset->mu);
+ gpr_mu_lock(&pollset->mu);
+ return;
}
fd = pollset->data.ptr;
- if (grpc_fd_is_orphaned(fd)) {
- grpc_fd_unref(fd);
- become_empty_pollset(pollset);
- return 0;
- }
- if (gpr_time_cmp(deadline, gpr_inf_future) == 0) {
- timeout = -1;
- } else {
- timeout = gpr_time_to_millis(gpr_time_sub(deadline, now));
- if (timeout <= 0) {
- return 1;
- }
+ if (fd && grpc_fd_is_orphaned(fd)) {
+ GRPC_FD_UNREF(fd, "basicpoll");
+ fd = pollset->data.ptr = NULL;
}
- pfd[0].fd = grpc_pollset_kick_pre_poll(&pollset->kick_state);
- if (pfd[0].fd < 0) {
+ timeout = grpc_poll_deadline_to_millis_timeout(deadline, now);
+ kfd = grpc_pollset_kick_pre_poll(&pollset->kick_state);
+ if (kfd == NULL) {
/* Already kicked */
- return 1;
+ return;
}
+ pfd[0].fd = GRPC_POLLSET_KICK_GET_FD(kfd);
pfd[0].events = POLLIN;
pfd[0].revents = 0;
- pfd[1].fd = fd->fd;
- pfd[1].revents = 0;
- pollset->counter = 1;
- gpr_mu_unlock(&pollset->mu);
-
- pfd[1].events = grpc_fd_begin_poll(fd, pollset, POLLIN, POLLOUT, &fd_watcher);
+ nfds = 1;
+ pollset->counter++;
+ if (fd) {
+ pfd[1].fd = fd->fd;
+ pfd[1].revents = 0;
+ gpr_mu_unlock(&pollset->mu);
+ pfd[1].events =
+ grpc_fd_begin_poll(fd, pollset, POLLIN, POLLOUT, &fd_watcher);
+ if (pfd[1].events != 0) {
+ nfds++;
+ }
+ } else {
+ gpr_mu_unlock(&pollset->mu);
+ }
/* poll fd count (argument 2) is shortened by one if we have no events
to poll on - such that it only includes the kicker */
- r = poll(pfd, GPR_ARRAY_SIZE(pfd) - (pfd[1].events == 0), timeout);
+ r = poll(pfd, nfds, timeout);
GRPC_TIMER_MARK(GRPC_PTAG_POLL_FINISHED, r);
- grpc_fd_end_poll(&fd_watcher, pfd[1].revents & POLLIN, pfd[1].revents & POLLOUT);
+ if (fd) {
+ grpc_fd_end_poll(&fd_watcher, pfd[1].revents & POLLIN,
+ pfd[1].revents & POLLOUT);
+ }
if (r < 0) {
if (errno != EINTR) {
@@ -453,39 +401,43 @@ static int unary_poll_pollset_maybe_work(grpc_pollset *pollset,
/* do nothing */
} else {
if (pfd[0].revents & POLLIN) {
- grpc_pollset_kick_consume(&pollset->kick_state);
+ grpc_pollset_kick_consume(&pollset->kick_state, kfd);
}
- if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) {
- grpc_fd_become_readable(fd, allow_synchronous_callback);
- }
- if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) {
- grpc_fd_become_writable(fd, allow_synchronous_callback);
+ if (nfds > 1) {
+ if (pfd[1].revents & (POLLIN | POLLHUP | POLLERR)) {
+ grpc_fd_become_readable(fd, allow_synchronous_callback);
+ }
+ if (pfd[1].revents & (POLLOUT | POLLHUP | POLLERR)) {
+ grpc_fd_become_writable(fd, allow_synchronous_callback);
+ }
}
}
- grpc_pollset_kick_post_poll(&pollset->kick_state);
+ grpc_pollset_kick_post_poll(&pollset->kick_state, kfd);
gpr_mu_lock(&pollset->mu);
- pollset->counter = 0;
- gpr_cv_broadcast(&pollset->cv);
- return 1;
+ pollset->counter--;
}
-static void unary_poll_pollset_destroy(grpc_pollset *pollset) {
+static void basic_pollset_destroy(grpc_pollset *pollset) {
GPR_ASSERT(pollset->counter == 0);
- grpc_fd_unref(pollset->data.ptr);
+ if (pollset->data.ptr != NULL) {
+ GRPC_FD_UNREF(pollset->data.ptr, "basicpoll");
+ pollset->data.ptr = NULL;
+ }
}
-static const grpc_pollset_vtable unary_poll_pollset = {
- unary_poll_pollset_add_fd, unary_poll_pollset_del_fd,
- unary_poll_pollset_maybe_work, kick_using_pollset_kick,
- unary_poll_pollset_destroy};
+static const grpc_pollset_vtable basic_pollset = {
+ basic_pollset_add_fd, basic_pollset_del_fd, basic_pollset_maybe_work,
+ kick_using_pollset_kick, basic_pollset_destroy, basic_pollset_destroy};
-static void become_unary_pollset(grpc_pollset *pollset, grpc_fd *fd) {
- pollset->vtable = &unary_poll_pollset;
+static void become_basic_pollset(grpc_pollset *pollset, grpc_fd *fd_or_null) {
+ pollset->vtable = &basic_pollset;
pollset->counter = 0;
- pollset->data.ptr = fd;
- grpc_fd_ref(fd);
+ pollset->data.ptr = fd_or_null;
+ if (fd_or_null) {
+ GRPC_FD_REF(fd_or_null, "basicpoll");
+ }
}
#endif /* GPR_POSIX_POLLSET */
diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h
index 088ec910c2..53585a2886 100644
--- a/src/core/iomgr/pollset_posix.h
+++ b/src/core/iomgr/pollset_posix.h
@@ -36,7 +36,7 @@
#include <grpc/support/sync.h>
-#include "src/core/iomgr/pollset_kick.h"
+#include "src/core/iomgr/pollset_kick_posix.h"
typedef struct grpc_pollset_vtable grpc_pollset_vtable;
@@ -52,11 +52,11 @@ typedef struct grpc_pollset {
few fds, and an epoll() based implementation for many fds */
const grpc_pollset_vtable *vtable;
gpr_mu mu;
- gpr_cv cv;
grpc_pollset_kick_state kick_state;
int counter;
int in_flight_cbs;
int shutting_down;
+ int called_shutdown;
void (*shutdown_done_cb)(void *arg);
void *shutdown_done_arg;
union {
@@ -68,14 +68,14 @@ typedef struct grpc_pollset {
struct grpc_pollset_vtable {
void (*add_fd)(grpc_pollset *pollset, struct grpc_fd *fd);
void (*del_fd)(grpc_pollset *pollset, struct grpc_fd *fd);
- int (*maybe_work)(grpc_pollset *pollset, gpr_timespec deadline,
- gpr_timespec now, int allow_synchronous_callback);
+ void (*maybe_work)(grpc_pollset *pollset, gpr_timespec deadline,
+ gpr_timespec now, int allow_synchronous_callback);
void (*kick)(grpc_pollset *pollset);
+ void (*finish_shutdown)(grpc_pollset *pollset);
void (*destroy)(grpc_pollset *pollset);
};
#define GRPC_POLLSET_MU(pollset) (&(pollset)->mu)
-#define GRPC_POLLSET_CV(pollset) (&(pollset)->cv)
/* Add an fd to a pollset */
void grpc_pollset_add_fd(grpc_pollset *pollset, struct grpc_fd *fd);
@@ -94,11 +94,14 @@ int grpc_kick_read_fd(grpc_pollset *p);
/* Call after polling has been kicked to leave the kicked state */
void grpc_kick_drain(grpc_pollset *p);
-/* All fds get added to a backup pollset to ensure that progress is made
- regardless of applications listening to events. Relying on this is slow
- however (the backup pollset only listens every 100ms or so) - so it's not
- to be relied on. */
-grpc_pollset *grpc_backup_pollset(void);
+/* Convert a timespec to milliseconds:
+ - very small or negative poll times are clamped to zero to do a
+ non-blocking poll (which becomes spin polling)
+ - other small values are rounded up to one millisecond
+ - longer than a millisecond polls are rounded up to the next nearest
+ millisecond to avoid spinning
+ - infinite timeouts are converted to -1 */
+int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline, gpr_timespec now);
/* turn a pollset into a multipoller: platform specific */
typedef void (*grpc_platform_become_multipoller_type)(grpc_pollset *pollset,
diff --git a/src/core/iomgr/pollset_set.h b/src/core/iomgr/pollset_set.h
new file mode 100644
index 0000000000..98e3b552a7
--- /dev/null
+++ b/src/core/iomgr/pollset_set.h
@@ -0,0 +1,59 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_H
+#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_H
+
+#include "src/core/iomgr/pollset.h"
+
+/* A grpc_pollset_set is a set of pollsets that are interested in an
+ action. Adding a pollset to a pollset_set automatically adds any
+ fd's (etc) that have been registered with the set_set with that pollset.
+ Registering fd's automatically adds them to all current pollsets. */
+
+#ifdef GPR_POSIX_SOCKET
+#include "src/core/iomgr/pollset_set_posix.h"
+#endif
+
+#ifdef GPR_WIN32
+#include "src/core/iomgr/pollset_set_windows.h"
+#endif
+
+void grpc_pollset_set_init(grpc_pollset_set *pollset_set);
+void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set);
+void grpc_pollset_set_add_pollset(grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset);
+void grpc_pollset_set_del_pollset(grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset);
+
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_H */
diff --git a/src/core/iomgr/pollset_set_posix.c b/src/core/iomgr/pollset_set_posix.c
new file mode 100644
index 0000000000..005e938398
--- /dev/null
+++ b/src/core/iomgr/pollset_set_posix.c
@@ -0,0 +1,125 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_POSIX_SOCKET
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/useful.h>
+
+#include "src/core/iomgr/pollset_set.h"
+
+void grpc_pollset_set_init(grpc_pollset_set *pollset_set) {
+ memset(pollset_set, 0, sizeof(*pollset_set));
+ gpr_mu_init(&pollset_set->mu);
+}
+
+void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) {
+ size_t i;
+ gpr_mu_destroy(&pollset_set->mu);
+ for (i = 0; i < pollset_set->fd_count; i++) {
+ GRPC_FD_UNREF(pollset_set->fds[i], "pollset");
+ }
+ gpr_free(pollset_set->pollsets);
+ gpr_free(pollset_set->fds);
+}
+
+void grpc_pollset_set_add_pollset(grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset) {
+ size_t i;
+ gpr_mu_lock(&pollset_set->mu);
+ if (pollset_set->pollset_count == pollset_set->pollset_capacity) {
+ pollset_set->pollset_capacity =
+ GPR_MAX(8, 2 * pollset_set->pollset_capacity);
+ pollset_set->pollsets =
+ gpr_realloc(pollset_set->pollsets, pollset_set->pollset_capacity *
+ sizeof(*pollset_set->pollsets));
+ }
+ pollset_set->pollsets[pollset_set->pollset_count++] = pollset;
+ for (i = 0; i < pollset_set->fd_count; i++) {
+ grpc_pollset_add_fd(pollset, pollset_set->fds[i]);
+ }
+ gpr_mu_unlock(&pollset_set->mu);
+}
+
+void grpc_pollset_set_del_pollset(grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset) {
+ size_t i;
+ gpr_mu_lock(&pollset_set->mu);
+ for (i = 0; i < pollset_set->pollset_count; i++) {
+ if (pollset_set->pollsets[i] == pollset) {
+ pollset_set->pollset_count--;
+ GPR_SWAP(grpc_pollset *, pollset_set->pollsets[i],
+ pollset_set->pollsets[pollset_set->pollset_count]);
+ break;
+ }
+ }
+ gpr_mu_unlock(&pollset_set->mu);
+}
+
+void grpc_pollset_set_add_fd(grpc_pollset_set *pollset_set, grpc_fd *fd) {
+ size_t i;
+ gpr_mu_lock(&pollset_set->mu);
+ if (pollset_set->fd_count == pollset_set->fd_capacity) {
+ pollset_set->fd_capacity = GPR_MAX(8, 2 * pollset_set->fd_capacity);
+ pollset_set->fds = gpr_realloc(
+ pollset_set->fds, pollset_set->fd_capacity * sizeof(*pollset_set->fds));
+ }
+ GRPC_FD_REF(fd, "pollset_set");
+ pollset_set->fds[pollset_set->fd_count++] = fd;
+ for (i = 0; i < pollset_set->pollset_count; i++) {
+ grpc_pollset_add_fd(pollset_set->pollsets[i], fd);
+ }
+ gpr_mu_unlock(&pollset_set->mu);
+}
+
+void grpc_pollset_set_del_fd(grpc_pollset_set *pollset_set, grpc_fd *fd) {
+ size_t i;
+ gpr_mu_lock(&pollset_set->mu);
+ for (i = 0; i < pollset_set->fd_count; i++) {
+ if (pollset_set->fds[i] == fd) {
+ pollset_set->fd_count--;
+ GPR_SWAP(grpc_fd *, pollset_set->fds[i],
+ pollset_set->fds[pollset_set->pollset_count]);
+ GRPC_FD_UNREF(fd, "pollset_set");
+ break;
+ }
+ }
+ gpr_mu_unlock(&pollset_set->mu);
+}
+
+#endif /* GPR_POSIX_SOCKET */
diff --git a/src/core/iomgr/pollset_set_posix.h b/src/core/iomgr/pollset_set_posix.h
new file mode 100644
index 0000000000..e88740bde1
--- /dev/null
+++ b/src/core/iomgr/pollset_set_posix.h
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_POSIX_H
+#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_POSIX_H
+
+#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/pollset_posix.h"
+
+typedef struct grpc_pollset_set {
+ gpr_mu mu;
+
+ size_t pollset_count;
+ size_t pollset_capacity;
+ grpc_pollset **pollsets;
+
+ size_t fd_count;
+ size_t fd_capacity;
+ grpc_fd **fds;
+} grpc_pollset_set;
+
+void grpc_pollset_set_add_fd(grpc_pollset_set *pollset_set, grpc_fd *fd);
+void grpc_pollset_set_del_fd(grpc_pollset_set *pollset_set, grpc_fd *fd);
+
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */
diff --git a/src/core/iomgr/pollset_kick_windows.h b/src/core/iomgr/pollset_set_windows.c
index c675c119ab..b9c209cd2c 100644
--- a/src/core/iomgr/pollset_kick_windows.h
+++ b/src/core/iomgr/pollset_set_windows.c
@@ -31,18 +31,20 @@
*
*/
-#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_WINDOWS_H
-#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_WINDOWS_H
+#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
+#ifdef GPR_WINSOCK_SOCKET
-/* There isn't really any such thing as a pollset under Windows, due to the
- nature of the IO completion ports. */
+#include "src/core/iomgr/pollset_set.h"
-struct grpc_kick_fd_info;
+void grpc_pollset_set_init(grpc_pollset_set *pollset_set) {}
-typedef struct grpc_pollset_kick_state {
- int unused;
-} grpc_pollset_kick_state;
+void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) {}
-#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_KICK_WINDOWS_H */
+void grpc_pollset_set_add_pollset(grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset) {}
+
+void grpc_pollset_set_del_pollset(grpc_pollset_set *pollset_set,
+ grpc_pollset *pollset) {}
+
+#endif /* GPR_WINSOCK_SOCKET */
diff --git a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m b/src/core/iomgr/pollset_set_windows.h
index 3ad757fb29..cada0d2b61 100644
--- a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.m
+++ b/src/core/iomgr/pollset_set_windows.h
@@ -31,14 +31,9 @@
*
*/
-#import "GRPCMethodName+HTTP2Encoding.h"
+#ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_WINDOWS_H
+#define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_WINDOWS_H
-@implementation GRPCMethodName (HTTP2Encoding)
-- (NSString *)HTTP2Path {
- if (self.package) {
- return [NSString stringWithFormat:@"/%@.%@/%@", self.package, self.interface, self.method];
- } else {
- return [NSString stringWithFormat:@"/%@/%@", self.interface, self.method];
- }
-}
-@end
+typedef struct grpc_pollset_set { void *unused; } grpc_pollset_set;
+
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */
diff --git a/src/core/iomgr/pollset_windows.c b/src/core/iomgr/pollset_windows.c
index b1f4c09a2c..8d6bc79c96 100644
--- a/src/core/iomgr/pollset_windows.c
+++ b/src/core/iomgr/pollset_windows.c
@@ -39,6 +39,7 @@
#include "src/core/iomgr/alarm_internal.h"
#include "src/core/iomgr/iomgr_internal.h"
+#include "src/core/iomgr/pollset.h"
#include "src/core/iomgr/pollset_windows.h"
/* There isn't really any such thing as a pollset under Windows, due to the
@@ -47,6 +48,7 @@
won't actually do any polling, and return as quickly as possible. */
void grpc_pollset_init(grpc_pollset *pollset) {
+ memset(pollset, 0, sizeof(*pollset));
gpr_mu_init(&pollset->mu);
gpr_cv_init(&pollset->cv);
}
@@ -54,6 +56,10 @@ void grpc_pollset_init(grpc_pollset *pollset) {
void grpc_pollset_shutdown(grpc_pollset *pollset,
void (*shutdown_done)(void *arg),
void *shutdown_done_arg) {
+ gpr_mu_lock(&pollset->mu);
+ pollset->shutting_down = 1;
+ gpr_cv_broadcast(&pollset->cv);
+ gpr_mu_unlock(&pollset->mu);
shutdown_done(shutdown_done_arg);
}
@@ -68,15 +74,20 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) {
if (gpr_time_cmp(now, deadline) > 0) {
return 0 /* GPR_FALSE */;
}
- if (grpc_maybe_call_delayed_callbacks(NULL, 1 /* GPR_TRUE */)) {
+ if (grpc_maybe_call_delayed_callbacks(&pollset->mu, 1 /* GPR_TRUE */)) {
return 1 /* GPR_TRUE */;
}
- if (grpc_alarm_check(NULL, now, &deadline)) {
+ if (grpc_alarm_check(&pollset->mu, now, &deadline)) {
return 1 /* GPR_TRUE */;
}
- return 0 /* GPR_FALSE */;
+ if (!pollset->shutting_down) {
+ gpr_cv_wait(&pollset->cv, &pollset->mu, deadline);
+ }
+ return 1 /* GPR_TRUE */;
}
-void grpc_pollset_kick(grpc_pollset *p) { }
+void grpc_pollset_kick(grpc_pollset *p) {
+ gpr_cv_signal(&p->cv);
+}
-#endif /* GPR_WINSOCK_SOCKET */
+#endif /* GPR_WINSOCK_SOCKET */
diff --git a/src/core/iomgr/pollset_windows.h b/src/core/iomgr/pollset_windows.h
index e1115bac4f..57a2907926 100644
--- a/src/core/iomgr/pollset_windows.h
+++ b/src/core/iomgr/pollset_windows.h
@@ -37,20 +37,18 @@
#include <windows.h>
#include <grpc/support/sync.h>
-#include "src/core/iomgr/pollset_kick.h"
#include "src/core/iomgr/socket_windows.h"
/* There isn't really any such thing as a pollset under Windows, due to the
nature of the IO completion ports. A Windows "pollset" is merely a mutex
- and a condition variable, as this is the minimal set of features we need
- implemented for the rest of grpc. But we won't use them directly. */
+ and a condition variable, used to synchronize with the IOCP. */
typedef struct grpc_pollset {
gpr_mu mu;
gpr_cv cv;
+ int shutting_down;
} grpc_pollset;
#define GRPC_POLLSET_MU(pollset) (&(pollset)->mu)
-#define GRPC_POLLSET_CV(pollset) (&(pollset)->cv)
-#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */
diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c
index 20d8c58eb4..dbf884c769 100644
--- a/src/core/iomgr/resolve_address_posix.c
+++ b/src/core/iomgr/resolve_address_posix.c
@@ -155,9 +155,9 @@ static void do_request(void *rp) {
grpc_resolve_cb cb = r->cb;
gpr_free(r->name);
gpr_free(r->default_port);
+ cb(arg, resolved);
grpc_iomgr_unregister_object(&r->iomgr_object);
gpr_free(r);
- cb(arg, resolved);
}
void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addrs) {
diff --git a/src/core/iomgr/tcp_client.h b/src/core/iomgr/tcp_client.h
index 2e91497fb7..0fa08b52b0 100644
--- a/src/core/iomgr/tcp_client.h
+++ b/src/core/iomgr/tcp_client.h
@@ -35,14 +35,18 @@
#define GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H
#include "src/core/iomgr/endpoint.h"
+#include "src/core/iomgr/pollset_set.h"
#include "src/core/iomgr/sockaddr.h"
#include <grpc/support/time.h>
/* Asynchronously connect to an address (specified as (addr, len)), and call
cb with arg and the completed connection when done (or call cb with arg and
- NULL on failure) */
+ NULL on failure).
+ interested_parties points to a set of pollsets that would be interested
+ in this connection being established (in order to continue their work) */
void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp),
- void *arg, const struct sockaddr *addr,
- int addr_len, gpr_timespec deadline);
+ void *arg, grpc_pollset_set *interested_parties,
+ const struct sockaddr *addr, int addr_len,
+ gpr_timespec deadline);
-#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H */
+#endif /* GRPC_INTERNAL_CORE_IOMGR_TCP_CLIENT_H */
diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c
index 668a651947..bbf7711588 100644
--- a/src/core/iomgr/tcp_client_posix.c
+++ b/src/core/iomgr/tcp_client_posix.c
@@ -113,8 +113,6 @@ static void on_writable(void *acp, int success) {
void (*cb)(void *arg, grpc_endpoint *tcp) = ac->cb;
void *cb_arg = ac->cb_arg;
- grpc_alarm_cancel(&ac->alarm);
-
if (success) {
do {
so_error_size = sizeof(so_error);
@@ -167,26 +165,30 @@ static void on_writable(void *acp, int success) {
finish:
gpr_mu_lock(&ac->mu);
if (!ep) {
- grpc_fd_orphan(ac->fd, NULL, NULL);
+ grpc_fd_orphan(ac->fd, NULL, "tcp_client_orphan");
}
done = (--ac->refs == 0);
gpr_mu_unlock(&ac->mu);
if (done) {
gpr_mu_destroy(&ac->mu);
gpr_free(ac);
+ } else {
+ grpc_alarm_cancel(&ac->alarm);
}
cb(cb_arg, ep);
}
void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *ep),
- void *arg, const struct sockaddr *addr,
- int addr_len, gpr_timespec deadline) {
+ void *arg, grpc_pollset_set *interested_parties,
+ const struct sockaddr *addr, int addr_len,
+ gpr_timespec deadline) {
int fd;
grpc_dualstack_mode dsmode;
int err;
async_connect *ac;
struct sockaddr_in6 addr6_v4mapped;
struct sockaddr_in addr4_copy;
+ grpc_fd *fdobj;
char *name;
char *addr_str;
@@ -218,31 +220,35 @@ void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *ep),
grpc_sockaddr_to_string(&addr_str, addr, 1);
gpr_asprintf(&name, "tcp-client:%s", addr_str);
+ fdobj = grpc_fd_create(fd, name);
+
if (err >= 0) {
- gpr_log(GPR_DEBUG, "instant connect");
- cb(arg, grpc_tcp_create(grpc_fd_create(fd, name),
- GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
+ cb(arg, grpc_tcp_create(fdobj, GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
goto done;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
gpr_log(GPR_ERROR, "connect error to '%s': %s", addr_str, strerror(errno));
- close(fd);
+ grpc_fd_orphan(fdobj, NULL, "tcp_client_connect_error");
cb(arg, NULL);
goto done;
}
+ grpc_pollset_set_add_fd(interested_parties, fdobj);
+
ac = gpr_malloc(sizeof(async_connect));
ac->cb = cb;
ac->cb_arg = arg;
- ac->fd = grpc_fd_create(fd, name);
+ ac->fd = fdobj;
gpr_mu_init(&ac->mu);
ac->refs = 2;
ac->write_closure.cb = on_writable;
ac->write_closure.cb_arg = ac;
+ gpr_mu_lock(&ac->mu);
grpc_alarm_init(&ac->alarm, deadline, on_alarm, ac, gpr_now());
grpc_fd_notify_on_write(ac->fd, &ac->write_closure);
+ gpr_mu_unlock(&ac->mu);
done:
gpr_free(name);
diff --git a/src/core/iomgr/tcp_client_windows.c b/src/core/iomgr/tcp_client_windows.c
index 2a040ffc4a..b1a169b519 100644
--- a/src/core/iomgr/tcp_client_windows.c
+++ b/src/core/iomgr/tcp_client_windows.c
@@ -52,7 +52,7 @@
#include "src/core/iomgr/socket_windows.h"
typedef struct {
- void(*cb)(void *arg, grpc_endpoint *tcp);
+ void (*cb)(void *arg, grpc_endpoint *tcp);
void *cb_arg;
gpr_mu mu;
grpc_winsocket *socket;
@@ -86,7 +86,7 @@ static void on_connect(void *acp, int from_iocp) {
SOCKET sock = ac->socket->socket;
grpc_endpoint *ep = NULL;
grpc_winsocket_callback_info *info = &ac->socket->write_info;
- void(*cb)(void *arg, grpc_endpoint *tcp) = ac->cb;
+ void (*cb)(void *arg, grpc_endpoint *tcp) = ac->cb;
void *cb_arg = ac->cb_arg;
int aborted;
@@ -99,8 +99,7 @@ static void on_connect(void *acp, int from_iocp) {
DWORD transfered_bytes = 0;
DWORD flags;
BOOL wsa_success = WSAGetOverlappedResult(sock, &info->overlapped,
- &transfered_bytes, FALSE,
- &flags);
+ &transfered_bytes, FALSE, &flags);
info->outstanding = 0;
GPR_ASSERT(transfered_bytes == 0);
if (!wsa_success) {
@@ -138,9 +137,10 @@ static void on_connect(void *acp, int from_iocp) {
/* Tries to issue one async connection, then schedules both an IOCP
notification request for the connection, and one timeout alert. */
-void grpc_tcp_client_connect(void(*cb)(void *arg, grpc_endpoint *tcp),
- void *arg, const struct sockaddr *addr,
- int addr_len, gpr_timespec deadline) {
+void grpc_tcp_client_connect(void (*cb)(void *arg, grpc_endpoint *tcp),
+ void *arg, grpc_pollset_set *interested_parties,
+ const struct sockaddr *addr, int addr_len,
+ gpr_timespec deadline) {
SOCKET sock = INVALID_SOCKET;
BOOL success;
int status;
@@ -175,9 +175,9 @@ void grpc_tcp_client_connect(void(*cb)(void *arg, grpc_endpoint *tcp),
/* Grab the function pointer for ConnectEx for that specific socket.
It may change depending on the interface. */
- status = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER,
- &guid, sizeof(guid), &ConnectEx, sizeof(ConnectEx),
- &ioctl_num_bytes, NULL, NULL);
+ status =
+ WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid),
+ &ConnectEx, sizeof(ConnectEx), &ioctl_num_bytes, NULL, NULL);
if (status != 0) {
message = "Unable to retrieve ConnectEx pointer: %s";
@@ -186,8 +186,7 @@ void grpc_tcp_client_connect(void(*cb)(void *arg, grpc_endpoint *tcp),
grpc_sockaddr_make_wildcard6(0, &local_address);
- status = bind(sock, (struct sockaddr *) &local_address,
- sizeof(local_address));
+ status = bind(sock, (struct sockaddr *)&local_address, sizeof(local_address));
if (status != 0) {
message = "Unable to bind socket: %s";
goto failure;
@@ -233,4 +232,4 @@ failure:
cb(arg, NULL);
}
-#endif /* GPR_WINSOCK_SOCKET */
+#endif /* GPR_WINSOCK_SOCKET */
diff --git a/src/core/iomgr/tcp_posix.c b/src/core/iomgr/tcp_posix.c
index 2f19f9d442..9ad089af66 100644
--- a/src/core/iomgr/tcp_posix.c
+++ b/src/core/iomgr/tcp_posix.c
@@ -266,7 +266,7 @@ typedef struct {
grpc_endpoint base;
grpc_fd *em_fd;
int fd;
- int iov_size; /* Number of slices to allocate per read attempt */
+ int iov_size; /* Number of slices to allocate per read attempt */
int finished_edge;
size_t slice_size;
gpr_refcount refcount;
@@ -295,7 +295,7 @@ static void grpc_tcp_shutdown(grpc_endpoint *ep) {
static void grpc_tcp_unref(grpc_tcp *tcp) {
int refcount_zero = gpr_unref(&tcp->refcount);
if (refcount_zero) {
- grpc_fd_orphan(tcp->em_fd, NULL, NULL);
+ grpc_fd_orphan(tcp->em_fd, NULL, "tcp_unref_orphan");
gpr_free(tcp);
}
}
@@ -412,8 +412,7 @@ static void grpc_tcp_continue_read(grpc_tcp *tcp) {
++tcp->iov_size;
}
GPR_ASSERT(slice_state_has_available(&read_state));
- slice_state_transfer_ownership(&read_state, &final_slices,
- &final_nslices);
+ slice_state_transfer_ownership(&read_state, &final_slices, &final_nslices);
call_read_cb(tcp, final_slices, final_nslices, GRPC_ENDPOINT_CB_OK);
slice_state_destroy(&read_state);
grpc_tcp_unref(tcp);
diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c
index c49f3e1518..5854031c9b 100644
--- a/src/core/iomgr/tcp_server_posix.c
+++ b/src/core/iomgr/tcp_server_posix.c
@@ -85,6 +85,7 @@ typedef struct {
} addr;
int addr_len;
grpc_iomgr_closure read_closure;
+ grpc_iomgr_closure destroyed_closure;
} server_port;
static void unlink_if_unix_domain_socket(const struct sockaddr_un *un) {
@@ -101,13 +102,15 @@ struct grpc_tcp_server {
void *cb_arg;
gpr_mu mu;
- gpr_cv cv;
/* active port count: how many ports are actually still listening */
size_t active_ports;
/* destroyed port count: how many ports are completely destroyed */
size_t destroyed_ports;
+ /* is this server shutting down? (boolean) */
+ int shutdown;
+
/* all listening ports */
server_port *ports;
size_t nports;
@@ -116,14 +119,19 @@ struct grpc_tcp_server {
/* shutdown callback */
void (*shutdown_complete)(void *);
void *shutdown_complete_arg;
+
+ /* all pollsets interested in new connections */
+ grpc_pollset **pollsets;
+ /* number of pollsets in the pollsets array */
+ size_t pollset_count;
};
grpc_tcp_server *grpc_tcp_server_create(void) {
grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server));
gpr_mu_init(&s->mu);
- gpr_cv_init(&s->cv);
s->active_ports = 0;
s->destroyed_ports = 0;
+ s->shutdown = 0;
s->cb = NULL;
s->cb_arg = NULL;
s->ports = gpr_malloc(sizeof(server_port) * INIT_PORT_CAP);
@@ -136,7 +144,6 @@ static void finish_shutdown(grpc_tcp_server *s) {
s->shutdown_complete(s->shutdown_complete_arg);
gpr_mu_destroy(&s->mu);
- gpr_cv_destroy(&s->cv);
gpr_free(s->ports);
gpr_free(s);
@@ -156,40 +163,60 @@ static void destroyed_port(void *server, int success) {
static void dont_care_about_shutdown_completion(void *ignored) {}
+/* called when all listening endpoints have been shutdown, so no further
+ events will be received on them - at this point it's safe to destroy
+ things */
+static void deactivated_all_ports(grpc_tcp_server *s) {
+ size_t i;
+
+ /* delete ALL the things */
+ gpr_mu_lock(&s->mu);
+
+ if (!s->shutdown) {
+ gpr_mu_unlock(&s->mu);
+ return;
+ }
+
+ if (s->nports) {
+ for (i = 0; i < s->nports; i++) {
+ server_port *sp = &s->ports[i];
+ if (sp->addr.sockaddr.sa_family == AF_UNIX) {
+ unlink_if_unix_domain_socket(&sp->addr.un);
+ }
+ sp->destroyed_closure.cb = destroyed_port;
+ sp->destroyed_closure.cb_arg = s;
+ grpc_fd_orphan(sp->emfd, &sp->destroyed_closure, "tcp_listener_shutdown");
+ }
+ gpr_mu_unlock(&s->mu);
+ } else {
+ gpr_mu_unlock(&s->mu);
+ finish_shutdown(s);
+ }
+}
+
void grpc_tcp_server_destroy(
grpc_tcp_server *s, void (*shutdown_complete)(void *shutdown_complete_arg),
void *shutdown_complete_arg) {
size_t i;
gpr_mu_lock(&s->mu);
+ GPR_ASSERT(!s->shutdown);
+ s->shutdown = 1;
+
s->shutdown_complete = shutdown_complete
? shutdown_complete
: dont_care_about_shutdown_completion;
s->shutdown_complete_arg = shutdown_complete_arg;
/* shutdown all fd's */
- for (i = 0; i < s->nports; i++) {
- grpc_fd_shutdown(s->ports[i].emfd);
- }
- /* wait while that happens */
- /* TODO(ctiller): make this asynchronous also */
- while (s->active_ports) {
- gpr_cv_wait(&s->cv, &s->mu, gpr_inf_future);
- }
-
- /* delete ALL the things */
- if (s->nports) {
+ if (s->active_ports) {
for (i = 0; i < s->nports; i++) {
- server_port *sp = &s->ports[i];
- if (sp->addr.sockaddr.sa_family == AF_UNIX) {
- unlink_if_unix_domain_socket(&sp->addr.un);
- }
- grpc_fd_orphan(sp->emfd, destroyed_port, s);
+ grpc_fd_shutdown(s->ports[i].emfd);
}
gpr_mu_unlock(&s->mu);
} else {
gpr_mu_unlock(&s->mu);
- finish_shutdown(s);
+ deactivated_all_ports(s);
}
}
@@ -274,6 +301,8 @@ error:
/* event manager callback when reads are ready */
static void on_read(void *arg, int success) {
server_port *sp = arg;
+ grpc_fd *fdobj;
+ size_t i;
if (!success) {
goto error;
@@ -306,12 +335,18 @@ static void on_read(void *arg, int success) {
grpc_sockaddr_to_string(&addr_str, (struct sockaddr *)&addr, 1);
gpr_asprintf(&name, "tcp-server-connection:%s", addr_str);
+ fdobj = grpc_fd_create(fd, name);
+ /* TODO(ctiller): revise this when we have server-side sharding
+ of channels -- we certainly should not be automatically adding every
+ incoming channel to every pollset owned by the server */
+ for (i = 0; i < sp->server->pollset_count; i++) {
+ grpc_pollset_add_fd(sp->server->pollsets[i], fdobj);
+ }
sp->server->cb(sp->server->cb_arg,
- grpc_tcp_create(grpc_fd_create(fd, name),
- GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
+ grpc_tcp_create(fdobj, GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
- gpr_free(addr_str);
gpr_free(name);
+ gpr_free(addr_str);
}
abort();
@@ -319,9 +354,11 @@ static void on_read(void *arg, int success) {
error:
gpr_mu_lock(&sp->server->mu);
if (0 == --sp->server->active_ports) {
- gpr_cv_broadcast(&sp->server->cv);
+ gpr_mu_unlock(&sp->server->mu);
+ deactivated_all_ports(sp->server);
+ } else {
+ gpr_mu_unlock(&sp->server->mu);
}
- gpr_mu_unlock(&sp->server->mu);
}
static int add_socket_to_server(grpc_tcp_server *s, int fd,
@@ -452,6 +489,8 @@ void grpc_tcp_server_start(grpc_tcp_server *s, grpc_pollset **pollsets,
GPR_ASSERT(s->active_ports == 0);
s->cb = cb;
s->cb_arg = cb_arg;
+ s->pollsets = pollsets;
+ s->pollset_count = pollset_count;
for (i = 0; i < s->nports; i++) {
for (j = 0; j < pollset_count; j++) {
grpc_pollset_add_fd(pollsets[j], s->ports[i].emfd);
diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c
index 12dac03080..15759c398a 100644
--- a/src/core/iomgr/tcp_windows.c
+++ b/src/core/iomgr/tcp_windows.c
@@ -154,7 +154,7 @@ static void on_read(void *tcpp, int from_iocp) {
status = GRPC_ENDPOINT_CB_ERROR;
} else {
if (info->bytes_transfered != 0) {
- sub = gpr_slice_sub(tcp->read_slice, 0, info->bytes_transfered);
+ sub = gpr_slice_sub_no_ref(tcp->read_slice, 0, info->bytes_transfered);
status = GRPC_ENDPOINT_CB_OK;
slice = &sub;
nslices = 1;
diff --git a/src/core/json/json.h b/src/core/json/json.h
index 69cbac17dc..b78b42a5b2 100644
--- a/src/core/json/json.h
+++ b/src/core/json/json.h
@@ -60,7 +60,7 @@ typedef struct grpc_json {
* strings in the tree. The input stream's UTF-8 isn't validated,
* as in, what you input is what you get as an output.
*
- * All the keys and values in the grpc_json_t objects will be strings
+ * All the keys and values in the grpc_json objects will be strings
* pointing at your input buffer.
*
* Delete the allocated tree afterward using grpc_json_destroy().
diff --git a/src/core/json/json_reader.c b/src/core/json/json_reader.c
index 5ea4e9569c..c14094c290 100644
--- a/src/core/json/json_reader.c
+++ b/src/core/json/json_reader.c
@@ -151,7 +151,7 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) {
case GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
case GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
case GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- success = json_reader_set_number(reader);
+ success = (gpr_uint32)json_reader_set_number(reader);
if (!success) return GRPC_JSON_PARSE_ERROR;
json_reader_string_clear(reader);
reader->state = GRPC_JSON_STATE_VALUE_END;
@@ -177,7 +177,7 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) {
case GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
case GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
case GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- success = json_reader_set_number(reader);
+ success = (gpr_uint32)json_reader_set_number(reader);
if (!success) return GRPC_JSON_PARSE_ERROR;
json_reader_string_clear(reader);
reader->state = GRPC_JSON_STATE_VALUE_END;
@@ -410,8 +410,8 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) {
} else {
return GRPC_JSON_PARSE_ERROR;
}
- reader->unicode_char <<= 4;
- reader->unicode_char |= c;
+ reader->unicode_char = (gpr_uint16)(reader->unicode_char << 4);
+ reader->unicode_char = (gpr_uint16)(reader->unicode_char | c);
switch (reader->state) {
case GRPC_JSON_STATE_STRING_ESCAPE_U1:
@@ -438,8 +438,8 @@ grpc_json_reader_status grpc_json_reader_run(grpc_json_reader* reader) {
if (reader->unicode_high_surrogate == 0)
return GRPC_JSON_PARSE_ERROR;
utf32 = 0x10000;
- utf32 += (reader->unicode_high_surrogate - 0xd800) * 0x400;
- utf32 += reader->unicode_char - 0xdc00;
+ utf32 += (gpr_uint32)((reader->unicode_high_surrogate - 0xd800) * 0x400);
+ utf32 += (gpr_uint32)(reader->unicode_char - 0xdc00);
json_reader_string_add_utf32(reader, utf32);
reader->unicode_high_surrogate = 0;
} else {
diff --git a/src/core/json/json_string.c b/src/core/json/json_string.c
index 13f816995b..03c1099167 100644
--- a/src/core/json/json_string.c
+++ b/src/core/json/json_string.c
@@ -83,7 +83,7 @@ static void json_writer_output_check(void* userdata, size_t needed) {
if (state->free_space >= needed) return;
needed -= state->free_space;
/* Round up by 256 bytes. */
- needed = (needed + 0xff) & ~0xff;
+ needed = (needed + 0xff) & ~0xffU;
state->output = gpr_realloc(state->output, state->allocated + needed);
state->free_space += needed;
state->allocated += needed;
@@ -128,7 +128,7 @@ static void json_reader_string_add_char(void* userdata, gpr_uint32 c) {
json_reader_userdata* state = userdata;
GPR_ASSERT(state->string_ptr < state->input);
GPR_ASSERT(c <= 0xff);
- *state->string_ptr++ = (char)c;
+ *state->string_ptr++ = (gpr_uint8)c;
}
/* We are converting a UTF-32 character into UTF-8 here,
@@ -138,22 +138,22 @@ static void json_reader_string_add_utf32(void* userdata, gpr_uint32 c) {
if (c <= 0x7f) {
json_reader_string_add_char(userdata, c);
} else if (c <= 0x7ff) {
- int b1 = 0xc0 | ((c >> 6) & 0x1f);
- int b2 = 0x80 | (c & 0x3f);
+ gpr_uint32 b1 = 0xc0 | ((c >> 6) & 0x1f);
+ gpr_uint32 b2 = 0x80 | (c & 0x3f);
json_reader_string_add_char(userdata, b1);
json_reader_string_add_char(userdata, b2);
} else if (c <= 0xffff) {
- int b1 = 0xe0 | ((c >> 12) & 0x0f);
- int b2 = 0x80 | ((c >> 6) & 0x3f);
- int b3 = 0x80 | (c & 0x3f);
+ gpr_uint32 b1 = 0xe0 | ((c >> 12) & 0x0f);
+ gpr_uint32 b2 = 0x80 | ((c >> 6) & 0x3f);
+ gpr_uint32 b3 = 0x80 | (c & 0x3f);
json_reader_string_add_char(userdata, b1);
json_reader_string_add_char(userdata, b2);
json_reader_string_add_char(userdata, b3);
} else if (c <= 0x1fffff) {
- int b1 = 0xf0 | ((c >> 18) & 0x07);
- int b2 = 0x80 | ((c >> 12) & 0x3f);
- int b3 = 0x80 | ((c >> 6) & 0x3f);
- int b4 = 0x80 | (c & 0x3f);
+ gpr_uint32 b1 = 0xf0 | ((c >> 18) & 0x07);
+ gpr_uint32 b2 = 0x80 | ((c >> 12) & 0x3f);
+ gpr_uint32 b3 = 0x80 | ((c >> 6) & 0x3f);
+ gpr_uint32 b4 = 0x80 | (c & 0x3f);
json_reader_string_add_char(userdata, b1);
json_reader_string_add_char(userdata, b2);
json_reader_string_add_char(userdata, b3);
diff --git a/src/core/json/json_writer.c b/src/core/json/json_writer.c
index a40bf1733e..bed9a9bfa5 100644
--- a/src/core/json/json_writer.c
+++ b/src/core/json/json_writer.c
@@ -66,7 +66,7 @@ static void json_writer_output_indent(
" "
" ";
- unsigned spaces = writer->depth * writer->indent;
+ unsigned spaces = (unsigned)(writer->depth * writer->indent);
if (writer->indent == 0) return;
@@ -78,7 +78,7 @@ static void json_writer_output_indent(
while (spaces >= (sizeof(spacesstr) - 1)) {
json_writer_output_string_with_len(writer, spacesstr,
sizeof(spacesstr) - 1);
- spaces -= (sizeof(spacesstr) - 1);
+ spaces -= (unsigned)(sizeof(spacesstr) - 1);
}
if (spaces == 0) return;
@@ -119,7 +119,7 @@ static void json_writer_escape_string(grpc_json_writer* writer,
break;
} else if ((c >= 32) && (c <= 126)) {
if ((c == '\\') || (c == '"')) json_writer_output_char(writer, '\\');
- json_writer_output_char(writer, c);
+ json_writer_output_char(writer, (char)c);
} else if ((c < 32) || (c == 127)) {
switch (c) {
case '\b':
@@ -160,7 +160,7 @@ static void json_writer_escape_string(grpc_json_writer* writer,
}
for (i = 0; i < extra; i++) {
utf32 <<= 6;
- c = *string++;
+ c = (gpr_uint8)(*string++);
/* Breaks out and bail on any invalid UTF-8 sequence, including \0. */
if ((c & 0xc0) != 0x80) {
valid = 0;
@@ -193,10 +193,10 @@ static void json_writer_escape_string(grpc_json_writer* writer,
* That range is exactly 20 bits.
*/
utf32 -= 0x10000;
- json_writer_escape_utf16(writer, 0xd800 | (utf32 >> 10));
- json_writer_escape_utf16(writer, 0xdc00 | (utf32 & 0x3ff));
+ json_writer_escape_utf16(writer, (gpr_uint16)(0xd800 | (utf32 >> 10)));
+ json_writer_escape_utf16(writer, (gpr_uint16)(0xdc00 | (utf32 & 0x3ff)));
} else {
- json_writer_escape_utf16(writer, utf32);
+ json_writer_escape_utf16(writer, (gpr_uint16)utf32);
}
}
}
diff --git a/src/core/security/base64.c b/src/core/security/base64.c
index 3b8fea8f73..8dfaef846f 100644
--- a/src/core/security/base64.c
+++ b/src/core/security/base64.c
@@ -120,7 +120,68 @@ char *grpc_base64_encode(const void *vdata, size_t data_size, int url_safe,
}
gpr_slice grpc_base64_decode(const char *b64, int url_safe) {
- size_t b64_len = strlen(b64);
+ return grpc_base64_decode_with_len(b64, strlen(b64), url_safe);
+}
+
+static void decode_one_char(const unsigned char *codes, unsigned char *result,
+ size_t *result_offset) {
+ gpr_uint32 packed = (codes[0] << 2) | (codes[1] >> 4);
+ result[(*result_offset)++] = (unsigned char)packed;
+}
+
+static void decode_two_chars(const unsigned char *codes, unsigned char *result,
+ size_t *result_offset) {
+ gpr_uint32 packed = (codes[0] << 10) | (codes[1] << 4) | (codes[2] >> 2);
+ result[(*result_offset)++] = (unsigned char)(packed >> 8);
+ result[(*result_offset)++] = (unsigned char)(packed);
+}
+
+static int decode_group(const unsigned char *codes, size_t num_codes,
+ unsigned char *result, size_t *result_offset) {
+ GPR_ASSERT(num_codes <= 4);
+
+ /* Short end groups that may not have padding. */
+ if (num_codes == 1) {
+ gpr_log(GPR_ERROR, "Invalid group. Must be at least 2 bytes.");
+ return 0;
+ }
+ if (num_codes == 2) {
+ decode_one_char(codes, result, result_offset);
+ return 1;
+ }
+ if (num_codes == 3) {
+ decode_two_chars(codes, result, result_offset);
+ return 1;
+ }
+
+ /* Regular 4 byte groups with padding or not. */
+ GPR_ASSERT(num_codes == 4);
+ if (codes[0] == GRPC_BASE64_PAD_BYTE || codes[1] == GRPC_BASE64_PAD_BYTE) {
+ gpr_log(GPR_ERROR, "Invalid padding detected.");
+ return 0;
+ }
+ if (codes[2] == GRPC_BASE64_PAD_BYTE) {
+ if (codes[3] == GRPC_BASE64_PAD_BYTE) {
+ decode_one_char(codes, result, result_offset);
+ } else {
+ gpr_log(GPR_ERROR, "Invalid padding detected.");
+ return 0;
+ }
+ } else if (codes[3] == GRPC_BASE64_PAD_BYTE) {
+ decode_two_chars(codes, result, result_offset);
+ } else {
+ /* No padding. */
+ gpr_uint32 packed =
+ (codes[0] << 18) | (codes[1] << 12) | (codes[2] << 6) | codes[3];
+ result[(*result_offset)++] = (unsigned char)(packed >> 16);
+ result[(*result_offset)++] = (unsigned char)(packed >> 8);
+ result[(*result_offset)++] = (unsigned char)(packed);
+ }
+ return 1;
+}
+
+gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
+ int url_safe) {
gpr_slice result = gpr_slice_malloc(b64_len);
unsigned char *current = GPR_SLICE_START_PTR(result);
size_t result_size = 0;
@@ -128,7 +189,7 @@ gpr_slice grpc_base64_decode(const char *b64, int url_safe) {
size_t num_codes = 0;
while (b64_len--) {
- unsigned char c = *b64++;
+ unsigned char c = (unsigned char)(*b64++);
signed char code;
if (c >= GPR_ARRAY_SIZE(base64_bytes)) continue;
if (url_safe) {
@@ -149,45 +210,17 @@ gpr_slice grpc_base64_decode(const char *b64, int url_safe) {
goto fail;
}
} else {
- codes[num_codes++] = code;
+ codes[num_codes++] = (unsigned char)code;
if (num_codes == 4) {
- if (codes[0] == GRPC_BASE64_PAD_BYTE ||
- codes[1] == GRPC_BASE64_PAD_BYTE) {
- gpr_log(GPR_ERROR, "Invalid padding detected.");
- goto fail;
- }
- if (codes[2] == GRPC_BASE64_PAD_BYTE) {
- if (codes[3] == GRPC_BASE64_PAD_BYTE) {
- /* Double padding. */
- gpr_uint32 packed = (codes[0] << 2) | (codes[1] >> 4);
- current[result_size++] = (unsigned char)packed;
- } else {
- gpr_log(GPR_ERROR, "Invalid padding detected.");
- goto fail;
- }
- } else if (codes[3] == GRPC_BASE64_PAD_BYTE) {
- /* Single padding. */
- gpr_uint32 packed =
- (codes[0] << 10) | (codes[1] << 4) | (codes[2] >> 2);
- current[result_size++] = (unsigned char)(packed >> 8);
- current[result_size++] = (unsigned char)(packed);
- } else {
- /* No padding. */
- gpr_uint32 packed =
- (codes[0] << 18) | (codes[1] << 12) | (codes[2] << 6) | codes[3];
- current[result_size++] = (unsigned char)(packed >> 16);
- current[result_size++] = (unsigned char)(packed >> 8);
- current[result_size++] = (unsigned char)(packed);
- }
+ if (!decode_group(codes, num_codes, current, &result_size)) goto fail;
num_codes = 0;
}
}
}
- if (num_codes != 0) {
- gpr_log(GPR_ERROR, "Invalid base64.");
- gpr_slice_unref(result);
- return gpr_empty_slice();
+ if (num_codes != 0 &&
+ !decode_group(codes, num_codes, current, &result_size)) {
+ goto fail;
}
GPR_SLICE_SET_LENGTH(result, result_size);
return result;
diff --git a/src/core/security/base64.h b/src/core/security/base64.h
index 6a7cd8e96c..b9abc07b52 100644
--- a/src/core/security/base64.h
+++ b/src/core/security/base64.h
@@ -45,4 +45,8 @@ char *grpc_base64_encode(const void *data, size_t data_size, int url_safe,
slice in case of failure. */
gpr_slice grpc_base64_decode(const char *b64, int url_safe);
+/* Same as above except that the length is provided by the caller. */
+gpr_slice grpc_base64_decode_with_len(const char *b64, size_t b64_len,
+ int url_safe);
+
#endif /* GRPC_INTERNAL_CORE_SECURITY_BASE64_H */
diff --git a/src/core/security/client_auth_filter.c b/src/core/security/client_auth_filter.c
index ddc91a93c2..9f1eae813b 100644
--- a/src/core/security/client_auth_filter.c
+++ b/src/core/security/client_auth_filter.c
@@ -53,6 +53,11 @@ typedef struct {
grpc_credentials *creds;
grpc_mdstr *host;
grpc_mdstr *method;
+ /* pollset bound to this call; if we need to make external
+ network requests, they should be done under this pollset
+ so that work can progress when this call wants work to
+ progress */
+ grpc_pollset *pollset;
grpc_transport_op op;
size_t op_md_idx;
int sent_initial_metadata;
@@ -162,8 +167,9 @@ static void send_security_metadata(grpc_call_element *elem,
service_url =
build_service_url(chand->security_connector->base.url_scheme, calld);
calld->op = *op; /* Copy op (originates from the caller's stack). */
- grpc_credentials_get_request_metadata(calld->creds, service_url,
- on_credentials_metadata, elem);
+ GPR_ASSERT(calld->pollset);
+ grpc_credentials_get_request_metadata(
+ calld->creds, calld->pollset, service_url, on_credentials_metadata, elem);
gpr_free(service_url);
}
@@ -215,6 +221,10 @@ static void auth_start_transport_op(grpc_call_element *elem,
}
}
+ if (op->bind_pollset) {
+ calld->pollset = op->bind_pollset;
+ }
+
if (op->send_ops && !calld->sent_initial_metadata) {
size_t nops = op->send_ops->nops;
grpc_stream_op *ops = op->send_ops->ops;
@@ -277,6 +287,7 @@ static void init_call_elem(grpc_call_element *elem,
calld->creds = NULL;
calld->host = NULL;
calld->method = NULL;
+ calld->pollset = NULL;
calld->sent_initial_metadata = 0;
calld->security_context_set = 0;
@@ -316,13 +327,10 @@ static void init_channel_elem(grpc_channel_element *elem,
chand->security_connector =
(grpc_channel_security_connector *)grpc_security_connector_ref(sc);
chand->md_ctx = metadata_context;
- chand->authority_string =
- grpc_mdstr_from_string(chand->md_ctx, ":authority");
+ chand->authority_string = grpc_mdstr_from_string(chand->md_ctx, ":authority");
chand->path_string = grpc_mdstr_from_string(chand->md_ctx, ":path");
- chand->error_msg_key =
- grpc_mdstr_from_string(chand->md_ctx, "grpc-message");
- chand->status_key =
- grpc_mdstr_from_string(chand->md_ctx, "grpc-status");
+ chand->error_msg_key = grpc_mdstr_from_string(chand->md_ctx, "grpc-message");
+ chand->status_key = grpc_mdstr_from_string(chand->md_ctx, "grpc-status");
}
/* Destructor for channel data */
@@ -346,6 +354,6 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
}
const grpc_channel_filter grpc_client_auth_filter = {
- auth_start_transport_op, channel_op, sizeof(call_data), init_call_elem,
- destroy_call_elem, sizeof(channel_data), init_channel_elem,
- destroy_channel_elem, "client-auth"};
+ auth_start_transport_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "client-auth"};
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c
index f1ae6cecbc..cf663faf2d 100644
--- a/src/core/security/credentials.c
+++ b/src/core/security/credentials.c
@@ -106,6 +106,7 @@ int grpc_credentials_has_request_metadata_only(grpc_credentials *creds) {
}
void grpc_credentials_get_request_metadata(grpc_credentials *creds,
+ grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data) {
@@ -116,7 +117,8 @@ void grpc_credentials_get_request_metadata(grpc_credentials *creds,
}
return;
}
- creds->vtable->get_request_metadata(creds, service_url, cb, user_data);
+ creds->vtable->get_request_metadata(creds, pollset, service_url, cb,
+ user_data);
}
grpc_security_status grpc_credentials_create_security_connector(
@@ -191,9 +193,7 @@ static void ssl_server_destroy(grpc_server_credentials *creds) {
gpr_free(creds);
}
-static int ssl_has_request_metadata(const grpc_credentials *creds) {
- return 0;
-}
+static int ssl_has_request_metadata(const grpc_credentials *creds) { return 0; }
static int ssl_has_request_metadata_only(const grpc_credentials *creds) {
return 0;
@@ -368,8 +368,8 @@ static int jwt_has_request_metadata_only(const grpc_credentials *creds) {
return 1;
}
-
static void jwt_get_request_metadata(grpc_credentials *creds,
+ grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data) {
@@ -450,6 +450,8 @@ grpc_credentials *grpc_jwt_credentials_create(const char *json_key,
from an http service. */
typedef void (*grpc_fetch_oauth2_func)(grpc_credentials_metadata_request *req,
+ grpc_httpcli_context *http_context,
+ grpc_pollset *pollset,
grpc_httpcli_response_cb response_cb,
gpr_timespec deadline);
@@ -458,6 +460,8 @@ typedef struct {
gpr_mu mu;
grpc_credentials_md_store *access_token_md;
gpr_timespec token_expiration;
+ grpc_httpcli_context httpcli_context;
+ grpc_pollset_set pollset_set;
grpc_fetch_oauth2_func fetch_func;
} grpc_oauth2_token_fetcher_credentials;
@@ -466,6 +470,7 @@ static void oauth2_token_fetcher_destroy(grpc_credentials *creds) {
(grpc_oauth2_token_fetcher_credentials *)creds;
grpc_credentials_md_store_unref(c->access_token_md);
gpr_mu_destroy(&c->mu);
+ grpc_httpcli_context_destroy(&c->httpcli_context);
gpr_free(c);
}
@@ -481,8 +486,8 @@ static int oauth2_token_fetcher_has_request_metadata_only(
grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response(
- const grpc_httpcli_response *response,
- grpc_credentials_md_store **token_md, gpr_timespec *token_lifetime) {
+ const grpc_httpcli_response *response, grpc_credentials_md_store **token_md,
+ gpr_timespec *token_lifetime) {
char *null_terminated_body = NULL;
char *new_access_token = NULL;
grpc_credentials_status status = GRPC_CREDENTIALS_OK;
@@ -593,7 +598,7 @@ static void on_oauth2_token_fetcher_http_response(
}
static void oauth2_token_fetcher_get_request_metadata(
- grpc_credentials *creds, const char *service_url,
+ grpc_credentials *creds, grpc_pollset *pollset, const char *service_url,
grpc_credentials_metadata_cb cb, void *user_data) {
grpc_oauth2_token_fetcher_credentials *c =
(grpc_oauth2_token_fetcher_credentials *)creds;
@@ -605,7 +610,8 @@ static void oauth2_token_fetcher_get_request_metadata(
if (c->access_token_md != NULL &&
(gpr_time_cmp(gpr_time_sub(c->token_expiration, gpr_now()),
refresh_threshold) > 0)) {
- cached_access_token_md = grpc_credentials_md_store_ref(c->access_token_md);
+ cached_access_token_md =
+ grpc_credentials_md_store_ref(c->access_token_md);
}
gpr_mu_unlock(&c->mu);
}
@@ -616,7 +622,7 @@ static void oauth2_token_fetcher_get_request_metadata(
} else {
c->fetch_func(
grpc_credentials_metadata_request_create(creds, cb, user_data),
- on_oauth2_token_fetcher_http_response,
+ &c->httpcli_context, pollset, on_oauth2_token_fetcher_http_response,
gpr_time_add(gpr_now(), refresh_threshold));
}
}
@@ -629,6 +635,7 @@ static void init_oauth2_token_fetcher(grpc_oauth2_token_fetcher_credentials *c,
gpr_mu_init(&c->mu);
c->token_expiration = gpr_inf_past;
c->fetch_func = fetch_func;
+ grpc_pollset_set_init(&c->pollset_set);
}
/* -- ComputeEngine credentials. -- */
@@ -640,6 +647,7 @@ static grpc_credentials_vtable compute_engine_vtable = {
static void compute_engine_fetch_oauth2(
grpc_credentials_metadata_request *metadata_req,
+ grpc_httpcli_context *httpcli_context, grpc_pollset *pollset,
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_httpcli_header header = {"Metadata-Flavor", "Google"};
grpc_httpcli_request request;
@@ -648,7 +656,8 @@ static void compute_engine_fetch_oauth2(
request.path = GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
request.hdr_count = 1;
request.hdrs = &header;
- grpc_httpcli_get(&request, deadline, response_cb, metadata_req);
+ grpc_httpcli_get(httpcli_context, pollset, &request, deadline, response_cb,
+ metadata_req);
}
grpc_credentials *grpc_compute_engine_credentials_create(void) {
@@ -683,6 +692,7 @@ static grpc_credentials_vtable service_account_vtable = {
static void service_account_fetch_oauth2(
grpc_credentials_metadata_request *metadata_req,
+ grpc_httpcli_context *httpcli_context, grpc_pollset *pollset,
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_service_account_credentials *c =
(grpc_service_account_credentials *)metadata_req->creds;
@@ -708,8 +718,8 @@ static void service_account_fetch_oauth2(
request.hdr_count = 1;
request.hdrs = &header;
request.use_ssl = 1;
- grpc_httpcli_post(&request, body, strlen(body), deadline, response_cb,
- metadata_req);
+ grpc_httpcli_post(httpcli_context, pollset, &request, body, strlen(body),
+ deadline, response_cb, metadata_req);
gpr_free(body);
gpr_free(jwt);
}
@@ -743,8 +753,7 @@ typedef struct {
} grpc_refresh_token_credentials;
static void refresh_token_destroy(grpc_credentials *creds) {
- grpc_refresh_token_credentials *c =
- (grpc_refresh_token_credentials *)creds;
+ grpc_refresh_token_credentials *c = (grpc_refresh_token_credentials *)creds;
grpc_auth_refresh_token_destruct(&c->refresh_token);
oauth2_token_fetcher_destroy(&c->base.base);
}
@@ -756,6 +765,7 @@ static grpc_credentials_vtable refresh_token_vtable = {
static void refresh_token_fetch_oauth2(
grpc_credentials_metadata_request *metadata_req,
+ grpc_httpcli_context *httpcli_context, grpc_pollset *pollset,
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_refresh_token_credentials *c =
(grpc_refresh_token_credentials *)metadata_req->creds;
@@ -772,8 +782,8 @@ static void refresh_token_fetch_oauth2(
request.hdr_count = 1;
request.hdrs = &header;
request.use_ssl = 1;
- grpc_httpcli_post(&request, body, strlen(body), deadline, response_cb,
- metadata_req);
+ grpc_httpcli_post(httpcli_context, pollset, &request, body, strlen(body),
+ deadline, response_cb, metadata_req);
gpr_free(body);
}
@@ -784,8 +794,7 @@ grpc_credentials *grpc_refresh_token_credentials_create(
grpc_auth_refresh_token_create_from_string(json_refresh_token);
if (!grpc_auth_refresh_token_is_valid(&refresh_token)) {
- gpr_log(GPR_ERROR,
- "Invalid input for refresh token credentials creation");
+ gpr_log(GPR_ERROR, "Invalid input for refresh token credentials creation");
return NULL;
}
c = gpr_malloc(sizeof(grpc_refresh_token_credentials));
@@ -830,6 +839,7 @@ void on_simulated_token_fetch_done(void *user_data, int success) {
}
static void fake_oauth2_get_request_metadata(grpc_credentials *creds,
+ grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data) {
@@ -888,8 +898,7 @@ static int fake_transport_security_has_request_metadata_only(
return 0;
}
-static grpc_security_status
-fake_transport_security_create_security_connector(
+static grpc_security_status fake_transport_security_create_security_connector(
grpc_credentials *c, const char *target, const grpc_channel_args *args,
grpc_credentials *request_metadata_creds,
grpc_channel_security_connector **sc, grpc_channel_args **new_args) {
@@ -947,6 +956,7 @@ typedef struct {
grpc_credentials_md_store *md_elems;
char *service_url;
void *user_data;
+ grpc_pollset *pollset;
grpc_credentials_metadata_cb cb;
} grpc_composite_credentials_metadata_context;
@@ -1015,7 +1025,8 @@ static void composite_metadata_cb(void *user_data,
grpc_credentials *inner_creds =
ctx->composite_creds->inner.creds_array[ctx->creds_index++];
if (grpc_credentials_has_request_metadata(inner_creds)) {
- grpc_credentials_get_request_metadata(inner_creds, ctx->service_url,
+ grpc_credentials_get_request_metadata(inner_creds, ctx->pollset,
+ ctx->service_url,
composite_metadata_cb, ctx);
return;
}
@@ -1028,6 +1039,7 @@ static void composite_metadata_cb(void *user_data,
}
static void composite_get_request_metadata(grpc_credentials *creds,
+ grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data) {
@@ -1043,11 +1055,12 @@ static void composite_get_request_metadata(grpc_credentials *creds,
ctx->user_data = user_data;
ctx->cb = cb;
ctx->composite_creds = c;
+ ctx->pollset = pollset;
ctx->md_elems = grpc_credentials_md_store_create(c->inner.num_creds);
while (ctx->creds_index < c->inner.num_creds) {
grpc_credentials *inner_creds = c->inner.creds_array[ctx->creds_index++];
if (grpc_credentials_has_request_metadata(inner_creds)) {
- grpc_credentials_get_request_metadata(inner_creds, service_url,
+ grpc_credentials_get_request_metadata(inner_creds, pollset, service_url,
composite_metadata_cb, ctx);
return;
}
@@ -1178,15 +1191,14 @@ static void iam_destroy(grpc_credentials *creds) {
gpr_free(c);
}
-static int iam_has_request_metadata(const grpc_credentials *creds) {
- return 1;
-}
+static int iam_has_request_metadata(const grpc_credentials *creds) { return 1; }
static int iam_has_request_metadata_only(const grpc_credentials *creds) {
return 1;
}
static void iam_get_request_metadata(grpc_credentials *creds,
+ grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data) {
diff --git a/src/core/security/credentials.h b/src/core/security/credentials.h
index 4768ce6990..75af73a0c6 100644
--- a/src/core/security/credentials.h
+++ b/src/core/security/credentials.h
@@ -108,7 +108,6 @@ grpc_credentials_md_store *grpc_credentials_md_store_ref(
grpc_credentials_md_store *store);
void grpc_credentials_md_store_unref(grpc_credentials_md_store *store);
-
/* --- grpc_credentials. --- */
/* It is the caller's responsibility to gpr_free the result if not NULL. */
@@ -123,7 +122,7 @@ typedef struct {
void (*destroy)(grpc_credentials *c);
int (*has_request_metadata)(const grpc_credentials *c);
int (*has_request_metadata_only)(const grpc_credentials *c);
- void (*get_request_metadata)(grpc_credentials *c,
+ void (*get_request_metadata)(grpc_credentials *c, grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data);
@@ -131,7 +130,6 @@ typedef struct {
grpc_credentials *c, const char *target, const grpc_channel_args *args,
grpc_credentials *request_metadata_creds,
grpc_channel_security_connector **sc, grpc_channel_args **new_args);
-
} grpc_credentials_vtable;
struct grpc_credentials {
@@ -145,6 +143,7 @@ void grpc_credentials_unref(grpc_credentials *creds);
int grpc_credentials_has_request_metadata(grpc_credentials *creds);
int grpc_credentials_has_request_metadata_only(grpc_credentials *creds);
void grpc_credentials_get_request_metadata(grpc_credentials *creds,
+ grpc_pollset *pollset,
const char *service_url,
grpc_credentials_metadata_cb cb,
void *user_data);
@@ -177,8 +176,8 @@ grpc_credentials *grpc_credentials_contains_type(
/* Exposed for testing only. */
grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response(
- const struct grpc_httpcli_response *response, grpc_credentials_md_store **token_md,
- gpr_timespec *token_lifetime);
+ const struct grpc_httpcli_response *response,
+ grpc_credentials_md_store **token_md, gpr_timespec *token_lifetime);
/* Simulates an oauth2 token fetch with the specified value for testing. */
grpc_credentials *grpc_fake_oauth2_credentials_create(
@@ -200,4 +199,4 @@ struct grpc_server_credentials {
grpc_security_status grpc_server_credentials_create_security_connector(
grpc_server_credentials *creds, grpc_security_connector **sc);
-#endif /* GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H */
+#endif /* GRPC_INTERNAL_CORE_SECURITY_CREDENTIALS_H */
diff --git a/src/core/security/google_default_credentials.c b/src/core/security/google_default_credentials.c
index 0e4b9fc9d3..5822ce6337 100644
--- a/src/core/security/google_default_credentials.c
+++ b/src/core/security/google_default_credentials.c
@@ -55,13 +55,10 @@ static int compute_engine_detection_done = 0;
static gpr_mu g_mu;
static gpr_once g_once = GPR_ONCE_INIT;
-static void init_default_credentials(void) {
- gpr_mu_init(&g_mu);
-}
+static void init_default_credentials(void) { gpr_mu_init(&g_mu); }
typedef struct {
- gpr_cv cv;
- gpr_mu mu;
+ grpc_pollset pollset;
int is_done;
int success;
} compute_engine_detector;
@@ -82,22 +79,22 @@ static void on_compute_engine_detection_http_response(
}
}
}
- gpr_mu_lock(&detector->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&detector->pollset));
detector->is_done = 1;
- gpr_mu_unlock(&detector->mu);
- gpr_cv_signal(&detector->cv);
+ grpc_pollset_kick(&detector->pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&detector->pollset));
}
static int is_stack_running_on_compute_engine(void) {
compute_engine_detector detector;
grpc_httpcli_request request;
+ grpc_httpcli_context context;
/* The http call is local. If it takes more than one sec, it is for sure not
on compute engine. */
gpr_timespec max_detection_delay = {1, 0};
- gpr_mu_init(&detector.mu);
- gpr_cv_init(&detector.cv);
+ grpc_pollset_init(&detector.pollset);
detector.is_done = 0;
detector.success = 0;
@@ -105,19 +102,23 @@ static int is_stack_running_on_compute_engine(void) {
request.host = GRPC_COMPUTE_ENGINE_DETECTION_HOST;
request.path = "/";
- grpc_httpcli_get(&request, gpr_time_add(gpr_now(), max_detection_delay),
+ grpc_httpcli_context_init(&context);
+
+ grpc_httpcli_get(&context, &detector.pollset, &request,
+ gpr_time_add(gpr_now(), max_detection_delay),
on_compute_engine_detection_http_response, &detector);
/* Block until we get the response. This is not ideal but this should only be
called once for the lifetime of the process by the default credentials. */
- gpr_mu_lock(&detector.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&detector.pollset));
while (!detector.is_done) {
- gpr_cv_wait(&detector.cv, &detector.mu, gpr_inf_future);
+ grpc_pollset_work(&detector.pollset, gpr_inf_future);
}
- gpr_mu_unlock(&detector.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&detector.pollset));
+
+ grpc_httpcli_context_destroy(&context);
+ grpc_pollset_destroy(&detector.pollset);
- gpr_mu_destroy(&detector.mu);
- gpr_cv_destroy(&detector.cv);
return detector.success;
}
diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c
index 7bb1de4413..73496d1153 100644
--- a/src/core/security/secure_endpoint.c
+++ b/src/core/security/secure_endpoint.c
@@ -116,7 +116,7 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
grpc_endpoint_cb_status error) {
unsigned i;
gpr_uint8 keep_looping = 0;
- int input_buffer_count = 0;
+ size_t input_buffer_count = 0;
tsi_result result = TSI_OK;
secure_endpoint *ep = (secure_endpoint *)user_data;
gpr_uint8 *cur = GPR_SLICE_START_PTR(ep->read_staging_buffer);
@@ -129,7 +129,7 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
size_t message_size = GPR_SLICE_LENGTH(encrypted);
while (message_size > 0 || keep_looping) {
- size_t unprotected_buffer_size_written = end - cur;
+ size_t unprotected_buffer_size_written = (size_t)(end - cur);
size_t processed_message_size = message_size;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_unprotect(ep->protector, message_bytes,
@@ -166,7 +166,7 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
&ep->input_buffer,
gpr_slice_split_head(
&ep->read_staging_buffer,
- cur - GPR_SLICE_START_PTR(ep->read_staging_buffer)));
+ (size_t)(cur - GPR_SLICE_START_PTR(ep->read_staging_buffer))));
}
/* TODO(yangg) experiment with moving this block after read_cb to see if it
@@ -225,7 +225,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
grpc_endpoint_write_cb cb,
void *user_data) {
unsigned i;
- int output_buffer_count = 0;
+ size_t output_buffer_count = 0;
tsi_result result = TSI_OK;
secure_endpoint *ep = (secure_endpoint *)secure_ep;
gpr_uint8 *cur = GPR_SLICE_START_PTR(ep->write_staging_buffer);
@@ -248,7 +248,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
gpr_uint8 *message_bytes = GPR_SLICE_START_PTR(plain);
size_t message_size = GPR_SLICE_LENGTH(plain);
while (message_size > 0) {
- size_t protected_buffer_size_to_send = end - cur;
+ size_t protected_buffer_size_to_send = (size_t)(end - cur);
size_t processed_message_size = message_size;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_protect(ep->protector, message_bytes,
@@ -273,7 +273,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
if (result == TSI_OK) {
size_t still_pending_size;
do {
- size_t protected_buffer_size_to_send = end - cur;
+ size_t protected_buffer_size_to_send = (size_t)(end - cur);
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_protect_flush(ep->protector, cur,
&protected_buffer_size_to_send,
@@ -290,7 +290,7 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
&ep->output_buffer,
gpr_slice_split_head(
&ep->write_staging_buffer,
- cur - GPR_SLICE_START_PTR(ep->write_staging_buffer)));
+ (size_t)(cur - GPR_SLICE_START_PTR(ep->write_staging_buffer))));
}
}
diff --git a/src/core/security/secure_transport_setup.c b/src/core/security/secure_transport_setup.c
index 3e1db9a12d..1b39ab141e 100644
--- a/src/core/security/secure_transport_setup.c
+++ b/src/core/security/secure_transport_setup.c
@@ -235,7 +235,7 @@ static void on_handshake_data_received_from_peer(
gpr_slice_unref(slices[i]); /* split_tail above increments refcount. */
}
gpr_slice_buffer_addn(&s->left_overs, &slices[i + 1],
- num_left_overs - has_left_overs_in_current_slice);
+ num_left_overs - (size_t)has_left_overs_in_current_slice);
check_peer(s);
}
diff --git a/src/core/security/security_connector.c b/src/core/security/security_connector.c
index 4098636a2e..34cb0395a2 100644
--- a/src/core/security/security_connector.c
+++ b/src/core/security/security_connector.c
@@ -196,12 +196,12 @@ typedef struct {
static void fake_channel_destroy(grpc_security_connector *sc) {
grpc_channel_security_connector *c = (grpc_channel_security_connector *)sc;
grpc_credentials_unref(c->request_metadata_creds);
- grpc_auth_context_unref(sc->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(sc->auth_context, "connector");
gpr_free(sc);
}
static void fake_server_destroy(grpc_security_connector *sc) {
- grpc_auth_context_unref(sc->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(sc->auth_context, "connector");
gpr_free(sc);
}
@@ -242,7 +242,7 @@ static grpc_security_status fake_check_peer(grpc_security_connector *sc,
status = GRPC_SECURITY_ERROR;
goto end;
}
- grpc_auth_context_unref(sc->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(sc->auth_context, "connector");
sc->auth_context = grpc_auth_context_create(NULL, 1);
sc->auth_context->properties[0] = grpc_auth_property_init_from_cstring(
GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
@@ -323,7 +323,7 @@ static void ssl_channel_destroy(grpc_security_connector *sc) {
if (c->target_name != NULL) gpr_free(c->target_name);
if (c->overridden_target_name != NULL) gpr_free(c->overridden_target_name);
tsi_peer_destruct(&c->peer);
- grpc_auth_context_unref(sc->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(sc->auth_context, "connector");
gpr_free(sc);
}
@@ -333,7 +333,7 @@ static void ssl_server_destroy(grpc_security_connector *sc) {
if (c->handshaker_factory != NULL) {
tsi_ssl_handshaker_factory_destroy(c->handshaker_factory);
}
- grpc_auth_context_unref(sc->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(sc->auth_context, "connector");
gpr_free(sc);
}
@@ -386,29 +386,13 @@ static int ssl_host_matches_name(const tsi_peer *peer, const char *peer_name) {
return r;
}
-static grpc_auth_context *tsi_ssl_peer_to_auth_context(const tsi_peer *peer) {
- /* We bet that iterating over a handful of properties twice will be faster
- than having to realloc on average . */
- size_t auth_prop_count = 1; /* for transport_security_type. */
+grpc_auth_context *tsi_ssl_peer_to_auth_context(const tsi_peer *peer) {
size_t i;
- const char *peer_identity_property_name = NULL;
grpc_auth_context *ctx = NULL;
- for (i = 0; i < peer->property_count; i++) {
- const tsi_peer_property *prop = &peer->properties[i];
- if (prop->name == NULL) continue;
- if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
- auth_prop_count++;
- /* If there is no subject alt name, have the CN as the identity. */
- if (peer_identity_property_name == NULL) {
- peer_identity_property_name = prop->name;
- }
- } else if (strcmp(prop->name,
- TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) == 0) {
- auth_prop_count++;
- peer_identity_property_name = prop->name;
- }
- }
- ctx = grpc_auth_context_create(NULL, auth_prop_count);
+
+ /* The caller has checked the certificate type property. */
+ GPR_ASSERT(peer->property_count >= 1);
+ ctx = grpc_auth_context_create(NULL, peer->property_count);
ctx->properties[0] = grpc_auth_property_init_from_cstring(
GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_SSL_TRANSPORT_SECURITY_TYPE);
@@ -417,15 +401,19 @@ static grpc_auth_context *tsi_ssl_peer_to_auth_context(const tsi_peer *peer) {
const tsi_peer_property *prop = &peer->properties[i];
if (prop->name == NULL) continue;
if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
+ /* If there is no subject alt name, have the CN as the identity. */
+ if (ctx->peer_identity_property_name == NULL) {
+ ctx->peer_identity_property_name = GRPC_X509_CN_PROPERTY_NAME;
+ }
ctx->properties[ctx->property_count++] = grpc_auth_property_init(
GRPC_X509_CN_PROPERTY_NAME, prop->value.data, prop->value.length);
} else if (strcmp(prop->name,
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) == 0) {
+ ctx->peer_identity_property_name = GRPC_X509_SAN_PROPERTY_NAME;
ctx->properties[ctx->property_count++] = grpc_auth_property_init(
GRPC_X509_SAN_PROPERTY_NAME, prop->value.data, prop->value.length);
}
}
- GPR_ASSERT(auth_prop_count == ctx->property_count);
return ctx;
}
@@ -449,6 +437,9 @@ static grpc_security_status ssl_check_peer(grpc_security_connector *sc,
gpr_log(GPR_ERROR, "Peer name %s is not in peer certificate", peer_name);
return GRPC_SECURITY_ERROR;
}
+ if (sc->auth_context != NULL) {
+ GRPC_AUTH_CONTEXT_UNREF(sc->auth_context, "connector");
+ }
sc->auth_context = tsi_ssl_peer_to_auth_context(peer);
return GRPC_SECURITY_OK;
}
@@ -550,7 +541,7 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
alpn_protocol_strings[i] =
(const unsigned char *)grpc_chttp2_get_alpn_version_index(i);
alpn_protocol_string_lengths[i] =
- strlen(grpc_chttp2_get_alpn_version_index(i));
+ (unsigned char)strlen(grpc_chttp2_get_alpn_version_index(i));
}
if (config == NULL || target_name == NULL) {
@@ -589,7 +580,7 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
config->pem_private_key, config->pem_private_key_size,
config->pem_cert_chain, config->pem_cert_chain_size, pem_root_certs,
pem_root_certs_size, ssl_cipher_suites(), alpn_protocol_strings,
- alpn_protocol_string_lengths, num_alpn_protocols, &c->handshaker_factory);
+ alpn_protocol_string_lengths, (uint16_t)num_alpn_protocols, &c->handshaker_factory);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
tsi_result_to_string(result));
@@ -623,7 +614,7 @@ grpc_security_status grpc_ssl_server_security_connector_create(
alpn_protocol_strings[i] =
(const unsigned char *)grpc_chttp2_get_alpn_version_index(i);
alpn_protocol_string_lengths[i] =
- strlen(grpc_chttp2_get_alpn_version_index(i));
+ (unsigned char)strlen(grpc_chttp2_get_alpn_version_index(i));
}
if (config == NULL || config->num_key_cert_pairs == 0) {
@@ -642,7 +633,7 @@ grpc_security_status grpc_ssl_server_security_connector_create(
(const unsigned char **)config->pem_cert_chains,
config->pem_cert_chains_sizes, config->num_key_cert_pairs,
config->pem_root_certs, config->pem_root_certs_size, ssl_cipher_suites(),
- alpn_protocol_strings, alpn_protocol_string_lengths, num_alpn_protocols,
+ alpn_protocol_strings, alpn_protocol_string_lengths, (uint16_t)num_alpn_protocols,
&c->handshaker_factory);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
@@ -661,4 +652,3 @@ error:
gpr_free(alpn_protocol_string_lengths);
return GRPC_SECURITY_ERROR;
}
-
diff --git a/src/core/security/security_connector.h b/src/core/security/security_connector.h
index 0617041448..ee3057b43b 100644
--- a/src/core/security/security_connector.h
+++ b/src/core/security/security_connector.h
@@ -203,4 +203,7 @@ grpc_security_status grpc_ssl_server_security_connector_create(
const tsi_peer_property *tsi_peer_get_property_by_name(
const tsi_peer *peer, const char *name);
+/* Exposed for testing only. */
+grpc_auth_context *tsi_ssl_peer_to_auth_context(const tsi_peer *peer);
+
#endif /* GRPC_INTERNAL_CORE_SECURITY_SECURITY_CONNECTOR_H */
diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c
index 9aba1e7f91..4d56549f9b 100644
--- a/src/core/security/security_context.c
+++ b/src/core/security/security_context.c
@@ -89,7 +89,7 @@ grpc_client_security_context *grpc_client_security_context_create(void) {
void grpc_client_security_context_destroy(void *ctx) {
grpc_client_security_context *c = (grpc_client_security_context *)ctx;
grpc_credentials_unref(c->creds);
- grpc_auth_context_unref(c->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "client_security_context");
gpr_free(ctx);
}
@@ -104,7 +104,7 @@ grpc_server_security_context *grpc_server_security_context_create(void) {
void grpc_server_security_context_destroy(void *ctx) {
grpc_server_security_context *c = (grpc_server_security_context *)ctx;
- grpc_auth_context_unref(c->auth_context);
+ GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "server_security_context");
gpr_free(ctx);
}
@@ -120,21 +120,40 @@ grpc_auth_context *grpc_auth_context_create(grpc_auth_context *chained,
memset(ctx->properties, 0, property_count * sizeof(grpc_auth_property));
ctx->property_count = property_count;
gpr_ref_init(&ctx->refcount, 1);
- if (chained != NULL) ctx->chained = grpc_auth_context_ref(chained);
+ if (chained != NULL) ctx->chained = GRPC_AUTH_CONTEXT_REF(chained, "chained");
return ctx;
}
+#ifdef GRPC_AUTH_CONTEXT_REFCOUNT_DEBUG
+grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *ctx,
+ const char *file, int line,
+ const char *reason) {
+ if (ctx == NULL) return NULL;
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
+ "AUTH_CONTEXT:%p ref %d -> %d %s", ctx, (int)ctx->refcount.count,
+ (int)ctx->refcount.count + 1, reason);
+#else
grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *ctx) {
if (ctx == NULL) return NULL;
+#endif
gpr_ref(&ctx->refcount);
return ctx;
}
+#ifdef GRPC_AUTH_CONTEXT_REFCOUNT_DEBUG
+void grpc_auth_context_unref(grpc_auth_context *ctx, const char *file, int line,
+ const char *reason) {
+ if (ctx == NULL) return;
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
+ "AUTH_CONTEXT:%p unref %d -> %d %s", ctx, (int)ctx->refcount.count,
+ (int)ctx->refcount.count - 1, reason);
+#else
void grpc_auth_context_unref(grpc_auth_context *ctx) {
if (ctx == NULL) return;
+#endif
if (gpr_unref(&ctx->refcount)) {
size_t i;
- grpc_auth_context_unref(ctx->chained);
+ GRPC_AUTH_CONTEXT_UNREF(ctx->chained, "chained");
if (ctx->properties != NULL) {
for (i = 0; i < ctx->property_count; i++) {
grpc_auth_property_reset(&ctx->properties[i]);
@@ -223,8 +242,8 @@ grpc_auth_property grpc_auth_property_init(const char *name, const char *value,
}
void grpc_auth_property_reset(grpc_auth_property *property) {
- if (property->name != NULL) gpr_free(property->name);
- if (property->value != NULL) gpr_free(property->value);
+ gpr_free(property->name);
+ gpr_free(property->value);
memset(property, 0, sizeof(grpc_auth_property));
}
diff --git a/src/core/security/security_context.h b/src/core/security/security_context.h
index e6ca919130..76a45910bb 100644
--- a/src/core/security/security_context.h
+++ b/src/core/security/security_context.h
@@ -59,9 +59,22 @@ grpc_auth_context *grpc_auth_context_create(grpc_auth_context *chained,
size_t property_count);
/* Refcounting. */
-grpc_auth_context *grpc_auth_context_ref(
- grpc_auth_context *ctx);
-void grpc_auth_context_unref(grpc_auth_context *ctx);
+#ifdef GRPC_AUTH_CONTEXT_REFCOUNT_DEBUG
+#define GRPC_AUTH_CONTEXT_REF(p, r) \
+ grpc_auth_context_ref((p), __FILE__, __LINE__, (r))
+#define GRPC_AUTH_CONTEXT_UNREF(p, r) \
+ grpc_auth_context_unref((p), __FILE__, __LINE__, (r))
+grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *policy,
+ const char *file, int line,
+ const char *reason);
+void grpc_auth_context_unref(grpc_auth_context *policy, const char *file,
+ int line, const char *reason);
+#else
+#define GRPC_AUTH_CONTEXT_REF(p, r) grpc_auth_context_ref((p))
+#define GRPC_AUTH_CONTEXT_UNREF(p, r) grpc_auth_context_unref((p))
+grpc_auth_context *grpc_auth_context_ref(grpc_auth_context *policy);
+void grpc_auth_context_unref(grpc_auth_context *policy);
+#endif
grpc_auth_property grpc_auth_property_init_from_cstring(const char *name,
const char *value);
diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c
index b19160b8ed..b8639287a5 100644
--- a/src/core/security/server_auth_filter.c
+++ b/src/core/security/server_auth_filter.c
@@ -82,9 +82,13 @@ static void init_call_elem(grpc_call_element *elem,
/* Create a security context for the call and reference the auth context from
the channel. */
+ if (initial_op->context[GRPC_CONTEXT_SECURITY].value != NULL) {
+ initial_op->context[GRPC_CONTEXT_SECURITY].destroy(
+ initial_op->context[GRPC_CONTEXT_SECURITY].value);
+ }
server_ctx = grpc_server_security_context_create();
- server_ctx->auth_context =
- grpc_auth_context_ref(chand->security_connector->auth_context);
+ server_ctx->auth_context = GRPC_AUTH_CONTEXT_REF(
+ chand->security_connector->auth_context, "server_security_context");
initial_op->context[GRPC_CONTEXT_SECURITY].value = server_ctx;
initial_op->context[GRPC_CONTEXT_SECURITY].destroy =
grpc_server_security_context_destroy;
diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c
index 3519930f38..53afa1caad 100644
--- a/src/core/security/server_secure_chttp2.c
+++ b/src/core/security/server_secure_chttp2.c
@@ -66,6 +66,10 @@ static void state_ref(grpc_server_secure_state *state) {
static void state_unref(grpc_server_secure_state *state) {
if (gpr_unref(&state->refcount)) {
+ /* ensure all threads have unlocked */
+ gpr_mu_lock(&state->mu);
+ gpr_mu_unlock(&state->mu);
+ /* clean up */
grpc_security_connector_unref(state->sc);
gpr_free(state);
}
@@ -124,16 +128,22 @@ static void start(grpc_server *server, void *statep, grpc_pollset **pollsets,
grpc_tcp_server_start(state->tcp, pollsets, pollset_count, on_accept, state);
}
+static void destroy_done(void *statep) {
+ grpc_server_secure_state *state = statep;
+ grpc_server_listener_destroy_done(state->server);
+ state_unref(state);
+}
+
/* Server callback: destroy the tcp listener (so we don't generate further
callbacks) */
static void destroy(grpc_server *server, void *statep) {
grpc_server_secure_state *state = statep;
+ grpc_tcp_server *tcp;
gpr_mu_lock(&state->mu);
state->is_shutdown = 1;
- grpc_tcp_server_destroy(state->tcp, grpc_server_listener_destroy_done,
- server);
+ tcp = state->tcp;
gpr_mu_unlock(&state->mu);
- state_unref(state);
+ grpc_tcp_server_destroy(tcp, destroy_done, state);
}
int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
diff --git a/src/core/support/cmdline.c b/src/core/support/cmdline.c
index 4baad85040..45a3182f73 100644
--- a/src/core/support/cmdline.c
+++ b/src/core/support/cmdline.c
@@ -228,7 +228,7 @@ static void value_state(gpr_cmdline *cl, char *arg) {
cl->cur_arg->name);
print_usage_and_die(cl);
}
- *(int *)cl->cur_arg->value = intval;
+ *(int *)cl->cur_arg->value = (int)intval;
break;
case ARGTYPE_BOOL:
if (0 == strcmp(arg, "1") || 0 == strcmp(arg, "true")) {
@@ -287,8 +287,8 @@ static void normal_state(gpr_cmdline *cl, char *arg) {
eq = strchr(arg, '=');
if (eq != NULL) {
/* copy the string into a temp buffer and extract the name */
- tmp = arg_name = gpr_malloc(eq - arg + 1);
- memcpy(arg_name, arg, eq - arg);
+ tmp = arg_name = gpr_malloc((size_t)(eq - arg + 1));
+ memcpy(arg_name, arg, (size_t)(eq - arg));
arg_name[eq - arg] = 0;
} else {
arg_name = arg;
diff --git a/src/core/support/cpu_linux.c b/src/core/support/cpu_linux.c
index 37e840d4cf..282d4daab1 100644
--- a/src/core/support/cpu_linux.c
+++ b/src/core/support/cpu_linux.c
@@ -51,7 +51,9 @@
static int ncpus = 0;
static void init_num_cpus() {
- ncpus = sysconf(_SC_NPROCESSORS_ONLN);
+ /* This must be signed. sysconf returns -1 when the number cannot be
+ determined */
+ ncpus = (int)sysconf(_SC_NPROCESSORS_ONLN);
if (ncpus < 1) {
gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1");
ncpus = 1;
@@ -61,7 +63,7 @@ static void init_num_cpus() {
unsigned gpr_cpu_num_cores(void) {
static gpr_once once = GPR_ONCE_INIT;
gpr_once_init(&once, init_num_cpus);
- return ncpus;
+ return (unsigned)ncpus;
}
unsigned gpr_cpu_current_cpu(void) {
@@ -70,7 +72,7 @@ unsigned gpr_cpu_current_cpu(void) {
gpr_log(GPR_ERROR, "Error determining current CPU: %s\n", strerror(errno));
return 0;
}
- return cpu;
+ return (unsigned)cpu;
}
#endif /* GPR_CPU_LINUX */
diff --git a/src/core/support/file.c b/src/core/support/file.c
index 8ce7a67fb1..c1361d8a9e 100644
--- a/src/core/support/file.c
+++ b/src/core/support/file.c
@@ -58,7 +58,8 @@ gpr_slice gpr_load_file(const char *filename, int add_null_terminator,
goto end;
}
fseek(file, 0, SEEK_END);
- contents_size = ftell(file);
+ /* Converting to size_t on the assumption that it will not fail */
+ contents_size = (size_t)ftell(file);
fseek(file, 0, SEEK_SET);
contents = gpr_malloc(contents_size + (add_null_terminator ? 1 : 0));
bytes_read = fread(contents, 1, contents_size, file);
diff --git a/src/core/support/histogram.c b/src/core/support/histogram.c
index 673affde71..9029703891 100644
--- a/src/core/support/histogram.c
+++ b/src/core/support/histogram.c
@@ -164,7 +164,9 @@ static double threshold_for_count_below(gpr_histogram *h, double count_below) {
size_t lower_idx;
size_t upper_idx;
- GPR_ASSERT(h->count >= 1);
+ if (h->count == 0) {
+ return 0.0;
+ }
if (count_below <= 0) {
return h->min_seen;
@@ -189,12 +191,12 @@ static double threshold_for_count_below(gpr_histogram *h, double count_below) {
break;
}
}
- return (bucket_start(h, lower_idx) + bucket_start(h, upper_idx)) / 2.0;
+ return (bucket_start(h, (double)lower_idx) + bucket_start(h, (double)upper_idx)) / 2.0;
} else {
/* treat values as uniform throughout the bucket, and find where this value
should lie */
- lower_bound = bucket_start(h, lower_idx);
- upper_bound = bucket_start(h, lower_idx + 1);
+ lower_bound = bucket_start(h, (double)lower_idx);
+ upper_bound = bucket_start(h, (double)(lower_idx + 1));
return GPR_CLAMP(upper_bound - (upper_bound - lower_bound) *
(count_so_far - count_below) /
h->buckets[lower_idx],
diff --git a/src/core/support/host_port.c b/src/core/support/host_port.c
index 53669f063b..0906ebc2a3 100644
--- a/src/core/support/host_port.c
+++ b/src/core/support/host_port.c
@@ -76,7 +76,7 @@ void gpr_split_host_port(const char *name, char **host, char **port) {
return;
}
host_start = name + 1;
- host_len = rbracket - host_start;
+ host_len = (size_t)(rbracket - host_start);
if (memchr(host_start, ':', host_len) == NULL) {
/* Require all bracketed hosts to contain a colon, because a hostname or
IPv4 address should never use brackets. */
@@ -87,7 +87,7 @@ void gpr_split_host_port(const char *name, char **host, char **port) {
if (colon != NULL && strchr(colon + 1, ':') == NULL) {
/* Exactly 1 colon. Split into host:port. */
host_start = name;
- host_len = colon - name;
+ host_len = (size_t)(colon - name);
port_start = colon + 1;
} else {
/* 0 or 2+ colons. Bare hostname or IPv6 litearal. */
diff --git a/src/core/support/log_win32.c b/src/core/support/log_win32.c
index f878e6aaa1..d249be7d2e 100644
--- a/src/core/support/log_win32.c
+++ b/src/core/support/log_win32.c
@@ -94,23 +94,22 @@ void gpr_default_log(gpr_log_func_args *args) {
fprintf(stderr, "%s%s.%09u %5lu %s:%d] %s\n",
gpr_log_severity_string(args->severity), time_buffer,
- (int)(now.tv_nsec), GetCurrentThreadId(),
- args->file, args->line, args->message);
+ (int)(now.tv_nsec), GetCurrentThreadId(), args->file, args->line,
+ args->message);
}
char *gpr_format_message(DWORD messageid) {
LPTSTR tmessage;
char *message;
- DWORD status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, messageid,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)(&tmessage), 0, NULL);
+ DWORD status = FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, messageid, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR)(&tmessage), 0, NULL);
if (status == 0) return gpr_strdup("Unable to retrieve error string");
message = gpr_tchar_to_char(tmessage);
LocalFree(tmessage);
return message;
}
-#endif /* GPR_WIN32 */
+#endif /* GPR_WIN32 */
diff --git a/src/core/support/murmur_hash.c b/src/core/support/murmur_hash.c
index cc84691508..37fdca82ba 100644
--- a/src/core/support/murmur_hash.c
+++ b/src/core/support/murmur_hash.c
@@ -48,7 +48,7 @@
gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed) {
const gpr_uint8 *data = (const gpr_uint8 *)key;
- const int nblocks = len / 4;
+ const size_t nblocks = len / 4;
int i;
gpr_uint32 h1 = seed;
@@ -57,11 +57,11 @@ gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed) {
const gpr_uint32 c1 = 0xcc9e2d51;
const gpr_uint32 c2 = 0x1b873593;
- const gpr_uint32 *blocks = (const uint32_t *)(data + nblocks * 4);
- const uint8_t *tail = (const uint8_t *)(data + nblocks * 4);
+ const gpr_uint32 *blocks = ((const gpr_uint32 *)key) + nblocks;
+ const gpr_uint8 *tail = (const gpr_uint8 *)(data + nblocks * 4);
/* body */
- for (i = -nblocks; i; i++) {
+ for (i = -(int)nblocks; i; i++) {
k1 = GETBLOCK32(blocks, i);
k1 *= c1;
@@ -78,9 +78,9 @@ gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed) {
/* tail */
switch (len & 3) {
case 3:
- k1 ^= tail[2] << 16;
+ k1 ^= ((gpr_uint32)tail[2]) << 16;
case 2:
- k1 ^= tail[1] << 8;
+ k1 ^= ((gpr_uint32)tail[1]) << 8;
case 1:
k1 ^= tail[0];
k1 *= c1;
@@ -90,7 +90,7 @@ gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed) {
};
/* finalization */
- h1 ^= len;
+ h1 ^= (gpr_uint32)len;
FMIX32(h1);
return h1;
}
diff --git a/src/core/support/slice.c b/src/core/support/slice.c
index 4cff029286..a2d62fc1e5 100644
--- a/src/core/support/slice.c
+++ b/src/core/support/slice.c
@@ -194,7 +194,7 @@ gpr_slice gpr_slice_malloc(size_t length) {
} else {
/* small slice: just inline the data */
slice.refcount = NULL;
- slice.data.inlined.length = length;
+ slice.data.inlined.length = (gpr_uint8)length;
}
return slice;
}
@@ -202,11 +202,11 @@ gpr_slice gpr_slice_malloc(size_t length) {
gpr_slice gpr_slice_sub_no_ref(gpr_slice source, size_t begin, size_t end) {
gpr_slice subset;
+ GPR_ASSERT(end >= begin);
+
if (source.refcount) {
/* Enforce preconditions */
- GPR_ASSERT(source.data.refcounted.length >= begin);
GPR_ASSERT(source.data.refcounted.length >= end);
- GPR_ASSERT(end >= begin);
/* Build the result */
subset.refcount = source.refcount;
@@ -214,8 +214,10 @@ gpr_slice gpr_slice_sub_no_ref(gpr_slice source, size_t begin, size_t end) {
subset.data.refcounted.bytes = source.data.refcounted.bytes + begin;
subset.data.refcounted.length = end - begin;
} else {
+ /* Enforce preconditions */
+ GPR_ASSERT(source.data.inlined.length >= end);
subset.refcount = NULL;
- subset.data.inlined.length = end - begin;
+ subset.data.inlined.length = (gpr_uint8)(end - begin);
memcpy(subset.data.inlined.bytes, source.data.inlined.bytes + begin,
end - begin);
}
@@ -227,7 +229,7 @@ gpr_slice gpr_slice_sub(gpr_slice source, size_t begin, size_t end) {
if (end - begin <= sizeof(subset.data.inlined.bytes)) {
subset.refcount = NULL;
- subset.data.inlined.length = end - begin;
+ subset.data.inlined.length = (gpr_uint8)(end - begin);
memcpy(subset.data.inlined.bytes, GPR_SLICE_START_PTR(source) + begin,
end - begin);
} else {
@@ -245,17 +247,17 @@ gpr_slice gpr_slice_split_tail(gpr_slice *source, size_t split) {
/* inlined data, copy it out */
GPR_ASSERT(source->data.inlined.length >= split);
tail.refcount = NULL;
- tail.data.inlined.length = source->data.inlined.length - split;
+ tail.data.inlined.length = (gpr_uint8)(source->data.inlined.length - split);
memcpy(tail.data.inlined.bytes, source->data.inlined.bytes + split,
tail.data.inlined.length);
- source->data.inlined.length = split;
+ source->data.inlined.length = (gpr_uint8)split;
} else {
size_t tail_length = source->data.refcounted.length - split;
GPR_ASSERT(source->data.refcounted.length >= split);
if (tail_length < sizeof(tail.data.inlined.bytes)) {
/* Copy out the bytes - it'll be cheaper than refcounting */
tail.refcount = NULL;
- tail.data.inlined.length = tail_length;
+ tail.data.inlined.length = (gpr_uint8)tail_length;
memcpy(tail.data.inlined.bytes, source->data.refcounted.bytes + split,
tail_length);
} else {
@@ -280,16 +282,16 @@ gpr_slice gpr_slice_split_head(gpr_slice *source, size_t split) {
GPR_ASSERT(source->data.inlined.length >= split);
head.refcount = NULL;
- head.data.inlined.length = split;
+ head.data.inlined.length = (gpr_uint8)split;
memcpy(head.data.inlined.bytes, source->data.inlined.bytes, split);
- source->data.inlined.length -= split;
+ source->data.inlined.length = (gpr_uint8)(source->data.inlined.length - split);
memmove(source->data.inlined.bytes, source->data.inlined.bytes + split,
source->data.inlined.length);
} else if (split < sizeof(head.data.inlined.bytes)) {
GPR_ASSERT(source->data.refcounted.length >= split);
head.refcount = NULL;
- head.data.inlined.length = split;
+ head.data.inlined.length = (gpr_uint8)split;
memcpy(head.data.inlined.bytes, source->data.refcounted.bytes, split);
source->data.refcounted.bytes += split;
source->data.refcounted.length -= split;
@@ -311,7 +313,7 @@ gpr_slice gpr_slice_split_head(gpr_slice *source, size_t split) {
}
int gpr_slice_cmp(gpr_slice a, gpr_slice b) {
- int d = GPR_SLICE_LENGTH(a) - GPR_SLICE_LENGTH(b);
+ int d = (int)(GPR_SLICE_LENGTH(a) - GPR_SLICE_LENGTH(b));
if (d != 0) return d;
return memcmp(GPR_SLICE_START_PTR(a), GPR_SLICE_START_PTR(b),
GPR_SLICE_LENGTH(a));
@@ -319,7 +321,7 @@ int gpr_slice_cmp(gpr_slice a, gpr_slice b) {
int gpr_slice_str_cmp(gpr_slice a, const char *b) {
size_t b_length = strlen(b);
- int d = GPR_SLICE_LENGTH(a) - b_length;
+ int d = (int)(GPR_SLICE_LENGTH(a) - b_length);
if (d != 0) return d;
return memcmp(GPR_SLICE_START_PTR(a), b, b_length);
}
diff --git a/src/core/support/slice_buffer.c b/src/core/support/slice_buffer.c
index 91b5d8c98b..6e6c72a2bf 100644
--- a/src/core/support/slice_buffer.c
+++ b/src/core/support/slice_buffer.c
@@ -81,7 +81,7 @@ gpr_uint8 *gpr_slice_buffer_tiny_add(gpr_slice_buffer *sb, unsigned n) {
if ((back->data.inlined.length + n) > sizeof(back->data.inlined.bytes))
goto add_new;
out = back->data.inlined.bytes + back->data.inlined.length;
- back->data.inlined.length += n;
+ back->data.inlined.length = (gpr_uint8)(back->data.inlined.length + n);
return out;
add_new:
@@ -89,7 +89,7 @@ add_new:
back = &sb->slices[sb->count];
sb->count++;
back->refcount = NULL;
- back->data.inlined.length = n;
+ back->data.inlined.length = (gpr_uint8)n;
return back->data.inlined.bytes;
}
@@ -116,7 +116,7 @@ void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice s) {
GPR_SLICE_INLINED_SIZE) {
memcpy(back->data.inlined.bytes + back->data.inlined.length,
s.data.inlined.bytes, s.data.inlined.length);
- back->data.inlined.length += s.data.inlined.length;
+ back->data.inlined.length = (gpr_uint8)(back->data.inlined.length + s.data.inlined.length);
} else {
size_t cp1 = GPR_SLICE_INLINED_SIZE - back->data.inlined.length;
memcpy(back->data.inlined.bytes + back->data.inlined.length,
@@ -126,7 +126,7 @@ void gpr_slice_buffer_add(gpr_slice_buffer *sb, gpr_slice s) {
back = &sb->slices[n];
sb->count = n + 1;
back->refcount = NULL;
- back->data.inlined.length = s.data.inlined.length - cp1;
+ back->data.inlined.length = (gpr_uint8)(s.data.inlined.length - cp1);
memcpy(back->data.inlined.bytes, s.data.inlined.bytes + cp1,
s.data.inlined.length - cp1);
}
@@ -190,3 +190,19 @@ void gpr_slice_buffer_swap(gpr_slice_buffer *a, gpr_slice_buffer *b) {
GPR_SWAP(gpr_slice *, a->slices, b->slices);
}
}
+
+void gpr_slice_buffer_move_into(gpr_slice_buffer *src, gpr_slice_buffer *dst) {
+ /* anything to move? */
+ if (src->count == 0) {
+ return;
+ }
+ /* anything in dst? */
+ if (dst->count == 0) {
+ gpr_slice_buffer_swap(src, dst);
+ return;
+ }
+ /* both buffers have data - copy, and reset src */
+ gpr_slice_buffer_addn(dst, src->slices, src->count);
+ src->count = 0;
+ src->length = 0;
+}
diff --git a/src/core/support/string.c b/src/core/support/string.c
index bfd7ce1590..6a80ccc841 100644
--- a/src/core/support/string.c
+++ b/src/core/support/string.c
@@ -94,7 +94,7 @@ char *gpr_hexdump(const char *buf, size_t len, gpr_uint32 flags) {
if (len) hexout_append(&out, ' ');
hexout_append(&out, '\'');
for (cur = beg; cur != end; ++cur) {
- hexout_append(&out, isprint(*cur) ? *cur : '.');
+ hexout_append(&out, isprint(*cur) ? *(char*)cur : '.');
}
hexout_append(&out, '\'');
}
@@ -113,7 +113,7 @@ int gpr_parse_bytes_to_uint32(const char *buf, size_t len, gpr_uint32 *result) {
for (i = 0; i < len; i++) {
if (buf[i] < '0' || buf[i] > '9') return 0; /* bad char */
- new = 10 * out + (buf[i] - '0');
+ new = 10 * out + (gpr_uint32)(buf[i] - '0');
if (new < out) return 0; /* overflow */
out = new;
}
@@ -143,7 +143,7 @@ int gpr_ltoa(long value, char *string) {
if (neg) value = -value;
while (value) {
- string[i++] = '0' + value % 10;
+ string[i++] = (char)('0' + value % 10);
value /= 10;
}
if (neg) string[i++] = '-';
diff --git a/src/core/support/subprocess_posix.c b/src/core/support/subprocess_posix.c
index b4631fa0ed..171054e4da 100644
--- a/src/core/support/subprocess_posix.c
+++ b/src/core/support/subprocess_posix.c
@@ -66,8 +66,8 @@ gpr_subprocess *gpr_subprocess_create(int argc, const char **argv) {
if (pid == -1) {
return NULL;
} else if (pid == 0) {
- exec_args = gpr_malloc((argc + 1) * sizeof(char *));
- memcpy(exec_args, argv, argc * sizeof(char *));
+ exec_args = gpr_malloc(((size_t)argc + 1) * sizeof(char *));
+ memcpy(exec_args, argv, (size_t)argc * sizeof(char *));
exec_args[argc] = NULL;
execv(exec_args[0], exec_args);
/* if we reach here, an error has occurred */
diff --git a/src/core/support/time.c b/src/core/support/time.c
index 7dbf95059f..d47b08b266 100644
--- a/src/core/support/time.c
+++ b/src/core/support/time.c
@@ -86,11 +86,11 @@ gpr_timespec gpr_time_from_nanos(long ns) {
result = gpr_inf_past;
} else if (ns >= 0) {
result.tv_sec = ns / GPR_NS_PER_SEC;
- result.tv_nsec = ns - result.tv_sec * GPR_NS_PER_SEC;
+ result.tv_nsec = (int)(ns - result.tv_sec * GPR_NS_PER_SEC);
} else {
/* Calculation carefully formulated to avoid any possible under/overflow. */
result.tv_sec = (-(999999999 - (ns + GPR_NS_PER_SEC)) / GPR_NS_PER_SEC) - 1;
- result.tv_nsec = ns - result.tv_sec * GPR_NS_PER_SEC;
+ result.tv_nsec = (int)(ns - result.tv_sec * GPR_NS_PER_SEC);
}
return result;
}
@@ -103,11 +103,11 @@ gpr_timespec gpr_time_from_micros(long us) {
result = gpr_inf_past;
} else if (us >= 0) {
result.tv_sec = us / 1000000;
- result.tv_nsec = (us - result.tv_sec * 1000000) * 1000;
+ result.tv_nsec = (int)((us - result.tv_sec * 1000000) * 1000);
} else {
/* Calculation carefully formulated to avoid any possible under/overflow. */
result.tv_sec = (-(999999 - (us + 1000000)) / 1000000) - 1;
- result.tv_nsec = (us - result.tv_sec * 1000000) * 1000;
+ result.tv_nsec = (int)((us - result.tv_sec * 1000000) * 1000);
}
return result;
}
@@ -120,11 +120,11 @@ gpr_timespec gpr_time_from_millis(long ms) {
result = gpr_inf_past;
} else if (ms >= 0) {
result.tv_sec = ms / 1000;
- result.tv_nsec = (ms - result.tv_sec * 1000) * 1000000;
+ result.tv_nsec = (int)((ms - result.tv_sec * 1000) * 1000000);
} else {
/* Calculation carefully formulated to avoid any possible under/overflow. */
result.tv_sec = (-(999 - (ms + 1000)) / 1000) - 1;
- result.tv_nsec = (ms - result.tv_sec * 1000) * 1000000;
+ result.tv_nsec = (int)((ms - result.tv_sec * 1000) * 1000000);
}
return result;
}
@@ -245,10 +245,10 @@ gpr_int32 gpr_time_to_millis(gpr_timespec t) {
care?) */
return -2147483647;
} else {
- return t.tv_sec * GPR_MS_PER_SEC + t.tv_nsec / GPR_NS_PER_MS;
+ return (gpr_int32)(t.tv_sec * GPR_MS_PER_SEC + t.tv_nsec / GPR_NS_PER_MS);
}
}
double gpr_timespec_to_micros(gpr_timespec t) {
- return t.tv_sec * GPR_US_PER_SEC + t.tv_nsec * 1e-3;
+ return (double)t.tv_sec * GPR_US_PER_SEC + t.tv_nsec * 1e-3;
}
diff --git a/src/core/support/time_posix.c b/src/core/support/time_posix.c
index 3675f1eb22..afb58ef231 100644
--- a/src/core/support/time_posix.c
+++ b/src/core/support/time_posix.c
@@ -51,7 +51,7 @@ static struct timespec timespec_from_gpr(gpr_timespec gts) {
static gpr_timespec gpr_from_timespec(struct timespec ts) {
gpr_timespec rv;
rv.tv_sec = ts.tv_sec;
- rv.tv_nsec = ts.tv_nsec;
+ rv.tv_nsec = (int)ts.tv_nsec;
return rv;
}
diff --git a/src/core/surface/byte_buffer.c b/src/core/surface/byte_buffer.c
index 4817e00454..a930949f2d 100644
--- a/src/core/surface/byte_buffer.c
+++ b/src/core/surface/byte_buffer.c
@@ -55,6 +55,20 @@ grpc_byte_buffer *grpc_raw_compressed_byte_buffer_create(
return bb;
}
+grpc_byte_buffer *grpc_raw_byte_buffer_from_reader(
+ grpc_byte_buffer_reader *reader) {
+ grpc_byte_buffer *bb = malloc(sizeof(grpc_byte_buffer));
+ gpr_slice slice;
+ bb->type = GRPC_BB_RAW;
+ bb->data.raw.compression = GRPC_COMPRESS_NONE;
+ gpr_slice_buffer_init(&bb->data.raw.slice_buffer);
+
+ while (grpc_byte_buffer_reader_next(reader, &slice)) {
+ gpr_slice_buffer_add(&bb->data.raw.slice_buffer, slice);
+ }
+ return bb;
+}
+
grpc_byte_buffer *grpc_byte_buffer_copy(grpc_byte_buffer *bb) {
switch (bb->type) {
case GRPC_BB_RAW:
diff --git a/src/core/surface/byte_buffer_reader.c b/src/core/surface/byte_buffer_reader.c
index 86829a686f..283db83833 100644
--- a/src/core/surface/byte_buffer_reader.c
+++ b/src/core/surface/byte_buffer_reader.c
@@ -64,11 +64,11 @@ void grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
grpc_msg_decompress(reader->buffer_in->data.raw.compression,
&reader->buffer_in->data.raw.slice_buffer,
&decompressed_slices_buffer);
- reader->buffer_out = grpc_raw_byte_buffer_create(
- decompressed_slices_buffer.slices,
- decompressed_slices_buffer.count);
+ reader->buffer_out =
+ grpc_raw_byte_buffer_create(decompressed_slices_buffer.slices,
+ decompressed_slices_buffer.count);
gpr_slice_buffer_destroy(&decompressed_slices_buffer);
- } else { /* not compressed, use the input buffer as output */
+ } else { /* not compressed, use the input buffer as output */
reader->buffer_out = reader->buffer_in;
}
reader->current.index = 0;
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 5cdd7cd0f6..181617fff8 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -99,6 +99,8 @@ typedef enum {
/* Status came from 'the wire' - or somewhere below the surface
layer */
STATUS_FROM_WIRE,
+ /* Status came from the server sending status */
+ STATUS_FROM_SERVER_STATUS,
STATUS_SOURCE_COUNT
} status_source;
@@ -148,13 +150,24 @@ struct grpc_call {
gpr_uint8 receiving;
/* are we currently completing requests */
gpr_uint8 completing;
+ /** has grpc_call_destroy been called */
+ gpr_uint8 destroy_called;
/* pairs with completed_requests */
gpr_uint8 num_completed_requests;
/* are we currently reading a message? */
gpr_uint8 reading_message;
+ /* have we bound a pollset yet? */
+ gpr_uint8 bound_pollset;
+ /* is an error status set */
+ gpr_uint8 error_status_set;
+ /** should the alarm be cancelled */
+ gpr_uint8 cancel_alarm;
+
/* flags with bits corresponding to write states allowing us to determine
what was sent */
gpr_uint16 last_send_contains;
+ /* cancel with this status on the next outgoing transport op */
+ grpc_status_code cancel_with_status;
/* Active ioreqs.
request_set and request_data contain one element per active ioreq
@@ -208,6 +221,9 @@ struct grpc_call {
/* Received call statuses from various sources */
received_status status[STATUS_SOURCE_COUNT];
+ /* Compression level for the call */
+ grpc_compression_level compression_level;
+
/* Contexts for various subsystems (security, tracing, ...). */
grpc_call_context_element context[GRPC_CONTEXT_COUNT];
@@ -231,6 +247,9 @@ struct grpc_call {
gpr_uint32 incoming_message_length;
gpr_uint32 incoming_message_flags;
grpc_iomgr_closure destroy_closure;
+ grpc_iomgr_closure on_done_recv;
+ grpc_iomgr_closure on_done_send;
+ grpc_iomgr_closure on_done_bind;
};
#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call) + 1))
@@ -248,8 +267,11 @@ static void execute_op(grpc_call *call, grpc_transport_op *op);
static void recv_metadata(grpc_call *call, grpc_metadata_batch *metadata);
static void finish_read_ops(grpc_call *call);
static grpc_call_error cancel_with_status(grpc_call *c, grpc_status_code status,
- const char *description,
- gpr_uint8 locked);
+ const char *description);
+static void finished_loose_op(void *call, int success);
+
+static void lock(grpc_call *call);
+static void unlock(grpc_call *call);
grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
const void *server_transport_data,
@@ -266,6 +288,9 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
gpr_mu_init(&call->mu);
call->channel = channel;
call->cq = cq;
+ if (cq) {
+ GRPC_CQ_INTERNAL_REF(cq, "bind");
+ }
call->is_client = server_transport_data == NULL;
for (i = 0; i < GRPC_IOREQ_OP_COUNT; i++) {
call->request_set[i] = REQSET_EMPTY;
@@ -282,21 +307,23 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
}
call->send_initial_metadata_count = add_initial_metadata_count;
call->send_deadline = send_deadline;
- grpc_channel_internal_ref(channel);
+ GRPC_CHANNEL_INTERNAL_REF(channel, "call");
call->metadata_context = grpc_channel_get_metadata_context(channel);
grpc_sopb_init(&call->send_ops);
grpc_sopb_init(&call->recv_ops);
gpr_slice_buffer_init(&call->incoming_message);
- /* dropped in destroy */
- gpr_ref_init(&call->internal_refcount, 1);
+ grpc_iomgr_closure_init(&call->on_done_recv, call_on_done_recv, call);
+ grpc_iomgr_closure_init(&call->on_done_send, call_on_done_send, call);
+ grpc_iomgr_closure_init(&call->on_done_bind, finished_loose_op, call);
+ /* dropped in destroy and when READ_STATE_STREAM_CLOSED received */
+ gpr_ref_init(&call->internal_refcount, 2);
/* server hack: start reads immediately so we can get initial metadata.
TODO(ctiller): figure out a cleaner solution */
if (!call->is_client) {
memset(&initial_op, 0, sizeof(initial_op));
initial_op.recv_ops = &call->recv_ops;
initial_op.recv_state = &call->recv_state;
- initial_op.on_done_recv = call_on_done_recv;
- initial_op.recv_user_data = call;
+ initial_op.on_done_recv = &call->on_done_recv;
initial_op.context = call->context;
call->receiving = 1;
GRPC_CALL_INTERNAL_REF(call, "receiving");
@@ -312,7 +339,12 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq,
void grpc_call_set_completion_queue(grpc_call *call,
grpc_completion_queue *cq) {
+ lock(call);
call->cq = cq;
+ if (cq) {
+ GRPC_CQ_INTERNAL_REF(cq, "bind");
+ }
+ unlock(call);
}
grpc_completion_queue *grpc_call_get_completion_queue(grpc_call *call) {
@@ -333,7 +365,7 @@ static void destroy_call(void *call, int ignored_success) {
size_t i;
grpc_call *c = call;
grpc_call_stack_destroy(CALL_STACK_FROM_CALL(c));
- grpc_channel_internal_unref(c->channel);
+ GRPC_CHANNEL_INTERNAL_UNREF(c->channel, "call");
gpr_mu_destroy(&c->mu);
for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
if (c->status[i].details) {
@@ -359,6 +391,9 @@ static void destroy_call(void *call, int ignored_success) {
grpc_sopb_destroy(&c->recv_ops);
grpc_bbq_destroy(&c->incoming_queue);
gpr_slice_buffer_destroy(&c->incoming_message);
+ if (c->cq) {
+ GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
+ }
gpr_free(c);
}
@@ -383,14 +418,22 @@ void grpc_call_internal_unref(grpc_call *c, int allow_immediate_deletion) {
static void set_status_code(grpc_call *call, status_source source,
gpr_uint32 status) {
+ if (call->status[source].is_set) return;
+
call->status[source].is_set = 1;
call->status[source].code = status;
+ call->error_status_set = status != GRPC_STATUS_OK;
if (status != GRPC_STATUS_OK && !grpc_bbq_empty(&call->incoming_queue)) {
grpc_bbq_flush(&call->incoming_queue);
}
}
+static void set_decode_compression_level(grpc_call *call,
+ grpc_compression_level clevel) {
+ call->compression_level = clevel;
+}
+
static void set_status_details(grpc_call *call, status_source source,
grpc_mdstr *status) {
if (call->status[source].details != NULL) {
@@ -411,6 +454,7 @@ static void lock(grpc_call *call) { gpr_mu_lock(&call->mu); }
static int need_more_data(grpc_call *call) {
if (call->read_state == READ_STATE_STREAM_CLOSED) return 0;
+ /* TODO(ctiller): this needs some serious cleanup */
return is_op_live(call, GRPC_IOREQ_RECV_INITIAL_METADATA) ||
(is_op_live(call, GRPC_IOREQ_RECV_MESSAGE) &&
grpc_bbq_empty(&call->incoming_queue)) ||
@@ -419,7 +463,9 @@ static int need_more_data(grpc_call *call) {
is_op_live(call, GRPC_IOREQ_RECV_STATUS_DETAILS) ||
(is_op_live(call, GRPC_IOREQ_RECV_CLOSE) &&
grpc_bbq_empty(&call->incoming_queue)) ||
- (call->write_state == WRITE_STATE_INITIAL && !call->is_client);
+ (call->write_state == WRITE_STATE_INITIAL && !call->is_client) ||
+ (call->cancel_with_status != GRPC_STATUS_OK) ||
+ call->destroy_called;
}
static void unlock(grpc_call *call) {
@@ -428,14 +474,21 @@ static void unlock(grpc_call *call) {
int completing_requests = 0;
int start_op = 0;
int i;
+ int cancel_alarm = 0;
memset(&op, 0, sizeof(op));
+ op.cancel_with_status = call->cancel_with_status;
+ start_op = op.cancel_with_status != GRPC_STATUS_OK;
+ call->cancel_with_status = GRPC_STATUS_OK; /* reset */
+
+ cancel_alarm = call->cancel_alarm;
+ call->cancel_alarm = 0;
+
if (!call->receiving && need_more_data(call)) {
op.recv_ops = &call->recv_ops;
op.recv_state = &call->recv_state;
- op.on_done_recv = call_on_done_recv;
- op.recv_user_data = call;
+ op.on_done_recv = &call->on_done_recv;
call->receiving = 1;
GRPC_CALL_INTERNAL_REF(call, "receiving");
start_op = 1;
@@ -449,6 +502,12 @@ static void unlock(grpc_call *call) {
}
}
+ if (!call->bound_pollset && call->cq && (!call->is_client || start_op)) {
+ call->bound_pollset = 1;
+ op.bind_pollset = grpc_cq_pollset(call->cq);
+ start_op = 1;
+ }
+
if (!call->completing && call->num_completed_requests != 0) {
completing_requests = call->num_completed_requests;
memcpy(completed_requests, call->completed_requests,
@@ -460,6 +519,10 @@ static void unlock(grpc_call *call) {
gpr_mu_unlock(&call->mu);
+ if (cancel_alarm) {
+ grpc_alarm_cancel(&call->alarm);
+ }
+
if (start_op) {
execute_op(call, &op);
}
@@ -551,10 +614,18 @@ static void finish_live_ioreq_op(grpc_call *call, grpc_ioreq_op op,
call->write_state = WRITE_STATE_WRITE_CLOSED;
}
break;
+ case GRPC_IOREQ_SEND_STATUS:
+ if (call->request_data[GRPC_IOREQ_SEND_STATUS].send_status.details !=
+ NULL) {
+ grpc_mdstr_unref(
+ call->request_data[GRPC_IOREQ_SEND_STATUS].send_status.details);
+ call->request_data[GRPC_IOREQ_SEND_STATUS].send_status.details =
+ NULL;
+ }
+ break;
case GRPC_IOREQ_RECV_CLOSE:
case GRPC_IOREQ_SEND_INITIAL_METADATA:
case GRPC_IOREQ_SEND_TRAILING_METADATA:
- case GRPC_IOREQ_SEND_STATUS:
case GRPC_IOREQ_SEND_CLOSE:
break;
case GRPC_IOREQ_RECV_STATUS:
@@ -637,13 +708,13 @@ static void call_on_done_send(void *pc, int success) {
}
static void finish_message(grpc_call *call) {
- /* TODO(ctiller): this could be a lot faster if coded directly */
- grpc_byte_buffer *byte_buffer = grpc_raw_byte_buffer_create(
- call->incoming_message.slices, call->incoming_message.count);
+ if (call->error_status_set == 0) {
+ /* TODO(ctiller): this could be a lot faster if coded directly */
+ grpc_byte_buffer *byte_buffer = grpc_raw_byte_buffer_create(
+ call->incoming_message.slices, call->incoming_message.count);
+ grpc_bbq_push(&call->incoming_queue, byte_buffer);
+ }
gpr_slice_buffer_reset_and_unref(&call->incoming_message);
-
- grpc_bbq_push(&call->incoming_queue, byte_buffer);
-
GPR_ASSERT(call->incoming_message.count == 0);
call->reading_message = 0;
}
@@ -655,7 +726,7 @@ static int begin_message(grpc_call *call, grpc_begin_message msg) {
gpr_asprintf(
&message, "Message terminated early; read %d bytes, expected %d",
(int)call->incoming_message.length, (int)call->incoming_message_length);
- cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT, message, 1);
+ cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT, message);
gpr_free(message);
return 0;
}
@@ -666,7 +737,7 @@ static int begin_message(grpc_call *call, grpc_begin_message msg) {
&message,
"Maximum message length of %d exceeded by a message of length %d",
grpc_channel_get_max_message_length(call->channel), msg.length);
- cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT, message, 1);
+ cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT, message);
gpr_free(message);
return 0;
} else if (msg.length > 0) {
@@ -688,7 +759,7 @@ static int add_slice_to_message(grpc_call *call, gpr_slice slice) {
/* we have to be reading a message to know what to do here */
if (!call->reading_message) {
cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT,
- "Received payload data while not reading a message", 1);
+ "Received payload data while not reading a message");
return 0;
}
/* append the slice to the incoming buffer */
@@ -699,7 +770,7 @@ static int add_slice_to_message(grpc_call *call, gpr_slice slice) {
gpr_asprintf(
&message, "Receiving message overflow; read %d bytes, expected %d",
(int)call->incoming_message.length, (int)call->incoming_message_length);
- cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT, message, 1);
+ cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT, message);
gpr_free(message);
return 0;
} else if (call->incoming_message.length == call->incoming_message_length) {
@@ -744,10 +815,8 @@ static void call_on_done_recv(void *pc, int success) {
if (call->recv_state == GRPC_STREAM_CLOSED) {
GPR_ASSERT(call->read_state <= READ_STATE_STREAM_CLOSED);
call->read_state = READ_STATE_STREAM_CLOSED;
- if (call->have_alarm) {
- grpc_alarm_cancel(&call->alarm);
- call->have_alarm = 0;
- }
+ call->cancel_alarm |= call->have_alarm;
+ GRPC_CALL_INTERNAL_UNREF(call, "closed", 0);
}
finish_read_ops(call);
} else {
@@ -841,7 +910,6 @@ static int fill_send_ops(grpc_call *call, grpc_transport_op *op) {
}
grpc_sopb_add_metadata(&call->send_ops, mdb);
op->send_ops = &call->send_ops;
- op->bind_pollset = grpc_cq_pollset(call->cq);
call->last_send_contains |= 1 << GRPC_IOREQ_SEND_INITIAL_METADATA;
call->send_initial_metadata_count = 0;
/* fall through intended */
@@ -880,8 +948,9 @@ static int fill_send_ops(grpc_call *call, grpc_transport_op *op) {
call->metadata_context,
grpc_mdstr_ref(
grpc_channel_get_message_string(call->channel)),
- grpc_mdstr_from_string(call->metadata_context,
- data.send_status.details)));
+ data.send_status.details));
+ call->request_data[GRPC_IOREQ_SEND_STATUS].send_status.details =
+ NULL;
}
grpc_sopb_add_metadata(&call->send_ops, mdb);
}
@@ -891,8 +960,7 @@ static int fill_send_ops(grpc_call *call, grpc_transport_op *op) {
break;
}
if (op->send_ops) {
- op->on_done_send = call_on_done_send;
- op->send_user_data = call;
+ op->on_done_send = &call->on_done_send;
}
return op->send_ops != NULL;
}
@@ -926,7 +994,7 @@ static void finish_read_ops(grpc_call *call) {
switch (call->read_state) {
case READ_STATE_STREAM_CLOSED:
- if (empty) {
+ if (empty && !call->have_alarm) {
finish_ioreq_op(call, GRPC_IOREQ_RECV_CLOSE, 1);
}
/* fallthrough */
@@ -981,6 +1049,14 @@ static grpc_call_error start_ioreq(grpc_call *call, const grpc_ioreq *reqs,
GRPC_CALL_ERROR_INVALID_METADATA);
}
}
+ if (op == GRPC_IOREQ_SEND_STATUS) {
+ set_status_code(call, STATUS_FROM_SERVER_STATUS,
+ reqs[i].data.send_status.code);
+ if (reqs[i].data.send_status.details) {
+ set_status_details(call, STATUS_FROM_SERVER_STATUS,
+ grpc_mdstr_ref(reqs[i].data.send_status.details));
+ }
+ }
have_ops |= 1u << op;
call->request_data[op] = data;
@@ -1014,10 +1090,9 @@ grpc_call_error grpc_call_start_ioreq_and_call_back(
void grpc_call_destroy(grpc_call *c) {
int cancel;
lock(c);
- if (c->have_alarm) {
- grpc_alarm_cancel(&c->alarm);
- c->have_alarm = 0;
- }
+ GPR_ASSERT(!c->destroy_called);
+ c->destroy_called = 1;
+ c->cancel_alarm |= c->have_alarm;
cancel = c->read_state != READ_STATE_STREAM_CLOSED;
unlock(c);
if (cancel) grpc_call_cancel(c);
@@ -1031,35 +1106,60 @@ grpc_call_error grpc_call_cancel(grpc_call *call) {
grpc_call_error grpc_call_cancel_with_status(grpc_call *c,
grpc_status_code status,
const char *description) {
- return cancel_with_status(c, status, description, 0);
+ grpc_call_error r;
+ lock(c);
+ r = cancel_with_status(c, status, description);
+ unlock(c);
+ return r;
}
static grpc_call_error cancel_with_status(grpc_call *c, grpc_status_code status,
- const char *description,
- gpr_uint8 locked) {
- grpc_transport_op op;
+ const char *description) {
grpc_mdstr *details =
description ? grpc_mdstr_from_string(c->metadata_context, description)
: NULL;
- memset(&op, 0, sizeof(op));
- op.cancel_with_status = status;
- if (locked == 0) {
- lock(c);
- }
+ GPR_ASSERT(status != GRPC_STATUS_OK);
+
set_status_code(c, STATUS_FROM_API_OVERRIDE, status);
set_status_details(c, STATUS_FROM_API_OVERRIDE, details);
- if (locked == 0) {
- unlock(c);
- }
- execute_op(c, &op);
+ c->cancel_with_status = status;
return GRPC_CALL_OK;
}
+static void finished_loose_op(void *call, int success_ignored) {
+ GRPC_CALL_INTERNAL_UNREF(call, "loose-op", 0);
+}
+
+typedef struct {
+ grpc_call *call;
+ grpc_iomgr_closure closure;
+} finished_loose_op_allocated_args;
+
+static void finished_loose_op_allocated(void *alloc, int success) {
+ finished_loose_op_allocated_args *args = alloc;
+ finished_loose_op(args->call, success);
+ gpr_free(args);
+}
+
static void execute_op(grpc_call *call, grpc_transport_op *op) {
grpc_call_element *elem;
+
+ GPR_ASSERT(op->on_consumed == NULL);
+ if (op->cancel_with_status != GRPC_STATUS_OK || op->bind_pollset) {
+ GRPC_CALL_INTERNAL_REF(call, "loose-op");
+ if (op->bind_pollset) {
+ op->on_consumed = &call->on_done_bind;
+ } else {
+ finished_loose_op_allocated_args *args = gpr_malloc(sizeof(*args));
+ args->call = call;
+ grpc_iomgr_closure_init(&args->closure, finished_loose_op_allocated, args);
+ op->on_consumed = &args->closure;
+ }
+ }
+
elem = CALL_ELEM_FROM_CALL(call, 0);
op->context = call->context;
elem->filter->start_transport_op(elem, op);
@@ -1071,14 +1171,14 @@ grpc_call *grpc_call_from_top_element(grpc_call_element *elem) {
static void call_alarm(void *arg, int success) {
grpc_call *call = arg;
+ lock(call);
+ call->have_alarm = 0;
if (success) {
- if (call->is_client) {
- cancel_with_status(call, GRPC_STATUS_DEADLINE_EXCEEDED,
- "Deadline Exceeded", 0);
- } else {
- grpc_call_cancel(call);
- }
+ cancel_with_status(call, GRPC_STATUS_DEADLINE_EXCEEDED,
+ "Deadline Exceeded");
}
+ finish_read_ops(call);
+ unlock(call);
GRPC_CALL_INTERNAL_UNREF(call, "alarm", 1);
}
@@ -1116,6 +1216,33 @@ static gpr_uint32 decode_status(grpc_mdelem *md) {
return status;
}
+/* just as for status above, we need to offset: metadata userdata can't hold a
+ * zero (null), which in this case is used to signal no compression */
+#define COMPRESS_OFFSET 1
+static void destroy_compression(void *ignored) {}
+
+static gpr_uint32 decode_compression(grpc_mdelem *md) {
+ grpc_compression_level clevel;
+ void *user_data = grpc_mdelem_get_user_data(md, destroy_status);
+ if (user_data) {
+ clevel = ((grpc_compression_level)(gpr_intptr)user_data) - COMPRESS_OFFSET;
+ } else {
+ gpr_uint32 parsed_clevel_bytes;
+ if (gpr_parse_bytes_to_uint32(grpc_mdstr_as_c_string(md->value),
+ GPR_SLICE_LENGTH(md->value->slice),
+ &parsed_clevel_bytes)) {
+ /* the following cast is safe, as a gpr_uint32 should be able to hold all
+ * possible values of the grpc_compression_level enum */
+ clevel = (grpc_compression_level) parsed_clevel_bytes;
+ } else {
+ clevel = GRPC_COMPRESS_LEVEL_NONE; /* could not parse, no compression */
+ }
+ grpc_mdelem_set_user_data(md, destroy_compression,
+ (void *)(gpr_intptr)(clevel + COMPRESS_OFFSET));
+ }
+ return clevel;
+}
+
static void recv_metadata(grpc_call *call, grpc_metadata_batch *md) {
grpc_linked_mdelem *l;
grpc_metadata_array *dest;
@@ -1131,6 +1258,8 @@ static void recv_metadata(grpc_call *call, grpc_metadata_batch *md) {
set_status_code(call, STATUS_FROM_WIRE, decode_status(md));
} else if (key == grpc_channel_get_message_string(call->channel)) {
set_status_details(call, STATUS_FROM_WIRE, grpc_mdstr_ref(md->value));
+ } else if (key == grpc_channel_get_compresssion_level_string(call->channel)) {
+ set_decode_compression_level(call, decode_compression(md));
} else {
dest = &call->buffered_metadata[is_trailing];
if (dest->count == dest->capacity) {
@@ -1235,7 +1364,7 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
req->flags = op->flags;
break;
case GRPC_OP_SEND_MESSAGE:
- if (!are_write_flags_valid(op->flags)){
+ if (!are_write_flags_valid(op->flags)) {
return GRPC_CALL_ERROR_INVALID_FLAGS;
}
req = &reqs[out++];
@@ -1270,7 +1399,11 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
req->op = GRPC_IOREQ_SEND_STATUS;
req->data.send_status.code = op->data.send_status_from_server.status;
req->data.send_status.details =
- op->data.send_status_from_server.status_details;
+ op->data.send_status_from_server.status_details != NULL
+ ? grpc_mdstr_from_string(
+ call->metadata_context,
+ op->data.send_status_from_server.status_details)
+ : NULL;
req = &reqs[out++];
req->op = GRPC_IOREQ_SEND_CLOSE;
break;
diff --git a/src/core/surface/call.h b/src/core/surface/call.h
index 7a14161253..fb3662b50d 100644
--- a/src/core/surface/call.h
+++ b/src/core/surface/call.h
@@ -72,14 +72,14 @@ typedef union {
grpc_byte_buffer *send_message;
struct {
grpc_status_code code;
- const char *details;
+ grpc_mdstr *details;
} send_status;
} grpc_ioreq_data;
typedef struct {
grpc_ioreq_op op;
grpc_ioreq_data data;
- gpr_uint32 flags; /**< A copy of the write flags from grpc_op */
+ gpr_uint32 flags; /**< A copy of the write flags from grpc_op */
} grpc_ioreq;
typedef void (*grpc_ioreq_completion_func)(grpc_call *call, int success,
@@ -96,8 +96,10 @@ grpc_completion_queue *grpc_call_get_completion_queue(grpc_call *call);
#ifdef GRPC_CALL_REF_COUNT_DEBUG
void grpc_call_internal_ref(grpc_call *call, const char *reason);
-void grpc_call_internal_unref(grpc_call *call, const char *reason, int allow_immediate_deletion);
-#define GRPC_CALL_INTERNAL_REF(call, reason) grpc_call_internal_ref(call, reason)
+void grpc_call_internal_unref(grpc_call *call, const char *reason,
+ int allow_immediate_deletion);
+#define GRPC_CALL_INTERNAL_REF(call, reason) \
+ grpc_call_internal_ref(call, reason)
#define GRPC_CALL_INTERNAL_UNREF(call, reason, allow_immediate_deletion) \
grpc_call_internal_unref(call, reason, allow_immediate_deletion)
#else
@@ -125,8 +127,7 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity,
void grpc_server_log_request_call(char *file, int line,
gpr_log_severity severity,
- grpc_server *server,
- grpc_call **call,
+ grpc_server *server, grpc_call **call,
grpc_call_details *details,
grpc_metadata_array *initial_metadata,
grpc_completion_queue *cq_bound_to_call,
@@ -135,16 +136,20 @@ void grpc_server_log_request_call(char *file, int line,
/* Set a context pointer.
No thread safety guarantees are made wrt this value. */
-void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *value,
- void (*destroy)(void *value));
+void grpc_call_context_set(grpc_call *call, grpc_context_index elem,
+ void *value, void (*destroy)(void *value));
/* Get a context pointer. */
void *grpc_call_context_get(grpc_call *call, grpc_context_index elem);
#define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \
if (grpc_trace_batch) grpc_call_log_batch(sev, call, ops, nops, tag)
-#define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notifications, tag) \
- if (grpc_trace_batch) grpc_server_log_request_call(sev, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notifications, tag)
+#define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, \
+ initial_metadata, cq_bound_to_call, \
+ cq_for_notifications, tag) \
+ if (grpc_trace_batch) \
+ grpc_server_log_request_call(sev, server, call, details, initial_metadata, \
+ cq_bound_to_call, cq_for_notifications, tag)
gpr_uint8 grpc_call_is_client(grpc_call *call);
diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c
index 9175ad0572..a3c4dcebc1 100644
--- a/src/core/surface/channel.c
+++ b/src/core/surface/channel.c
@@ -64,6 +64,7 @@ struct grpc_channel {
grpc_mdctx *metadata_context;
/** mdstr for the grpc-status key */
grpc_mdstr *grpc_status_string;
+ grpc_mdstr *grpc_compression_level_string;
grpc_mdstr *grpc_message_string;
grpc_mdstr *path_string;
grpc_mdstr *authority_string;
@@ -98,6 +99,8 @@ grpc_channel *grpc_channel_create_from_filters(
gpr_ref_init(&channel->refs, 1 + is_client);
channel->metadata_context = mdctx;
channel->grpc_status_string = grpc_mdstr_from_string(mdctx, "grpc-status");
+ channel->grpc_compression_level_string =
+ grpc_mdstr_from_string(mdctx, "grpc-compression-level");
channel->grpc_message_string = grpc_mdstr_from_string(mdctx, "grpc-message");
for (i = 0; i < NUM_CACHED_STATUS_ELEMS; i++) {
char buf[GPR_LTOA_MIN_BUFSIZE];
@@ -187,8 +190,14 @@ grpc_call *grpc_channel_create_registered_call(
grpc_mdelem_ref(rc->authority), deadline);
}
-void grpc_channel_internal_ref(grpc_channel *channel) {
- gpr_ref(&channel->refs);
+#ifdef GRPC_CHANNEL_REF_COUNT_DEBUG
+void grpc_channel_internal_ref(grpc_channel *c, const char *reason) {
+ gpr_log(GPR_DEBUG, "CHANNEL: ref %p %d -> %d [%s]", c, c->refs.count,
+ c->refs.count + 1, reason);
+#else
+void grpc_channel_internal_ref(grpc_channel *c) {
+#endif
+ gpr_ref(&c->refs);
}
static void destroy_channel(void *p, int ok) {
@@ -199,6 +208,7 @@ static void destroy_channel(void *p, int ok) {
grpc_mdelem_unref(channel->grpc_status_elem[i]);
}
grpc_mdstr_unref(channel->grpc_status_string);
+ grpc_mdstr_unref(channel->grpc_compression_level_string);
grpc_mdstr_unref(channel->grpc_message_string);
grpc_mdstr_unref(channel->path_string);
grpc_mdstr_unref(channel->authority_string);
@@ -214,7 +224,13 @@ static void destroy_channel(void *p, int ok) {
gpr_free(channel);
}
+#ifdef GRPC_CHANNEL_REF_COUNT_DEBUG
+void grpc_channel_internal_unref(grpc_channel *channel, const char *reason) {
+ gpr_log(GPR_DEBUG, "CHANNEL: unref %p %d -> %d [%s]", channel,
+ channel->refs.count, channel->refs.count - 1, reason);
+#else
void grpc_channel_internal_unref(grpc_channel *channel) {
+#endif
if (gpr_unref(&channel->refs)) {
channel->destroy_closure.cb = destroy_channel;
channel->destroy_closure.cb_arg = channel;
@@ -238,11 +254,11 @@ void grpc_channel_destroy(grpc_channel *channel) {
op.dir = GRPC_CALL_DOWN;
elem->filter->channel_op(elem, NULL, &op);
- grpc_channel_internal_unref(channel);
+ GRPC_CHANNEL_INTERNAL_UNREF(channel, "channel");
}
void grpc_client_channel_closed(grpc_channel_element *elem) {
- grpc_channel_internal_unref(CHANNEL_FROM_TOP_ELEM(elem));
+ GRPC_CHANNEL_INTERNAL_UNREF(CHANNEL_FROM_TOP_ELEM(elem), "closed");
}
grpc_channel_stack *grpc_channel_get_channel_stack(grpc_channel *channel) {
@@ -257,6 +273,11 @@ grpc_mdstr *grpc_channel_get_status_string(grpc_channel *channel) {
return channel->grpc_status_string;
}
+grpc_mdstr *grpc_channel_get_compresssion_level_string(grpc_channel *channel) {
+ return channel->grpc_compression_level_string;
+}
+
+
grpc_mdelem *grpc_channel_get_reffed_status_elem(grpc_channel *channel, int i) {
if (i >= 0 && i < NUM_CACHED_STATUS_ELEMS) {
return grpc_mdelem_ref(channel->grpc_status_elem[i]);
diff --git a/src/core/surface/channel.h b/src/core/surface/channel.h
index 6d1ed87900..3c04676b43 100644
--- a/src/core/surface/channel.h
+++ b/src/core/surface/channel.h
@@ -53,12 +53,26 @@ grpc_mdctx *grpc_channel_get_metadata_context(grpc_channel *channel);
grpc_mdelem *grpc_channel_get_reffed_status_elem(grpc_channel *channel,
int status_code);
grpc_mdstr *grpc_channel_get_status_string(grpc_channel *channel);
+grpc_mdstr *grpc_channel_get_compresssion_level_string(grpc_channel *channel);
grpc_mdstr *grpc_channel_get_message_string(grpc_channel *channel);
gpr_uint32 grpc_channel_get_max_message_length(grpc_channel *channel);
void grpc_client_channel_closed(grpc_channel_element *elem);
+#ifdef GRPC_CHANNEL_REF_COUNT_DEBUG
+void grpc_channel_internal_ref(grpc_channel *channel, const char *reason);
+void grpc_channel_internal_unref(grpc_channel *channel, const char *reason);
+#define GRPC_CHANNEL_INTERNAL_REF(channel, reason) \
+ grpc_channel_internal_ref(channel, reason)
+#define GRPC_CHANNEL_INTERNAL_UNREF(channel, reason) \
+ grpc_channel_internal_unref(channel, reason)
+#else
void grpc_channel_internal_ref(grpc_channel *channel);
void grpc_channel_internal_unref(grpc_channel *channel);
+#define GRPC_CHANNEL_INTERNAL_REF(channel, reason) \
+ grpc_channel_internal_ref(channel)
+#define GRPC_CHANNEL_INTERNAL_UNREF(channel, reason) \
+ grpc_channel_internal_unref(channel)
+#endif
#endif /* GRPC_INTERNAL_CORE_SURFACE_CHANNEL_H */
diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c
index 946ee0949d..d069a04a9a 100644
--- a/src/core/surface/channel_create.c
+++ b/src/core/surface/channel_create.c
@@ -91,7 +91,7 @@ static void done(request *r, int was_successful) {
static void on_connect(void *rp, grpc_endpoint *tcp) {
request *r = rp;
- if (!grpc_client_setup_request_should_continue(r->cs_request)) {
+ if (!grpc_client_setup_request_should_continue(r->cs_request, "on_connect")) {
if (tcp) {
grpc_endpoint_shutdown(tcp);
grpc_endpoint_destroy(tcp);
@@ -107,12 +107,12 @@ static void on_connect(void *rp, grpc_endpoint *tcp) {
} else {
return;
}
- } else if (grpc_client_setup_cb_begin(r->cs_request)) {
+ } else if (grpc_client_setup_cb_begin(r->cs_request, "on_connect")) {
grpc_create_chttp2_transport(
r->setup->setup_callback, r->setup->setup_user_data,
grpc_client_setup_get_channel_args(r->cs_request), tcp, NULL, 0,
grpc_client_setup_get_mdctx(r->cs_request), 1);
- grpc_client_setup_cb_end(r->cs_request);
+ grpc_client_setup_cb_end(r->cs_request, "on_connect");
done(r, 1);
return;
} else {
@@ -126,9 +126,10 @@ static int maybe_try_next_resolved(request *r) {
if (!r->resolved) return 0;
if (r->resolved_index == r->resolved->naddrs) return 0;
addr = &r->resolved->addrs[r->resolved_index++];
- grpc_tcp_client_connect(on_connect, r, (struct sockaddr *)&addr->addr,
- addr->len,
- grpc_client_setup_request_deadline(r->cs_request));
+ grpc_tcp_client_connect(
+ on_connect, r, grpc_client_setup_get_interested_parties(r->cs_request),
+ (struct sockaddr *)&addr->addr, addr->len,
+ grpc_client_setup_request_deadline(r->cs_request));
return 1;
}
@@ -137,7 +138,8 @@ static void on_resolved(void *rp, grpc_resolved_addresses *resolved) {
request *r = rp;
/* if we're not still the active request, abort */
- if (!grpc_client_setup_request_should_continue(r->cs_request)) {
+ if (!grpc_client_setup_request_should_continue(r->cs_request,
+ "on_resolved")) {
if (resolved) {
grpc_resolved_addresses_destroy(resolved);
}
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index b48fbace31..030a8b4e6f 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -59,9 +59,6 @@ typedef struct event {
/* Completion queue structure */
struct grpc_completion_queue {
- /* TODO(ctiller): see if this can be removed */
- int allow_polling;
-
/* When refs drops to zero, we are in shutdown mode, and will be destroyable
once all queued events are drained */
gpr_refcount refs;
@@ -76,6 +73,7 @@ struct grpc_completion_queue {
event *queue;
/* Fixed size chained hash table of events for pluck() */
event *buckets[NUM_TAG_BUCKETS];
+ int is_server_cq;
};
grpc_completion_queue *grpc_completion_queue_create(void) {
@@ -86,20 +84,35 @@ grpc_completion_queue *grpc_completion_queue_create(void) {
/* One for destroy(), one for pollset_shutdown */
gpr_ref_init(&cc->owning_refs, 2);
grpc_pollset_init(&cc->pollset);
- cc->allow_polling = 1;
return cc;
}
+#ifdef GRPC_CQ_REF_COUNT_DEBUG
+void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason,
+ const char *file, int line) {
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CQ:%p ref %d -> %d %s",
+ cc, (int)cc->owning_refs.count, (int)cc->owning_refs.count + 1,
+ reason);
+#else
void grpc_cq_internal_ref(grpc_completion_queue *cc) {
+#endif
gpr_ref(&cc->owning_refs);
}
static void on_pollset_destroy_done(void *arg) {
grpc_completion_queue *cc = arg;
- grpc_cq_internal_unref(cc);
+ GRPC_CQ_INTERNAL_UNREF(cc, "pollset_destroy");
}
+#ifdef GRPC_CQ_REF_COUNT_DEBUG
+void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason,
+ const char *file, int line) {
+ gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "CQ:%p unref %d -> %d %s",
+ cc, (int)cc->owning_refs.count, (int)cc->owning_refs.count - 1,
+ reason);
+#else
void grpc_cq_internal_unref(grpc_completion_queue *cc) {
+#endif
if (gpr_unref(&cc->owning_refs)) {
GPR_ASSERT(cc->queue == NULL);
grpc_pollset_destroy(&cc->pollset);
@@ -107,10 +120,6 @@ void grpc_cq_internal_unref(grpc_completion_queue *cc) {
}
}
-void grpc_completion_queue_dont_poll_test_only(grpc_completion_queue *cc) {
- cc->allow_polling = 0;
-}
-
/* Create and append an event to the queue. Returns the event so that its data
members can be filled in.
Requires GRPC_POLLSET_MU(&cc->pollset) locked. */
@@ -134,7 +143,6 @@ static event *add_locked(grpc_completion_queue *cc, grpc_completion_type type,
ev->bucket_prev = cc->buckets[bucket]->bucket_prev;
ev->bucket_next->bucket_prev = ev->bucket_prev->bucket_next = ev;
}
- gpr_cv_broadcast(GRPC_POLLSET_CV(&cc->pollset));
grpc_pollset_kick(&cc->pollset);
return ev;
}
@@ -157,7 +165,6 @@ void grpc_cq_end_op(grpc_completion_queue *cc, void *tag, grpc_call *call,
GPR_ASSERT(!cc->shutdown);
GPR_ASSERT(cc->shutdown_called);
cc->shutdown = 1;
- gpr_cv_broadcast(GRPC_POLLSET_CV(&cc->pollset));
shutdown = 1;
}
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
@@ -180,7 +187,7 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
event *ev = NULL;
grpc_event ret;
- grpc_cq_internal_ref(cc);
+ GRPC_CQ_INTERNAL_REF(cc, "next");
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
for (;;) {
if (cc->queue != NULL) {
@@ -207,16 +214,12 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
ev = create_shutdown_event();
break;
}
- if (cc->allow_polling && grpc_pollset_work(&cc->pollset, deadline)) {
- continue;
- }
- if (gpr_cv_wait(GRPC_POLLSET_CV(&cc->pollset),
- GRPC_POLLSET_MU(&cc->pollset), deadline)) {
+ if (!grpc_pollset_work(&cc->pollset, deadline)) {
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
memset(&ret, 0, sizeof(ret));
ret.type = GRPC_QUEUE_TIMEOUT;
GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret);
- grpc_cq_internal_unref(cc);
+ GRPC_CQ_INTERNAL_UNREF(cc, "next");
return ret;
}
}
@@ -224,7 +227,7 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
ret = ev->base;
gpr_free(ev);
GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret);
- grpc_cq_internal_unref(cc);
+ GRPC_CQ_INTERNAL_UNREF(cc, "next");
return ret;
}
@@ -262,7 +265,7 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
event *ev = NULL;
grpc_event ret;
- grpc_cq_internal_ref(cc);
+ GRPC_CQ_INTERNAL_REF(cc, "pluck");
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
for (;;) {
if ((ev = pluck_event(cc, tag))) {
@@ -272,16 +275,12 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
ev = create_shutdown_event();
break;
}
- if (cc->allow_polling && grpc_pollset_work(&cc->pollset, deadline)) {
- continue;
- }
- if (gpr_cv_wait(GRPC_POLLSET_CV(&cc->pollset),
- GRPC_POLLSET_MU(&cc->pollset), deadline)) {
+ if (!grpc_pollset_work(&cc->pollset, deadline)) {
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
memset(&ret, 0, sizeof(ret));
ret.type = GRPC_QUEUE_TIMEOUT;
GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret);
- grpc_cq_internal_unref(cc);
+ GRPC_CQ_INTERNAL_UNREF(cc, "pluck");
return ret;
}
}
@@ -289,7 +288,7 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
ret = ev->base;
gpr_free(ev);
GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret);
- grpc_cq_internal_unref(cc);
+ GRPC_CQ_INTERNAL_UNREF(cc, "pluck");
return ret;
}
@@ -297,6 +296,10 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
to zero here, then enter shutdown mode and wake up any waiters */
void grpc_completion_queue_shutdown(grpc_completion_queue *cc) {
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
+ if (cc->shutdown_called) {
+ gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
+ return;
+ }
cc->shutdown_called = 1;
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
@@ -304,14 +307,14 @@ void grpc_completion_queue_shutdown(grpc_completion_queue *cc) {
gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset));
GPR_ASSERT(!cc->shutdown);
cc->shutdown = 1;
- gpr_cv_broadcast(GRPC_POLLSET_CV(&cc->pollset));
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
grpc_pollset_shutdown(&cc->pollset, on_pollset_destroy_done, cc);
}
}
void grpc_completion_queue_destroy(grpc_completion_queue *cc) {
- grpc_cq_internal_unref(cc);
+ grpc_completion_queue_shutdown(cc);
+ GRPC_CQ_INTERNAL_UNREF(cc, "destroy");
}
grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc) {
@@ -325,3 +328,7 @@ void grpc_cq_hack_spin_pollset(grpc_completion_queue *cc) {
gpr_time_add(gpr_now(), gpr_time_from_millis(100)));
gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset));
}
+
+void grpc_cq_mark_server_cq(grpc_completion_queue *cc) { cc->is_server_cq = 1; }
+
+int grpc_cq_is_server_cq(grpc_completion_queue *cc) { return cc->is_server_cq; }
diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h
index 7b6fad98fd..1b9010f462 100644
--- a/src/core/surface/completion_queue.h
+++ b/src/core/surface/completion_queue.h
@@ -39,8 +39,21 @@
#include "src/core/iomgr/pollset.h"
#include <grpc/grpc.h>
+#ifdef GRPC_CQ_REF_COUNT_DEBUG
+void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason,
+ const char *file, int line);
+void grpc_cq_internal_unref(grpc_completion_queue *cc, const char *reason,
+ const char *file, int line);
+#define GRPC_CQ_INTERNAL_REF(cc, reason) \
+ grpc_cq_internal_ref(cc, reason, __FILE__, __LINE__)
+#define GRPC_CQ_INTERNAL_UNREF(cc, reason) \
+ grpc_cq_internal_unref(cc, reason, __FILE__, __LINE__)
+#else
void grpc_cq_internal_ref(grpc_completion_queue *cc);
void grpc_cq_internal_unref(grpc_completion_queue *cc);
+#define GRPC_CQ_INTERNAL_REF(cc, reason) grpc_cq_internal_ref(cc)
+#define GRPC_CQ_INTERNAL_UNREF(cc, reason) grpc_cq_internal_unref(cc)
+#endif
/* Flag that an operation is beginning: the completion channel will not finish
shutdown until a corrensponding grpc_cq_end_* call is made */
@@ -50,11 +63,11 @@ void grpc_cq_begin_op(grpc_completion_queue *cc, grpc_call *call);
void grpc_cq_end_op(grpc_completion_queue *cc, void *tag, grpc_call *call,
int success);
-/* disable polling for some tests */
-void grpc_completion_queue_dont_poll_test_only(grpc_completion_queue *cc);
-
grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc);
void grpc_cq_hack_spin_pollset(grpc_completion_queue *cc);
+void grpc_cq_mark_server_cq(grpc_completion_queue *cc);
+int grpc_cq_is_server_cq(grpc_completion_queue *cc);
+
#endif /* GRPC_INTERNAL_CORE_SURFACE_COMPLETION_QUEUE_H */
diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c
index a3b0b2672b..85e1ab5554 100644
--- a/src/core/surface/lame_client.c
+++ b/src/core/surface/lame_client.c
@@ -56,7 +56,7 @@ static void lame_start_transport_op(grpc_call_element *elem,
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
if (op->send_ops) {
grpc_stream_ops_unref_owned_objects(op->send_ops->ops, op->send_ops->nops);
- op->on_done_send(op->send_user_data, 0);
+ op->on_done_send->cb(op->on_done_send->cb_arg, 0);
}
if (op->recv_ops) {
char tmp[GPR_LTOA_MIN_BUFSIZE];
@@ -75,7 +75,10 @@ static void lame_start_transport_op(grpc_call_element *elem,
mdb.deadline = gpr_inf_future;
grpc_sopb_add_metadata(op->recv_ops, mdb);
*op->recv_state = GRPC_STREAM_CLOSED;
- op->on_done_recv(op->recv_user_data, 1);
+ op->on_done_recv->cb(op->on_done_recv->cb_arg, 1);
+ }
+ if (op->on_consumed) {
+ op->on_consumed->cb(op->on_consumed->cb_arg, 0);
}
}
@@ -115,9 +118,9 @@ static void init_channel_elem(grpc_channel_element *elem,
static void destroy_channel_elem(grpc_channel_element *elem) {}
static const grpc_channel_filter lame_filter = {
- lame_start_transport_op, channel_op, sizeof(call_data), init_call_elem,
- destroy_call_elem, sizeof(channel_data), init_channel_elem,
- destroy_channel_elem, "lame-client",
+ lame_start_transport_op, channel_op, sizeof(call_data),
+ init_call_elem, destroy_call_elem, sizeof(channel_data),
+ init_channel_elem, destroy_channel_elem, "lame-client",
};
grpc_channel *grpc_lame_client_channel_create(void) {
diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c
index 8b39934881..fae3e4e90a 100644
--- a/src/core/surface/secure_channel_create.c
+++ b/src/core/surface/secure_channel_create.c
@@ -97,12 +97,13 @@ static void on_secure_transport_setup_done(void *rp,
if (status != GRPC_SECURITY_OK) {
gpr_log(GPR_ERROR, "Secure transport setup failed with error %d.", status);
done(r, 0);
- } else if (grpc_client_setup_cb_begin(r->cs_request)) {
+ } else if (grpc_client_setup_cb_begin(r->cs_request,
+ "on_secure_transport_setup_done")) {
grpc_create_chttp2_transport(
r->setup->setup_callback, r->setup->setup_user_data,
grpc_client_setup_get_channel_args(r->cs_request), secure_endpoint,
NULL, 0, grpc_client_setup_get_mdctx(r->cs_request), 1);
- grpc_client_setup_cb_end(r->cs_request);
+ grpc_client_setup_cb_end(r->cs_request, "on_secure_transport_setup_done");
done(r, 1);
} else {
done(r, 0);
@@ -113,7 +114,8 @@ static void on_secure_transport_setup_done(void *rp,
static void on_connect(void *rp, grpc_endpoint *tcp) {
request *r = rp;
- if (!grpc_client_setup_request_should_continue(r->cs_request)) {
+ if (!grpc_client_setup_request_should_continue(r->cs_request,
+ "on_connect.secure")) {
if (tcp) {
grpc_endpoint_shutdown(tcp);
grpc_endpoint_destroy(tcp);
@@ -141,9 +143,10 @@ static int maybe_try_next_resolved(request *r) {
if (!r->resolved) return 0;
if (r->resolved_index == r->resolved->naddrs) return 0;
addr = &r->resolved->addrs[r->resolved_index++];
- grpc_tcp_client_connect(on_connect, r, (struct sockaddr *)&addr->addr,
- addr->len,
- grpc_client_setup_request_deadline(r->cs_request));
+ grpc_tcp_client_connect(
+ on_connect, r, grpc_client_setup_get_interested_parties(r->cs_request),
+ (struct sockaddr *)&addr->addr, addr->len,
+ grpc_client_setup_request_deadline(r->cs_request));
return 1;
}
@@ -152,7 +155,8 @@ static void on_resolved(void *rp, grpc_resolved_addresses *resolved) {
request *r = rp;
/* if we're not still the active request, abort */
- if (!grpc_client_setup_request_should_continue(r->cs_request)) {
+ if (!grpc_client_setup_request_should_continue(r->cs_request,
+ "on_resolved.secure")) {
if (resolved) {
grpc_resolved_addresses_destroy(resolved);
}
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index 825ef66804..13ec5bee94 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -114,6 +114,7 @@ typedef struct channel_registered_method {
struct channel_data {
grpc_server *server;
+ size_t num_calls;
grpc_channel *channel;
grpc_mdstr *path_key;
grpc_mdstr *authority_key;
@@ -123,7 +124,6 @@ struct channel_data {
channel_registered_method *registered_methods;
gpr_uint32 registered_method_slots;
gpr_uint32 registered_method_max_probes;
- grpc_iomgr_closure finish_shutdown_channel_closure;
grpc_iomgr_closure finish_destroy_channel_closure;
};
@@ -141,7 +141,15 @@ struct grpc_server {
grpc_pollset **pollsets;
size_t cq_count;
- gpr_mu mu;
+ /* The two following mutexes control access to server-state
+ mu_global controls access to non-call-related state (e.g., channel state)
+ mu_call controls access to call-related state (e.g., the call lists)
+
+ If they are ever required to be nested, you must lock mu_global
+ before mu_call. This is currently used in shutdown processing
+ (grpc_server_shutdown_and_notify and maybe_finish_shutdown) */
+ gpr_mu mu_global; /* mutex for server and channel state */
+ gpr_mu mu_call; /* mutex for call-specific state */
registered_method *registered_methods;
requested_call_array requested_calls;
@@ -183,9 +191,9 @@ struct call_data {
grpc_stream_op_buffer *recv_ops;
grpc_stream_state *recv_state;
- void (*on_done_recv)(void *user_data, int success);
- void *recv_user_data;
+ grpc_iomgr_closure *on_done_recv;
+ grpc_iomgr_closure server_on_recv;
grpc_iomgr_closure kill_zombie_closure;
call_data **root[CALL_LIST_COUNT];
@@ -198,6 +206,11 @@ struct call_data {
static void begin_call(grpc_server *server, call_data *calld,
requested_call *rc);
static void fail_call(grpc_server *server, requested_call *rc);
+static void shutdown_channel(channel_data *chand, int send_goaway,
+ int send_disconnect);
+/* Before calling maybe_finish_shutdown, we must hold mu_global and not
+ hold mu_call */
+static void maybe_finish_shutdown(grpc_server *server);
static int call_list_join(call_data **root, call_data *call, call_list list) {
GPR_ASSERT(!call->root[list]);
@@ -270,7 +283,8 @@ static void server_delete(grpc_server *server) {
registered_method *rm;
size_t i;
grpc_channel_args_destroy(server->channel_args);
- gpr_mu_destroy(&server->mu);
+ gpr_mu_destroy(&server->mu_global);
+ gpr_mu_destroy(&server->mu_call);
gpr_free(server->channel_filters);
requested_call_array_destroy(&server->requested_calls);
while ((rm = server->registered_methods) != NULL) {
@@ -281,7 +295,7 @@ static void server_delete(grpc_server *server) {
gpr_free(rm);
}
for (i = 0; i < server->cq_count; i++) {
- grpc_cq_internal_unref(server->cqs[i]);
+ GRPC_CQ_INTERNAL_UNREF(server->cqs[i], "server");
}
gpr_free(server->cqs);
gpr_free(server->pollsets);
@@ -308,7 +322,7 @@ static void orphan_channel(channel_data *chand) {
static void finish_destroy_channel(void *cd, int success) {
channel_data *chand = cd;
grpc_server *server = chand->server;
- grpc_channel_internal_unref(chand->channel);
+ GRPC_CHANNEL_INTERNAL_UNREF(chand->channel, "server");
server_unref(server);
}
@@ -317,6 +331,7 @@ static void destroy_channel(channel_data *chand) {
GPR_ASSERT(chand->server != NULL);
orphan_channel(chand);
server_ref(chand->server);
+ maybe_finish_shutdown(chand->server);
chand->finish_destroy_channel_closure.cb = finish_destroy_channel;
chand->finish_destroy_channel_closure.cb_arg = chand;
grpc_iomgr_add_callback(&chand->finish_destroy_channel_closure);
@@ -331,11 +346,11 @@ static void finish_start_new_rpc_and_unlock(grpc_server *server,
if (array->count == 0) {
calld->state = PENDING;
call_list_join(pending_root, calld, PENDING_START);
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
} else {
rc = array->calls[--array->count];
calld->state = ACTIVATED;
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
begin_call(server, calld, &rc);
}
}
@@ -348,7 +363,7 @@ static void start_new_rpc(grpc_call_element *elem) {
gpr_uint32 hash;
channel_registered_method *rm;
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_call);
if (chand->registered_methods && calld->path && calld->host) {
/* TODO(ctiller): unify these two searches */
/* check for an exact match with host */
@@ -397,12 +412,33 @@ static int num_listeners(grpc_server *server) {
static void maybe_finish_shutdown(grpc_server *server) {
size_t i;
- if (server->shutdown && !server->shutdown_published && server->lists[ALL_CALLS] == NULL && server->listeners_destroyed == num_listeners(server)) {
- server->shutdown_published = 1;
- for (i = 0; i < server->num_shutdown_tags; i++) {
- grpc_cq_end_op(server->shutdown_tags[i].cq, server->shutdown_tags[i].tag,
- NULL, 1);
- }
+ if (!server->shutdown || server->shutdown_published) {
+ return;
+ }
+
+ gpr_mu_lock(&server->mu_call);
+ if (server->lists[ALL_CALLS] != NULL) {
+ gpr_log(GPR_DEBUG,
+ "Waiting for all calls to finish before destroying server");
+ gpr_mu_unlock(&server->mu_call);
+ return;
+ }
+ gpr_mu_unlock(&server->mu_call);
+
+ if (server->root_channel_data.next != &server->root_channel_data) {
+ gpr_log(GPR_DEBUG,
+ "Waiting for all channels to close before destroying server");
+ return;
+ }
+ if (server->listeners_destroyed < num_listeners(server)) {
+ gpr_log(GPR_DEBUG, "Waiting for all listeners to be destroyed (@ %d/%d)",
+ server->listeners_destroyed, num_listeners(server));
+ return;
+ }
+ server->shutdown_published = 1;
+ for (i = 0; i < server->num_shutdown_tags; i++) {
+ grpc_cq_end_op(server->shutdown_tags[i].cq, server->shutdown_tags[i].tag,
+ NULL, 1);
}
}
@@ -420,10 +456,19 @@ static grpc_mdelem *server_filter(void *user_data, grpc_mdelem *md) {
return md;
}
+static void decrement_call_count(channel_data *chand) {
+ chand->num_calls--;
+ if (0 == chand->num_calls && chand->server->shutdown) {
+ shutdown_channel(chand, 0, 1);
+ }
+ maybe_finish_shutdown(chand->server);
+}
+
static void server_on_recv(void *ptr, int success) {
grpc_call_element *elem = ptr;
call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
+ int remove_res;
if (success && !calld->got_initial_metadata) {
size_t i;
@@ -448,16 +493,16 @@ static void server_on_recv(void *ptr, int success) {
case GRPC_STREAM_SEND_CLOSED:
break;
case GRPC_STREAM_RECV_CLOSED:
- gpr_mu_lock(&chand->server->mu);
+ gpr_mu_lock(&chand->server->mu_call);
if (calld->state == NOT_STARTED) {
calld->state = ZOMBIED;
grpc_iomgr_closure_init(&calld->kill_zombie_closure, kill_zombie, elem);
grpc_iomgr_add_callback(&calld->kill_zombie_closure);
}
- gpr_mu_unlock(&chand->server->mu);
+ gpr_mu_unlock(&chand->server->mu_call);
break;
case GRPC_STREAM_CLOSED:
- gpr_mu_lock(&chand->server->mu);
+ gpr_mu_lock(&chand->server->mu_call);
if (calld->state == NOT_STARTED) {
calld->state = ZOMBIED;
grpc_iomgr_closure_init(&calld->kill_zombie_closure, kill_zombie, elem);
@@ -467,16 +512,18 @@ static void server_on_recv(void *ptr, int success) {
calld->state = ZOMBIED;
grpc_iomgr_closure_init(&calld->kill_zombie_closure, kill_zombie, elem);
grpc_iomgr_add_callback(&calld->kill_zombie_closure);
-
}
- if (call_list_remove(calld, ALL_CALLS)) {
- maybe_finish_shutdown(chand->server);
+ remove_res = call_list_remove(calld, ALL_CALLS);
+ gpr_mu_unlock(&chand->server->mu_call);
+ gpr_mu_lock(&chand->server->mu_global);
+ if (remove_res) {
+ decrement_call_count(chand);
}
- gpr_mu_unlock(&chand->server->mu);
+ gpr_mu_unlock(&chand->server->mu_global);
break;
}
- calld->on_done_recv(calld->recv_user_data, success);
+ calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success);
}
static void server_mutate_op(grpc_call_element *elem, grpc_transport_op *op) {
@@ -487,9 +534,7 @@ static void server_mutate_op(grpc_call_element *elem, grpc_transport_op *op) {
calld->recv_ops = op->recv_ops;
calld->recv_state = op->recv_state;
calld->on_done_recv = op->on_done_recv;
- calld->recv_user_data = op->recv_user_data;
- op->on_done_recv = server_on_recv;
- op->recv_user_data = elem;
+ op->on_done_recv = &calld->server_on_recv;
}
}
@@ -515,10 +560,10 @@ static void channel_op(grpc_channel_element *elem,
case GRPC_TRANSPORT_CLOSED:
/* if the transport is closed for a server channel, we destroy the
channel */
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_global);
server_ref(server);
destroy_channel(chand);
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_global);
server_unref(server);
break;
case GRPC_TRANSPORT_GOAWAY:
@@ -531,22 +576,49 @@ static void channel_op(grpc_channel_element *elem,
}
}
-static void finish_shutdown_channel(void *cd, int success) {
- channel_data *chand = cd;
+typedef struct {
+ channel_data *chand;
+ int send_goaway;
+ int send_disconnect;
+ grpc_iomgr_closure finish_shutdown_channel_closure;
+} shutdown_channel_args;
+
+static void finish_shutdown_channel(void *p, int success) {
+ shutdown_channel_args *sca = p;
grpc_channel_op op;
- op.type = GRPC_CHANNEL_DISCONNECT;
- op.dir = GRPC_CALL_DOWN;
- channel_op(grpc_channel_stack_element(
- grpc_channel_get_channel_stack(chand->channel), 0),
- NULL, &op);
- grpc_channel_internal_unref(chand->channel);
+
+ if (sca->send_goaway) {
+ op.type = GRPC_CHANNEL_GOAWAY;
+ op.dir = GRPC_CALL_DOWN;
+ op.data.goaway.status = GRPC_STATUS_OK;
+ op.data.goaway.message = gpr_slice_from_copied_string("Server shutdown");
+ channel_op(grpc_channel_stack_element(
+ grpc_channel_get_channel_stack(sca->chand->channel), 0),
+ NULL, &op);
+ }
+ if (sca->send_disconnect) {
+ op.type = GRPC_CHANNEL_DISCONNECT;
+ op.dir = GRPC_CALL_DOWN;
+ channel_op(grpc_channel_stack_element(
+ grpc_channel_get_channel_stack(sca->chand->channel), 0),
+ NULL, &op);
+ }
+ GRPC_CHANNEL_INTERNAL_UNREF(sca->chand->channel, "shutdown");
+
+ gpr_free(sca);
}
-static void shutdown_channel(channel_data *chand) {
- grpc_channel_internal_ref(chand->channel);
- chand->finish_shutdown_channel_closure.cb = finish_shutdown_channel;
- chand->finish_shutdown_channel_closure.cb_arg = chand;
- grpc_iomgr_add_callback(&chand->finish_shutdown_channel_closure);
+static void shutdown_channel(channel_data *chand, int send_goaway,
+ int send_disconnect) {
+ shutdown_channel_args *sca;
+ GRPC_CHANNEL_INTERNAL_REF(chand->channel, "shutdown");
+ sca = gpr_malloc(sizeof(shutdown_channel_args));
+ sca->chand = chand;
+ sca->send_goaway = send_goaway;
+ sca->send_disconnect = send_disconnect;
+ sca->finish_shutdown_channel_closure.cb = finish_shutdown_channel;
+ sca->finish_shutdown_channel_closure.cb_arg = sca;
+ grpc_iomgr_add_callback(&sca->finish_shutdown_channel_closure);
}
static void init_call_elem(grpc_call_element *elem,
@@ -558,9 +630,15 @@ static void init_call_elem(grpc_call_element *elem,
calld->deadline = gpr_inf_future;
calld->call = grpc_call_from_top_element(elem);
- gpr_mu_lock(&chand->server->mu);
+ grpc_iomgr_closure_init(&calld->server_on_recv, server_on_recv, elem);
+
+ gpr_mu_lock(&chand->server->mu_call);
call_list_join(&chand->server->lists[ALL_CALLS], calld, ALL_CALLS);
- gpr_mu_unlock(&chand->server->mu);
+ gpr_mu_unlock(&chand->server->mu_call);
+
+ gpr_mu_lock(&chand->server->mu_global);
+ chand->num_calls++;
+ gpr_mu_unlock(&chand->server->mu_global);
server_ref(chand->server);
@@ -573,14 +651,16 @@ static void destroy_call_elem(grpc_call_element *elem) {
int removed[CALL_LIST_COUNT];
size_t i;
- gpr_mu_lock(&chand->server->mu);
+ gpr_mu_lock(&chand->server->mu_call);
for (i = 0; i < CALL_LIST_COUNT; i++) {
removed[i] = call_list_remove(elem->call_data, i);
}
+ gpr_mu_unlock(&chand->server->mu_call);
if (removed[ALL_CALLS]) {
- maybe_finish_shutdown(chand->server);
+ gpr_mu_lock(&chand->server->mu_global);
+ decrement_call_count(chand);
+ gpr_mu_unlock(&chand->server->mu_global);
}
- gpr_mu_unlock(&chand->server->mu);
if (calld->host) {
grpc_mdstr_unref(calld->host);
@@ -600,6 +680,7 @@ static void init_channel_elem(grpc_channel_element *elem,
GPR_ASSERT(is_first);
GPR_ASSERT(!is_last);
chand->server = NULL;
+ chand->num_calls = 0;
chand->channel = NULL;
chand->path_key = grpc_mdstr_from_string(metadata_context, ":path");
chand->authority_key = grpc_mdstr_from_string(metadata_context, ":authority");
@@ -622,11 +703,12 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
gpr_free(chand->registered_methods);
}
if (chand->server) {
- gpr_mu_lock(&chand->server->mu);
+ gpr_mu_lock(&chand->server->mu_global);
chand->next->prev = chand->prev;
chand->prev->next = chand->next;
chand->next = chand->prev = chand;
- gpr_mu_unlock(&chand->server->mu);
+ maybe_finish_shutdown(chand->server);
+ gpr_mu_unlock(&chand->server->mu_global);
grpc_mdstr_unref(chand->path_key);
grpc_mdstr_unref(chand->authority_key);
server_unref(chand->server);
@@ -651,7 +733,8 @@ void grpc_server_register_completion_queue(grpc_server *server,
for (i = 0; i < server->cq_count; i++) {
if (server->cqs[i] == cq) return;
}
- grpc_cq_internal_ref(cq);
+ GRPC_CQ_INTERNAL_REF(cq, "server");
+ grpc_cq_mark_server_cq(cq);
n = server->cq_count++;
server->cqs = gpr_realloc(server->cqs,
server->cq_count * sizeof(grpc_completion_queue *));
@@ -672,7 +755,8 @@ grpc_server *grpc_server_create_from_filters(grpc_channel_filter **filters,
memset(server, 0, sizeof(grpc_server));
- gpr_mu_init(&server->mu);
+ gpr_mu_init(&server->mu_global);
+ gpr_mu_init(&server->mu_call);
/* decremented by grpc_server_destroy */
gpr_ref_init(&server->internal_refcount, 1);
@@ -713,7 +797,8 @@ void *grpc_server_register_method(grpc_server *server, const char *method,
const char *host) {
registered_method *m;
if (!method) {
- gpr_log(GPR_ERROR, "grpc_server_register_method method string cannot be NULL");
+ gpr_log(GPR_ERROR,
+ "grpc_server_register_method method string cannot be NULL");
return NULL;
}
for (m = server->registered_methods; m; m = m->next) {
@@ -821,11 +906,11 @@ grpc_transport_setup_result grpc_server_setup_transport(
result = grpc_connected_channel_bind_transport(
grpc_channel_get_channel_stack(channel), transport);
- gpr_mu_lock(&s->mu);
+ gpr_mu_lock(&s->mu_global);
chand->next = &s->root_channel_data;
chand->prev = chand->next->prev;
chand->next->prev = chand->prev->next = chand;
- gpr_mu_unlock(&s->mu);
+ gpr_mu_unlock(&s->mu_global);
gpr_free(filters);
@@ -836,17 +921,13 @@ void grpc_server_shutdown_and_notify(grpc_server *server,
grpc_completion_queue *cq, void *tag) {
listener *l;
requested_call_array requested_calls;
- channel_data **channels;
channel_data *c;
- size_t nchannels;
size_t i;
- grpc_channel_op op;
- grpc_channel_element *elem;
registered_method *rm;
shutdown_tag *sdt;
/* lock, and gather up some stuff to do */
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_global);
grpc_cq_begin_op(cq, NULL);
server->shutdown_tags =
gpr_realloc(server->shutdown_tags,
@@ -855,25 +936,17 @@ void grpc_server_shutdown_and_notify(grpc_server *server,
sdt->tag = tag;
sdt->cq = cq;
if (server->shutdown) {
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_global);
return;
}
- nchannels = 0;
for (c = server->root_channel_data.next; c != &server->root_channel_data;
c = c->next) {
- nchannels++;
- }
- channels = gpr_malloc(sizeof(channel_data *) * nchannels);
- i = 0;
- for (c = server->root_channel_data.next; c != &server->root_channel_data;
- c = c->next) {
- grpc_channel_internal_ref(c->channel);
- channels[i] = c;
- i++;
+ shutdown_channel(c, 1, c->num_calls == 0);
}
/* collect all unregistered then registered calls */
+ gpr_mu_lock(&server->mu_call);
requested_calls = server->requested_calls;
memset(&server->requested_calls, 0, sizeof(server->requested_calls));
for (rm = server->registered_methods; rm; rm = rm->next) {
@@ -892,25 +965,11 @@ void grpc_server_shutdown_and_notify(grpc_server *server,
gpr_free(rm->requested.calls);
memset(&rm->requested, 0, sizeof(rm->requested));
}
+ gpr_mu_unlock(&server->mu_call);
server->shutdown = 1;
maybe_finish_shutdown(server);
- gpr_mu_unlock(&server->mu);
-
- for (i = 0; i < nchannels; i++) {
- c = channels[i];
- elem = grpc_channel_stack_element(
- grpc_channel_get_channel_stack(c->channel), 0);
-
- op.type = GRPC_CHANNEL_GOAWAY;
- op.dir = GRPC_CALL_DOWN;
- op.data.goaway.status = GRPC_STATUS_OK;
- op.data.goaway.message = gpr_slice_from_copied_string("Server shutdown");
- elem->filter->channel_op(elem, NULL, &op);
-
- grpc_channel_internal_unref(c->channel);
- }
- gpr_free(channels);
+ gpr_mu_unlock(&server->mu_global);
/* terminate all the requested calls */
for (i = 0; i < requested_calls.count; i++) {
@@ -926,10 +985,10 @@ void grpc_server_shutdown_and_notify(grpc_server *server,
void grpc_server_listener_destroy_done(void *s) {
grpc_server *server = s;
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_global);
server->listeners_destroyed++;
maybe_finish_shutdown(server);
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_global);
}
void grpc_server_cancel_all_calls(grpc_server *server) {
@@ -940,12 +999,12 @@ void grpc_server_cancel_all_calls(grpc_server *server) {
int is_first = 1;
size_t i;
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_call);
GPR_ASSERT(server->shutdown);
if (!server->lists[ALL_CALLS]) {
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
return;
}
@@ -953,7 +1012,9 @@ void grpc_server_cancel_all_calls(grpc_server *server) {
call_count = 0;
calls = gpr_malloc(sizeof(grpc_call *) * call_capacity);
- for (calld = server->lists[ALL_CALLS]; calld != server->lists[ALL_CALLS] || is_first; calld = calld->links[ALL_CALLS].next) {
+ for (calld = server->lists[ALL_CALLS];
+ calld != server->lists[ALL_CALLS] || is_first;
+ calld = calld->links[ALL_CALLS].next) {
if (call_count == call_capacity) {
call_capacity *= 2;
calls = gpr_realloc(calls, sizeof(grpc_call *) * call_capacity);
@@ -963,10 +1024,11 @@ void grpc_server_cancel_all_calls(grpc_server *server) {
is_first = 0;
}
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
for (i = 0; i < call_count; i++) {
- grpc_call_cancel_with_status(calls[i], GRPC_STATUS_UNAVAILABLE, "Unavailable");
+ grpc_call_cancel_with_status(calls[i], GRPC_STATUS_UNAVAILABLE,
+ "Unavailable");
GRPC_CALL_INTERNAL_UNREF(calls[i], "cancel_all", 1);
}
@@ -974,11 +1036,9 @@ void grpc_server_cancel_all_calls(grpc_server *server) {
}
void grpc_server_destroy(grpc_server *server) {
- channel_data *c;
listener *l;
- call_data *calld;
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_global);
GPR_ASSERT(server->shutdown || !server->listeners);
GPR_ASSERT(server->listeners_destroyed == num_listeners(server));
@@ -988,20 +1048,7 @@ void grpc_server_destroy(grpc_server *server) {
gpr_free(l);
}
- while ((calld = call_list_remove_head(&server->lists[PENDING_START],
- PENDING_START)) != NULL) {
- calld->state = ZOMBIED;
- grpc_iomgr_closure_init(
- &calld->kill_zombie_closure, kill_zombie,
- grpc_call_stack_element(grpc_call_get_call_stack(calld->call), 0));
- grpc_iomgr_add_callback(&calld->kill_zombie_closure);
- }
-
- for (c = server->root_channel_data.next; c != &server->root_channel_data;
- c = c->next) {
- shutdown_channel(c);
- }
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_global);
server_unref(server);
}
@@ -1023,9 +1070,9 @@ static grpc_call_error queue_call_request(grpc_server *server,
requested_call *rc) {
call_data *calld = NULL;
requested_call_array *requested_calls = NULL;
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_call);
if (server->shutdown) {
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
fail_call(server, rc);
return GRPC_CALL_OK;
}
@@ -1044,12 +1091,12 @@ static grpc_call_error queue_call_request(grpc_server *server,
if (calld) {
GPR_ASSERT(calld->state == PENDING);
calld->state = ACTIVATED;
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
begin_call(server, calld, rc);
return GRPC_CALL_OK;
} else {
*requested_call_array_add(requested_calls) = *rc;
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_call);
return GRPC_CALL_OK;
}
}
@@ -1063,6 +1110,9 @@ grpc_call_error grpc_server_request_call(
GRPC_SERVER_LOG_REQUEST_CALL(GPR_INFO, server, call, details,
initial_metadata, cq_bound_to_call,
cq_for_notification, tag);
+ if (!grpc_cq_is_server_cq(cq_for_notification)) {
+ return GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE;
+ }
grpc_cq_begin_op(cq_for_notification, NULL);
rc.type = BATCH_CALL;
rc.tag = tag;
@@ -1081,6 +1131,9 @@ grpc_call_error grpc_server_request_registered_call(
grpc_completion_queue *cq_for_notification, void *tag) {
requested_call rc;
registered_method *registered_method = rm;
+ if (!grpc_cq_is_server_cq(cq_for_notification)) {
+ return GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE;
+ }
grpc_cq_begin_op(cq_for_notification, NULL);
rc.type = REGISTERED_CALL;
rc.tag = tag;
@@ -1187,9 +1240,8 @@ const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server) {
int grpc_server_has_open_connections(grpc_server *server) {
int r;
- gpr_mu_lock(&server->mu);
+ gpr_mu_lock(&server->mu_global);
r = server->root_channel_data.next != &server->root_channel_data;
- gpr_mu_unlock(&server->mu);
+ gpr_mu_unlock(&server->mu_global);
return r;
}
-
diff --git a/src/core/transport/chttp2/alpn.h b/src/core/transport/chttp2/alpn.h
index fcbefc060f..f38b4c3167 100644
--- a/src/core/transport/chttp2/alpn.h
+++ b/src/core/transport/chttp2/alpn.h
@@ -46,4 +46,4 @@ size_t grpc_chttp2_num_alpn_versions(void);
* grpc_chttp2_num_alpn_versions()) */
const char *grpc_chttp2_get_alpn_version_index(size_t i);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_ALPN_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_ALPN_H */
diff --git a/src/core/transport/chttp2/bin_encoder.c b/src/core/transport/chttp2/bin_encoder.c
index f5ca6c4e50..dee6dbec8b 100644
--- a/src/core/transport/chttp2/bin_encoder.c
+++ b/src/core/transport/chttp2/bin_encoder.c
@@ -46,70 +46,18 @@ typedef struct {
gpr_uint8 length;
} b64_huff_sym;
-static const b64_huff_sym huff_alphabet[64] = {{0x21, 6},
- {0x5d, 7},
- {0x5e, 7},
- {0x5f, 7},
- {0x60, 7},
- {0x61, 7},
- {0x62, 7},
- {0x63, 7},
- {0x64, 7},
- {0x65, 7},
- {0x66, 7},
- {0x67, 7},
- {0x68, 7},
- {0x69, 7},
- {0x6a, 7},
- {0x6b, 7},
- {0x6c, 7},
- {0x6d, 7},
- {0x6e, 7},
- {0x6f, 7},
- {0x70, 7},
- {0x71, 7},
- {0x72, 7},
- {0xfc, 8},
- {0x73, 7},
- {0xfd, 8},
- {0x3, 5},
- {0x23, 6},
- {0x4, 5},
- {0x24, 6},
- {0x5, 5},
- {0x25, 6},
- {0x26, 6},
- {0x27, 6},
- {0x6, 5},
- {0x74, 7},
- {0x75, 7},
- {0x28, 6},
- {0x29, 6},
- {0x2a, 6},
- {0x7, 5},
- {0x2b, 6},
- {0x76, 7},
- {0x2c, 6},
- {0x8, 5},
- {0x9, 5},
- {0x2d, 6},
- {0x77, 7},
- {0x78, 7},
- {0x79, 7},
- {0x7a, 7},
- {0x7b, 7},
- {0x0, 5},
- {0x1, 5},
- {0x2, 5},
- {0x19, 6},
- {0x1a, 6},
- {0x1b, 6},
- {0x1c, 6},
- {0x1d, 6},
- {0x1e, 6},
- {0x1f, 6},
- {0x7fb, 11},
- {0x18, 6}};
+static const b64_huff_sym huff_alphabet[64] = {
+ {0x21, 6}, {0x5d, 7}, {0x5e, 7}, {0x5f, 7}, {0x60, 7}, {0x61, 7},
+ {0x62, 7}, {0x63, 7}, {0x64, 7}, {0x65, 7}, {0x66, 7}, {0x67, 7},
+ {0x68, 7}, {0x69, 7}, {0x6a, 7}, {0x6b, 7}, {0x6c, 7}, {0x6d, 7},
+ {0x6e, 7}, {0x6f, 7}, {0x70, 7}, {0x71, 7}, {0x72, 7}, {0xfc, 8},
+ {0x73, 7}, {0xfd, 8}, {0x3, 5}, {0x23, 6}, {0x4, 5}, {0x24, 6},
+ {0x5, 5}, {0x25, 6}, {0x26, 6}, {0x27, 6}, {0x6, 5}, {0x74, 7},
+ {0x75, 7}, {0x28, 6}, {0x29, 6}, {0x2a, 6}, {0x7, 5}, {0x2b, 6},
+ {0x76, 7}, {0x2c, 6}, {0x8, 5}, {0x9, 5}, {0x2d, 6}, {0x77, 7},
+ {0x78, 7}, {0x79, 7}, {0x7a, 7}, {0x7b, 7}, {0x0, 5}, {0x1, 5},
+ {0x2, 5}, {0x19, 6}, {0x1a, 6}, {0x1b, 6}, {0x1c, 6}, {0x1d, 6},
+ {0x1e, 6}, {0x1f, 6}, {0x7fb, 11}, {0x18, 6}};
static const gpr_uint8 tail_xtra[3] = {0, 2, 3};
diff --git a/src/core/transport/chttp2/bin_encoder.h b/src/core/transport/chttp2/bin_encoder.h
index 9c88ac9725..d3e5a855dd 100644
--- a/src/core/transport/chttp2/bin_encoder.h
+++ b/src/core/transport/chttp2/bin_encoder.h
@@ -53,4 +53,4 @@ gpr_slice grpc_chttp2_base64_encode_and_huffman_compress(gpr_slice input);
int grpc_is_binary_header(const char *key, size_t length);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_BIN_ENCODER_H */
diff --git a/src/core/transport/chttp2/frame.h b/src/core/transport/chttp2/frame.h
index c9e3e13042..879ee036fa 100644
--- a/src/core/transport/chttp2/frame.h
+++ b/src/core/transport/chttp2/frame.h
@@ -45,23 +45,9 @@ typedef enum {
GRPC_CHTTP2_CONNECTION_ERROR
} grpc_chttp2_parse_error;
-typedef struct {
- gpr_uint8 end_of_stream;
- gpr_uint8 need_flush_reads;
- gpr_uint8 metadata_boundary;
- gpr_uint8 ack_settings;
- gpr_uint8 send_ping_ack;
- gpr_uint8 process_ping_reply;
- gpr_uint8 goaway;
- gpr_uint8 rst_stream;
-
- gpr_int64 initial_window_update;
- gpr_uint32 window_update;
- gpr_uint32 goaway_last_stream_index;
- gpr_uint32 goaway_error;
- gpr_slice goaway_text;
- gpr_uint32 rst_stream_reason;
-} grpc_chttp2_parse_state;
+/* defined in internal.h */
+typedef struct grpc_chttp2_stream_parsing grpc_chttp2_stream_parsing;
+typedef struct grpc_chttp2_transport_parsing grpc_chttp2_transport_parsing;
#define GRPC_CHTTP2_FRAME_DATA 0
#define GRPC_CHTTP2_FRAME_HEADER 1
@@ -80,4 +66,4 @@ typedef struct {
#define GRPC_CHTTP2_DATA_FLAG_PADDED 8
#define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_H */
diff --git a/src/core/transport/chttp2/frame_data.c b/src/core/transport/chttp2/frame_data.c
index a1ae9ed2e6..0ad62a9999 100644
--- a/src/core/transport/chttp2/frame_data.c
+++ b/src/core/transport/chttp2/frame_data.c
@@ -35,6 +35,7 @@
#include <string.h>
+#include "src/core/transport/chttp2/internal.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -69,16 +70,15 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_begin_frame(
}
grpc_chttp2_parse_error grpc_chttp2_data_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last) {
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
gpr_uint8 *const beg = GPR_SLICE_START_PTR(slice);
gpr_uint8 *const end = GPR_SLICE_END_PTR(slice);
gpr_uint8 *cur = beg;
grpc_chttp2_data_parser *p = parser;
if (is_last && p->is_last_frame) {
- state->end_of_stream = 1;
- state->need_flush_reads = 1;
+ stream_parsing->received_close = 1;
}
if (cur == end) {
@@ -105,51 +105,52 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse(
}
/* fallthrough */
case GRPC_CHTTP2_DATA_FH_1:
- p->frame_size = ((gpr_uint32) * cur) << 24;
+ p->frame_size = ((gpr_uint32)*cur) << 24;
if (++cur == end) {
p->state = GRPC_CHTTP2_DATA_FH_2;
return GRPC_CHTTP2_PARSE_OK;
}
/* fallthrough */
case GRPC_CHTTP2_DATA_FH_2:
- p->frame_size |= ((gpr_uint32) * cur) << 16;
+ p->frame_size |= ((gpr_uint32)*cur) << 16;
if (++cur == end) {
p->state = GRPC_CHTTP2_DATA_FH_3;
return GRPC_CHTTP2_PARSE_OK;
}
/* fallthrough */
case GRPC_CHTTP2_DATA_FH_3:
- p->frame_size |= ((gpr_uint32) * cur) << 8;
+ p->frame_size |= ((gpr_uint32)*cur) << 8;
if (++cur == end) {
p->state = GRPC_CHTTP2_DATA_FH_4;
return GRPC_CHTTP2_PARSE_OK;
}
/* fallthrough */
case GRPC_CHTTP2_DATA_FH_4:
- p->frame_size |= ((gpr_uint32) * cur);
+ p->frame_size |= ((gpr_uint32)*cur);
p->state = GRPC_CHTTP2_DATA_FRAME;
++cur;
- state->need_flush_reads = 1;
grpc_sopb_add_begin_message(&p->incoming_sopb, p->frame_size, 0);
/* fallthrough */
case GRPC_CHTTP2_DATA_FRAME:
if (cur == end) {
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing,
+ stream_parsing);
return GRPC_CHTTP2_PARSE_OK;
- } else if ((gpr_uint32)(end - cur) == p->frame_size) {
- state->need_flush_reads = 1;
+ }
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing,
+ stream_parsing);
+ if ((gpr_uint32)(end - cur) == p->frame_size) {
grpc_sopb_add_slice(&p->incoming_sopb,
gpr_slice_sub(slice, cur - beg, end - beg));
p->state = GRPC_CHTTP2_DATA_FH_0;
return GRPC_CHTTP2_PARSE_OK;
} else if ((gpr_uint32)(end - cur) > p->frame_size) {
- state->need_flush_reads = 1;
grpc_sopb_add_slice(
&p->incoming_sopb,
gpr_slice_sub(slice, cur - beg, cur + p->frame_size - beg));
cur += p->frame_size;
goto fh_0; /* loop */
} else {
- state->need_flush_reads = 1;
grpc_sopb_add_slice(&p->incoming_sopb,
gpr_slice_sub(slice, cur - beg, end - beg));
p->frame_size -= (end - cur);
diff --git a/src/core/transport/chttp2/frame_data.h b/src/core/transport/chttp2/frame_data.h
index 24e557accd..8d6cfcb841 100644
--- a/src/core/transport/chttp2/frame_data.h
+++ b/src/core/transport/chttp2/frame_data.h
@@ -72,9 +72,10 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_begin_frame(
/* handle a slice of a data frame - is_last indicates the last slice of a
frame */
grpc_chttp2_parse_error grpc_chttp2_data_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
/* create a slice with an empty data frame and is_last set */
gpr_slice grpc_chttp2_data_frame_create_empty_close(gpr_uint32 id);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_DATA_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_DATA_H */
diff --git a/src/core/transport/chttp2/frame_goaway.c b/src/core/transport/chttp2/frame_goaway.c
index 95b75d4fde..1ccbba840c 100644
--- a/src/core/transport/chttp2/frame_goaway.c
+++ b/src/core/transport/chttp2/frame_goaway.c
@@ -32,6 +32,7 @@
*/
#include "src/core/transport/chttp2/frame_goaway.h"
+#include "src/core/transport/chttp2/internal.h"
#include <string.h>
@@ -62,8 +63,8 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_begin_frame(
}
grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last) {
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
gpr_uint8 *const beg = GPR_SLICE_START_PTR(slice);
gpr_uint8 *const end = GPR_SLICE_END_PTR(slice);
gpr_uint8 *cur = beg;
@@ -75,7 +76,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_LSI0;
return GRPC_CHTTP2_PARSE_OK;
}
- p->last_stream_id = ((gpr_uint32) * cur) << 24;
+ p->last_stream_id = ((gpr_uint32)*cur) << 24;
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_LSI1:
@@ -83,7 +84,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_LSI1;
return GRPC_CHTTP2_PARSE_OK;
}
- p->last_stream_id |= ((gpr_uint32) * cur) << 16;
+ p->last_stream_id |= ((gpr_uint32)*cur) << 16;
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_LSI2:
@@ -91,7 +92,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_LSI2;
return GRPC_CHTTP2_PARSE_OK;
}
- p->last_stream_id |= ((gpr_uint32) * cur) << 8;
+ p->last_stream_id |= ((gpr_uint32)*cur) << 8;
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_LSI3:
@@ -99,7 +100,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_LSI3;
return GRPC_CHTTP2_PARSE_OK;
}
- p->last_stream_id |= ((gpr_uint32) * cur);
+ p->last_stream_id |= ((gpr_uint32)*cur);
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_ERR0:
@@ -107,7 +108,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_ERR0;
return GRPC_CHTTP2_PARSE_OK;
}
- p->error_code = ((gpr_uint32) * cur) << 24;
+ p->error_code = ((gpr_uint32)*cur) << 24;
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_ERR1:
@@ -115,7 +116,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_ERR1;
return GRPC_CHTTP2_PARSE_OK;
}
- p->error_code |= ((gpr_uint32) * cur) << 16;
+ p->error_code |= ((gpr_uint32)*cur) << 16;
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_ERR2:
@@ -123,7 +124,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_ERR2;
return GRPC_CHTTP2_PARSE_OK;
}
- p->error_code |= ((gpr_uint32) * cur) << 8;
+ p->error_code |= ((gpr_uint32)*cur) << 8;
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_ERR3:
@@ -131,7 +132,7 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->state = GRPC_CHTTP2_GOAWAY_ERR3;
return GRPC_CHTTP2_PARSE_OK;
}
- p->error_code |= ((gpr_uint32) * cur);
+ p->error_code |= ((gpr_uint32)*cur);
++cur;
/* fallthrough */
case GRPC_CHTTP2_GOAWAY_DEBUG:
@@ -139,10 +140,11 @@ grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
p->debug_pos += end - cur;
p->state = GRPC_CHTTP2_GOAWAY_DEBUG;
if (is_last) {
- state->goaway = 1;
- state->goaway_last_stream_index = p->last_stream_id;
- state->goaway_error = p->error_code;
- state->goaway_text =
+ transport_parsing->goaway_received = 1;
+ transport_parsing->goaway_last_stream_index = p->last_stream_id;
+ gpr_slice_unref(transport_parsing->goaway_text);
+ transport_parsing->goaway_error = p->error_code;
+ transport_parsing->goaway_text =
gpr_slice_new(p->debug_data, p->debug_length, gpr_free);
p->debug_data = NULL;
}
diff --git a/src/core/transport/chttp2/frame_goaway.h b/src/core/transport/chttp2/frame_goaway.h
index 7638891514..9c5edfc821 100644
--- a/src/core/transport/chttp2/frame_goaway.h
+++ b/src/core/transport/chttp2/frame_goaway.h
@@ -65,10 +65,11 @@ void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser *p);
grpc_chttp2_parse_error grpc_chttp2_goaway_parser_begin_frame(
grpc_chttp2_goaway_parser *parser, gpr_uint32 length, gpr_uint8 flags);
grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
void grpc_chttp2_goaway_append(gpr_uint32 last_stream_id, gpr_uint32 error_code,
gpr_slice debug_data,
gpr_slice_buffer *slice_buffer);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_GOAWAY_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_GOAWAY_H */
diff --git a/src/core/transport/chttp2/frame_ping.c b/src/core/transport/chttp2/frame_ping.c
index 26004b3b7c..05451c7a8a 100644
--- a/src/core/transport/chttp2/frame_ping.c
+++ b/src/core/transport/chttp2/frame_ping.c
@@ -32,9 +32,11 @@
*/
#include "src/core/transport/chttp2/frame_ping.h"
+#include "src/core/transport/chttp2/internal.h"
#include <string.h>
+#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
gpr_slice grpc_chttp2_ping_create(gpr_uint8 ack, gpr_uint8 *opaque_8bytes) {
@@ -67,12 +69,13 @@ grpc_chttp2_parse_error grpc_chttp2_ping_parser_begin_frame(
}
grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last) {
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
gpr_uint8 *const beg = GPR_SLICE_START_PTR(slice);
gpr_uint8 *const end = GPR_SLICE_END_PTR(slice);
gpr_uint8 *cur = beg;
grpc_chttp2_ping_parser *p = parser;
+ grpc_chttp2_outstanding_ping *ping;
while (p->byte != 8 && cur != end) {
p->opaque_8bytes[p->byte] = *cur;
@@ -83,9 +86,18 @@ grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse(
if (p->byte == 8) {
GPR_ASSERT(is_last);
if (p->is_ack) {
- state->process_ping_reply = 1;
+ for (ping = transport_parsing->pings.next;
+ ping != &transport_parsing->pings; ping = ping->next) {
+ if (0 == memcmp(p->opaque_8bytes, ping->id, 8)) {
+ grpc_iomgr_add_delayed_callback(ping->on_recv, 1);
+ }
+ ping->next->prev = ping->prev;
+ ping->prev->next = ping->next;
+ gpr_free(ping);
+ }
} else {
- state->send_ping_ack = 1;
+ gpr_slice_buffer_add(&transport_parsing->qbuf,
+ grpc_chttp2_ping_create(1, p->opaque_8bytes));
}
}
diff --git a/src/core/transport/chttp2/frame_ping.h b/src/core/transport/chttp2/frame_ping.h
index 11d38b80ea..99197e8352 100644
--- a/src/core/transport/chttp2/frame_ping.h
+++ b/src/core/transport/chttp2/frame_ping.h
@@ -48,6 +48,7 @@ gpr_slice grpc_chttp2_ping_create(gpr_uint8 ack, gpr_uint8 *opaque_8bytes);
grpc_chttp2_parse_error grpc_chttp2_ping_parser_begin_frame(
grpc_chttp2_ping_parser *parser, gpr_uint32 length, gpr_uint8 flags);
grpc_chttp2_parse_error grpc_chttp2_ping_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_PING_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_PING_H */
diff --git a/src/core/transport/chttp2/frame_rst_stream.c b/src/core/transport/chttp2/frame_rst_stream.c
index 3016aac7a2..a878d936c1 100644
--- a/src/core/transport/chttp2/frame_rst_stream.c
+++ b/src/core/transport/chttp2/frame_rst_stream.c
@@ -32,6 +32,7 @@
*/
#include "src/core/transport/chttp2/frame_rst_stream.h"
+#include "src/core/transport/chttp2/internal.h"
#include <grpc/support/log.h>
@@ -61,7 +62,8 @@ gpr_slice grpc_chttp2_rst_stream_create(gpr_uint32 id, gpr_uint32 code) {
grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_begin_frame(
grpc_chttp2_rst_stream_parser *parser, gpr_uint32 length, gpr_uint8 flags) {
if (length != 4) {
- gpr_log(GPR_ERROR, "invalid rst_stream: length=%d, flags=%02x", length, flags);
+ gpr_log(GPR_ERROR, "invalid rst_stream: length=%d, flags=%02x", length,
+ flags);
return GRPC_CHTTP2_CONNECTION_ERROR;
}
parser->byte = 0;
@@ -69,8 +71,8 @@ grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_begin_frame(
}
grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last) {
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
gpr_uint8 *const beg = GPR_SLICE_START_PTR(slice);
gpr_uint8 *const end = GPR_SLICE_END_PTR(slice);
gpr_uint8 *cur = beg;
@@ -84,12 +86,13 @@ grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse(
if (p->byte == 4) {
GPR_ASSERT(is_last);
- state->rst_stream = 1;
- state->rst_stream_reason =
- (((gpr_uint32)p->reason_bytes[0]) << 24) |
- (((gpr_uint32)p->reason_bytes[1]) << 16) |
- (((gpr_uint32)p->reason_bytes[2]) << 8) |
- (((gpr_uint32)p->reason_bytes[3]));
+ stream_parsing->received_close = 1;
+ stream_parsing->saw_rst_stream = 1;
+ stream_parsing->rst_stream_reason =
+ (((gpr_uint32)p->reason_bytes[0]) << 24) |
+ (((gpr_uint32)p->reason_bytes[1]) << 16) |
+ (((gpr_uint32)p->reason_bytes[2]) << 8) |
+ (((gpr_uint32)p->reason_bytes[3]));
}
return GRPC_CHTTP2_PARSE_OK;
diff --git a/src/core/transport/chttp2/frame_rst_stream.h b/src/core/transport/chttp2/frame_rst_stream.h
index 07a3c98d03..ed69e588af 100644
--- a/src/core/transport/chttp2/frame_rst_stream.h
+++ b/src/core/transport/chttp2/frame_rst_stream.h
@@ -47,6 +47,7 @@ gpr_slice grpc_chttp2_rst_stream_create(gpr_uint32 stream_id, gpr_uint32 code);
grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_begin_frame(
grpc_chttp2_rst_stream_parser *parser, gpr_uint32 length, gpr_uint8 flags);
grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H */
diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c
index 2ffce730d5..d42bc000ae 100644
--- a/src/core/transport/chttp2/frame_settings.c
+++ b/src/core/transport/chttp2/frame_settings.c
@@ -32,6 +32,7 @@
*/
#include "src/core/transport/chttp2/frame_settings.h"
+#include "src/core/transport/chttp2/internal.h"
#include <string.h>
@@ -137,7 +138,8 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame(
}
grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse(
- void *p, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last) {
+ void *p, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
grpc_chttp2_settings_parser *parser = p;
const gpr_uint8 *cur = GPR_SLICE_START_PTR(slice);
const gpr_uint8 *end = GPR_SLICE_END_PTR(slice);
@@ -152,9 +154,11 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse(
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_ID0;
if (is_last) {
+ transport_parsing->settings_updated = 1;
memcpy(parser->target_settings, parser->incoming_settings,
GRPC_CHTTP2_NUM_SETTINGS * sizeof(gpr_uint32));
- state->ack_settings = 1;
+ gpr_slice_buffer_add(&transport_parsing->qbuf,
+ grpc_chttp2_settings_ack_create());
}
return GRPC_CHTTP2_PARSE_OK;
}
@@ -220,15 +224,16 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse(
}
if (parser->id == GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE &&
parser->incoming_settings[parser->id] != parser->value) {
- state->initial_window_update =
+ transport_parsing->initial_window_update =
(gpr_int64)parser->value -
parser->incoming_settings[parser->id];
gpr_log(GPR_DEBUG, "adding %d for initial_window change",
- (int)state->initial_window_update);
+ (int)transport_parsing->initial_window_update);
}
parser->incoming_settings[parser->id] = parser->value;
if (grpc_http_trace) {
- gpr_log(GPR_DEBUG, "CHTTP2: got setting %d = %d", parser->id,
+ gpr_log(GPR_DEBUG, "CHTTP2:%s: got setting %d = %d",
+ transport_parsing->is_client ? "CLI" : "SVR", parser->id,
parser->value);
}
} else {
diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h
index 18765631a6..0ac68a9fa8 100644
--- a/src/core/transport/chttp2/frame_settings.h
+++ b/src/core/transport/chttp2/frame_settings.h
@@ -94,6 +94,7 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_settings_parser *parser, gpr_uint32 length, gpr_uint8 flags,
gpr_uint32 *settings);
grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_SETTINGS_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_SETTINGS_H */
diff --git a/src/core/transport/chttp2/frame_window_update.c b/src/core/transport/chttp2/frame_window_update.c
index a8db7d6653..b817df7745 100644
--- a/src/core/transport/chttp2/frame_window_update.c
+++ b/src/core/transport/chttp2/frame_window_update.c
@@ -32,6 +32,7 @@
*/
#include "src/core/transport/chttp2/frame_window_update.h"
+#include "src/core/transport/chttp2/internal.h"
#include <grpc/support/log.h>
@@ -73,15 +74,15 @@ grpc_chttp2_parse_error grpc_chttp2_window_update_parser_begin_frame(
}
grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last) {
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
gpr_uint8 *const beg = GPR_SLICE_START_PTR(slice);
gpr_uint8 *const end = GPR_SLICE_END_PTR(slice);
gpr_uint8 *cur = beg;
grpc_chttp2_window_update_parser *p = parser;
while (p->byte != 4 && cur != end) {
- p->amount |= ((gpr_uint32) * cur) << (8 * (3 - p->byte));
+ p->amount |= ((gpr_uint32)*cur) << (8 * (3 - p->byte));
cur++;
p->byte++;
}
@@ -92,7 +93,21 @@ grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse(
return GRPC_CHTTP2_CONNECTION_ERROR;
}
GPR_ASSERT(is_last);
- state->window_update = p->amount;
+
+ if (transport_parsing->incoming_stream_id) {
+ if (stream_parsing) {
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM("update", transport_parsing,
+ stream_parsing, outgoing_window_update,
+ p->amount);
+ stream_parsing->outgoing_window_update += p->amount;
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing,
+ stream_parsing);
+ }
+ } else {
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT("update", transport_parsing,
+ outgoing_window_update, p->amount);
+ transport_parsing->outgoing_window_update += p->amount;
+ }
}
return GRPC_CHTTP2_PARSE_OK;
diff --git a/src/core/transport/chttp2/frame_window_update.h b/src/core/transport/chttp2/frame_window_update.h
index 85475a8f9e..deba801d00 100644
--- a/src/core/transport/chttp2/frame_window_update.h
+++ b/src/core/transport/chttp2/frame_window_update.h
@@ -50,6 +50,7 @@ grpc_chttp2_parse_error grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_window_update_parser *parser, gpr_uint32 length,
gpr_uint8 flags);
grpc_chttp2_parse_error grpc_chttp2_window_update_parser_parse(
- void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last);
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H */
diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c
index a489543868..b8ab664db5 100644
--- a/src/core/transport/chttp2/hpack_parser.c
+++ b/src/core/transport/chttp2/hpack_parser.c
@@ -32,6 +32,7 @@
*/
#include "src/core/transport/chttp2/hpack_parser.h"
+#include "src/core/transport/chttp2/internal.h"
#include <stddef.h>
#include <string.h>
@@ -149,10 +150,12 @@ typedef enum {
/* jump table of parse state functions -- order must match first_byte_type
above */
static const grpc_chttp2_hpack_parser_state first_byte_action[] = {
- parse_indexed_field, parse_indexed_field_x, parse_lithdr_incidx,
- parse_lithdr_incidx_x, parse_lithdr_incidx_v, parse_lithdr_notidx,
- parse_lithdr_notidx_x, parse_lithdr_notidx_v, parse_lithdr_nvridx,
- parse_lithdr_nvridx_x, parse_lithdr_nvridx_v, parse_max_tbl_size,
+ parse_indexed_field, parse_indexed_field_x,
+ parse_lithdr_incidx, parse_lithdr_incidx_x,
+ parse_lithdr_incidx_v, parse_lithdr_notidx,
+ parse_lithdr_notidx_x, parse_lithdr_notidx_v,
+ parse_lithdr_nvridx, parse_lithdr_nvridx_x,
+ parse_lithdr_nvridx_v, parse_max_tbl_size,
parse_max_tbl_size_x, parse_error};
/* indexes the first byte to a parse state function - generated by
@@ -221,7 +224,8 @@ static const gpr_uint8 first_byte_lut[256] = {
INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD_X, };
+ INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD_X,
+};
/* state table for huffman decoding: given a state, gives an index/16 into
next_sub_tbl. Taking that index and adding the value of the nibble being
@@ -241,7 +245,8 @@ static const gpr_uint8 next_tbl[256] = {
38, 1, 1, 1, 1, 1, 1, 1, 15, 2, 2, 2, 2, 26, 3, 3, 39, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 7, 3, 3, 3, 40, 2,
41, 1, 1, 1, 42, 43, 1, 1, 44, 1, 1, 1, 1, 15, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 45, 46, 1, 1, 2, 2, 2, 35, 3, 3, 18, 47, 2, };
+ 3, 3, 3, 45, 46, 1, 1, 2, 2, 2, 35, 3, 3, 18, 47, 2,
+};
/* next state, based upon current state and the current nibble: see above.
generated by gen_hpack_tables.c */
static const gpr_int16 next_sub_tbl[48 * 16] = {
@@ -296,7 +301,8 @@ static const gpr_int16 next_sub_tbl[48 * 16] = {
4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 245, 246, 247, 248, 249, 250, 251, 252,
253, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 255, };
+ 0, 0, 255,
+};
/* emission table: indexed like next_tbl, ultimately gives the byte to be
emitted, or -1 for no byte, or 256 for end of stream
@@ -319,7 +325,8 @@ static const gpr_uint16 emit_tbl[256] = {
204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218,
219, 220, 221, 0, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232,
233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
- 248, };
+ 248,
+};
/* generated by gen_hpack_tables.c */
static const gpr_int16 emit_sub_tbl[249 * 16] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -587,7 +594,8 @@ static const gpr_int16 emit_sub_tbl[249 * 16] = {
251, 251, 252, 252, 253, 253, 254, 254, 2, 3, 4, 5, 6, 7, 8,
11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27,
28, 29, 30, 31, 127, 220, 249, -1, 10, 10, 10, 10, 13, 13, 13,
- 13, 22, 22, 22, 22, 256, 256, 256, 256, };
+ 13, 22, 22, 22, 22, 256, 256, 256, 256,
+};
static const gpr_uint8 inverse_base64[256] = {
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
@@ -607,7 +615,8 @@ static const gpr_uint8 inverse_base64[256] = {
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, };
+ 255,
+};
/* emission helpers */
static void on_hdr(grpc_chttp2_hpack_parser *p, grpc_mdelem *md,
@@ -945,7 +954,7 @@ static int parse_value1(grpc_chttp2_hpack_parser *p, const gpr_uint8 *cur,
return 1;
}
- *p->parsing.value += (((gpr_uint32) * cur) & 0x7f) << 7;
+ *p->parsing.value += (((gpr_uint32)*cur) & 0x7f) << 7;
if ((*cur) & 0x80) {
return parse_value2(p, cur + 1, end);
@@ -963,7 +972,7 @@ static int parse_value2(grpc_chttp2_hpack_parser *p, const gpr_uint8 *cur,
return 1;
}
- *p->parsing.value += (((gpr_uint32) * cur) & 0x7f) << 14;
+ *p->parsing.value += (((gpr_uint32)*cur) & 0x7f) << 14;
if ((*cur) & 0x80) {
return parse_value3(p, cur + 1, end);
@@ -981,7 +990,7 @@ static int parse_value3(grpc_chttp2_hpack_parser *p, const gpr_uint8 *cur,
return 1;
}
- *p->parsing.value += (((gpr_uint32) * cur) & 0x7f) << 21;
+ *p->parsing.value += (((gpr_uint32)*cur) & 0x7f) << 21;
if ((*cur) & 0x80) {
return parse_value4(p, cur + 1, end);
@@ -1369,8 +1378,8 @@ int grpc_chttp2_hpack_parser_parse(grpc_chttp2_hpack_parser *p,
}
grpc_chttp2_parse_error grpc_chttp2_header_parser_parse(
- void *hpack_parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last) {
+ void *hpack_parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
grpc_chttp2_hpack_parser *parser = hpack_parser;
if (!grpc_chttp2_hpack_parser_parse(parser, GPR_SLICE_START_PTR(slice),
GPR_SLICE_END_PTR(slice))) {
@@ -1382,9 +1391,16 @@ grpc_chttp2_parse_error grpc_chttp2_header_parser_parse(
"end of header frame not aligned with a hpack record boundary");
return GRPC_CHTTP2_CONNECTION_ERROR;
}
- state->metadata_boundary = parser->is_boundary;
- state->end_of_stream = parser->is_eof;
- state->need_flush_reads = parser->is_eof;
+ if (parser->is_boundary) {
+ grpc_chttp2_incoming_metadata_buffer_place_metadata_batch_into(
+ &stream_parsing->incoming_metadata,
+ &stream_parsing->data_parser.incoming_sopb);
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing,
+ stream_parsing);
+ }
+ if (parser->is_eof) {
+ stream_parsing->received_close = 1;
+ }
parser->on_header = on_header_not_set;
parser->on_header_user_data = NULL;
parser->is_boundary = 0xde;
diff --git a/src/core/transport/chttp2/hpack_parser.h b/src/core/transport/chttp2/hpack_parser.h
index bfc06b3980..c1768d9d5d 100644
--- a/src/core/transport/chttp2/hpack_parser.h
+++ b/src/core/transport/chttp2/hpack_parser.h
@@ -107,7 +107,7 @@ int grpc_chttp2_hpack_parser_parse(grpc_chttp2_hpack_parser *p,
/* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for
the transport */
grpc_chttp2_parse_error grpc_chttp2_header_parser_parse(
- void *hpack_parser, grpc_chttp2_parse_state *state, gpr_slice slice,
- int is_last);
+ void *hpack_parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_PARSER_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_PARSER_H */
diff --git a/src/core/transport/chttp2/hpack_table.c b/src/core/transport/chttp2/hpack_table.c
index 2c0159260f..372e71d68f 100644
--- a/src/core/transport/chttp2/hpack_table.c
+++ b/src/core/transport/chttp2/hpack_table.c
@@ -43,68 +43,69 @@ static struct {
const char *key;
const char *value;
} static_table[] = {
- /* 0: */ {NULL, NULL},
- /* 1: */ {":authority", ""},
- /* 2: */ {":method", "GET"},
- /* 3: */ {":method", "POST"},
- /* 4: */ {":path", "/"},
- /* 5: */ {":path", "/index.html"},
- /* 6: */ {":scheme", "http"},
- /* 7: */ {":scheme", "https"},
- /* 8: */ {":status", "200"},
- /* 9: */ {":status", "204"},
- /* 10: */ {":status", "206"},
- /* 11: */ {":status", "304"},
- /* 12: */ {":status", "400"},
- /* 13: */ {":status", "404"},
- /* 14: */ {":status", "500"},
- /* 15: */ {"accept-charset", ""},
- /* 16: */ {"accept-encoding", "gzip, deflate"},
- /* 17: */ {"accept-language", ""},
- /* 18: */ {"accept-ranges", ""},
- /* 19: */ {"accept", ""},
- /* 20: */ {"access-control-allow-origin", ""},
- /* 21: */ {"age", ""},
- /* 22: */ {"allow", ""},
- /* 23: */ {"authorization", ""},
- /* 24: */ {"cache-control", ""},
- /* 25: */ {"content-disposition", ""},
- /* 26: */ {"content-encoding", ""},
- /* 27: */ {"content-language", ""},
- /* 28: */ {"content-length", ""},
- /* 29: */ {"content-location", ""},
- /* 30: */ {"content-range", ""},
- /* 31: */ {"content-type", ""},
- /* 32: */ {"cookie", ""},
- /* 33: */ {"date", ""},
- /* 34: */ {"etag", ""},
- /* 35: */ {"expect", ""},
- /* 36: */ {"expires", ""},
- /* 37: */ {"from", ""},
- /* 38: */ {"host", ""},
- /* 39: */ {"if-match", ""},
- /* 40: */ {"if-modified-since", ""},
- /* 41: */ {"if-none-match", ""},
- /* 42: */ {"if-range", ""},
- /* 43: */ {"if-unmodified-since", ""},
- /* 44: */ {"last-modified", ""},
- /* 45: */ {"link", ""},
- /* 46: */ {"location", ""},
- /* 47: */ {"max-forwards", ""},
- /* 48: */ {"proxy-authenticate", ""},
- /* 49: */ {"proxy-authorization", ""},
- /* 50: */ {"range", ""},
- /* 51: */ {"referer", ""},
- /* 52: */ {"refresh", ""},
- /* 53: */ {"retry-after", ""},
- /* 54: */ {"server", ""},
- /* 55: */ {"set-cookie", ""},
- /* 56: */ {"strict-transport-security", ""},
- /* 57: */ {"transfer-encoding", ""},
- /* 58: */ {"user-agent", ""},
- /* 59: */ {"vary", ""},
- /* 60: */ {"via", ""},
- /* 61: */ {"www-authenticate", ""}, };
+ /* 0: */ {NULL, NULL},
+ /* 1: */ {":authority", ""},
+ /* 2: */ {":method", "GET"},
+ /* 3: */ {":method", "POST"},
+ /* 4: */ {":path", "/"},
+ /* 5: */ {":path", "/index.html"},
+ /* 6: */ {":scheme", "http"},
+ /* 7: */ {":scheme", "https"},
+ /* 8: */ {":status", "200"},
+ /* 9: */ {":status", "204"},
+ /* 10: */ {":status", "206"},
+ /* 11: */ {":status", "304"},
+ /* 12: */ {":status", "400"},
+ /* 13: */ {":status", "404"},
+ /* 14: */ {":status", "500"},
+ /* 15: */ {"accept-charset", ""},
+ /* 16: */ {"accept-encoding", "gzip, deflate"},
+ /* 17: */ {"accept-language", ""},
+ /* 18: */ {"accept-ranges", ""},
+ /* 19: */ {"accept", ""},
+ /* 20: */ {"access-control-allow-origin", ""},
+ /* 21: */ {"age", ""},
+ /* 22: */ {"allow", ""},
+ /* 23: */ {"authorization", ""},
+ /* 24: */ {"cache-control", ""},
+ /* 25: */ {"content-disposition", ""},
+ /* 26: */ {"content-encoding", ""},
+ /* 27: */ {"content-language", ""},
+ /* 28: */ {"content-length", ""},
+ /* 29: */ {"content-location", ""},
+ /* 30: */ {"content-range", ""},
+ /* 31: */ {"content-type", ""},
+ /* 32: */ {"cookie", ""},
+ /* 33: */ {"date", ""},
+ /* 34: */ {"etag", ""},
+ /* 35: */ {"expect", ""},
+ /* 36: */ {"expires", ""},
+ /* 37: */ {"from", ""},
+ /* 38: */ {"host", ""},
+ /* 39: */ {"if-match", ""},
+ /* 40: */ {"if-modified-since", ""},
+ /* 41: */ {"if-none-match", ""},
+ /* 42: */ {"if-range", ""},
+ /* 43: */ {"if-unmodified-since", ""},
+ /* 44: */ {"last-modified", ""},
+ /* 45: */ {"link", ""},
+ /* 46: */ {"location", ""},
+ /* 47: */ {"max-forwards", ""},
+ /* 48: */ {"proxy-authenticate", ""},
+ /* 49: */ {"proxy-authorization", ""},
+ /* 50: */ {"range", ""},
+ /* 51: */ {"referer", ""},
+ /* 52: */ {"refresh", ""},
+ /* 53: */ {"retry-after", ""},
+ /* 54: */ {"server", ""},
+ /* 55: */ {"set-cookie", ""},
+ /* 56: */ {"strict-transport-security", ""},
+ /* 57: */ {"transfer-encoding", ""},
+ /* 58: */ {"user-agent", ""},
+ /* 59: */ {"vary", ""},
+ /* 60: */ {"via", ""},
+ /* 61: */ {"www-authenticate", ""},
+};
void grpc_chttp2_hptbl_init(grpc_chttp2_hptbl *tbl, grpc_mdctx *mdctx) {
size_t i;
diff --git a/src/core/transport/chttp2/hpack_table.h b/src/core/transport/chttp2/hpack_table.h
index d3bf41bbc5..4f882e2e03 100644
--- a/src/core/transport/chttp2/hpack_table.h
+++ b/src/core/transport/chttp2/hpack_table.h
@@ -94,4 +94,4 @@ typedef struct {
grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
const grpc_chttp2_hptbl *tbl, grpc_mdelem *md);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_TABLE_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HPACK_TABLE_H */
diff --git a/src/core/transport/chttp2/http2_errors.h b/src/core/transport/chttp2/http2_errors.h
index 4ab2ec0220..a4f309e056 100644
--- a/src/core/transport/chttp2/http2_errors.h
+++ b/src/core/transport/chttp2/http2_errors.h
@@ -53,4 +53,4 @@ typedef enum {
GRPC_CHTTP2__ERROR_DO_NOT_USE = -1
} grpc_chttp2_error_code;
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HTTP2_ERRORS_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HTTP2_ERRORS_H */
diff --git a/src/core/transport/chttp2/huffsyms.c b/src/core/transport/chttp2/huffsyms.c
index 0a926e7e35..6f5cf6a2a9 100644
--- a/src/core/transport/chttp2/huffsyms.c
+++ b/src/core/transport/chttp2/huffsyms.c
@@ -37,260 +37,69 @@
command:
:%s/.* \([0-9a-f]\+\) \[ *\([0-9]\+\)\]/{0x\1, \2},/g */
const grpc_chttp2_huffsym grpc_chttp2_huffsyms[GRPC_CHTTP2_NUM_HUFFSYMS] = {
- {0x1ff8, 13},
- {0x7fffd8, 23},
- {0xfffffe2, 28},
- {0xfffffe3, 28},
- {0xfffffe4, 28},
- {0xfffffe5, 28},
- {0xfffffe6, 28},
- {0xfffffe7, 28},
- {0xfffffe8, 28},
- {0xffffea, 24},
- {0x3ffffffc, 30},
- {0xfffffe9, 28},
- {0xfffffea, 28},
- {0x3ffffffd, 30},
- {0xfffffeb, 28},
- {0xfffffec, 28},
- {0xfffffed, 28},
- {0xfffffee, 28},
- {0xfffffef, 28},
- {0xffffff0, 28},
- {0xffffff1, 28},
- {0xffffff2, 28},
- {0x3ffffffe, 30},
- {0xffffff3, 28},
- {0xffffff4, 28},
- {0xffffff5, 28},
- {0xffffff6, 28},
- {0xffffff7, 28},
- {0xffffff8, 28},
- {0xffffff9, 28},
- {0xffffffa, 28},
- {0xffffffb, 28},
- {0x14, 6},
- {0x3f8, 10},
- {0x3f9, 10},
- {0xffa, 12},
- {0x1ff9, 13},
- {0x15, 6},
- {0xf8, 8},
- {0x7fa, 11},
- {0x3fa, 10},
- {0x3fb, 10},
- {0xf9, 8},
- {0x7fb, 11},
- {0xfa, 8},
- {0x16, 6},
- {0x17, 6},
- {0x18, 6},
- {0x0, 5},
- {0x1, 5},
- {0x2, 5},
- {0x19, 6},
- {0x1a, 6},
- {0x1b, 6},
- {0x1c, 6},
- {0x1d, 6},
- {0x1e, 6},
- {0x1f, 6},
- {0x5c, 7},
- {0xfb, 8},
- {0x7ffc, 15},
- {0x20, 6},
- {0xffb, 12},
- {0x3fc, 10},
- {0x1ffa, 13},
- {0x21, 6},
- {0x5d, 7},
- {0x5e, 7},
- {0x5f, 7},
- {0x60, 7},
- {0x61, 7},
- {0x62, 7},
- {0x63, 7},
- {0x64, 7},
- {0x65, 7},
- {0x66, 7},
- {0x67, 7},
- {0x68, 7},
- {0x69, 7},
- {0x6a, 7},
- {0x6b, 7},
- {0x6c, 7},
- {0x6d, 7},
- {0x6e, 7},
- {0x6f, 7},
- {0x70, 7},
- {0x71, 7},
- {0x72, 7},
- {0xfc, 8},
- {0x73, 7},
- {0xfd, 8},
- {0x1ffb, 13},
- {0x7fff0, 19},
- {0x1ffc, 13},
- {0x3ffc, 14},
- {0x22, 6},
- {0x7ffd, 15},
- {0x3, 5},
- {0x23, 6},
- {0x4, 5},
- {0x24, 6},
- {0x5, 5},
- {0x25, 6},
- {0x26, 6},
- {0x27, 6},
- {0x6, 5},
- {0x74, 7},
- {0x75, 7},
- {0x28, 6},
- {0x29, 6},
- {0x2a, 6},
- {0x7, 5},
- {0x2b, 6},
- {0x76, 7},
- {0x2c, 6},
- {0x8, 5},
- {0x9, 5},
- {0x2d, 6},
- {0x77, 7},
- {0x78, 7},
- {0x79, 7},
- {0x7a, 7},
- {0x7b, 7},
- {0x7ffe, 15},
- {0x7fc, 11},
- {0x3ffd, 14},
- {0x1ffd, 13},
- {0xffffffc, 28},
- {0xfffe6, 20},
- {0x3fffd2, 22},
- {0xfffe7, 20},
- {0xfffe8, 20},
- {0x3fffd3, 22},
- {0x3fffd4, 22},
- {0x3fffd5, 22},
- {0x7fffd9, 23},
- {0x3fffd6, 22},
- {0x7fffda, 23},
- {0x7fffdb, 23},
- {0x7fffdc, 23},
- {0x7fffdd, 23},
- {0x7fffde, 23},
- {0xffffeb, 24},
- {0x7fffdf, 23},
- {0xffffec, 24},
- {0xffffed, 24},
- {0x3fffd7, 22},
- {0x7fffe0, 23},
- {0xffffee, 24},
- {0x7fffe1, 23},
- {0x7fffe2, 23},
- {0x7fffe3, 23},
- {0x7fffe4, 23},
- {0x1fffdc, 21},
- {0x3fffd8, 22},
- {0x7fffe5, 23},
- {0x3fffd9, 22},
- {0x7fffe6, 23},
- {0x7fffe7, 23},
- {0xffffef, 24},
- {0x3fffda, 22},
- {0x1fffdd, 21},
- {0xfffe9, 20},
- {0x3fffdb, 22},
- {0x3fffdc, 22},
- {0x7fffe8, 23},
- {0x7fffe9, 23},
- {0x1fffde, 21},
- {0x7fffea, 23},
- {0x3fffdd, 22},
- {0x3fffde, 22},
- {0xfffff0, 24},
- {0x1fffdf, 21},
- {0x3fffdf, 22},
- {0x7fffeb, 23},
- {0x7fffec, 23},
- {0x1fffe0, 21},
- {0x1fffe1, 21},
- {0x3fffe0, 22},
- {0x1fffe2, 21},
- {0x7fffed, 23},
- {0x3fffe1, 22},
- {0x7fffee, 23},
- {0x7fffef, 23},
- {0xfffea, 20},
- {0x3fffe2, 22},
- {0x3fffe3, 22},
- {0x3fffe4, 22},
- {0x7ffff0, 23},
- {0x3fffe5, 22},
- {0x3fffe6, 22},
- {0x7ffff1, 23},
- {0x3ffffe0, 26},
- {0x3ffffe1, 26},
- {0xfffeb, 20},
- {0x7fff1, 19},
- {0x3fffe7, 22},
- {0x7ffff2, 23},
- {0x3fffe8, 22},
- {0x1ffffec, 25},
- {0x3ffffe2, 26},
- {0x3ffffe3, 26},
- {0x3ffffe4, 26},
- {0x7ffffde, 27},
- {0x7ffffdf, 27},
- {0x3ffffe5, 26},
- {0xfffff1, 24},
- {0x1ffffed, 25},
- {0x7fff2, 19},
- {0x1fffe3, 21},
- {0x3ffffe6, 26},
- {0x7ffffe0, 27},
- {0x7ffffe1, 27},
- {0x3ffffe7, 26},
- {0x7ffffe2, 27},
- {0xfffff2, 24},
- {0x1fffe4, 21},
- {0x1fffe5, 21},
- {0x3ffffe8, 26},
- {0x3ffffe9, 26},
- {0xffffffd, 28},
- {0x7ffffe3, 27},
- {0x7ffffe4, 27},
- {0x7ffffe5, 27},
- {0xfffec, 20},
- {0xfffff3, 24},
- {0xfffed, 20},
- {0x1fffe6, 21},
- {0x3fffe9, 22},
- {0x1fffe7, 21},
- {0x1fffe8, 21},
- {0x7ffff3, 23},
- {0x3fffea, 22},
- {0x3fffeb, 22},
- {0x1ffffee, 25},
- {0x1ffffef, 25},
- {0xfffff4, 24},
- {0xfffff5, 24},
- {0x3ffffea, 26},
- {0x7ffff4, 23},
- {0x3ffffeb, 26},
- {0x7ffffe6, 27},
- {0x3ffffec, 26},
- {0x3ffffed, 26},
- {0x7ffffe7, 27},
- {0x7ffffe8, 27},
- {0x7ffffe9, 27},
- {0x7ffffea, 27},
- {0x7ffffeb, 27},
- {0xffffffe, 28},
- {0x7ffffec, 27},
- {0x7ffffed, 27},
- {0x7ffffee, 27},
- {0x7ffffef, 27},
- {0x7fffff0, 27},
- {0x3ffffee, 26},
- {0x3fffffff, 30}, };
+ {0x1ff8, 13}, {0x7fffd8, 23}, {0xfffffe2, 28}, {0xfffffe3, 28},
+ {0xfffffe4, 28}, {0xfffffe5, 28}, {0xfffffe6, 28}, {0xfffffe7, 28},
+ {0xfffffe8, 28}, {0xffffea, 24}, {0x3ffffffc, 30}, {0xfffffe9, 28},
+ {0xfffffea, 28}, {0x3ffffffd, 30}, {0xfffffeb, 28}, {0xfffffec, 28},
+ {0xfffffed, 28}, {0xfffffee, 28}, {0xfffffef, 28}, {0xffffff0, 28},
+ {0xffffff1, 28}, {0xffffff2, 28}, {0x3ffffffe, 30}, {0xffffff3, 28},
+ {0xffffff4, 28}, {0xffffff5, 28}, {0xffffff6, 28}, {0xffffff7, 28},
+ {0xffffff8, 28}, {0xffffff9, 28}, {0xffffffa, 28}, {0xffffffb, 28},
+ {0x14, 6}, {0x3f8, 10}, {0x3f9, 10}, {0xffa, 12},
+ {0x1ff9, 13}, {0x15, 6}, {0xf8, 8}, {0x7fa, 11},
+ {0x3fa, 10}, {0x3fb, 10}, {0xf9, 8}, {0x7fb, 11},
+ {0xfa, 8}, {0x16, 6}, {0x17, 6}, {0x18, 6},
+ {0x0, 5}, {0x1, 5}, {0x2, 5}, {0x19, 6},
+ {0x1a, 6}, {0x1b, 6}, {0x1c, 6}, {0x1d, 6},
+ {0x1e, 6}, {0x1f, 6}, {0x5c, 7}, {0xfb, 8},
+ {0x7ffc, 15}, {0x20, 6}, {0xffb, 12}, {0x3fc, 10},
+ {0x1ffa, 13}, {0x21, 6}, {0x5d, 7}, {0x5e, 7},
+ {0x5f, 7}, {0x60, 7}, {0x61, 7}, {0x62, 7},
+ {0x63, 7}, {0x64, 7}, {0x65, 7}, {0x66, 7},
+ {0x67, 7}, {0x68, 7}, {0x69, 7}, {0x6a, 7},
+ {0x6b, 7}, {0x6c, 7}, {0x6d, 7}, {0x6e, 7},
+ {0x6f, 7}, {0x70, 7}, {0x71, 7}, {0x72, 7},
+ {0xfc, 8}, {0x73, 7}, {0xfd, 8}, {0x1ffb, 13},
+ {0x7fff0, 19}, {0x1ffc, 13}, {0x3ffc, 14}, {0x22, 6},
+ {0x7ffd, 15}, {0x3, 5}, {0x23, 6}, {0x4, 5},
+ {0x24, 6}, {0x5, 5}, {0x25, 6}, {0x26, 6},
+ {0x27, 6}, {0x6, 5}, {0x74, 7}, {0x75, 7},
+ {0x28, 6}, {0x29, 6}, {0x2a, 6}, {0x7, 5},
+ {0x2b, 6}, {0x76, 7}, {0x2c, 6}, {0x8, 5},
+ {0x9, 5}, {0x2d, 6}, {0x77, 7}, {0x78, 7},
+ {0x79, 7}, {0x7a, 7}, {0x7b, 7}, {0x7ffe, 15},
+ {0x7fc, 11}, {0x3ffd, 14}, {0x1ffd, 13}, {0xffffffc, 28},
+ {0xfffe6, 20}, {0x3fffd2, 22}, {0xfffe7, 20}, {0xfffe8, 20},
+ {0x3fffd3, 22}, {0x3fffd4, 22}, {0x3fffd5, 22}, {0x7fffd9, 23},
+ {0x3fffd6, 22}, {0x7fffda, 23}, {0x7fffdb, 23}, {0x7fffdc, 23},
+ {0x7fffdd, 23}, {0x7fffde, 23}, {0xffffeb, 24}, {0x7fffdf, 23},
+ {0xffffec, 24}, {0xffffed, 24}, {0x3fffd7, 22}, {0x7fffe0, 23},
+ {0xffffee, 24}, {0x7fffe1, 23}, {0x7fffe2, 23}, {0x7fffe3, 23},
+ {0x7fffe4, 23}, {0x1fffdc, 21}, {0x3fffd8, 22}, {0x7fffe5, 23},
+ {0x3fffd9, 22}, {0x7fffe6, 23}, {0x7fffe7, 23}, {0xffffef, 24},
+ {0x3fffda, 22}, {0x1fffdd, 21}, {0xfffe9, 20}, {0x3fffdb, 22},
+ {0x3fffdc, 22}, {0x7fffe8, 23}, {0x7fffe9, 23}, {0x1fffde, 21},
+ {0x7fffea, 23}, {0x3fffdd, 22}, {0x3fffde, 22}, {0xfffff0, 24},
+ {0x1fffdf, 21}, {0x3fffdf, 22}, {0x7fffeb, 23}, {0x7fffec, 23},
+ {0x1fffe0, 21}, {0x1fffe1, 21}, {0x3fffe0, 22}, {0x1fffe2, 21},
+ {0x7fffed, 23}, {0x3fffe1, 22}, {0x7fffee, 23}, {0x7fffef, 23},
+ {0xfffea, 20}, {0x3fffe2, 22}, {0x3fffe3, 22}, {0x3fffe4, 22},
+ {0x7ffff0, 23}, {0x3fffe5, 22}, {0x3fffe6, 22}, {0x7ffff1, 23},
+ {0x3ffffe0, 26}, {0x3ffffe1, 26}, {0xfffeb, 20}, {0x7fff1, 19},
+ {0x3fffe7, 22}, {0x7ffff2, 23}, {0x3fffe8, 22}, {0x1ffffec, 25},
+ {0x3ffffe2, 26}, {0x3ffffe3, 26}, {0x3ffffe4, 26}, {0x7ffffde, 27},
+ {0x7ffffdf, 27}, {0x3ffffe5, 26}, {0xfffff1, 24}, {0x1ffffed, 25},
+ {0x7fff2, 19}, {0x1fffe3, 21}, {0x3ffffe6, 26}, {0x7ffffe0, 27},
+ {0x7ffffe1, 27}, {0x3ffffe7, 26}, {0x7ffffe2, 27}, {0xfffff2, 24},
+ {0x1fffe4, 21}, {0x1fffe5, 21}, {0x3ffffe8, 26}, {0x3ffffe9, 26},
+ {0xffffffd, 28}, {0x7ffffe3, 27}, {0x7ffffe4, 27}, {0x7ffffe5, 27},
+ {0xfffec, 20}, {0xfffff3, 24}, {0xfffed, 20}, {0x1fffe6, 21},
+ {0x3fffe9, 22}, {0x1fffe7, 21}, {0x1fffe8, 21}, {0x7ffff3, 23},
+ {0x3fffea, 22}, {0x3fffeb, 22}, {0x1ffffee, 25}, {0x1ffffef, 25},
+ {0xfffff4, 24}, {0xfffff5, 24}, {0x3ffffea, 26}, {0x7ffff4, 23},
+ {0x3ffffeb, 26}, {0x7ffffe6, 27}, {0x3ffffec, 26}, {0x3ffffed, 26},
+ {0x7ffffe7, 27}, {0x7ffffe8, 27}, {0x7ffffe9, 27}, {0x7ffffea, 27},
+ {0x7ffffeb, 27}, {0xffffffe, 28}, {0x7ffffec, 27}, {0x7ffffed, 27},
+ {0x7ffffee, 27}, {0x7ffffef, 27}, {0x7fffff0, 27}, {0x3ffffee, 26},
+ {0x3fffffff, 30},
+};
diff --git a/src/core/transport/chttp2/huffsyms.h b/src/core/transport/chttp2/huffsyms.h
index f9c1447966..a3cdba8235 100644
--- a/src/core/transport/chttp2/huffsyms.h
+++ b/src/core/transport/chttp2/huffsyms.h
@@ -45,4 +45,4 @@ typedef struct {
extern const grpc_chttp2_huffsym grpc_chttp2_huffsyms[GRPC_CHTTP2_NUM_HUFFSYMS];
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HUFFSYMS_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_HUFFSYMS_H */
diff --git a/src/core/transport/chttp2/incoming_metadata.c b/src/core/transport/chttp2/incoming_metadata.c
new file mode 100644
index 0000000000..a4b7174329
--- /dev/null
+++ b/src/core/transport/chttp2/incoming_metadata.c
@@ -0,0 +1,181 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/transport/chttp2/incoming_metadata.h"
+
+#include <string.h>
+
+#include "src/core/transport/chttp2/internal.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+void grpc_chttp2_incoming_metadata_buffer_init(
+ grpc_chttp2_incoming_metadata_buffer *buffer) {
+ buffer->deadline = gpr_inf_future;
+}
+
+void grpc_chttp2_incoming_metadata_buffer_destroy(
+ grpc_chttp2_incoming_metadata_buffer *buffer) {
+ size_t i;
+ for (i = 0; i < buffer->count; i++) {
+ grpc_mdelem_unref(buffer->elems[i].md);
+ }
+ gpr_free(buffer->elems);
+}
+
+void grpc_chttp2_incoming_metadata_buffer_add(
+ grpc_chttp2_incoming_metadata_buffer *buffer, grpc_mdelem *elem) {
+ if (buffer->capacity == buffer->count) {
+ buffer->capacity = GPR_MAX(8, 2 * buffer->capacity);
+ buffer->elems =
+ gpr_realloc(buffer->elems, sizeof(*buffer->elems) * buffer->capacity);
+ }
+ buffer->elems[buffer->count++].md = elem;
+}
+
+void grpc_chttp2_incoming_metadata_buffer_set_deadline(
+ grpc_chttp2_incoming_metadata_buffer *buffer, gpr_timespec deadline) {
+ buffer->deadline = deadline;
+}
+
+void grpc_chttp2_incoming_metadata_live_op_buffer_end(
+ grpc_chttp2_incoming_metadata_live_op_buffer *buffer) {
+ gpr_free(buffer->elems);
+ buffer->elems = NULL;
+}
+
+void grpc_chttp2_incoming_metadata_buffer_place_metadata_batch_into(
+ grpc_chttp2_incoming_metadata_buffer *buffer, grpc_stream_op_buffer *sopb) {
+ grpc_metadata_batch b;
+
+ b.list.head = NULL;
+ /* Store away the last element of the list, so that in patch_metadata_ops
+ we can reconstitute the list.
+ We can't do list building here as later incoming metadata may reallocate
+ the underlying array. */
+ b.list.tail = (void *)(gpr_intptr)buffer->count;
+ b.garbage.head = b.garbage.tail = NULL;
+ b.deadline = buffer->deadline;
+ buffer->deadline = gpr_inf_future;
+
+ grpc_sopb_add_metadata(sopb, b);
+}
+
+void grpc_chttp2_incoming_metadata_buffer_swap(
+ grpc_chttp2_incoming_metadata_buffer *a,
+ grpc_chttp2_incoming_metadata_buffer *b) {
+ GPR_SWAP(grpc_chttp2_incoming_metadata_buffer, *a, *b);
+}
+
+void grpc_incoming_metadata_buffer_move_to_referencing_sopb(
+ grpc_chttp2_incoming_metadata_buffer *src,
+ grpc_chttp2_incoming_metadata_buffer *dst, grpc_stream_op_buffer *sopb) {
+ size_t delta;
+ size_t i;
+ dst->deadline = gpr_time_min(src->deadline, dst->deadline);
+
+ if (src->count == 0) {
+ return;
+ }
+ if (dst->count == 0) {
+ grpc_chttp2_incoming_metadata_buffer_swap(src, dst);
+ return;
+ }
+ delta = dst->count;
+ if (dst->capacity < src->count + dst->count) {
+ dst->capacity = GPR_MAX(dst->capacity * 2, src->count + dst->count);
+ dst->elems = gpr_realloc(dst->elems, dst->capacity * sizeof(*dst->elems));
+ }
+ memcpy(dst->elems + dst->count, src->elems, src->count * sizeof(*src->elems));
+ dst->count += src->count;
+ for (i = 0; i < sopb->nops; i++) {
+ if (sopb->ops[i].type != GRPC_OP_METADATA) continue;
+ sopb->ops[i].data.metadata.list.tail =
+ (void *)(delta + (gpr_intptr)sopb->ops[i].data.metadata.list.tail);
+ }
+}
+
+void grpc_chttp2_incoming_metadata_buffer_postprocess_sopb_and_begin_live_op(
+ grpc_chttp2_incoming_metadata_buffer *buffer, grpc_stream_op_buffer *sopb,
+ grpc_chttp2_incoming_metadata_live_op_buffer *live_op_buffer) {
+ grpc_stream_op *ops = sopb->ops;
+ size_t nops = sopb->nops;
+ size_t i;
+ size_t j;
+ size_t mdidx = 0;
+ size_t last_mdidx;
+ int found_metadata = 0;
+
+ /* rework the array of metadata into a linked list, making use
+ of the breadcrumbs we left in metadata batches during
+ add_metadata_batch */
+ for (i = 0; i < nops; i++) {
+ grpc_stream_op *op = &ops[i];
+ if (op->type != GRPC_OP_METADATA) continue;
+ found_metadata = 1;
+ /* we left a breadcrumb indicating where the end of this list is,
+ and since we add sequentially, we know from the end of the last
+ segment where this segment begins */
+ last_mdidx = (size_t)(gpr_intptr)(op->data.metadata.list.tail);
+ GPR_ASSERT(last_mdidx > mdidx);
+ GPR_ASSERT(last_mdidx <= buffer->count);
+ /* turn the array into a doubly linked list */
+ op->data.metadata.list.head = &buffer->elems[mdidx];
+ op->data.metadata.list.tail = &buffer->elems[last_mdidx - 1];
+ for (j = mdidx + 1; j < last_mdidx; j++) {
+ buffer->elems[j].prev = &buffer->elems[j - 1];
+ buffer->elems[j - 1].next = &buffer->elems[j];
+ }
+ buffer->elems[mdidx].prev = NULL;
+ buffer->elems[last_mdidx - 1].next = NULL;
+ /* track where we're up to */
+ mdidx = last_mdidx;
+ }
+ if (found_metadata) {
+ live_op_buffer->elems = buffer->elems;
+ if (mdidx != buffer->count) {
+ /* we have a partially read metadata batch still in incoming_metadata */
+ size_t new_count = buffer->count - mdidx;
+ size_t copy_bytes = sizeof(*buffer->elems) * new_count;
+ GPR_ASSERT(mdidx < buffer->count);
+ buffer->elems = gpr_malloc(copy_bytes);
+ memcpy(live_op_buffer->elems + mdidx, buffer->elems, copy_bytes);
+ buffer->count = buffer->capacity = new_count;
+ } else {
+ buffer->elems = NULL;
+ buffer->count = 0;
+ buffer->capacity = 0;
+ }
+ }
+}
diff --git a/src/core/transport/chttp2/incoming_metadata.h b/src/core/transport/chttp2/incoming_metadata.h
new file mode 100644
index 0000000000..2f1de411ba
--- /dev/null
+++ b/src/core/transport/chttp2/incoming_metadata.h
@@ -0,0 +1,80 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CORE_CHTTP2_INCOMING_METADATA_H
+#define GRPC_INTERNAL_CORE_CHTTP2_INCOMING_METADATA_H
+
+#include "src/core/transport/transport.h"
+
+typedef struct {
+ grpc_linked_mdelem *elems;
+ size_t count;
+ size_t capacity;
+ gpr_timespec deadline;
+} grpc_chttp2_incoming_metadata_buffer;
+
+typedef struct {
+ grpc_linked_mdelem *elems;
+} grpc_chttp2_incoming_metadata_live_op_buffer;
+
+/** assumes everything initially zeroed */
+void grpc_chttp2_incoming_metadata_buffer_init(
+ grpc_chttp2_incoming_metadata_buffer *buffer);
+void grpc_chttp2_incoming_metadata_buffer_destroy(
+ grpc_chttp2_incoming_metadata_buffer *buffer);
+void grpc_chttp2_incoming_metadata_buffer_reset(
+ grpc_chttp2_incoming_metadata_buffer *buffer);
+
+void grpc_chttp2_incoming_metadata_buffer_add(
+ grpc_chttp2_incoming_metadata_buffer *buffer, grpc_mdelem *elem);
+void grpc_chttp2_incoming_metadata_buffer_set_deadline(
+ grpc_chttp2_incoming_metadata_buffer *buffer, gpr_timespec deadline);
+
+/** extend sopb with a metadata batch; this must be post-processed by
+ grpc_chttp2_incoming_metadata_buffer_postprocess_sopb before being handed
+ out of the transport */
+void grpc_chttp2_incoming_metadata_buffer_place_metadata_batch_into(
+ grpc_chttp2_incoming_metadata_buffer *buffer, grpc_stream_op_buffer *sopb);
+
+void grpc_incoming_metadata_buffer_move_to_referencing_sopb(
+ grpc_chttp2_incoming_metadata_buffer *src,
+ grpc_chttp2_incoming_metadata_buffer *dst, grpc_stream_op_buffer *sopb);
+
+void grpc_chttp2_incoming_metadata_buffer_postprocess_sopb_and_begin_live_op(
+ grpc_chttp2_incoming_metadata_buffer *buffer, grpc_stream_op_buffer *sopb,
+ grpc_chttp2_incoming_metadata_live_op_buffer *live_op_buffer);
+
+void grpc_chttp2_incoming_metadata_live_op_buffer_end(
+ grpc_chttp2_incoming_metadata_live_op_buffer *live_op_buffer);
+
+#endif /* GRPC_INTERNAL_CORE_CHTTP2_INCOMING_METADATA_H */
diff --git a/src/core/transport/chttp2/internal.h b/src/core/transport/chttp2/internal.h
new file mode 100644
index 0000000000..02c94744ee
--- /dev/null
+++ b/src/core/transport/chttp2/internal.h
@@ -0,0 +1,609 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H
+#define GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H
+
+#include "src/core/transport/transport_impl.h"
+#include "src/core/iomgr/endpoint.h"
+#include "src/core/transport/chttp2/frame.h"
+#include "src/core/transport/chttp2/frame_data.h"
+#include "src/core/transport/chttp2/frame_goaway.h"
+#include "src/core/transport/chttp2/frame_ping.h"
+#include "src/core/transport/chttp2/frame_rst_stream.h"
+#include "src/core/transport/chttp2/frame_settings.h"
+#include "src/core/transport/chttp2/frame_window_update.h"
+#include "src/core/transport/chttp2/hpack_parser.h"
+#include "src/core/transport/chttp2/incoming_metadata.h"
+#include "src/core/transport/chttp2/stream_encoder.h"
+#include "src/core/transport/chttp2/stream_map.h"
+
+typedef struct grpc_chttp2_transport grpc_chttp2_transport;
+typedef struct grpc_chttp2_stream grpc_chttp2_stream;
+
+/* streams are kept in various linked lists depending on what things need to
+ happen to them... this enum labels each list */
+typedef enum {
+ GRPC_CHTTP2_LIST_ALL_STREAMS,
+ GRPC_CHTTP2_LIST_READ_WRITE_STATE_CHANGED,
+ GRPC_CHTTP2_LIST_WRITABLE,
+ GRPC_CHTTP2_LIST_WRITING,
+ GRPC_CHTTP2_LIST_WRITTEN,
+ GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE,
+ GRPC_CHTTP2_LIST_PARSING_SEEN,
+ GRPC_CHTTP2_LIST_CLOSED_WAITING_FOR_PARSING,
+ GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED,
+ /** streams that are waiting to start because there are too many concurrent
+ streams on the connection */
+ GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY,
+ STREAM_LIST_COUNT /* must be last */
+} grpc_chttp2_stream_list_id;
+
+/* deframer state for the overall http2 stream of bytes */
+typedef enum {
+ /* prefix: one entry per http2 connection prefix byte */
+ GRPC_DTS_CLIENT_PREFIX_0 = 0,
+ GRPC_DTS_CLIENT_PREFIX_1,
+ GRPC_DTS_CLIENT_PREFIX_2,
+ GRPC_DTS_CLIENT_PREFIX_3,
+ GRPC_DTS_CLIENT_PREFIX_4,
+ GRPC_DTS_CLIENT_PREFIX_5,
+ GRPC_DTS_CLIENT_PREFIX_6,
+ GRPC_DTS_CLIENT_PREFIX_7,
+ GRPC_DTS_CLIENT_PREFIX_8,
+ GRPC_DTS_CLIENT_PREFIX_9,
+ GRPC_DTS_CLIENT_PREFIX_10,
+ GRPC_DTS_CLIENT_PREFIX_11,
+ GRPC_DTS_CLIENT_PREFIX_12,
+ GRPC_DTS_CLIENT_PREFIX_13,
+ GRPC_DTS_CLIENT_PREFIX_14,
+ GRPC_DTS_CLIENT_PREFIX_15,
+ GRPC_DTS_CLIENT_PREFIX_16,
+ GRPC_DTS_CLIENT_PREFIX_17,
+ GRPC_DTS_CLIENT_PREFIX_18,
+ GRPC_DTS_CLIENT_PREFIX_19,
+ GRPC_DTS_CLIENT_PREFIX_20,
+ GRPC_DTS_CLIENT_PREFIX_21,
+ GRPC_DTS_CLIENT_PREFIX_22,
+ GRPC_DTS_CLIENT_PREFIX_23,
+ /* frame header byte 0... */
+ /* must follow from the prefix states */
+ GRPC_DTS_FH_0,
+ GRPC_DTS_FH_1,
+ GRPC_DTS_FH_2,
+ GRPC_DTS_FH_3,
+ GRPC_DTS_FH_4,
+ GRPC_DTS_FH_5,
+ GRPC_DTS_FH_6,
+ GRPC_DTS_FH_7,
+ /* ... frame header byte 8 */
+ GRPC_DTS_FH_8,
+ /* inside a http2 frame */
+ GRPC_DTS_FRAME
+} grpc_chttp2_deframe_transport_state;
+
+typedef enum {
+ GRPC_WRITE_STATE_OPEN,
+ GRPC_WRITE_STATE_QUEUED_CLOSE,
+ GRPC_WRITE_STATE_SENT_CLOSE
+} grpc_chttp2_write_state;
+
+typedef enum {
+ GRPC_DONT_SEND_CLOSED = 0,
+ GRPC_SEND_CLOSED,
+ GRPC_SEND_CLOSED_WITH_RST_STREAM
+} grpc_chttp2_send_closed;
+
+typedef struct {
+ grpc_chttp2_stream *head;
+ grpc_chttp2_stream *tail;
+} grpc_chttp2_stream_list;
+
+typedef struct {
+ grpc_chttp2_stream *next;
+ grpc_chttp2_stream *prev;
+} grpc_chttp2_stream_link;
+
+typedef enum {
+ GRPC_CHTTP2_ERROR_STATE_NONE,
+ GRPC_CHTTP2_ERROR_STATE_SEEN,
+ GRPC_CHTTP2_ERROR_STATE_NOTIFIED
+} grpc_chttp2_error_state;
+
+/* We keep several sets of connection wide parameters */
+typedef enum {
+ /* The settings our peer has asked for (and we have acked) */
+ GRPC_PEER_SETTINGS = 0,
+ /* The settings we'd like to have */
+ GRPC_LOCAL_SETTINGS,
+ /* The settings we've published to our peer */
+ GRPC_SENT_SETTINGS,
+ /* The settings the peer has acked */
+ GRPC_ACKED_SETTINGS,
+ GRPC_NUM_SETTING_SETS
+} grpc_chttp2_setting_set;
+
+/* Outstanding ping request data */
+typedef struct grpc_chttp2_outstanding_ping {
+ gpr_uint8 id[8];
+ grpc_iomgr_closure *on_recv;
+ struct grpc_chttp2_outstanding_ping *next;
+ struct grpc_chttp2_outstanding_ping *prev;
+} grpc_chttp2_outstanding_ping;
+
+typedef struct {
+ /** data to write next write */
+ gpr_slice_buffer qbuf;
+ /** queued callbacks */
+ grpc_iomgr_closure *pending_closures;
+
+ /** window available for us to send to peer */
+ gpr_uint32 outgoing_window;
+ /** window available for peer to send to us - updated after parse */
+ gpr_uint32 incoming_window;
+ /** how much window would we like to have for incoming_window */
+ gpr_uint32 connection_window_target;
+
+ /** is this transport a client? */
+ gpr_uint8 is_client;
+ /** are the local settings dirty and need to be sent? */
+ gpr_uint8 dirtied_local_settings;
+ /** have local settings been sent? */
+ gpr_uint8 sent_local_settings;
+ /** bitmask of setting indexes to send out */
+ gpr_uint32 force_send_settings;
+ /** settings values */
+ gpr_uint32 settings[GRPC_NUM_SETTING_SETS][GRPC_CHTTP2_NUM_SETTINGS];
+
+ /** has there been a connection level error, and have we notified
+ anyone about it? */
+ grpc_chttp2_error_state error_state;
+
+ /** what is the next stream id to be allocated by this peer?
+ copied to next_stream_id in parsing when parsing commences */
+ gpr_uint32 next_stream_id;
+
+ /** last received stream id */
+ gpr_uint32 last_incoming_stream_id;
+
+ /** pings awaiting responses */
+ grpc_chttp2_outstanding_ping pings;
+ /** next payload for an outgoing ping */
+ gpr_uint64 ping_counter;
+
+ /** concurrent stream count: updated when not parsing,
+ so this is a strict over-estimation on the client */
+ gpr_uint32 concurrent_stream_count;
+
+ /** is there a goaway available? (boolean) */
+ grpc_chttp2_error_state goaway_state;
+ /** what is the debug text of the goaway? */
+ gpr_slice goaway_text;
+ /** what is the status code of the goaway? */
+ grpc_status_code goaway_error;
+} grpc_chttp2_transport_global;
+
+typedef struct {
+ /** data to write now */
+ gpr_slice_buffer outbuf;
+ /** hpack encoding */
+ grpc_chttp2_hpack_compressor hpack_compressor;
+ /** is this a client? */
+ gpr_uint8 is_client;
+} grpc_chttp2_transport_writing;
+
+struct grpc_chttp2_transport_parsing {
+ /** is this transport a client? (boolean) */
+ gpr_uint8 is_client;
+
+ /** were settings updated? */
+ gpr_uint8 settings_updated;
+ /** was a settings ack received? */
+ gpr_uint8 settings_ack_received;
+ /** was a goaway frame received? */
+ gpr_uint8 goaway_received;
+
+ /** initial window change */
+ gpr_int64 initial_window_update;
+
+ /** data to write later - after parsing */
+ gpr_slice_buffer qbuf;
+ /* metadata object cache */
+ grpc_mdstr *str_grpc_timeout;
+ /** parser for headers */
+ grpc_chttp2_hpack_parser hpack_parser;
+ /** simple one shot parsers */
+ union {
+ grpc_chttp2_window_update_parser window_update;
+ grpc_chttp2_settings_parser settings;
+ grpc_chttp2_ping_parser ping;
+ grpc_chttp2_rst_stream_parser rst_stream;
+ } simple;
+ /** parser for goaway frames */
+ grpc_chttp2_goaway_parser goaway_parser;
+
+ /** window available for peer to send to us */
+ gpr_uint32 incoming_window;
+ gpr_uint32 incoming_window_delta;
+
+ /** next stream id available at the time of beginning parsing */
+ gpr_uint32 next_stream_id;
+ gpr_uint32 last_incoming_stream_id;
+
+ /* deframing */
+ grpc_chttp2_deframe_transport_state deframe_state;
+ gpr_uint8 incoming_frame_type;
+ gpr_uint8 incoming_frame_flags;
+ gpr_uint8 header_eof;
+ gpr_uint32 expect_continuation_stream_id;
+ gpr_uint32 incoming_frame_size;
+ gpr_uint32 incoming_stream_id;
+
+ /* active parser */
+ void *parser_data;
+ grpc_chttp2_stream_parsing *incoming_stream;
+ grpc_chttp2_parse_error (*parser)(
+ void *parser_user_data, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last);
+
+ /* received settings */
+ gpr_uint32 settings[GRPC_CHTTP2_NUM_SETTINGS];
+
+ /* goaway data */
+ grpc_status_code goaway_error;
+ gpr_uint32 goaway_last_stream_index;
+ gpr_slice goaway_text;
+
+ gpr_uint64 outgoing_window_update;
+
+ /** pings awaiting responses */
+ grpc_chttp2_outstanding_ping pings;
+};
+
+struct grpc_chttp2_transport {
+ grpc_transport base; /* must be first */
+ grpc_endpoint *ep;
+ grpc_mdctx *metadata_context;
+ gpr_refcount refs;
+
+ gpr_mu mu;
+
+ /** is the transport destroying itself? */
+ gpr_uint8 destroying;
+ /** has the upper layer closed the transport? */
+ gpr_uint8 closed;
+
+ /** is a thread currently writing */
+ gpr_uint8 writing_active;
+ /** is a thread currently parsing */
+ gpr_uint8 parsing_active;
+
+ /** is there a read request to the endpoint outstanding? */
+ gpr_uint8 endpoint_reading;
+
+ /** various lists of streams */
+ grpc_chttp2_stream_list lists[STREAM_LIST_COUNT];
+
+ /** global state for reading/writing */
+ grpc_chttp2_transport_global global;
+ /** state only accessible by the chain of execution that
+ set writing_active=1 */
+ grpc_chttp2_transport_writing writing;
+ /** state only accessible by the chain of execution that
+ set parsing_active=1 */
+ grpc_chttp2_transport_parsing parsing;
+
+ /** maps stream id to grpc_chttp2_stream objects;
+ owned by the parsing thread when parsing */
+ grpc_chttp2_stream_map parsing_stream_map;
+
+ /** streams created by the client (possibly during parsing);
+ merged with parsing_stream_map during unlock when no
+ parsing is occurring */
+ grpc_chttp2_stream_map new_stream_map;
+
+ /** closure to execute writing */
+ grpc_iomgr_closure writing_action;
+ /** closure to start reading from the endpoint */
+ grpc_iomgr_closure reading_action;
+
+ /** address to place a newly accepted stream - set and unset by
+ grpc_chttp2_parsing_accept_stream; used by init_stream to
+ publish the accepted server stream */
+ grpc_chttp2_stream **accepting_stream;
+
+ struct {
+ /** is a thread currently performing channel callbacks */
+ gpr_uint8 executing;
+ /** transport channel-level callback */
+ const grpc_transport_callbacks *cb;
+ /** user data for cb calls */
+ void *cb_user_data;
+ /** closure for notifying transport closure */
+ grpc_iomgr_closure notify_closed;
+ } channel_callback;
+};
+
+typedef struct {
+ /** HTTP2 stream id for this stream, or zero if one has not been assigned */
+ gpr_uint32 id;
+
+ grpc_iomgr_closure *send_done_closure;
+ grpc_iomgr_closure *recv_done_closure;
+
+ /** window available for us to send to peer */
+ gpr_int64 outgoing_window;
+ /** window available for peer to send to us - updated after parse */
+ gpr_uint32 incoming_window;
+ /** stream ops the transport user would like to send */
+ grpc_stream_op_buffer *outgoing_sopb;
+ /** when the application requests writes be closed, the write_closed is
+ 'queued'; when the close is flow controlled into the send path, we are
+ 'sending' it; when the write has been performed it is 'sent' */
+ grpc_chttp2_write_state write_state;
+ /** is this stream closed (boolean) */
+ gpr_uint8 read_closed;
+ /** has this stream been cancelled? (boolean) */
+ gpr_uint8 cancelled;
+ grpc_status_code cancelled_status;
+ /** have we told the upper layer that this stream is cancelled? */
+ gpr_uint8 published_cancelled;
+ /** is this stream in the stream map? (boolean) */
+ gpr_uint8 in_stream_map;
+
+ /** stream state already published to the upper layer */
+ grpc_stream_state published_state;
+ /** address to publish next stream state to */
+ grpc_stream_state *publish_state;
+ /** pointer to sop buffer to fill in with new stream ops */
+ grpc_stream_op_buffer *publish_sopb;
+ grpc_stream_op_buffer incoming_sopb;
+
+ /** incoming metadata */
+ grpc_chttp2_incoming_metadata_buffer incoming_metadata;
+ grpc_chttp2_incoming_metadata_live_op_buffer outstanding_metadata;
+} grpc_chttp2_stream_global;
+
+typedef struct {
+ /** HTTP2 stream id for this stream, or zero if one has not been assigned */
+ gpr_uint32 id;
+ /** sops that have passed flow control to be written */
+ grpc_stream_op_buffer sopb;
+ /** how strongly should we indicate closure with the next write */
+ grpc_chttp2_send_closed send_closed;
+} grpc_chttp2_stream_writing;
+
+struct grpc_chttp2_stream_parsing {
+ /** HTTP2 stream id for this stream, or zero if one has not been assigned */
+ gpr_uint32 id;
+ /** has this stream received a close */
+ gpr_uint8 received_close;
+ /** saw a rst_stream */
+ gpr_uint8 saw_rst_stream;
+ /** incoming_window has been reduced by this much during parsing */
+ gpr_uint32 incoming_window_delta;
+ /** window available for peer to send to us */
+ gpr_uint32 incoming_window;
+ /** parsing state for data frames */
+ grpc_chttp2_data_parser data_parser;
+ /** reason give to rst_stream */
+ gpr_uint32 rst_stream_reason;
+ /* amount of window given */
+ gpr_uint64 outgoing_window_update;
+
+ /** incoming metadata */
+ grpc_chttp2_incoming_metadata_buffer incoming_metadata;
+};
+
+struct grpc_chttp2_stream {
+ grpc_chttp2_stream_global global;
+ grpc_chttp2_stream_writing writing;
+ grpc_chttp2_stream_parsing parsing;
+
+ grpc_chttp2_stream_link links[STREAM_LIST_COUNT];
+ gpr_uint8 included[STREAM_LIST_COUNT];
+};
+
+/** Transport writing call flow:
+ chttp2_transport.c calls grpc_chttp2_unlocking_check_writes to see if writes
+ are required;
+ if they are, chttp2_transport.c calls grpc_chttp2_perform_writes to do the
+ writes.
+ Once writes have been completed (meaning another write could potentially be
+ started),
+ grpc_chttp2_terminate_writing is called. This will call
+ grpc_chttp2_cleanup_writing, at which
+ point the write phase is complete. */
+
+/** Someone is unlocking the transport mutex: check to see if writes
+ are required, and schedule them if so */
+int grpc_chttp2_unlocking_check_writes(grpc_chttp2_transport_global *global,
+ grpc_chttp2_transport_writing *writing);
+void grpc_chttp2_perform_writes(
+ grpc_chttp2_transport_writing *transport_writing, grpc_endpoint *endpoint);
+void grpc_chttp2_terminate_writing(
+ grpc_chttp2_transport_writing *transport_writing, int success);
+void grpc_chttp2_cleanup_writing(grpc_chttp2_transport_global *global,
+ grpc_chttp2_transport_writing *writing);
+
+void grpc_chttp2_prepare_to_read(grpc_chttp2_transport_global *global,
+ grpc_chttp2_transport_parsing *parsing);
+/** Process one slice of incoming data; return 1 if the connection is still
+ viable after reading, or 0 if the connection should be torn down */
+int grpc_chttp2_perform_read(grpc_chttp2_transport_parsing *transport_parsing,
+ gpr_slice slice);
+void grpc_chttp2_publish_reads(grpc_chttp2_transport_global *global,
+ grpc_chttp2_transport_parsing *parsing);
+
+/** Get a writable stream
+ returns non-zero if there was a stream available */
+void grpc_chttp2_list_add_writable_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+int grpc_chttp2_list_pop_writable_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_writing **stream_writing);
+
+void grpc_chttp2_list_add_incoming_window_updated(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+int grpc_chttp2_list_pop_incoming_window_updated(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_parsing **stream_parsing);
+void grpc_chttp2_list_remove_incoming_window_updated(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+
+void grpc_chttp2_list_add_writing_stream(
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_writing *stream_writing);
+int grpc_chttp2_list_have_writing_streams(
+ grpc_chttp2_transport_writing *transport_writing);
+int grpc_chttp2_list_pop_writing_stream(
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_writing **stream_writing);
+
+void grpc_chttp2_list_add_written_stream(
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_writing *stream_writing);
+int grpc_chttp2_list_pop_written_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_writing **stream_writing);
+
+void grpc_chttp2_list_add_writable_window_update_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+int grpc_chttp2_list_pop_writable_window_update_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global);
+void grpc_chttp2_list_remove_writable_window_update_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+
+void grpc_chttp2_list_add_parsing_seen_stream(
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing);
+int grpc_chttp2_list_pop_parsing_seen_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_parsing **stream_parsing);
+
+void grpc_chttp2_list_add_waiting_for_concurrency(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+int grpc_chttp2_list_pop_waiting_for_concurrency(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global);
+
+void grpc_chttp2_list_add_closed_waiting_for_parsing(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+int grpc_chttp2_list_pop_closed_waiting_for_parsing(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global);
+
+void grpc_chttp2_list_add_read_write_state_changed(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global);
+int grpc_chttp2_list_pop_read_write_state_changed(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global);
+
+/** schedule a closure to run without the transport lock taken */
+void grpc_chttp2_schedule_closure(
+ grpc_chttp2_transport_global *transport_global, grpc_iomgr_closure *closure,
+ int success);
+
+grpc_chttp2_stream_parsing *grpc_chttp2_parsing_lookup_stream(
+ grpc_chttp2_transport_parsing *transport_parsing, gpr_uint32 id);
+grpc_chttp2_stream_parsing *grpc_chttp2_parsing_accept_stream(
+ grpc_chttp2_transport_parsing *transport_parsing, gpr_uint32 id);
+
+void grpc_chttp2_add_incoming_goaway(
+ grpc_chttp2_transport_global *transport_global, gpr_uint32 goaway_error,
+ gpr_slice goaway_text);
+
+void grpc_chttp2_register_stream(grpc_chttp2_transport *t,
+ grpc_chttp2_stream *s);
+void grpc_chttp2_unregister_stream(grpc_chttp2_transport *t,
+ grpc_chttp2_stream *s);
+void grpc_chttp2_for_all_streams(
+ grpc_chttp2_transport_global *transport_global, void *user_data,
+ void (*cb)(grpc_chttp2_transport_global *transport_global, void *user_data,
+ grpc_chttp2_stream_global *stream_global));
+
+void grpc_chttp2_parsing_become_skip_parser(
+ grpc_chttp2_transport_parsing *transport_parsing);
+
+#define GRPC_CHTTP2_CLIENT_CONNECT_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
+#define GRPC_CHTTP2_CLIENT_CONNECT_STRLEN \
+ (sizeof(GRPC_CHTTP2_CLIENT_CONNECT_STRING) - 1)
+
+extern int grpc_http_trace;
+extern int grpc_flowctl_trace;
+
+#define GRPC_CHTTP2_IF_TRACING(stmt) \
+ if (!(grpc_http_trace)) \
+ ; \
+ else \
+ stmt
+
+#define GRPC_CHTTP2_FLOWCTL_TRACE_STREAM(reason, transport, context, var, \
+ delta) \
+ if (!(grpc_flowctl_trace)) { \
+ } else { \
+ grpc_chttp2_flowctl_trace(__FILE__, __LINE__, reason, #context, #var, \
+ transport->is_client, context->id, context->var, \
+ delta); \
+ }
+
+#define GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(reason, context, var, delta) \
+ if (!(grpc_flowctl_trace)) { \
+ } else { \
+ grpc_chttp2_flowctl_trace(__FILE__, __LINE__, reason, #context, #var, \
+ context->is_client, 0, context->var, delta); \
+ }
+
+void grpc_chttp2_flowctl_trace(const char *file, int line, const char *reason,
+ const char *context, const char *var,
+ int is_client, gpr_uint32 stream_id,
+ gpr_int64 current_value, gpr_int64 delta);
+
+#endif
diff --git a/src/core/transport/chttp2/parsing.c b/src/core/transport/chttp2/parsing.c
new file mode 100644
index 0000000000..4664a0895c
--- /dev/null
+++ b/src/core/transport/chttp2/parsing.c
@@ -0,0 +1,810 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/transport/chttp2/internal.h"
+
+#include <string.h>
+
+#include "src/core/transport/chttp2/http2_errors.h"
+#include "src/core/transport/chttp2/status_conversion.h"
+#include "src/core/transport/chttp2/timeout_encoding.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+static int init_frame_parser(grpc_chttp2_transport_parsing *transport_parsing);
+static int init_header_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing, int is_continuation);
+static int init_data_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing);
+static int init_rst_stream_parser(
+ grpc_chttp2_transport_parsing *transport_parsing);
+static int init_settings_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing);
+static int init_window_update_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing);
+static int init_ping_parser(grpc_chttp2_transport_parsing *transport_parsing);
+static int init_goaway_parser(grpc_chttp2_transport_parsing *transport_parsing);
+static int init_skip_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing, int is_header);
+
+static int parse_frame_slice(grpc_chttp2_transport_parsing *transport_parsing,
+ gpr_slice slice, int is_last);
+
+void grpc_chttp2_prepare_to_read(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ grpc_chttp2_stream_global *stream_global;
+ grpc_chttp2_stream_parsing *stream_parsing;
+
+ transport_parsing->next_stream_id = transport_global->next_stream_id;
+
+ /* update the parsing view of incoming window */
+ if (transport_parsing->incoming_window != transport_global->incoming_window) {
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "parse", transport_parsing, incoming_window,
+ (gpr_int64)transport_global->incoming_window -
+ (gpr_int64)transport_parsing->incoming_window);
+ transport_parsing->incoming_window = transport_global->incoming_window;
+ }
+ while (grpc_chttp2_list_pop_incoming_window_updated(
+ transport_global, transport_parsing, &stream_global, &stream_parsing)) {
+ stream_parsing->id = stream_global->id;
+ if (stream_parsing->incoming_window != stream_global->incoming_window) {
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM(
+ "parse", transport_parsing, stream_parsing, incoming_window,
+ (gpr_int64)stream_global->incoming_window -
+ (gpr_int64)stream_parsing->incoming_window);
+ stream_parsing->incoming_window = stream_global->incoming_window;
+ }
+ }
+}
+
+void grpc_chttp2_publish_reads(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ grpc_chttp2_stream_global *stream_global;
+ grpc_chttp2_stream_parsing *stream_parsing;
+
+ /* transport_parsing->last_incoming_stream_id is used as
+ last-grpc_chttp2_stream-id when
+ sending GOAWAY frame.
+ https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-6.8
+ says that last-grpc_chttp2_stream-id is peer-initiated grpc_chttp2_stream
+ ID. So,
+ since we don't have server pushed streams, client should send
+ GOAWAY last-grpc_chttp2_stream-id=0 in this case. */
+ if (!transport_parsing->is_client) {
+ transport_global->last_incoming_stream_id =
+ transport_parsing->incoming_stream_id;
+ }
+
+ /* copy parsing qbuf to global qbuf */
+ gpr_slice_buffer_move_into(&transport_parsing->qbuf, &transport_global->qbuf);
+
+ /* update global settings */
+ if (transport_parsing->settings_updated) {
+ memcpy(transport_global->settings[GRPC_PEER_SETTINGS],
+ transport_parsing->settings, sizeof(transport_parsing->settings));
+ transport_parsing->settings_updated = 0;
+ }
+
+ /* update settings based on ack if received */
+ if (transport_parsing->settings_ack_received) {
+ memcpy(transport_global->settings[GRPC_ACKED_SETTINGS],
+ transport_global->settings[GRPC_SENT_SETTINGS],
+ GRPC_CHTTP2_NUM_SETTINGS * sizeof(gpr_uint32));
+ transport_parsing->settings_ack_received = 0;
+ }
+
+ /* move goaway to the global state if we received one (it will be
+ published later */
+ if (transport_parsing->goaway_received) {
+ grpc_chttp2_add_incoming_goaway(transport_global,
+ transport_parsing->goaway_error,
+ transport_parsing->goaway_text);
+ transport_parsing->goaway_text = gpr_empty_slice();
+ transport_parsing->goaway_received = 0;
+ }
+
+ /* propagate flow control tokens to global state */
+ if (transport_parsing->outgoing_window_update) {
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "parsed", transport_global, outgoing_window,
+ transport_parsing->outgoing_window_update);
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "parsed", transport_parsing, outgoing_window_update,
+ -(gpr_int64)transport_parsing->outgoing_window_update);
+ transport_global->outgoing_window +=
+ transport_parsing->outgoing_window_update;
+ transport_parsing->outgoing_window_update = 0;
+ }
+
+ if (transport_parsing->incoming_window_delta) {
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "parsed", transport_global, incoming_window,
+ -(gpr_int64)transport_parsing->incoming_window_delta);
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "parsed", transport_parsing, incoming_window_delta,
+ -(gpr_int64)transport_parsing->incoming_window_delta);
+ transport_global->incoming_window -=
+ transport_parsing->incoming_window_delta;
+ transport_parsing->incoming_window_delta = 0;
+ }
+
+ /* for each stream that saw an update, fixup global state */
+ while (grpc_chttp2_list_pop_parsing_seen_stream(
+ transport_global, transport_parsing, &stream_global, &stream_parsing)) {
+ /* update incoming flow control window */
+ if (stream_parsing->incoming_window_delta) {
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM(
+ "parsed", transport_parsing, stream_global, incoming_window,
+ -(gpr_int64)stream_parsing->incoming_window_delta);
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM(
+ "parsed", transport_parsing, stream_parsing, incoming_window_delta,
+ -(gpr_int64)stream_parsing->incoming_window_delta);
+ stream_global->incoming_window -= stream_parsing->incoming_window_delta;
+ stream_parsing->incoming_window_delta = 0;
+ grpc_chttp2_list_add_writable_window_update_stream(transport_global,
+ stream_global);
+ }
+
+ /* update outgoing flow control window */
+ if (stream_parsing->outgoing_window_update) {
+ int was_zero = stream_global->outgoing_window <= 0;
+ int is_zero;
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM("parsed", transport_parsing,
+ stream_global, outgoing_window,
+ stream_parsing->outgoing_window_update);
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM(
+ "parsed", transport_parsing, stream_parsing, outgoing_window_update,
+ -(gpr_int64)stream_parsing->outgoing_window_update);
+ stream_global->outgoing_window += stream_parsing->outgoing_window_update;
+ stream_parsing->outgoing_window_update = 0;
+ is_zero = stream_global->outgoing_window <= 0;
+ if (was_zero && !is_zero) {
+ grpc_chttp2_list_add_writable_stream(transport_global, stream_global);
+ }
+ }
+
+ /* updating closed status */
+ if (stream_parsing->received_close) {
+ stream_global->read_closed = 1;
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
+ }
+ if (stream_parsing->saw_rst_stream) {
+ stream_global->cancelled = 1;
+ stream_global->cancelled_status = grpc_chttp2_http2_error_to_grpc_status(stream_parsing->rst_stream_reason);
+ if (stream_parsing->rst_stream_reason == GRPC_CHTTP2_NO_ERROR) {
+ stream_global->published_cancelled = 1;
+ }
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
+ }
+
+ /* publish incoming stream ops */
+ if (stream_parsing->data_parser.incoming_sopb.nops > 0) {
+ grpc_incoming_metadata_buffer_move_to_referencing_sopb(
+ &stream_parsing->incoming_metadata, &stream_global->incoming_metadata,
+ &stream_parsing->data_parser.incoming_sopb);
+ grpc_sopb_move_to(&stream_parsing->data_parser.incoming_sopb,
+ &stream_global->incoming_sopb);
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
+ }
+ }
+}
+
+int grpc_chttp2_perform_read(grpc_chttp2_transport_parsing *transport_parsing,
+ gpr_slice slice) {
+ gpr_uint8 *beg = GPR_SLICE_START_PTR(slice);
+ gpr_uint8 *end = GPR_SLICE_END_PTR(slice);
+ gpr_uint8 *cur = beg;
+
+ if (cur == end) return 1;
+
+ switch (transport_parsing->deframe_state) {
+ case GRPC_DTS_CLIENT_PREFIX_0:
+ case GRPC_DTS_CLIENT_PREFIX_1:
+ case GRPC_DTS_CLIENT_PREFIX_2:
+ case GRPC_DTS_CLIENT_PREFIX_3:
+ case GRPC_DTS_CLIENT_PREFIX_4:
+ case GRPC_DTS_CLIENT_PREFIX_5:
+ case GRPC_DTS_CLIENT_PREFIX_6:
+ case GRPC_DTS_CLIENT_PREFIX_7:
+ case GRPC_DTS_CLIENT_PREFIX_8:
+ case GRPC_DTS_CLIENT_PREFIX_9:
+ case GRPC_DTS_CLIENT_PREFIX_10:
+ case GRPC_DTS_CLIENT_PREFIX_11:
+ case GRPC_DTS_CLIENT_PREFIX_12:
+ case GRPC_DTS_CLIENT_PREFIX_13:
+ case GRPC_DTS_CLIENT_PREFIX_14:
+ case GRPC_DTS_CLIENT_PREFIX_15:
+ case GRPC_DTS_CLIENT_PREFIX_16:
+ case GRPC_DTS_CLIENT_PREFIX_17:
+ case GRPC_DTS_CLIENT_PREFIX_18:
+ case GRPC_DTS_CLIENT_PREFIX_19:
+ case GRPC_DTS_CLIENT_PREFIX_20:
+ case GRPC_DTS_CLIENT_PREFIX_21:
+ case GRPC_DTS_CLIENT_PREFIX_22:
+ case GRPC_DTS_CLIENT_PREFIX_23:
+ while (cur != end && transport_parsing->deframe_state != GRPC_DTS_FH_0) {
+ if (*cur != GRPC_CHTTP2_CLIENT_CONNECT_STRING[transport_parsing
+ ->deframe_state]) {
+ gpr_log(GPR_INFO,
+ "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
+ "at byte %d",
+ GRPC_CHTTP2_CLIENT_CONNECT_STRING[transport_parsing
+ ->deframe_state],
+ (int)(gpr_uint8)GRPC_CHTTP2_CLIENT_CONNECT_STRING
+ [transport_parsing->deframe_state],
+ *cur, (int)*cur, transport_parsing->deframe_state);
+ return 0;
+ }
+ ++cur;
+ ++transport_parsing->deframe_state;
+ }
+ if (cur == end) {
+ return 1;
+ }
+ /* fallthrough */
+ dts_fh_0:
+ case GRPC_DTS_FH_0:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_frame_size = ((gpr_uint32)*cur) << 16;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_1;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_1:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_frame_size |= ((gpr_uint32)*cur) << 8;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_2;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_2:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_frame_size |= *cur;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_3;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_3:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_frame_type = *cur;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_4;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_4:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_frame_flags = *cur;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_5;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_5:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_stream_id = (((gpr_uint32)*cur) & 0x7f) << 24;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_6;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_6:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_stream_id |= ((gpr_uint32)*cur) << 16;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_7;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_7:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_stream_id |= ((gpr_uint32)*cur) << 8;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_8;
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FH_8:
+ GPR_ASSERT(cur < end);
+ transport_parsing->incoming_stream_id |= ((gpr_uint32)*cur);
+ transport_parsing->deframe_state = GRPC_DTS_FRAME;
+ if (!init_frame_parser(transport_parsing)) {
+ return 0;
+ }
+ if (transport_parsing->incoming_stream_id) {
+ transport_parsing->last_incoming_stream_id =
+ transport_parsing->incoming_stream_id;
+ }
+ if (transport_parsing->incoming_frame_size == 0) {
+ if (!parse_frame_slice(transport_parsing, gpr_empty_slice(), 1)) {
+ return 0;
+ }
+ transport_parsing->incoming_stream = NULL;
+ if (++cur == end) {
+ transport_parsing->deframe_state = GRPC_DTS_FH_0;
+ return 1;
+ }
+ goto dts_fh_0; /* loop */
+ }
+ if (++cur == end) {
+ return 1;
+ }
+ /* fallthrough */
+ case GRPC_DTS_FRAME:
+ GPR_ASSERT(cur < end);
+ if ((gpr_uint32)(end - cur) == transport_parsing->incoming_frame_size) {
+ if (!parse_frame_slice(
+ transport_parsing,
+ gpr_slice_sub_no_ref(slice, cur - beg, end - beg), 1)) {
+ return 0;
+ }
+ transport_parsing->deframe_state = GRPC_DTS_FH_0;
+ transport_parsing->incoming_stream = NULL;
+ return 1;
+ } else if ((gpr_uint32)(end - cur) >
+ transport_parsing->incoming_frame_size) {
+ if (!parse_frame_slice(
+ transport_parsing,
+ gpr_slice_sub_no_ref(
+ slice, cur - beg,
+ cur + transport_parsing->incoming_frame_size - beg),
+ 1)) {
+ return 0;
+ }
+ cur += transport_parsing->incoming_frame_size;
+ transport_parsing->incoming_stream = NULL;
+ goto dts_fh_0; /* loop */
+ } else {
+ if (!parse_frame_slice(
+ transport_parsing,
+ gpr_slice_sub_no_ref(slice, cur - beg, end - beg), 0)) {
+ return 0;
+ }
+ transport_parsing->incoming_frame_size -= (end - cur);
+ return 1;
+ }
+ gpr_log(GPR_ERROR, "should never reach here");
+ abort();
+ }
+
+ gpr_log(GPR_ERROR, "should never reach here");
+ abort();
+
+ return 0;
+}
+
+static int init_frame_parser(grpc_chttp2_transport_parsing *transport_parsing) {
+ if (transport_parsing->expect_continuation_stream_id != 0) {
+ if (transport_parsing->incoming_frame_type !=
+ GRPC_CHTTP2_FRAME_CONTINUATION) {
+ gpr_log(GPR_ERROR, "Expected CONTINUATION frame, got frame type %02x",
+ transport_parsing->incoming_frame_type);
+ return 0;
+ }
+ if (transport_parsing->expect_continuation_stream_id !=
+ transport_parsing->incoming_stream_id) {
+ gpr_log(GPR_ERROR,
+ "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
+ "grpc_chttp2_stream %08x",
+ transport_parsing->expect_continuation_stream_id,
+ transport_parsing->incoming_stream_id);
+ return 0;
+ }
+ return init_header_frame_parser(transport_parsing, 1);
+ }
+ switch (transport_parsing->incoming_frame_type) {
+ case GRPC_CHTTP2_FRAME_DATA:
+ return init_data_frame_parser(transport_parsing);
+ case GRPC_CHTTP2_FRAME_HEADER:
+ return init_header_frame_parser(transport_parsing, 0);
+ case GRPC_CHTTP2_FRAME_CONTINUATION:
+ gpr_log(GPR_ERROR, "Unexpected CONTINUATION frame");
+ return 0;
+ case GRPC_CHTTP2_FRAME_RST_STREAM:
+ return init_rst_stream_parser(transport_parsing);
+ case GRPC_CHTTP2_FRAME_SETTINGS:
+ return init_settings_frame_parser(transport_parsing);
+ case GRPC_CHTTP2_FRAME_WINDOW_UPDATE:
+ return init_window_update_frame_parser(transport_parsing);
+ case GRPC_CHTTP2_FRAME_PING:
+ return init_ping_parser(transport_parsing);
+ case GRPC_CHTTP2_FRAME_GOAWAY:
+ return init_goaway_parser(transport_parsing);
+ default:
+ gpr_log(GPR_ERROR, "Unknown frame type %02x",
+ transport_parsing->incoming_frame_type);
+ return init_skip_frame_parser(transport_parsing, 0);
+ }
+}
+
+static grpc_chttp2_parse_error skip_parser(
+ void *parser, grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last) {
+ return GRPC_CHTTP2_PARSE_OK;
+}
+
+static void skip_header(void *tp, grpc_mdelem *md) { grpc_mdelem_unref(md); }
+
+static int init_skip_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing, int is_header) {
+ if (is_header) {
+ int is_eoh = transport_parsing->expect_continuation_stream_id != 0;
+ transport_parsing->parser = grpc_chttp2_header_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->hpack_parser;
+ transport_parsing->hpack_parser.on_header = skip_header;
+ transport_parsing->hpack_parser.on_header_user_data = NULL;
+ transport_parsing->hpack_parser.is_boundary = is_eoh;
+ transport_parsing->hpack_parser.is_eof =
+ is_eoh ? transport_parsing->header_eof : 0;
+ } else {
+ transport_parsing->parser = skip_parser;
+ }
+ return 1;
+}
+
+void grpc_chttp2_parsing_become_skip_parser(
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ init_skip_frame_parser(
+ transport_parsing,
+ transport_parsing->parser == grpc_chttp2_header_parser_parse);
+}
+
+static grpc_chttp2_parse_error update_incoming_window(
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing) {
+ if (transport_parsing->incoming_frame_size >
+ transport_parsing->incoming_window) {
+ gpr_log(GPR_ERROR, "frame of size %d overflows incoming window of %d",
+ transport_parsing->incoming_frame_size,
+ transport_parsing->incoming_window);
+ return GRPC_CHTTP2_CONNECTION_ERROR;
+ }
+
+ if (transport_parsing->incoming_frame_size >
+ stream_parsing->incoming_window) {
+ gpr_log(GPR_ERROR, "frame of size %d overflows incoming window of %d",
+ transport_parsing->incoming_frame_size,
+ stream_parsing->incoming_window);
+ return GRPC_CHTTP2_CONNECTION_ERROR;
+ }
+
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "data", transport_parsing, incoming_window,
+ -(gpr_int64)transport_parsing->incoming_frame_size);
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT("data", transport_parsing,
+ incoming_window_delta,
+ transport_parsing->incoming_frame_size);
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM(
+ "data", transport_parsing, stream_parsing, incoming_window,
+ -(gpr_int64)transport_parsing->incoming_frame_size);
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM("data", transport_parsing, stream_parsing,
+ incoming_window_delta,
+ transport_parsing->incoming_frame_size);
+
+ transport_parsing->incoming_window -= transport_parsing->incoming_frame_size;
+ transport_parsing->incoming_window_delta +=
+ transport_parsing->incoming_frame_size;
+ stream_parsing->incoming_window -= transport_parsing->incoming_frame_size;
+ stream_parsing->incoming_window_delta +=
+ transport_parsing->incoming_frame_size;
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, stream_parsing);
+
+ return GRPC_CHTTP2_PARSE_OK;
+}
+
+static int init_data_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ grpc_chttp2_stream_parsing *stream_parsing =
+ grpc_chttp2_parsing_lookup_stream(transport_parsing,
+ transport_parsing->incoming_stream_id);
+ grpc_chttp2_parse_error err = GRPC_CHTTP2_PARSE_OK;
+ if (!stream_parsing || stream_parsing->received_close)
+ return init_skip_frame_parser(transport_parsing, 0);
+ if (err == GRPC_CHTTP2_PARSE_OK) {
+ err = update_incoming_window(transport_parsing, stream_parsing);
+ }
+ if (err == GRPC_CHTTP2_PARSE_OK) {
+ err = grpc_chttp2_data_parser_begin_frame(
+ &stream_parsing->data_parser, transport_parsing->incoming_frame_flags);
+ }
+ switch (err) {
+ case GRPC_CHTTP2_PARSE_OK:
+ transport_parsing->incoming_stream = stream_parsing;
+ transport_parsing->parser = grpc_chttp2_data_parser_parse;
+ transport_parsing->parser_data = &stream_parsing->data_parser;
+ return 1;
+ case GRPC_CHTTP2_STREAM_ERROR:
+ stream_parsing->received_close = 1;
+ stream_parsing->saw_rst_stream = 1;
+ stream_parsing->rst_stream_reason = GRPC_CHTTP2_PROTOCOL_ERROR;
+ gpr_slice_buffer_add(
+ &transport_parsing->qbuf,
+ grpc_chttp2_rst_stream_create(transport_parsing->incoming_stream_id,
+ GRPC_CHTTP2_PROTOCOL_ERROR));
+ return init_skip_frame_parser(transport_parsing, 0);
+ case GRPC_CHTTP2_CONNECTION_ERROR:
+ return 0;
+ }
+ gpr_log(GPR_ERROR, "should never reach here");
+ abort();
+ return 0;
+}
+
+static void free_timeout(void *p) { gpr_free(p); }
+
+static void on_header(void *tp, grpc_mdelem *md) {
+ grpc_chttp2_transport_parsing *transport_parsing = tp;
+ grpc_chttp2_stream_parsing *stream_parsing =
+ transport_parsing->incoming_stream;
+
+ GPR_ASSERT(stream_parsing);
+
+ GRPC_CHTTP2_IF_TRACING(gpr_log(
+ GPR_INFO, "HTTP:%d:HDR: %s: %s", stream_parsing->id,
+ transport_parsing->is_client ? "CLI" : "SVR",
+ grpc_mdstr_as_c_string(md->key), grpc_mdstr_as_c_string(md->value)));
+
+ if (md->key == transport_parsing->str_grpc_timeout) {
+ gpr_timespec *cached_timeout = grpc_mdelem_get_user_data(md, free_timeout);
+ if (!cached_timeout) {
+ /* not already parsed: parse it now, and store the result away */
+ cached_timeout = gpr_malloc(sizeof(gpr_timespec));
+ if (!grpc_chttp2_decode_timeout(grpc_mdstr_as_c_string(md->value),
+ cached_timeout)) {
+ gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'",
+ grpc_mdstr_as_c_string(md->value));
+ *cached_timeout = gpr_inf_future;
+ }
+ grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
+ }
+ grpc_chttp2_incoming_metadata_buffer_set_deadline(
+ &stream_parsing->incoming_metadata,
+ gpr_time_add(gpr_now(), *cached_timeout));
+ grpc_mdelem_unref(md);
+ } else {
+ grpc_chttp2_incoming_metadata_buffer_add(&stream_parsing->incoming_metadata,
+ md);
+ }
+
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, stream_parsing);
+}
+
+static int init_header_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing, int is_continuation) {
+ int is_eoh = (transport_parsing->incoming_frame_flags &
+ GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0;
+ int via_accept = 0;
+ grpc_chttp2_stream_parsing *stream_parsing;
+
+ if (is_eoh) {
+ transport_parsing->expect_continuation_stream_id = 0;
+ } else {
+ transport_parsing->expect_continuation_stream_id =
+ transport_parsing->incoming_stream_id;
+ }
+
+ if (!is_continuation) {
+ transport_parsing->header_eof = (transport_parsing->incoming_frame_flags &
+ GRPC_CHTTP2_DATA_FLAG_END_STREAM) != 0;
+ }
+
+ /* could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream */
+ stream_parsing = grpc_chttp2_parsing_lookup_stream(
+ transport_parsing, transport_parsing->incoming_stream_id);
+ if (stream_parsing == NULL) {
+ if (is_continuation) {
+ gpr_log(GPR_ERROR,
+ "grpc_chttp2_stream disbanded before CONTINUATION received");
+ return init_skip_frame_parser(transport_parsing, 1);
+ }
+ if (transport_parsing->is_client) {
+ if ((transport_parsing->incoming_stream_id & 1) &&
+ transport_parsing->incoming_stream_id <
+ transport_parsing->next_stream_id) {
+ /* this is an old (probably cancelled) grpc_chttp2_stream */
+ } else {
+ gpr_log(GPR_ERROR,
+ "ignoring new grpc_chttp2_stream creation on client");
+ }
+ return init_skip_frame_parser(transport_parsing, 1);
+ } else if (transport_parsing->last_incoming_stream_id >
+ transport_parsing->incoming_stream_id) {
+ gpr_log(GPR_ERROR,
+ "ignoring out of order new grpc_chttp2_stream request on server; "
+ "last grpc_chttp2_stream "
+ "id=%d, new grpc_chttp2_stream id=%d",
+ transport_parsing->last_incoming_stream_id,
+ transport_parsing->incoming_stream_id);
+ return init_skip_frame_parser(transport_parsing, 1);
+ } else if ((transport_parsing->incoming_stream_id & 1) == 0) {
+ gpr_log(GPR_ERROR,
+ "ignoring grpc_chttp2_stream with non-client generated index %d",
+ transport_parsing->incoming_stream_id);
+ return init_skip_frame_parser(transport_parsing, 1);
+ }
+ stream_parsing = transport_parsing->incoming_stream =
+ grpc_chttp2_parsing_accept_stream(
+ transport_parsing, transport_parsing->incoming_stream_id);
+ if (stream_parsing == NULL) {
+ gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted");
+ return init_skip_frame_parser(transport_parsing, 1);
+ }
+ via_accept = 1;
+ } else {
+ transport_parsing->incoming_stream = stream_parsing;
+ }
+ GPR_ASSERT(stream_parsing != NULL && (via_accept == 0 || via_accept == 1));
+ if (stream_parsing->received_close) {
+ gpr_log(GPR_ERROR, "skipping already closed grpc_chttp2_stream header");
+ transport_parsing->incoming_stream = NULL;
+ return init_skip_frame_parser(transport_parsing, 1);
+ }
+ transport_parsing->parser = grpc_chttp2_header_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->hpack_parser;
+ transport_parsing->hpack_parser.on_header = on_header;
+ transport_parsing->hpack_parser.on_header_user_data = transport_parsing;
+ transport_parsing->hpack_parser.is_boundary = is_eoh;
+ transport_parsing->hpack_parser.is_eof =
+ is_eoh ? transport_parsing->header_eof : 0;
+ if (!is_continuation && (transport_parsing->incoming_frame_flags &
+ GRPC_CHTTP2_FLAG_HAS_PRIORITY)) {
+ grpc_chttp2_hpack_parser_set_has_priority(&transport_parsing->hpack_parser);
+ }
+ return 1;
+}
+
+static int init_window_update_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ int ok = GRPC_CHTTP2_PARSE_OK == grpc_chttp2_window_update_parser_begin_frame(
+ &transport_parsing->simple.window_update,
+ transport_parsing->incoming_frame_size,
+ transport_parsing->incoming_frame_flags);
+ if (transport_parsing->incoming_stream_id) {
+ transport_parsing->incoming_stream = grpc_chttp2_parsing_lookup_stream(
+ transport_parsing, transport_parsing->incoming_stream_id);
+ }
+ transport_parsing->parser = grpc_chttp2_window_update_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->simple.window_update;
+ return ok;
+}
+
+static int init_ping_parser(grpc_chttp2_transport_parsing *transport_parsing) {
+ int ok = GRPC_CHTTP2_PARSE_OK == grpc_chttp2_ping_parser_begin_frame(
+ &transport_parsing->simple.ping,
+ transport_parsing->incoming_frame_size,
+ transport_parsing->incoming_frame_flags);
+ transport_parsing->parser = grpc_chttp2_ping_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->simple.ping;
+ return ok;
+}
+
+static int init_rst_stream_parser(
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ int ok = GRPC_CHTTP2_PARSE_OK == grpc_chttp2_rst_stream_parser_begin_frame(
+ &transport_parsing->simple.rst_stream,
+ transport_parsing->incoming_frame_size,
+ transport_parsing->incoming_frame_flags);
+ transport_parsing->incoming_stream = grpc_chttp2_parsing_lookup_stream(
+ transport_parsing, transport_parsing->incoming_stream_id);
+ if (!transport_parsing->incoming_stream) {
+ return init_skip_frame_parser(transport_parsing, 0);
+ }
+ transport_parsing->parser = grpc_chttp2_rst_stream_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->simple.rst_stream;
+ return ok;
+}
+
+static int init_goaway_parser(
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ int ok = GRPC_CHTTP2_PARSE_OK == grpc_chttp2_goaway_parser_begin_frame(
+ &transport_parsing->goaway_parser,
+ transport_parsing->incoming_frame_size,
+ transport_parsing->incoming_frame_flags);
+ transport_parsing->parser = grpc_chttp2_goaway_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->goaway_parser;
+ return ok;
+}
+
+static int init_settings_frame_parser(
+ grpc_chttp2_transport_parsing *transport_parsing) {
+ int ok;
+
+ if (transport_parsing->incoming_stream_id != 0) {
+ gpr_log(GPR_ERROR, "settings frame received for grpc_chttp2_stream %d",
+ transport_parsing->incoming_stream_id);
+ return 0;
+ }
+
+ ok = GRPC_CHTTP2_PARSE_OK == grpc_chttp2_settings_parser_begin_frame(
+ &transport_parsing->simple.settings,
+ transport_parsing->incoming_frame_size,
+ transport_parsing->incoming_frame_flags,
+ transport_parsing->settings);
+ if (!ok) {
+ return 0;
+ }
+ if (transport_parsing->incoming_frame_flags & GRPC_CHTTP2_FLAG_ACK) {
+ transport_parsing->settings_ack_received = 1;
+ }
+ transport_parsing->parser = grpc_chttp2_settings_parser_parse;
+ transport_parsing->parser_data = &transport_parsing->simple.settings;
+ return ok;
+}
+
+/*
+static int is_window_update_legal(gpr_int64 window_update, gpr_int64 window) {
+ return window + window_update < MAX_WINDOW;
+}
+*/
+
+static int parse_frame_slice(grpc_chttp2_transport_parsing *transport_parsing,
+ gpr_slice slice, int is_last) {
+ grpc_chttp2_stream_parsing *stream_parsing =
+ transport_parsing->incoming_stream;
+ switch (transport_parsing->parser(transport_parsing->parser_data,
+ transport_parsing, stream_parsing, slice,
+ is_last)) {
+ case GRPC_CHTTP2_PARSE_OK:
+ if (stream_parsing) {
+ grpc_chttp2_list_add_parsing_seen_stream(transport_parsing,
+ stream_parsing);
+ }
+ return 1;
+ case GRPC_CHTTP2_STREAM_ERROR:
+ grpc_chttp2_parsing_become_skip_parser(transport_parsing);
+ if (stream_parsing) {
+ stream_parsing->saw_rst_stream = 1;
+ stream_parsing->rst_stream_reason = GRPC_CHTTP2_PROTOCOL_ERROR;
+ gpr_slice_buffer_add(
+ &transport_parsing->qbuf,
+ grpc_chttp2_rst_stream_create(transport_parsing->incoming_stream_id,
+ GRPC_CHTTP2_PROTOCOL_ERROR));
+ }
+ return 1;
+ case GRPC_CHTTP2_CONNECTION_ERROR:
+ return 0;
+ }
+ gpr_log(GPR_ERROR, "should never reach here");
+ abort();
+ return 0;
+}
diff --git a/src/core/transport/chttp2/status_conversion.h b/src/core/transport/chttp2/status_conversion.h
index cf06c3576e..0ec5b560b8 100644
--- a/src/core/transport/chttp2/status_conversion.h
+++ b/src/core/transport/chttp2/status_conversion.h
@@ -47,4 +47,4 @@ grpc_status_code grpc_chttp2_http2_error_to_grpc_status(
grpc_status_code grpc_chttp2_http2_status_to_grpc_status(int status);
int grpc_chttp2_grpc_status_to_http2_status(grpc_status_code status);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STATUS_CONVERSION_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STATUS_CONVERSION_H */
diff --git a/src/core/transport/chttp2/stream_encoder.h b/src/core/transport/chttp2/stream_encoder.h
index 50c58ad5ca..db52f2a0f6 100644
--- a/src/core/transport/chttp2/stream_encoder.h
+++ b/src/core/transport/chttp2/stream_encoder.h
@@ -90,4 +90,4 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
grpc_chttp2_hpack_compressor *compressor,
gpr_slice_buffer *output);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_ENCODER_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_ENCODER_H */
diff --git a/src/core/transport/chttp2/stream_lists.c b/src/core/transport/chttp2/stream_lists.c
new file mode 100644
index 0000000000..c6ba12fca8
--- /dev/null
+++ b/src/core/transport/chttp2/stream_lists.c
@@ -0,0 +1,352 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/transport/chttp2/internal.h"
+
+#include <grpc/support/log.h>
+
+#define TRANSPORT_FROM_GLOBAL(tg) \
+ ((grpc_chttp2_transport *)((char *)(tg)-offsetof(grpc_chttp2_transport, \
+ global)))
+
+#define STREAM_FROM_GLOBAL(sg) \
+ ((grpc_chttp2_stream *)((char *)(sg)-offsetof(grpc_chttp2_stream, global)))
+
+#define TRANSPORT_FROM_WRITING(tw) \
+ ((grpc_chttp2_transport *)((char *)(tw)-offsetof(grpc_chttp2_transport, \
+ writing)))
+
+#define STREAM_FROM_WRITING(sw) \
+ ((grpc_chttp2_stream *)((char *)(sw)-offsetof(grpc_chttp2_stream, writing)))
+
+#define TRANSPORT_FROM_PARSING(tp) \
+ ((grpc_chttp2_transport *)((char *)(tp)-offsetof(grpc_chttp2_transport, \
+ parsing)))
+
+#define STREAM_FROM_PARSING(sp) \
+ ((grpc_chttp2_stream *)((char *)(sp)-offsetof(grpc_chttp2_stream, parsing)))
+
+/* core list management */
+
+static int stream_list_empty(grpc_chttp2_transport *t,
+ grpc_chttp2_stream_list_id id) {
+ return t->lists[id].head == NULL;
+}
+
+static int stream_list_pop(grpc_chttp2_transport *t,
+ grpc_chttp2_stream **stream,
+ grpc_chttp2_stream_list_id id) {
+ grpc_chttp2_stream *s = t->lists[id].head;
+ if (s) {
+ grpc_chttp2_stream *new_head = s->links[id].next;
+ GPR_ASSERT(s->included[id]);
+ if (new_head) {
+ t->lists[id].head = new_head;
+ new_head->links[id].prev = NULL;
+ } else {
+ t->lists[id].head = NULL;
+ t->lists[id].tail = NULL;
+ }
+ s->included[id] = 0;
+ }
+ *stream = s;
+ return s != 0;
+}
+
+static void stream_list_remove(grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+ grpc_chttp2_stream_list_id id) {
+ GPR_ASSERT(s->included[id]);
+ s->included[id] = 0;
+ if (s->links[id].prev) {
+ s->links[id].prev->links[id].next = s->links[id].next;
+ } else {
+ GPR_ASSERT(t->lists[id].head == s);
+ t->lists[id].head = s->links[id].next;
+ }
+ if (s->links[id].next) {
+ s->links[id].next->links[id].prev = s->links[id].prev;
+ } else {
+ t->lists[id].tail = s->links[id].prev;
+ }
+}
+
+static void stream_list_maybe_remove(grpc_chttp2_transport *t,
+ grpc_chttp2_stream *s,
+ grpc_chttp2_stream_list_id id) {
+ if (s->included[id]) {
+ stream_list_remove(t, s, id);
+ }
+}
+
+static void stream_list_add_tail(grpc_chttp2_transport *t,
+ grpc_chttp2_stream *s,
+ grpc_chttp2_stream_list_id id) {
+ grpc_chttp2_stream *old_tail;
+ GPR_ASSERT(!s->included[id]);
+ old_tail = t->lists[id].tail;
+ s->links[id].next = NULL;
+ s->links[id].prev = old_tail;
+ if (old_tail) {
+ old_tail->links[id].next = s;
+ } else {
+ s->links[id].prev = NULL;
+ t->lists[id].head = s;
+ }
+ t->lists[id].tail = s;
+ s->included[id] = 1;
+}
+
+static void stream_list_add(grpc_chttp2_transport *t, grpc_chttp2_stream *s,
+ grpc_chttp2_stream_list_id id) {
+ if (s->included[id]) {
+ return;
+ }
+ stream_list_add_tail(t, s, id);
+}
+
+/* wrappers for specializations */
+
+void grpc_chttp2_list_add_writable_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global), GRPC_CHTTP2_LIST_WRITABLE);
+}
+
+int grpc_chttp2_list_pop_writable_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_writing **stream_writing) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
+ GRPC_CHTTP2_LIST_WRITABLE);
+ *stream_global = &stream->global;
+ *stream_writing = &stream->writing;
+ return r;
+}
+
+void grpc_chttp2_list_add_writing_stream(
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_writing *stream_writing) {
+ stream_list_add(TRANSPORT_FROM_WRITING(transport_writing),
+ STREAM_FROM_WRITING(stream_writing),
+ GRPC_CHTTP2_LIST_WRITING);
+}
+
+int grpc_chttp2_list_have_writing_streams(
+ grpc_chttp2_transport_writing *transport_writing) {
+ return !stream_list_empty(TRANSPORT_FROM_WRITING(transport_writing),
+ GRPC_CHTTP2_LIST_WRITING);
+}
+
+int grpc_chttp2_list_pop_writing_stream(
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_writing **stream_writing) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_WRITING(transport_writing), &stream,
+ GRPC_CHTTP2_LIST_WRITING);
+ *stream_writing = &stream->writing;
+ return r;
+}
+
+void grpc_chttp2_list_add_written_stream(
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_writing *stream_writing) {
+ stream_list_add(TRANSPORT_FROM_WRITING(transport_writing),
+ STREAM_FROM_WRITING(stream_writing),
+ GRPC_CHTTP2_LIST_WRITTEN);
+}
+
+int grpc_chttp2_list_pop_written_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_writing *transport_writing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_writing **stream_writing) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_WRITING(transport_writing), &stream,
+ GRPC_CHTTP2_LIST_WRITTEN);
+ *stream_global = &stream->global;
+ *stream_writing = &stream->writing;
+ return r;
+}
+
+void grpc_chttp2_list_add_writable_window_update_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global),
+ GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE);
+}
+
+int grpc_chttp2_list_pop_writable_window_update_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
+ GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE);
+ *stream_global = &stream->global;
+ return r;
+}
+
+void grpc_chttp2_list_remove_writable_window_update_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_maybe_remove(TRANSPORT_FROM_GLOBAL(transport_global), STREAM_FROM_GLOBAL(stream_global), GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE);
+}
+
+void grpc_chttp2_list_add_parsing_seen_stream(
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_parsing *stream_parsing) {
+ stream_list_add(TRANSPORT_FROM_PARSING(transport_parsing),
+ STREAM_FROM_PARSING(stream_parsing),
+ GRPC_CHTTP2_LIST_PARSING_SEEN);
+}
+
+int grpc_chttp2_list_pop_parsing_seen_stream(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_parsing **stream_parsing) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_PARSING(transport_parsing), &stream,
+ GRPC_CHTTP2_LIST_PARSING_SEEN);
+ *stream_global = &stream->global;
+ *stream_parsing = &stream->parsing;
+ return r;
+}
+
+void grpc_chttp2_list_add_waiting_for_concurrency(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global),
+ GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
+}
+
+int grpc_chttp2_list_pop_waiting_for_concurrency(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
+ GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY);
+ *stream_global = &stream->global;
+ return r;
+}
+
+void grpc_chttp2_list_add_closed_waiting_for_parsing(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global),
+ GRPC_CHTTP2_LIST_CLOSED_WAITING_FOR_PARSING);
+}
+
+int grpc_chttp2_list_pop_closed_waiting_for_parsing(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
+ GRPC_CHTTP2_LIST_CLOSED_WAITING_FOR_PARSING);
+ *stream_global = &stream->global;
+ return r;
+}
+
+void grpc_chttp2_list_add_incoming_window_updated(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global),
+ GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED);
+}
+
+int grpc_chttp2_list_pop_incoming_window_updated(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_parsing *transport_parsing,
+ grpc_chttp2_stream_global **stream_global,
+ grpc_chttp2_stream_parsing **stream_parsing) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
+ GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED);
+ *stream_global = &stream->global;
+ *stream_parsing = &stream->parsing;
+ return r;
+}
+
+void grpc_chttp2_list_remove_incoming_window_updated(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_maybe_remove(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global),
+ GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED);
+}
+
+void grpc_chttp2_list_add_read_write_state_changed(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global) {
+ stream_list_add(TRANSPORT_FROM_GLOBAL(transport_global),
+ STREAM_FROM_GLOBAL(stream_global),
+ GRPC_CHTTP2_LIST_READ_WRITE_STATE_CHANGED);
+}
+
+int grpc_chttp2_list_pop_read_write_state_changed(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global **stream_global) {
+ grpc_chttp2_stream *stream;
+ int r = stream_list_pop(TRANSPORT_FROM_GLOBAL(transport_global), &stream,
+ GRPC_CHTTP2_LIST_READ_WRITE_STATE_CHANGED);
+ *stream_global = &stream->global;
+ return r;
+}
+
+void grpc_chttp2_register_stream(grpc_chttp2_transport *t,
+ grpc_chttp2_stream *s) {
+ stream_list_add_tail(t, s, GRPC_CHTTP2_LIST_ALL_STREAMS);
+}
+
+void grpc_chttp2_unregister_stream(grpc_chttp2_transport *t,
+ grpc_chttp2_stream *s) {
+ stream_list_remove(t, s, GRPC_CHTTP2_LIST_ALL_STREAMS);
+}
+
+void grpc_chttp2_for_all_streams(
+ grpc_chttp2_transport_global *transport_global, void *user_data,
+ void (*cb)(grpc_chttp2_transport_global *transport_global, void *user_data,
+ grpc_chttp2_stream_global *stream_global)) {
+ grpc_chttp2_stream *s;
+ grpc_chttp2_transport *t = TRANSPORT_FROM_GLOBAL(transport_global);
+ for (s = t->lists[GRPC_CHTTP2_LIST_ALL_STREAMS].head; s != NULL;
+ s = s->links[GRPC_CHTTP2_LIST_ALL_STREAMS].next) {
+ cb(transport_global, user_data, &s->global);
+ }
+}
diff --git a/src/core/transport/chttp2/stream_map.c b/src/core/transport/chttp2/stream_map.c
index 580e32c582..0ec2f27291 100644
--- a/src/core/transport/chttp2/stream_map.c
+++ b/src/core/transport/chttp2/stream_map.c
@@ -32,8 +32,12 @@
*/
#include "src/core/transport/chttp2/stream_map.h"
+
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map *map,
size_t initial_capacity) {
@@ -92,6 +96,41 @@ void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map *map, gpr_uint32 key,
map->count = count + 1;
}
+void grpc_chttp2_stream_map_move_into(grpc_chttp2_stream_map *src,
+ grpc_chttp2_stream_map *dst) {
+ /* if src is empty we dont need to do anything */
+ if (src->count == src->free) {
+ return;
+ }
+ /* if dst is empty we simply need to swap */
+ if (dst->count == dst->free) {
+ GPR_SWAP(grpc_chttp2_stream_map, *src, *dst);
+ return;
+ }
+ /* the first element of src must be greater than the last of dst...
+ * however the maps may need compacting for this property to hold */
+ if (src->keys[0] <= dst->keys[dst->count - 1]) {
+ src->count = compact(src->keys, src->values, src->count);
+ src->free = 0;
+ dst->count = compact(dst->keys, dst->values, dst->count);
+ dst->free = 0;
+ }
+ GPR_ASSERT(src->keys[0] > dst->keys[dst->count - 1]);
+ /* if dst doesn't have capacity, resize */
+ if (dst->count + src->count > dst->capacity) {
+ dst->capacity = GPR_MAX(dst->capacity * 3 / 2, dst->count + src->count);
+ dst->keys = gpr_realloc(dst->keys, dst->capacity * sizeof(gpr_uint32));
+ dst->values = gpr_realloc(dst->values, dst->capacity * sizeof(void *));
+ }
+ memcpy(dst->keys + dst->count, src->keys, src->count * sizeof(gpr_uint32));
+ memcpy(dst->values + dst->count, src->values,
+ src->count * sizeof(void*));
+ dst->count += src->count;
+ dst->free += src->free;
+ src->count = 0;
+ src->free = 0;
+}
+
static void **find(grpc_chttp2_stream_map *map, gpr_uint32 key) {
size_t min_idx = 0;
size_t max_idx = map->count;
@@ -127,6 +166,11 @@ void *grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map *map,
out = *pvalue;
*pvalue = NULL;
map->free += (out != NULL);
+ /* recognize complete emptyness and ensure we can skip
+ * defragmentation later */
+ if (map->free == map->count) {
+ map->free = map->count = 0;
+ }
}
return out;
}
diff --git a/src/core/transport/chttp2/stream_map.h b/src/core/transport/chttp2/stream_map.h
index d338d2f892..71b0582054 100644
--- a/src/core/transport/chttp2/stream_map.h
+++ b/src/core/transport/chttp2/stream_map.h
@@ -66,6 +66,10 @@ void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map *map, gpr_uint32 key,
void *grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map *map,
gpr_uint32 key);
+/* Move all elements of src into dst */
+void grpc_chttp2_stream_map_move_into(grpc_chttp2_stream_map *src,
+ grpc_chttp2_stream_map *dst);
+
/* Return an existing key, or NULL if it does not exist */
void *grpc_chttp2_stream_map_find(grpc_chttp2_stream_map *map, gpr_uint32 key);
@@ -78,4 +82,4 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map,
void *value),
void *user_data);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_MAP_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_STREAM_MAP_H */
diff --git a/src/core/transport/chttp2/timeout_encoding.h b/src/core/transport/chttp2/timeout_encoding.h
index e6664c6262..9d8756e799 100644
--- a/src/core/transport/chttp2/timeout_encoding.h
+++ b/src/core/transport/chttp2/timeout_encoding.h
@@ -44,4 +44,4 @@
void grpc_chttp2_encode_timeout(gpr_timespec timeout, char *buffer);
int grpc_chttp2_decode_timeout(const char *buffer, gpr_timespec *timeout);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TIMEOUT_ENCODING_H */
diff --git a/src/core/transport/chttp2/varint.h b/src/core/transport/chttp2/varint.h
index ee04ed7fb2..0a6fb55248 100644
--- a/src/core/transport/chttp2/varint.h
+++ b/src/core/transport/chttp2/varint.h
@@ -56,19 +56,18 @@ void grpc_chttp2_hpack_write_varint_tail(gpr_uint32 tail_value,
((n) < GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) \
? 1 \
: grpc_chttp2_hpack_varint_length( \
- (n) - GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits)))
+ (n)-GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits)))
-#define GRPC_CHTTP2_WRITE_VARINT(n, prefix_bits, prefix_or, target, length) \
- do { \
- gpr_uint8* tgt = target; \
- if ((length) == 1) { \
- (tgt)[0] = (prefix_or) | (n); \
- } else { \
- (tgt)[0] = (prefix_or) | GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits); \
- grpc_chttp2_hpack_write_varint_tail( \
- (n) - GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits), (tgt) + 1, \
- (length) - 1); \
- } \
+#define GRPC_CHTTP2_WRITE_VARINT(n, prefix_bits, prefix_or, target, length) \
+ do { \
+ gpr_uint8* tgt = target; \
+ if ((length) == 1) { \
+ (tgt)[0] = (prefix_or) | (n); \
+ } else { \
+ (tgt)[0] = (prefix_or) | GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits); \
+ grpc_chttp2_hpack_write_varint_tail( \
+ (n)-GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits), (tgt) + 1, (length)-1); \
+ } \
} while (0)
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_VARINT_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_VARINT_H */
diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c
new file mode 100644
index 0000000000..fdcc300099
--- /dev/null
+++ b/src/core/transport/chttp2/writing.c
@@ -0,0 +1,215 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/transport/chttp2/internal.h"
+#include "src/core/transport/chttp2/http2_errors.h"
+
+#include <grpc/support/log.h>
+
+static void finalize_outbuf(grpc_chttp2_transport_writing *transport_writing);
+static void finish_write_cb(void *tw, grpc_endpoint_cb_status write_status);
+
+int grpc_chttp2_unlocking_check_writes(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_writing *transport_writing) {
+ grpc_chttp2_stream_global *stream_global;
+ grpc_chttp2_stream_writing *stream_writing;
+ gpr_uint32 window_delta;
+
+ /* simple writes are queued to qbuf, and flushed here */
+ gpr_slice_buffer_swap(&transport_global->qbuf, &transport_writing->outbuf);
+ GPR_ASSERT(transport_global->qbuf.count == 0);
+
+ if (transport_global->dirtied_local_settings &&
+ !transport_global->sent_local_settings) {
+ gpr_slice_buffer_add(
+ &transport_writing->outbuf,
+ grpc_chttp2_settings_create(
+ transport_global->settings[GRPC_SENT_SETTINGS],
+ transport_global->settings[GRPC_LOCAL_SETTINGS],
+ transport_global->force_send_settings, GRPC_CHTTP2_NUM_SETTINGS));
+ transport_global->force_send_settings = 0;
+ transport_global->dirtied_local_settings = 0;
+ transport_global->sent_local_settings = 1;
+ }
+
+ /* for each grpc_chttp2_stream that's become writable, frame it's data
+ (according to
+ available window sizes) and add to the output buffer */
+ while (transport_global->outgoing_window &&
+ grpc_chttp2_list_pop_writable_stream(transport_global,
+ transport_writing, &stream_global,
+ &stream_writing) &&
+ stream_global->outgoing_window > 0) {
+ stream_writing->id = stream_global->id;
+ window_delta = grpc_chttp2_preencode(
+ stream_global->outgoing_sopb->ops, &stream_global->outgoing_sopb->nops,
+ GPR_MIN(transport_global->outgoing_window,
+ stream_global->outgoing_window),
+ &stream_writing->sopb);
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT(
+ "write", transport_global, outgoing_window, -(gpr_int64)window_delta);
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM("write", transport_global, stream_global,
+ outgoing_window, -(gpr_int64)window_delta);
+ transport_global->outgoing_window -= window_delta;
+ stream_global->outgoing_window -= window_delta;
+
+ if (stream_global->write_state == GRPC_WRITE_STATE_QUEUED_CLOSE &&
+ stream_global->outgoing_sopb->nops == 0) {
+ if (!transport_global->is_client && !stream_global->read_closed) {
+ stream_writing->send_closed = GRPC_SEND_CLOSED_WITH_RST_STREAM;
+ } else {
+ stream_writing->send_closed = GRPC_SEND_CLOSED;
+ }
+ }
+ if (stream_writing->sopb.nops > 0 ||
+ stream_writing->send_closed != GRPC_DONT_SEND_CLOSED) {
+ grpc_chttp2_list_add_writing_stream(transport_writing, stream_writing);
+ }
+
+ /* we should either exhaust window or have no ops left, but not both */
+ if (stream_global->outgoing_sopb->nops == 0) {
+ stream_global->outgoing_sopb = NULL;
+ grpc_chttp2_schedule_closure(transport_global,
+ stream_global->send_done_closure, 1);
+ } else if (stream_global->outgoing_window > 0) {
+ grpc_chttp2_list_add_writable_stream(transport_global, stream_global);
+ }
+ }
+
+ /* for each grpc_chttp2_stream that wants to update its window, add that
+ * window here */
+ while (grpc_chttp2_list_pop_writable_window_update_stream(transport_global,
+ &stream_global)) {
+ window_delta =
+ transport_global->settings[GRPC_LOCAL_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] -
+ stream_global->incoming_window;
+ if (!stream_global->read_closed && window_delta > 0) {
+ gpr_slice_buffer_add(
+ &transport_writing->outbuf,
+ grpc_chttp2_window_update_create(stream_global->id, window_delta));
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM("write", transport_global, stream_global,
+ incoming_window, window_delta);
+ stream_global->incoming_window += window_delta;
+ grpc_chttp2_list_add_incoming_window_updated(transport_global,
+ stream_global);
+ }
+ }
+
+ /* if the grpc_chttp2_transport is ready to send a window update, do so here
+ also; 3/4 is a magic number that will likely get tuned soon */
+ if (transport_global->incoming_window <
+ transport_global->connection_window_target * 3 / 4) {
+ window_delta = transport_global->connection_window_target -
+ transport_global->incoming_window;
+ gpr_slice_buffer_add(&transport_writing->outbuf,
+ grpc_chttp2_window_update_create(0, window_delta));
+ GRPC_CHTTP2_FLOWCTL_TRACE_TRANSPORT("write", transport_global,
+ incoming_window, window_delta);
+ transport_global->incoming_window += window_delta;
+ }
+
+ return transport_writing->outbuf.count > 0 ||
+ grpc_chttp2_list_have_writing_streams(transport_writing);
+}
+
+void grpc_chttp2_perform_writes(
+ grpc_chttp2_transport_writing *transport_writing, grpc_endpoint *endpoint) {
+ GPR_ASSERT(transport_writing->outbuf.count > 0 ||
+ grpc_chttp2_list_have_writing_streams(transport_writing));
+
+ finalize_outbuf(transport_writing);
+
+ GPR_ASSERT(transport_writing->outbuf.count > 0);
+ GPR_ASSERT(endpoint);
+
+ switch (grpc_endpoint_write(endpoint, transport_writing->outbuf.slices,
+ transport_writing->outbuf.count, finish_write_cb,
+ transport_writing)) {
+ case GRPC_ENDPOINT_WRITE_DONE:
+ grpc_chttp2_terminate_writing(transport_writing, 1);
+ break;
+ case GRPC_ENDPOINT_WRITE_ERROR:
+ grpc_chttp2_terminate_writing(transport_writing, 0);
+ break;
+ case GRPC_ENDPOINT_WRITE_PENDING:
+ break;
+ }
+}
+
+static void finalize_outbuf(grpc_chttp2_transport_writing *transport_writing) {
+ grpc_chttp2_stream_writing *stream_writing;
+
+ while (
+ grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) {
+ grpc_chttp2_encode(stream_writing->sopb.ops, stream_writing->sopb.nops,
+ stream_writing->send_closed != GRPC_DONT_SEND_CLOSED,
+ stream_writing->id, &transport_writing->hpack_compressor,
+ &transport_writing->outbuf);
+ stream_writing->sopb.nops = 0;
+ if (stream_writing->send_closed == GRPC_SEND_CLOSED_WITH_RST_STREAM) {
+ gpr_slice_buffer_add(&transport_writing->outbuf,
+ grpc_chttp2_rst_stream_create(stream_writing->id,
+ GRPC_CHTTP2_NO_ERROR));
+ }
+ grpc_chttp2_list_add_written_stream(transport_writing, stream_writing);
+ }
+}
+
+static void finish_write_cb(void *tw, grpc_endpoint_cb_status write_status) {
+ grpc_chttp2_transport_writing *transport_writing = tw;
+ grpc_chttp2_terminate_writing(transport_writing,
+ write_status == GRPC_ENDPOINT_CB_OK);
+}
+
+void grpc_chttp2_cleanup_writing(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_transport_writing *transport_writing) {
+ grpc_chttp2_stream_writing *stream_writing;
+ grpc_chttp2_stream_global *stream_global;
+
+ while (grpc_chttp2_list_pop_written_stream(
+ transport_global, transport_writing, &stream_global, &stream_writing)) {
+ if (stream_writing->send_closed != GRPC_DONT_SEND_CLOSED) {
+ stream_global->write_state = GRPC_WRITE_STATE_SENT_CLOSE;
+ if (!transport_global->is_client) {
+ stream_global->read_closed = 1;
+ }
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
+ }
+ }
+ transport_writing->outbuf.count = 0;
+ transport_writing->outbuf.length = 0;
+}
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c
index bd259f7ae3..7ecc49ed60 100644
--- a/src/core/transport/chttp2_transport.c
+++ b/src/core/transport/chttp2_transport.c
@@ -39,22 +39,15 @@
#include "src/core/profiling/timers.h"
#include "src/core/support/string.h"
-#include "src/core/transport/chttp2/frame_data.h"
-#include "src/core/transport/chttp2/frame_goaway.h"
-#include "src/core/transport/chttp2/frame_ping.h"
-#include "src/core/transport/chttp2/frame_rst_stream.h"
-#include "src/core/transport/chttp2/frame_settings.h"
-#include "src/core/transport/chttp2/frame_window_update.h"
-#include "src/core/transport/chttp2/hpack_parser.h"
#include "src/core/transport/chttp2/http2_errors.h"
#include "src/core/transport/chttp2/status_conversion.h"
-#include "src/core/transport/chttp2/stream_encoder.h"
-#include "src/core/transport/chttp2/stream_map.h"
#include "src/core/transport/chttp2/timeout_encoding.h"
+#include "src/core/transport/chttp2/internal.h"
#include "src/core/transport/transport_impl.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice_buffer.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#define DEFAULT_WINDOW 65535
@@ -63,421 +56,156 @@
#define MAX_CLIENT_STREAM_ID 0x7fffffffu
-#define CLIENT_CONNECT_STRING "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
-#define CLIENT_CONNECT_STRLEN 24
-
int grpc_http_trace = 0;
int grpc_flowctl_trace = 0;
-typedef struct transport transport;
-typedef struct stream stream;
-
-#define IF_TRACING(stmt) \
- if (!(grpc_http_trace)) \
- ; \
- else \
- stmt
-
-#define FLOWCTL_TRACE(t, obj, dir, id, delta) \
- if (!grpc_flowctl_trace) \
- ; \
- else \
- flowctl_trace(t, #dir, obj->dir##_window, id, delta)
-
-/* streams are kept in various linked lists depending on what things need to
- happen to them... this enum labels each list */
-typedef enum {
- /* streams that have pending writes */
- WRITABLE = 0,
- /* streams that have been selected to be written */
- WRITING,
- /* streams that have just been written, and included a close */
- WRITTEN_CLOSED,
- /* streams that have been cancelled and have some pending state updates
- to perform */
- CANCELLED,
- /* streams that want to send window updates */
- WINDOW_UPDATE,
- /* streams that are waiting to start because there are too many concurrent
- streams on the connection */
- WAITING_FOR_CONCURRENCY,
- /* streams that have finished reading: we wait until unlock to coalesce
- all changes into one callback */
- FINISHED_READ_OP,
- STREAM_LIST_COUNT /* must be last */
-} stream_list_id;
-
-/* deframer state for the overall http2 stream of bytes */
-typedef enum {
- /* prefix: one entry per http2 connection prefix byte */
- DTS_CLIENT_PREFIX_0 = 0,
- DTS_CLIENT_PREFIX_1,
- DTS_CLIENT_PREFIX_2,
- DTS_CLIENT_PREFIX_3,
- DTS_CLIENT_PREFIX_4,
- DTS_CLIENT_PREFIX_5,
- DTS_CLIENT_PREFIX_6,
- DTS_CLIENT_PREFIX_7,
- DTS_CLIENT_PREFIX_8,
- DTS_CLIENT_PREFIX_9,
- DTS_CLIENT_PREFIX_10,
- DTS_CLIENT_PREFIX_11,
- DTS_CLIENT_PREFIX_12,
- DTS_CLIENT_PREFIX_13,
- DTS_CLIENT_PREFIX_14,
- DTS_CLIENT_PREFIX_15,
- DTS_CLIENT_PREFIX_16,
- DTS_CLIENT_PREFIX_17,
- DTS_CLIENT_PREFIX_18,
- DTS_CLIENT_PREFIX_19,
- DTS_CLIENT_PREFIX_20,
- DTS_CLIENT_PREFIX_21,
- DTS_CLIENT_PREFIX_22,
- DTS_CLIENT_PREFIX_23,
- /* frame header byte 0... */
- /* must follow from the prefix states */
- DTS_FH_0,
- DTS_FH_1,
- DTS_FH_2,
- DTS_FH_3,
- DTS_FH_4,
- DTS_FH_5,
- DTS_FH_6,
- DTS_FH_7,
- /* ... frame header byte 8 */
- DTS_FH_8,
- /* inside a http2 frame */
- DTS_FRAME
-} deframe_transport_state;
-
-typedef enum {
- WRITE_STATE_OPEN,
- WRITE_STATE_QUEUED_CLOSE,
- WRITE_STATE_SENT_CLOSE
-} write_state;
-
-typedef enum {
- DONT_SEND_CLOSED = 0,
- SEND_CLOSED,
- SEND_CLOSED_WITH_RST_STREAM
-} send_closed;
-
-typedef struct {
- stream *head;
- stream *tail;
-} stream_list;
-
-typedef struct {
- stream *next;
- stream *prev;
-} stream_link;
-
-typedef enum {
- ERROR_STATE_NONE,
- ERROR_STATE_SEEN,
- ERROR_STATE_NOTIFIED
-} error_state;
-
-/* We keep several sets of connection wide parameters */
-typedef enum {
- /* The settings our peer has asked for (and we have acked) */
- PEER_SETTINGS = 0,
- /* The settings we'd like to have */
- LOCAL_SETTINGS,
- /* The settings we've published to our peer */
- SENT_SETTINGS,
- /* The settings the peer has acked */
- ACKED_SETTINGS,
- NUM_SETTING_SETS
-} setting_set;
-
-/* Outstanding ping request data */
-typedef struct {
- gpr_uint8 id[8];
- void (*cb)(void *user_data);
- void *user_data;
-} outstanding_ping;
+#define TRANSPORT_FROM_WRITING(tw) \
+ ((grpc_chttp2_transport *)((char *)(tw)-offsetof(grpc_chttp2_transport, \
+ writing)))
-typedef struct {
- grpc_status_code status;
- gpr_slice debug;
-} pending_goaway;
+#define TRANSPORT_FROM_PARSING(tw) \
+ ((grpc_chttp2_transport *)((char *)(tw)-offsetof(grpc_chttp2_transport, \
+ parsing)))
-typedef struct {
- void (*cb)(void *user_data, int success);
- void *user_data;
- int success;
-} op_closure;
+#define TRANSPORT_FROM_GLOBAL(tg) \
+ ((grpc_chttp2_transport *)((char *)(tg)-offsetof(grpc_chttp2_transport, \
+ global)))
-typedef struct {
- op_closure *callbacks;
- size_t count;
- size_t capacity;
-} op_closure_array;
-
-struct transport {
- grpc_transport base; /* must be first */
- const grpc_transport_callbacks *cb;
- void *cb_user_data;
- grpc_endpoint *ep;
- grpc_mdctx *metadata_context;
- gpr_refcount refs;
- gpr_uint8 is_client;
-
- gpr_mu mu;
- gpr_cv cv;
-
- /* basic state management - what are we doing at the moment? */
- gpr_uint8 reading;
- gpr_uint8 writing;
- /** are we calling back (via cb) with a channel-level event */
- gpr_uint8 calling_back_channel;
- /** are we calling back any grpc_transport_op completion events */
- gpr_uint8 calling_back_ops;
- gpr_uint8 destroying;
- gpr_uint8 closed;
- error_state error_state;
-
- /* queued callbacks */
- op_closure_array pending_callbacks;
- op_closure_array executing_callbacks;
-
- /* stream indexing */
- gpr_uint32 next_stream_id;
- gpr_uint32 last_incoming_stream_id;
-
- /* settings */
- gpr_uint32 settings[NUM_SETTING_SETS][GRPC_CHTTP2_NUM_SETTINGS];
- gpr_uint32 force_send_settings; /* bitmask of setting indexes to send out */
- gpr_uint8 sent_local_settings; /* have local settings been sent? */
- gpr_uint8 dirtied_local_settings; /* are the local settings dirty? */
-
- /* window management */
- gpr_uint32 outgoing_window;
- gpr_uint32 incoming_window;
- gpr_uint32 connection_window_target;
-
- /* deframing */
- deframe_transport_state deframe_state;
- gpr_uint8 incoming_frame_type;
- gpr_uint8 incoming_frame_flags;
- gpr_uint8 header_eof;
- gpr_uint32 expect_continuation_stream_id;
- gpr_uint32 incoming_frame_size;
- gpr_uint32 incoming_stream_id;
-
- /* hpack encoding */
- grpc_chttp2_hpack_compressor hpack_compressor;
-
- /* various parsers */
- grpc_chttp2_hpack_parser hpack_parser;
- /* simple one shot parsers */
- union {
- grpc_chttp2_window_update_parser window_update;
- grpc_chttp2_settings_parser settings;
- grpc_chttp2_ping_parser ping;
- grpc_chttp2_rst_stream_parser rst_stream;
- } simple_parsers;
-
- /* goaway */
- grpc_chttp2_goaway_parser goaway_parser;
- pending_goaway *pending_goaways;
- size_t num_pending_goaways;
- size_t cap_pending_goaways;
-
- /* state for a stream that's not yet been created */
- grpc_stream_op_buffer new_stream_sopb;
-
- /* stream ops that need to be destroyed, but outside of the lock */
- grpc_stream_op_buffer nuke_later_sopb;
-
- /* active parser */
- void *parser_data;
- stream *incoming_stream;
- grpc_chttp2_parse_error (*parser)(void *parser_user_data,
- grpc_chttp2_parse_state *state,
- gpr_slice slice, int is_last);
-
- gpr_slice_buffer outbuf;
- gpr_slice_buffer qbuf;
-
- stream_list lists[STREAM_LIST_COUNT];
- grpc_chttp2_stream_map stream_map;
-
- /* metadata object cache */
- grpc_mdstr *str_grpc_timeout;
-
- /* pings */
- outstanding_ping *pings;
- size_t ping_count;
- size_t ping_capacity;
- gpr_int64 ping_counter;
-};
-
-struct stream {
- gpr_uint32 id;
-
- gpr_uint32 incoming_window;
- gpr_int64 outgoing_window;
- /* when the application requests writes be closed, the write_closed is
- 'queued'; when the close is flow controlled into the send path, we are
- 'sending' it; when the write has been performed it is 'sent' */
- write_state write_state;
- send_closed send_closed;
- gpr_uint8 read_closed;
- gpr_uint8 cancelled;
-
- op_closure send_done_closure;
- op_closure recv_done_closure;
-
- stream_link links[STREAM_LIST_COUNT];
- gpr_uint8 included[STREAM_LIST_COUNT];
-
- /* incoming metadata */
- grpc_linked_mdelem *incoming_metadata;
- size_t incoming_metadata_count;
- size_t incoming_metadata_capacity;
- grpc_linked_mdelem *old_incoming_metadata;
- gpr_timespec incoming_deadline;
-
- /* sops from application */
- grpc_stream_op_buffer *outgoing_sopb;
- grpc_stream_op_buffer *incoming_sopb;
- grpc_stream_state *publish_state;
- grpc_stream_state published_state;
- /* sops that have passed flow control to be written */
- grpc_stream_op_buffer writing_sopb;
-
- grpc_chttp2_data_parser parser;
-
- grpc_stream_state callback_state;
- grpc_stream_op_buffer callback_sopb;
-};
+#define STREAM_FROM_GLOBAL(sg) \
+ ((grpc_chttp2_stream *)((char *)(sg)-offsetof(grpc_chttp2_stream, global)))
static const grpc_transport_vtable vtable;
-static void push_setting(transport *t, grpc_chttp2_setting_id id,
- gpr_uint32 value);
+static void lock(grpc_chttp2_transport *t);
+static void unlock(grpc_chttp2_transport *t);
-static int prepare_callbacks(transport *t);
-static void run_callbacks(transport *t);
-static void call_cb_closed(transport *t, const grpc_transport_callbacks *cb);
+static void unlock_check_channel_callbacks(grpc_chttp2_transport *t);
+static void unlock_check_read_write_state(grpc_chttp2_transport *t);
-static int prepare_write(transport *t);
-static void perform_write(transport *t, grpc_endpoint *ep);
+/* forward declarations of various callbacks that we'll build closures around */
+static void writing_action(void *t, int iomgr_success_ignored);
+static void reading_action(void *t, int iomgr_success_ignored);
+static void notify_closed(void *t, int iomgr_success_ignored);
-static void lock(transport *t);
-static void unlock(transport *t);
+/** Set a transport level setting, and push it to our peer */
+static void push_setting(grpc_chttp2_transport *t, grpc_chttp2_setting_id id,
+ gpr_uint32 value);
-static void drop_connection(transport *t);
-static void end_all_the_calls(transport *t);
+/** Endpoint callback to process incoming data */
+static void recv_data(void *tp, gpr_slice *slices, size_t nslices,
+ grpc_endpoint_cb_status error);
-static stream *stream_list_remove_head(transport *t, stream_list_id id);
-static void stream_list_remove(transport *t, stream *s, stream_list_id id);
-static void stream_list_add_tail(transport *t, stream *s, stream_list_id id);
-static void stream_list_join(transport *t, stream *s, stream_list_id id);
+/** Start disconnection chain */
+static void drop_connection(grpc_chttp2_transport *t);
-static void cancel_stream_id(transport *t, gpr_uint32 id,
- grpc_status_code local_status,
- grpc_chttp2_error_code error_code, int send_rst);
-static void cancel_stream(transport *t, stream *s,
- grpc_status_code local_status,
- grpc_chttp2_error_code error_code,
- grpc_mdstr *optional_message, int send_rst);
-static void finalize_cancellations(transport *t);
-static stream *lookup_stream(transport *t, gpr_uint32 id);
-static void remove_from_stream_map(transport *t, stream *s);
-static void maybe_start_some_streams(transport *t);
+/** Perform a transport_op */
+static void perform_op_locked(grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global,
+ grpc_transport_op *op);
-static void become_skip_parser(transport *t);
+/** Cancel a stream: coming from the transport API */
+static void cancel_from_api(grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global,
+ grpc_status_code status);
-static void recv_data(void *tp, gpr_slice *slices, size_t nslices,
- grpc_endpoint_cb_status error);
+/** Add endpoint from this transport to pollset */
+static void add_to_pollset_locked(grpc_chttp2_transport *t,
+ grpc_pollset *pollset);
-static void schedule_cb(transport *t, op_closure closure, int success);
-static void maybe_finish_read(transport *t, stream *s);
-static void maybe_join_window_updates(transport *t, stream *s);
-static void finish_reads(transport *t);
-static void add_to_pollset_locked(transport *t, grpc_pollset *pollset);
-static void perform_op_locked(transport *t, stream *s, grpc_transport_op *op);
-static void add_metadata_batch(transport *t, stream *s);
-
-static void flowctl_trace(transport *t, const char *flow, gpr_int32 window,
- gpr_uint32 id, gpr_int32 delta) {
- gpr_log(GPR_DEBUG, "HTTP:FLOW:%p:%d:%s: %d + %d = %d", t, id, flow, window,
- delta, window + delta);
-}
+/** Start new streams that have been created if we can */
+static void maybe_start_some_streams(
+ grpc_chttp2_transport_global *transport_global);
/*
* CONSTRUCTION/DESTRUCTION/REFCOUNTING
*/
-static void destruct_transport(transport *t) {
+static void destruct_transport(grpc_chttp2_transport *t) {
size_t i;
gpr_mu_lock(&t->mu);
GPR_ASSERT(t->ep == NULL);
- gpr_slice_buffer_destroy(&t->outbuf);
- gpr_slice_buffer_destroy(&t->qbuf);
- grpc_chttp2_hpack_parser_destroy(&t->hpack_parser);
- grpc_chttp2_hpack_compressor_destroy(&t->hpack_compressor);
- grpc_chttp2_goaway_parser_destroy(&t->goaway_parser);
+ gpr_slice_buffer_destroy(&t->global.qbuf);
+
+ gpr_slice_buffer_destroy(&t->writing.outbuf);
+ grpc_chttp2_hpack_compressor_destroy(&t->writing.hpack_compressor);
+
+ gpr_slice_buffer_destroy(&t->parsing.qbuf);
+ grpc_chttp2_hpack_parser_destroy(&t->parsing.hpack_parser);
+ grpc_chttp2_goaway_parser_destroy(&t->parsing.goaway_parser);
- grpc_mdstr_unref(t->str_grpc_timeout);
+ grpc_mdstr_unref(t->parsing.str_grpc_timeout);
for (i = 0; i < STREAM_LIST_COUNT; i++) {
GPR_ASSERT(t->lists[i].head == NULL);
GPR_ASSERT(t->lists[i].tail == NULL);
}
- GPR_ASSERT(grpc_chttp2_stream_map_size(&t->stream_map) == 0);
+ GPR_ASSERT(grpc_chttp2_stream_map_size(&t->parsing_stream_map) == 0);
+ GPR_ASSERT(grpc_chttp2_stream_map_size(&t->new_stream_map) == 0);
- grpc_chttp2_stream_map_destroy(&t->stream_map);
+ grpc_chttp2_stream_map_destroy(&t->parsing_stream_map);
+ grpc_chttp2_stream_map_destroy(&t->new_stream_map);
gpr_mu_unlock(&t->mu);
gpr_mu_destroy(&t->mu);
- gpr_cv_destroy(&t->cv);
/* callback remaining pings: they're not allowed to call into the transpot,
and maybe they hold resources that need to be freed */
- for (i = 0; i < t->ping_count; i++) {
- t->pings[i].cb(t->pings[i].user_data);
+ while (t->global.pings.next != &t->global.pings) {
+ grpc_chttp2_outstanding_ping *ping = t->global.pings.next;
+ grpc_iomgr_add_delayed_callback(ping->on_recv, 0);
+ ping->next->prev = ping->prev;
+ ping->prev->next = ping->next;
+ gpr_free(ping);
}
- gpr_free(t->pings);
-
- gpr_free(t->pending_callbacks.callbacks);
- gpr_free(t->executing_callbacks.callbacks);
-
- for (i = 0; i < t->num_pending_goaways; i++) {
- gpr_slice_unref(t->pending_goaways[i].debug);
- }
- gpr_free(t->pending_goaways);
-
- grpc_sopb_destroy(&t->nuke_later_sopb);
grpc_mdctx_unref(t->metadata_context);
gpr_free(t);
}
-static void unref_transport(transport *t) {
+#ifdef REFCOUNTING_DEBUG
+#define REF_TRANSPORT(t, r) ref_transport(t, r, __FILE__, __LINE__)
+#define UNREF_TRANSPORT(t, r) unref_transport(t, r, __FILE__, __LINE__)
+static void unref_transport(grpc_chttp2_transport *t, const char *reason,
+ const char *file, int line) {
+ gpr_log(GPR_DEBUG, "chttp2:unref:%p %d->%d %s [%s:%d]", t, t->refs.count,
+ t->refs.count - 1, reason, file, line);
+ if (!gpr_unref(&t->refs)) return;
+ destruct_transport(t);
+}
+
+static void ref_transport(grpc_chttp2_transport *t, const char *reason,
+ const char *file, int line) {
+ gpr_log(GPR_DEBUG, "chttp2: ref:%p %d->%d %s [%s:%d]", t, t->refs.count,
+ t->refs.count + 1, reason, file, line);
+ gpr_ref(&t->refs);
+}
+#else
+#define REF_TRANSPORT(t, r) ref_transport(t)
+#define UNREF_TRANSPORT(t, r) unref_transport(t)
+static void unref_transport(grpc_chttp2_transport *t) {
if (!gpr_unref(&t->refs)) return;
destruct_transport(t);
}
-static void ref_transport(transport *t) { gpr_ref(&t->refs); }
+static void ref_transport(grpc_chttp2_transport *t) { gpr_ref(&t->refs); }
+#endif
-static void init_transport(transport *t, grpc_transport_setup_callback setup,
- void *arg, const grpc_channel_args *channel_args,
+static void init_transport(grpc_chttp2_transport *t,
+ grpc_transport_setup_callback setup, void *arg,
+ const grpc_channel_args *channel_args,
grpc_endpoint *ep, gpr_slice *slices, size_t nslices,
grpc_mdctx *mdctx, int is_client) {
size_t i;
int j;
grpc_transport_setup_result sr;
- GPR_ASSERT(strlen(CLIENT_CONNECT_STRING) == CLIENT_CONNECT_STRLEN);
+ GPR_ASSERT(strlen(GRPC_CHTTP2_CLIENT_CONNECT_STRING) ==
+ GRPC_CHTTP2_CLIENT_CONNECT_STRLEN);
memset(t, 0, sizeof(*t));
@@ -486,51 +214,65 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup,
/* one ref is for destroy, the other for when ep becomes NULL */
gpr_ref_init(&t->refs, 2);
gpr_mu_init(&t->mu);
- gpr_cv_init(&t->cv);
grpc_mdctx_ref(mdctx);
t->metadata_context = mdctx;
- t->str_grpc_timeout =
+ t->endpoint_reading = 1;
+ t->global.error_state = GRPC_CHTTP2_ERROR_STATE_NONE;
+ t->global.next_stream_id = is_client ? 1 : 2;
+ t->global.is_client = is_client;
+ t->global.outgoing_window = DEFAULT_WINDOW;
+ t->global.incoming_window = DEFAULT_WINDOW;
+ t->global.connection_window_target = DEFAULT_CONNECTION_WINDOW_TARGET;
+ t->global.ping_counter = 1;
+ t->global.pings.next = t->global.pings.prev = &t->global.pings;
+ t->parsing.is_client = is_client;
+ t->parsing.str_grpc_timeout =
grpc_mdstr_from_string(t->metadata_context, "grpc-timeout");
- t->reading = 1;
- t->error_state = ERROR_STATE_NONE;
- t->next_stream_id = is_client ? 1 : 2;
- t->is_client = is_client;
- t->outgoing_window = DEFAULT_WINDOW;
- t->incoming_window = DEFAULT_WINDOW;
- t->connection_window_target = DEFAULT_CONNECTION_WINDOW_TARGET;
- t->deframe_state = is_client ? DTS_FH_0 : DTS_CLIENT_PREFIX_0;
- t->ping_counter = gpr_now().tv_nsec;
- grpc_chttp2_hpack_compressor_init(&t->hpack_compressor, mdctx);
- grpc_chttp2_goaway_parser_init(&t->goaway_parser);
- gpr_slice_buffer_init(&t->outbuf);
- gpr_slice_buffer_init(&t->qbuf);
- grpc_sopb_init(&t->nuke_later_sopb);
- grpc_chttp2_hpack_parser_init(&t->hpack_parser, t->metadata_context);
+ t->parsing.deframe_state =
+ is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0;
+ t->writing.is_client = is_client;
+
+ gpr_slice_buffer_init(&t->global.qbuf);
+
+ gpr_slice_buffer_init(&t->writing.outbuf);
+ grpc_chttp2_hpack_compressor_init(&t->writing.hpack_compressor, mdctx);
+ grpc_iomgr_closure_init(&t->writing_action, writing_action, t);
+ grpc_iomgr_closure_init(&t->reading_action, reading_action, t);
+
+ gpr_slice_buffer_init(&t->parsing.qbuf);
+ grpc_chttp2_goaway_parser_init(&t->parsing.goaway_parser);
+ grpc_chttp2_hpack_parser_init(&t->parsing.hpack_parser, t->metadata_context);
+
+ grpc_iomgr_closure_init(&t->channel_callback.notify_closed, notify_closed, t);
if (is_client) {
- gpr_slice_buffer_add(&t->qbuf,
- gpr_slice_from_copied_string(CLIENT_CONNECT_STRING));
+ gpr_slice_buffer_add(
+ &t->global.qbuf,
+ gpr_slice_from_copied_string(GRPC_CHTTP2_CLIENT_CONNECT_STRING));
}
/* 8 is a random stab in the dark as to a good initial size: it's small enough
that it shouldn't waste memory for infrequently used connections, yet
large enough that the exponential growth should happen nicely when it's
needed.
TODO(ctiller): tune this */
- grpc_chttp2_stream_map_init(&t->stream_map, 8);
+ grpc_chttp2_stream_map_init(&t->parsing_stream_map, 8);
+ grpc_chttp2_stream_map_init(&t->new_stream_map, 8);
/* copy in initial settings to all setting sets */
- for (i = 0; i < NUM_SETTING_SETS; i++) {
- for (j = 0; j < GRPC_CHTTP2_NUM_SETTINGS; j++) {
- t->settings[i][j] = grpc_chttp2_settings_parameters[j].default_value;
+ for (i = 0; i < GRPC_CHTTP2_NUM_SETTINGS; i++) {
+ t->parsing.settings[i] = grpc_chttp2_settings_parameters[i].default_value;
+ for (j = 0; j < GRPC_NUM_SETTING_SETS; j++) {
+ t->global.settings[j][i] =
+ grpc_chttp2_settings_parameters[i].default_value;
}
}
- t->dirtied_local_settings = 1;
+ t->global.dirtied_local_settings = 1;
/* Hack: it's common for implementations to assume 65536 bytes initial send
window -- this should by rights be 0 */
- t->force_send_settings = 1 << GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
- t->sent_local_settings = 0;
+ t->global.force_send_settings = 1 << GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
+ t->global.sent_local_settings = 0;
/* configure http2 the way we like it */
- if (t->is_client) {
+ if (is_client) {
push_setting(t, GRPC_CHTTP2_SETTINGS_ENABLE_PUSH, 0);
push_setting(t, GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 0);
}
@@ -540,7 +282,7 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup,
for (i = 0; i < channel_args->num_args; i++) {
if (0 ==
strcmp(channel_args->args[i].key, GRPC_ARG_MAX_CONCURRENT_STREAMS)) {
- if (t->is_client) {
+ if (is_client) {
gpr_log(GPR_ERROR, "%s: is ignored on the client",
GRPC_ARG_MAX_CONCURRENT_STREAMS);
} else if (channel_args->args[i].type != GRPC_ARG_INTEGER) {
@@ -555,357 +297,212 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup,
if (channel_args->args[i].type != GRPC_ARG_INTEGER) {
gpr_log(GPR_ERROR, "%s: must be an integer",
GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER);
- } else if ((t->next_stream_id & 1) !=
+ } else if ((t->global.next_stream_id & 1) !=
(channel_args->args[i].value.integer & 1)) {
gpr_log(GPR_ERROR, "%s: low bit must be %d on %s",
- GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER, t->next_stream_id & 1,
- t->is_client ? "client" : "server");
+ GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER,
+ t->global.next_stream_id & 1,
+ is_client ? "client" : "server");
} else {
- t->next_stream_id = channel_args->args[i].value.integer;
+ t->global.next_stream_id = channel_args->args[i].value.integer;
}
}
}
}
gpr_mu_lock(&t->mu);
- t->calling_back_channel = 1;
- ref_transport(t); /* matches unref at end of this function */
+ t->channel_callback.executing = 1;
+ REF_TRANSPORT(t, "init"); /* matches unref at end of this function */
gpr_mu_unlock(&t->mu);
sr = setup(arg, &t->base, t->metadata_context);
lock(t);
- t->cb = sr.callbacks;
- t->cb_user_data = sr.user_data;
- t->calling_back_channel = 0;
- if (t->destroying) gpr_cv_signal(&t->cv);
+ t->channel_callback.cb = sr.callbacks;
+ t->channel_callback.cb_user_data = sr.user_data;
+ t->channel_callback.executing = 0;
unlock(t);
- ref_transport(t); /* matches unref inside recv_data */
+ REF_TRANSPORT(t, "recv_data"); /* matches unref inside recv_data */
recv_data(t, slices, nslices, GRPC_ENDPOINT_CB_OK);
- unref_transport(t);
+ UNREF_TRANSPORT(t, "init");
}
static void destroy_transport(grpc_transport *gt) {
- transport *t = (transport *)gt;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
lock(t);
t->destroying = 1;
- /* Wait for pending stuff to finish.
- We need to be not calling back to ensure that closed() gets a chance to
- trigger if needed during unlock() before we die.
- We need to be not writing as cancellation finalization may produce some
- callbacks that NEED to be made to close out some streams when t->writing
- becomes 0. */
- while (t->calling_back_channel || t->writing) {
- gpr_cv_wait(&t->cv, &t->mu, gpr_inf_future);
- }
drop_connection(t);
unlock(t);
- /* The drop_connection() above puts the transport into an error state, and
- the follow-up unlock should then (as part of the cleanup work it does)
- ensure that cb is NULL, and therefore not call back anything further.
- This check validates this very subtle behavior.
- It's shutdown path, so I don't believe an extra lock pair is going to be
- problematic for performance. */
- lock(t);
- GPR_ASSERT(!t->cb);
- unlock(t);
+ UNREF_TRANSPORT(t, "destroy");
+}
- unref_transport(t);
+static void close_transport_locked(grpc_chttp2_transport *t) {
+ if (!t->closed) {
+ t->closed = 1;
+ if (t->ep) {
+ grpc_endpoint_shutdown(t->ep);
+ }
+ }
}
static void close_transport(grpc_transport *gt) {
- transport *t = (transport *)gt;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
gpr_mu_lock(&t->mu);
- GPR_ASSERT(!t->closed);
- t->closed = 1;
- if (t->ep) {
- grpc_endpoint_shutdown(t->ep);
- }
+ close_transport_locked(t);
gpr_mu_unlock(&t->mu);
}
static void goaway(grpc_transport *gt, grpc_status_code status,
gpr_slice debug_data) {
- transport *t = (transport *)gt;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
lock(t);
- grpc_chttp2_goaway_append(t->last_incoming_stream_id,
+ grpc_chttp2_goaway_append(t->global.last_incoming_stream_id,
grpc_chttp2_grpc_status_to_http2_error(status),
- debug_data, &t->qbuf);
+ debug_data, &t->global.qbuf);
unlock(t);
}
static int init_stream(grpc_transport *gt, grpc_stream *gs,
const void *server_data, grpc_transport_op *initial_op) {
- transport *t = (transport *)gt;
- stream *s = (stream *)gs;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+ grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
memset(s, 0, sizeof(*s));
- ref_transport(t);
+ grpc_chttp2_incoming_metadata_buffer_init(&s->parsing.incoming_metadata);
+ grpc_chttp2_incoming_metadata_buffer_init(&s->global.incoming_metadata);
+ grpc_sopb_init(&s->writing.sopb);
+ grpc_sopb_init(&s->global.incoming_sopb);
+ grpc_chttp2_data_parser_init(&s->parsing.data_parser);
- if (!server_data) {
- lock(t);
- s->id = 0;
- s->outgoing_window = 0;
- s->incoming_window = 0;
- } else {
- /* already locked */
- s->id = (gpr_uint32)(gpr_uintptr)server_data;
- s->outgoing_window =
- t->settings[PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
- s->incoming_window =
- t->settings[SENT_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
- t->incoming_stream = s;
- grpc_chttp2_stream_map_add(&t->stream_map, s->id, s);
- }
-
- s->incoming_deadline = gpr_inf_future;
- grpc_sopb_init(&s->writing_sopb);
- grpc_sopb_init(&s->callback_sopb);
- grpc_chttp2_data_parser_init(&s->parser);
+ REF_TRANSPORT(t, "stream");
- if (initial_op) perform_op_locked(t, s, initial_op);
-
- if (!server_data) {
- unlock(t);
- }
+ lock(t);
+ grpc_chttp2_register_stream(t, s);
+ if (server_data) {
+ GPR_ASSERT(t->parsing_active);
+ s->global.id = (gpr_uint32)(gpr_uintptr)server_data;
+ s->global.outgoing_window =
+ t->global.settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
+ s->parsing.incoming_window = s->global.incoming_window =
+ t->global.settings[GRPC_SENT_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
+ *t->accepting_stream = s;
+ grpc_chttp2_stream_map_add(&t->parsing_stream_map, s->global.id, s);
+ s->global.in_stream_map = 1;
+ }
+
+ if (initial_op) perform_op_locked(&t->global, &s->global, initial_op);
+ unlock(t);
return 0;
}
-static void schedule_nuke_sopb(transport *t, grpc_stream_op_buffer *sopb) {
- grpc_sopb_append(&t->nuke_later_sopb, sopb->ops, sopb->nops);
- sopb->nops = 0;
-}
-
static void destroy_stream(grpc_transport *gt, grpc_stream *gs) {
- transport *t = (transport *)gt;
- stream *s = (stream *)gs;
- size_t i;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+ grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
+ int i;
gpr_mu_lock(&t->mu);
- /* stop parsing if we're currently parsing this stream */
- if (t->deframe_state == DTS_FRAME && t->incoming_stream_id == s->id &&
- s->id != 0) {
- become_skip_parser(t);
+ GPR_ASSERT(s->global.published_state == GRPC_STREAM_CLOSED ||
+ s->global.id == 0);
+ GPR_ASSERT(!s->global.in_stream_map);
+ grpc_chttp2_unregister_stream(t, s);
+ if (!t->parsing_active && s->global.id) {
+ GPR_ASSERT(grpc_chttp2_stream_map_find(&t->parsing_stream_map,
+ s->global.id) == NULL);
}
- for (i = 0; i < STREAM_LIST_COUNT; i++) {
- stream_list_remove(t, s, i);
- }
- remove_from_stream_map(t, s);
+ grpc_chttp2_list_remove_incoming_window_updated(&t->global, &s->global);
+ grpc_chttp2_list_remove_writable_window_update_stream(&t->global, &s->global);
gpr_mu_unlock(&t->mu);
- GPR_ASSERT(s->outgoing_sopb == NULL);
- GPR_ASSERT(s->incoming_sopb == NULL);
- grpc_sopb_destroy(&s->writing_sopb);
- grpc_sopb_destroy(&s->callback_sopb);
- grpc_chttp2_data_parser_destroy(&s->parser);
- for (i = 0; i < s->incoming_metadata_count; i++) {
- grpc_mdelem_unref(s->incoming_metadata[i].md);
+ for (i = 0; i < STREAM_LIST_COUNT; i++) {
+ GPR_ASSERT(!s->included[i]);
}
- gpr_free(s->incoming_metadata);
- gpr_free(s->old_incoming_metadata);
- unref_transport(t);
-}
+ GPR_ASSERT(s->global.outgoing_sopb == NULL);
+ GPR_ASSERT(s->global.publish_sopb == NULL);
+ grpc_sopb_destroy(&s->writing.sopb);
+ grpc_sopb_destroy(&s->global.incoming_sopb);
+ grpc_chttp2_data_parser_destroy(&s->parsing.data_parser);
+ grpc_chttp2_incoming_metadata_buffer_destroy(&s->parsing.incoming_metadata);
+ grpc_chttp2_incoming_metadata_buffer_destroy(&s->global.incoming_metadata);
+ grpc_chttp2_incoming_metadata_live_op_buffer_end(
+ &s->global.outstanding_metadata);
-/*
- * LIST MANAGEMENT
- */
-
-static int stream_list_empty(transport *t, stream_list_id id) {
- return t->lists[id].head == NULL;
+ UNREF_TRANSPORT(t, "stream");
}
-static stream *stream_list_remove_head(transport *t, stream_list_id id) {
- stream *s = t->lists[id].head;
- if (s) {
- stream *new_head = s->links[id].next;
- GPR_ASSERT(s->included[id]);
- if (new_head) {
- t->lists[id].head = new_head;
- new_head->links[id].prev = NULL;
- } else {
- t->lists[id].head = NULL;
- t->lists[id].tail = NULL;
- }
- s->included[id] = 0;
- }
- return s;
+grpc_chttp2_stream_parsing *grpc_chttp2_parsing_lookup_stream(
+ grpc_chttp2_transport_parsing *transport_parsing, gpr_uint32 id) {
+ grpc_chttp2_transport *t = TRANSPORT_FROM_PARSING(transport_parsing);
+ grpc_chttp2_stream *s =
+ grpc_chttp2_stream_map_find(&t->parsing_stream_map, id);
+ return s ? &s->parsing : NULL;
}
-static void stream_list_remove(transport *t, stream *s, stream_list_id id) {
- if (!s->included[id]) return;
- s->included[id] = 0;
- if (s->links[id].prev) {
- s->links[id].prev->links[id].next = s->links[id].next;
- } else {
- GPR_ASSERT(t->lists[id].head == s);
- t->lists[id].head = s->links[id].next;
- }
- if (s->links[id].next) {
- s->links[id].next->links[id].prev = s->links[id].prev;
- } else {
- t->lists[id].tail = s->links[id].prev;
- }
-}
-
-static void stream_list_add_tail(transport *t, stream *s, stream_list_id id) {
- stream *old_tail;
- GPR_ASSERT(!s->included[id]);
- old_tail = t->lists[id].tail;
- s->links[id].next = NULL;
- s->links[id].prev = old_tail;
- if (old_tail) {
- old_tail->links[id].next = s;
- } else {
- s->links[id].prev = NULL;
- t->lists[id].head = s;
- }
- t->lists[id].tail = s;
- s->included[id] = 1;
-}
-
-static void stream_list_join(transport *t, stream *s, stream_list_id id) {
- if (s->included[id]) {
- return;
- }
- stream_list_add_tail(t, s, id);
-}
-
-static void remove_from_stream_map(transport *t, stream *s) {
- if (s->id == 0) return;
- IF_TRACING(gpr_log(GPR_DEBUG, "HTTP:%s: Removing stream %d",
- t->is_client ? "CLI" : "SVR", s->id));
- if (grpc_chttp2_stream_map_delete(&t->stream_map, s->id)) {
- maybe_start_some_streams(t);
- }
+grpc_chttp2_stream_parsing *grpc_chttp2_parsing_accept_stream(
+ grpc_chttp2_transport_parsing *transport_parsing, gpr_uint32 id) {
+ grpc_chttp2_stream *accepting;
+ grpc_chttp2_transport *t = TRANSPORT_FROM_PARSING(transport_parsing);
+ GPR_ASSERT(t->accepting_stream == NULL);
+ t->accepting_stream = &accepting;
+ t->channel_callback.cb->accept_stream(t->channel_callback.cb_user_data,
+ &t->base, (void *)(gpr_uintptr)id);
+ t->accepting_stream = NULL;
+ return &accepting->parsing;
}
/*
* LOCK MANAGEMENT
*/
-/* We take a transport-global lock in response to calls coming in from above,
+/* We take a grpc_chttp2_transport-global lock in response to calls coming in
+ from above,
and in response to data being received from below. New data to be written
is always queued, as are callbacks to process data. During unlock() we
check our todo lists and initiate callbacks and flush writes. */
-static void lock(transport *t) { gpr_mu_lock(&t->mu); }
-
-static void unlock(transport *t) {
- int start_write = 0;
- int perform_callbacks = 0;
- int call_closed = 0;
- int num_goaways = 0;
- int i;
- pending_goaway *goaways = NULL;
- grpc_endpoint *ep = t->ep;
- grpc_stream_op_buffer nuke_now;
- const grpc_transport_callbacks *cb = t->cb;
-
- GRPC_TIMER_BEGIN(GRPC_PTAG_HTTP2_UNLOCK, 0);
+static void lock(grpc_chttp2_transport *t) { gpr_mu_lock(&t->mu); }
- grpc_sopb_init(&nuke_now);
- if (t->nuke_later_sopb.nops) {
- grpc_sopb_swap(&nuke_now, &t->nuke_later_sopb);
- }
-
- /* see if we need to trigger a write - and if so, get the data ready */
- if (ep && !t->writing) {
- t->writing = start_write = prepare_write(t);
- if (start_write) {
- ref_transport(t);
- }
- }
+static void unlock(grpc_chttp2_transport *t) {
+ grpc_iomgr_closure *run_closures;
- if (!t->writing) {
- finalize_cancellations(t);
+ unlock_check_read_write_state(t);
+ if (!t->writing_active && t->global.error_state == GRPC_CHTTP2_ERROR_STATE_NONE &&
+ grpc_chttp2_unlocking_check_writes(&t->global, &t->writing)) {
+ t->writing_active = 1;
+ REF_TRANSPORT(t, "writing");
+ grpc_chttp2_schedule_closure(&t->global, &t->writing_action, 1);
}
+ /* unlock_check_parser(t); */
+ unlock_check_channel_callbacks(t);
- finish_reads(t);
-
- /* gather any callbacks that need to be made */
- if (!t->calling_back_ops) {
- t->calling_back_ops = perform_callbacks = prepare_callbacks(t);
- if (perform_callbacks) ref_transport(t);
- }
-
- if (!t->calling_back_channel && cb) {
- if (t->error_state == ERROR_STATE_SEEN && !t->writing) {
- call_closed = 1;
- t->calling_back_channel = 1;
- t->cb = NULL; /* no more callbacks */
- t->error_state = ERROR_STATE_NOTIFIED;
- }
- if (t->num_pending_goaways) {
- goaways = t->pending_goaways;
- num_goaways = t->num_pending_goaways;
- t->pending_goaways = NULL;
- t->num_pending_goaways = 0;
- t->cap_pending_goaways = 0;
- t->calling_back_channel = 1;
- }
- if (call_closed || num_goaways) {
- ref_transport(t);
- }
- }
+ run_closures = t->global.pending_closures;
+ t->global.pending_closures = NULL;
- /* finally unlock */
gpr_mu_unlock(&t->mu);
- GRPC_TIMER_MARK(GRPC_PTAG_HTTP2_UNLOCK_CLEANUP, 0);
-
- /* perform some callbacks if necessary */
- for (i = 0; i < num_goaways; i++) {
- cb->goaway(t->cb_user_data, &t->base, goaways[i].status, goaways[i].debug);
- }
-
- if (perform_callbacks) {
- run_callbacks(t);
- lock(t);
- t->calling_back_ops = 0;
- unlock(t);
- unref_transport(t);
- }
-
- if (call_closed) {
- call_cb_closed(t, cb);
- }
-
- /* write some bytes if necessary */
- if (start_write) {
- /* ultimately calls unref_transport(t); and clears t->writing */
- perform_write(t, ep);
- }
-
- if (call_closed || num_goaways) {
- lock(t);
- t->calling_back_channel = 0;
- if (t->destroying) gpr_cv_signal(&t->cv);
- unlock(t);
- unref_transport(t);
+ while (run_closures) {
+ grpc_iomgr_closure *next = run_closures->next;
+ run_closures->cb(run_closures->cb_arg, run_closures->success);
+ run_closures = next;
}
-
- grpc_sopb_destroy(&nuke_now);
-
- gpr_free(goaways);
-
- GRPC_TIMER_END(GRPC_PTAG_HTTP2_UNLOCK, 0);
}
/*
* OUTPUT PROCESSING
*/
-static void push_setting(transport *t, grpc_chttp2_setting_id id,
+static void push_setting(grpc_chttp2_transport *t, grpc_chttp2_setting_id id,
gpr_uint32 value) {
const grpc_chttp2_setting_parameters *sp =
&grpc_chttp2_settings_parameters[id];
@@ -914,292 +511,196 @@ static void push_setting(transport *t, grpc_chttp2_setting_id id,
gpr_log(GPR_INFO, "Requested parameter %s clamped from %d to %d", sp->name,
value, use_value);
}
- if (use_value != t->settings[LOCAL_SETTINGS][id]) {
- t->settings[LOCAL_SETTINGS][id] = use_value;
- t->dirtied_local_settings = 1;
- }
-}
-
-static int prepare_write(transport *t) {
- stream *s;
- gpr_uint32 window_delta;
-
- /* simple writes are queued to qbuf, and flushed here */
- gpr_slice_buffer_swap(&t->qbuf, &t->outbuf);
- GPR_ASSERT(t->qbuf.count == 0);
-
- if (t->dirtied_local_settings && !t->sent_local_settings) {
- gpr_slice_buffer_add(
- &t->outbuf, grpc_chttp2_settings_create(
- t->settings[SENT_SETTINGS], t->settings[LOCAL_SETTINGS],
- t->force_send_settings, GRPC_CHTTP2_NUM_SETTINGS));
- t->force_send_settings = 0;
- t->dirtied_local_settings = 0;
- t->sent_local_settings = 1;
- }
-
- /* for each stream that's become writable, frame it's data (according to
- available window sizes) and add to the output buffer */
- while (t->outgoing_window && (s = stream_list_remove_head(t, WRITABLE)) &&
- s->outgoing_window > 0) {
- window_delta = grpc_chttp2_preencode(
- s->outgoing_sopb->ops, &s->outgoing_sopb->nops,
- GPR_MIN(t->outgoing_window, s->outgoing_window), &s->writing_sopb);
- FLOWCTL_TRACE(t, t, outgoing, 0, -(gpr_int64)window_delta);
- FLOWCTL_TRACE(t, s, outgoing, s->id, -(gpr_int64)window_delta);
- t->outgoing_window -= window_delta;
- s->outgoing_window -= window_delta;
-
- if (s->write_state == WRITE_STATE_QUEUED_CLOSE &&
- s->outgoing_sopb->nops == 0) {
- if (!t->is_client && !s->read_closed) {
- s->send_closed = SEND_CLOSED_WITH_RST_STREAM;
- } else {
- s->send_closed = SEND_CLOSED;
- }
- }
- if (s->writing_sopb.nops > 0 || s->send_closed) {
- stream_list_join(t, s, WRITING);
- }
-
- /* we should either exhaust window or have no ops left, but not both */
- if (s->outgoing_sopb->nops == 0) {
- s->outgoing_sopb = NULL;
- schedule_cb(t, s->send_done_closure, 1);
- } else if (s->outgoing_window) {
- stream_list_add_tail(t, s, WRITABLE);
- }
- }
-
- /* for each stream that wants to update its window, add that window here */
- while ((s = stream_list_remove_head(t, WINDOW_UPDATE))) {
- window_delta =
- t->settings[LOCAL_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] -
- s->incoming_window;
- if (!s->read_closed && window_delta) {
- gpr_slice_buffer_add(
- &t->outbuf, grpc_chttp2_window_update_create(s->id, window_delta));
- FLOWCTL_TRACE(t, s, incoming, s->id, window_delta);
- s->incoming_window += window_delta;
- }
- }
-
- /* if the transport is ready to send a window update, do so here also */
- if (t->incoming_window < t->connection_window_target * 3 / 4) {
- window_delta = t->connection_window_target - t->incoming_window;
- gpr_slice_buffer_add(&t->outbuf,
- grpc_chttp2_window_update_create(0, window_delta));
- FLOWCTL_TRACE(t, t, incoming, 0, window_delta);
- t->incoming_window += window_delta;
+ if (use_value != t->global.settings[GRPC_LOCAL_SETTINGS][id]) {
+ t->global.settings[GRPC_LOCAL_SETTINGS][id] = use_value;
+ t->global.dirtied_local_settings = 1;
}
-
- return t->outbuf.length > 0 || !stream_list_empty(t, WRITING);
}
-static void finalize_outbuf(transport *t) {
- stream *s;
-
- while ((s = stream_list_remove_head(t, WRITING))) {
- grpc_chttp2_encode(s->writing_sopb.ops, s->writing_sopb.nops,
- s->send_closed != DONT_SEND_CLOSED, s->id, &t->hpack_compressor, &t->outbuf);
- s->writing_sopb.nops = 0;
- if (s->send_closed == SEND_CLOSED_WITH_RST_STREAM) {
- gpr_slice_buffer_add(&t->outbuf, grpc_chttp2_rst_stream_create(s->id, GRPC_CHTTP2_NO_ERROR));
- }
- if (s->send_closed != DONT_SEND_CLOSED) {
- stream_list_join(t, s, WRITTEN_CLOSED);
- }
- }
-}
-
-static void finish_write_common(transport *t, int success) {
- stream *s;
+void grpc_chttp2_terminate_writing(
+ grpc_chttp2_transport_writing *transport_writing, int success) {
+ grpc_chttp2_transport *t = TRANSPORT_FROM_WRITING(transport_writing);
lock(t);
+
if (!success) {
drop_connection(t);
}
- while ((s = stream_list_remove_head(t, WRITTEN_CLOSED))) {
- s->write_state = WRITE_STATE_SENT_CLOSE;
- if (!t->is_client) {
- s->read_closed = 1;
- }
- maybe_finish_read(t, s);
- }
- t->outbuf.count = 0;
- t->outbuf.length = 0;
+
+ /* cleanup writing related jazz */
+ grpc_chttp2_cleanup_writing(&t->global, &t->writing);
+
/* leave the writing flag up on shutdown to prevent further writes in unlock()
from starting */
- t->writing = 0;
- if (t->destroying) {
- gpr_cv_signal(&t->cv);
- }
- if (!t->reading) {
+ t->writing_active = 0;
+ if (t->ep && !t->endpoint_reading) {
grpc_endpoint_destroy(t->ep);
t->ep = NULL;
- unref_transport(t); /* safe because we'll still have the ref for write */
+ UNREF_TRANSPORT(
+ t, "disconnect"); /* safe because we'll still have the ref for write */
}
- unlock(t);
- unref_transport(t);
-}
-
-static void finish_write(void *tp, grpc_endpoint_cb_status error) {
- transport *t = tp;
- finish_write_common(t, error == GRPC_ENDPOINT_CB_OK);
-}
-
-static void perform_write(transport *t, grpc_endpoint *ep) {
- finalize_outbuf(t);
-
- GPR_ASSERT(t->outbuf.count > 0);
+ unlock(t);
- switch (grpc_endpoint_write(ep, t->outbuf.slices, t->outbuf.count,
- finish_write, t)) {
- case GRPC_ENDPOINT_WRITE_DONE:
- finish_write_common(t, 1);
- break;
- case GRPC_ENDPOINT_WRITE_ERROR:
- finish_write_common(t, 0);
- break;
- case GRPC_ENDPOINT_WRITE_PENDING:
- break;
- }
+ UNREF_TRANSPORT(t, "writing");
}
-static void add_goaway(transport *t, gpr_uint32 goaway_error, gpr_slice goaway_text) {
- if (t->num_pending_goaways == t->cap_pending_goaways) {
- t->cap_pending_goaways = GPR_MAX(1, t->cap_pending_goaways * 2);
- t->pending_goaways =
- gpr_realloc(t->pending_goaways,
- sizeof(pending_goaway) * t->cap_pending_goaways);
- }
- t->pending_goaways[t->num_pending_goaways].status =
- grpc_chttp2_http2_error_to_grpc_status(goaway_error);
- t->pending_goaways[t->num_pending_goaways].debug = goaway_text;
- t->num_pending_goaways++;
+static void writing_action(void *gt, int iomgr_success_ignored) {
+ grpc_chttp2_transport *t = gt;
+ grpc_chttp2_perform_writes(&t->writing, t->ep);
}
-
-static void maybe_start_some_streams(transport *t) {
- /* start streams where we have free stream ids and free concurrency */
- while (
- t->next_stream_id <= MAX_CLIENT_STREAM_ID &&
- grpc_chttp2_stream_map_size(&t->stream_map) <
- t->settings[PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS]) {
- stream *s = stream_list_remove_head(t, WAITING_FOR_CONCURRENCY);
- if (!s) return;
-
- IF_TRACING(gpr_log(GPR_DEBUG, "HTTP:%s: Allocating new stream %p to id %d",
- t->is_client ? "CLI" : "SVR", s, t->next_stream_id));
-
- if (t->next_stream_id == MAX_CLIENT_STREAM_ID) {
- add_goaway(t, GRPC_CHTTP2_NO_ERROR, gpr_slice_from_copied_string("Exceeded sequence number limit"));
+void grpc_chttp2_add_incoming_goaway(
+ grpc_chttp2_transport_global *transport_global, gpr_uint32 goaway_error,
+ gpr_slice goaway_text) {
+ char *msg = gpr_hexdump((char*)GPR_SLICE_START_PTR(goaway_text), GPR_SLICE_LENGTH(goaway_text), GPR_HEXDUMP_PLAINTEXT);
+ gpr_free(msg);
+ if (transport_global->goaway_state == GRPC_CHTTP2_ERROR_STATE_NONE) {
+ transport_global->goaway_state = GRPC_CHTTP2_ERROR_STATE_SEEN;
+ transport_global->goaway_text = goaway_text;
+ transport_global->goaway_error = goaway_error;
+ } else {
+ gpr_slice_unref(goaway_text);
+ }
+}
+
+static void maybe_start_some_streams(
+ grpc_chttp2_transport_global *transport_global) {
+ grpc_chttp2_stream_global *stream_global;
+ /* start streams where we have free grpc_chttp2_stream ids and free
+ * concurrency */
+ while (transport_global->next_stream_id <= MAX_CLIENT_STREAM_ID &&
+ transport_global->concurrent_stream_count <
+ transport_global
+ ->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS] &&
+ grpc_chttp2_list_pop_waiting_for_concurrency(transport_global,
+ &stream_global)) {
+ GRPC_CHTTP2_IF_TRACING(gpr_log(
+ GPR_DEBUG, "HTTP:%s: Allocating new grpc_chttp2_stream %p to id %d",
+ transport_global->is_client ? "CLI" : "SVR", stream_global,
+ transport_global->next_stream_id));
+
+ GPR_ASSERT(stream_global->id == 0);
+ stream_global->id = transport_global->next_stream_id;
+ transport_global->next_stream_id += 2;
+
+ if (transport_global->next_stream_id >= MAX_CLIENT_STREAM_ID) {
+ grpc_chttp2_add_incoming_goaway(
+ transport_global, GRPC_CHTTP2_NO_ERROR,
+ gpr_slice_from_copied_string("Exceeded sequence number limit"));
}
- GPR_ASSERT(s->id == 0);
- s->id = t->next_stream_id;
- t->next_stream_id += 2;
- s->outgoing_window =
- t->settings[PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
- s->incoming_window =
- t->settings[SENT_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
- grpc_chttp2_stream_map_add(&t->stream_map, s->id, s);
- stream_list_join(t, s, WRITABLE);
+ stream_global->outgoing_window =
+ transport_global->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
+ stream_global->incoming_window =
+ transport_global->settings[GRPC_SENT_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
+ grpc_chttp2_stream_map_add(
+ &TRANSPORT_FROM_GLOBAL(transport_global)->new_stream_map,
+ stream_global->id, STREAM_FROM_GLOBAL(stream_global));
+ stream_global->in_stream_map = 1;
+ transport_global->concurrent_stream_count++;
+ grpc_chttp2_list_add_incoming_window_updated(transport_global,
+ stream_global);
+ grpc_chttp2_list_add_writable_stream(transport_global, stream_global);
}
/* cancel out streams that will never be started */
- while (t->next_stream_id > MAX_CLIENT_STREAM_ID) {
- stream *s = stream_list_remove_head(t, WAITING_FOR_CONCURRENCY);
- if (!s) return;
-
- cancel_stream(t, s, GRPC_STATUS_UNAVAILABLE, grpc_chttp2_grpc_status_to_http2_error(GRPC_STATUS_UNAVAILABLE), NULL, 0);
+ while (transport_global->next_stream_id >= MAX_CLIENT_STREAM_ID &&
+ grpc_chttp2_list_pop_waiting_for_concurrency(transport_global,
+ &stream_global)) {
+ cancel_from_api(transport_global, stream_global, GRPC_STATUS_UNAVAILABLE);
}
}
-static void perform_op_locked(transport *t, stream *s, grpc_transport_op *op) {
+static void perform_op_locked(grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global,
+ grpc_transport_op *op) {
if (op->cancel_with_status != GRPC_STATUS_OK) {
- cancel_stream(
- t, s, op->cancel_with_status,
- grpc_chttp2_grpc_status_to_http2_error(op->cancel_with_status),
- op->cancel_message, 1);
+ cancel_from_api(transport_global, stream_global, op->cancel_with_status);
}
if (op->send_ops) {
- GPR_ASSERT(s->outgoing_sopb == NULL);
- s->send_done_closure.cb = op->on_done_send;
- s->send_done_closure.user_data = op->send_user_data;
- if (!s->cancelled) {
- s->outgoing_sopb = op->send_ops;
- if (op->is_last_send && s->write_state == WRITE_STATE_OPEN) {
- s->write_state = WRITE_STATE_QUEUED_CLOSE;
+ GPR_ASSERT(stream_global->outgoing_sopb == NULL);
+ stream_global->send_done_closure = op->on_done_send;
+ if (!stream_global->cancelled) {
+ stream_global->outgoing_sopb = op->send_ops;
+ if (op->is_last_send &&
+ stream_global->write_state == GRPC_WRITE_STATE_OPEN) {
+ stream_global->write_state = GRPC_WRITE_STATE_QUEUED_CLOSE;
}
- if (s->id == 0) {
- IF_TRACING(gpr_log(GPR_DEBUG,
- "HTTP:%s: New stream %p waiting for concurrency",
- t->is_client ? "CLI" : "SVR", s));
- stream_list_join(t, s, WAITING_FOR_CONCURRENCY);
- maybe_start_some_streams(t);
- } else if (s->outgoing_window > 0) {
- stream_list_join(t, s, WRITABLE);
+ if (stream_global->id == 0) {
+ GRPC_CHTTP2_IF_TRACING(gpr_log(
+ GPR_DEBUG,
+ "HTTP:%s: New grpc_chttp2_stream %p waiting for concurrency",
+ transport_global->is_client ? "CLI" : "SVR", stream_global));
+ grpc_chttp2_list_add_waiting_for_concurrency(transport_global,
+ stream_global);
+ maybe_start_some_streams(transport_global);
+ } else if (stream_global->outgoing_window > 0) {
+ grpc_chttp2_list_add_writable_stream(transport_global, stream_global);
}
} else {
- schedule_nuke_sopb(t, op->send_ops);
- schedule_cb(t, s->send_done_closure, 0);
+ grpc_sopb_reset(op->send_ops);
+ grpc_chttp2_schedule_closure(transport_global,
+ stream_global->send_done_closure, 0);
}
}
if (op->recv_ops) {
- GPR_ASSERT(s->incoming_sopb == NULL);
- GPR_ASSERT(s->published_state != GRPC_STREAM_CLOSED);
- s->recv_done_closure.cb = op->on_done_recv;
- s->recv_done_closure.user_data = op->recv_user_data;
- s->incoming_sopb = op->recv_ops;
- s->incoming_sopb->nops = 0;
- s->publish_state = op->recv_state;
- gpr_free(s->old_incoming_metadata);
- s->old_incoming_metadata = NULL;
- maybe_finish_read(t, s);
- maybe_join_window_updates(t, s);
+ GPR_ASSERT(stream_global->publish_sopb == NULL);
+ GPR_ASSERT(stream_global->published_state != GRPC_STREAM_CLOSED);
+ stream_global->recv_done_closure = op->on_done_recv;
+ stream_global->publish_sopb = op->recv_ops;
+ stream_global->publish_sopb->nops = 0;
+ stream_global->publish_state = op->recv_state;
+ grpc_chttp2_incoming_metadata_live_op_buffer_end(
+ &stream_global->outstanding_metadata);
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
+ grpc_chttp2_list_add_writable_window_update_stream(transport_global,
+ stream_global);
}
if (op->bind_pollset) {
- add_to_pollset_locked(t, op->bind_pollset);
+ add_to_pollset_locked(TRANSPORT_FROM_GLOBAL(transport_global),
+ op->bind_pollset);
+ }
+
+ if (op->on_consumed) {
+ grpc_chttp2_schedule_closure(transport_global, op->on_consumed, 1);
}
}
static void perform_op(grpc_transport *gt, grpc_stream *gs,
grpc_transport_op *op) {
- transport *t = (transport *)gt;
- stream *s = (stream *)gs;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+ grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs;
lock(t);
- perform_op_locked(t, s, op);
+ perform_op_locked(&t->global, &s->global, op);
unlock(t);
}
-static void send_ping(grpc_transport *gt, void (*cb)(void *user_data),
- void *user_data) {
- transport *t = (transport *)gt;
- outstanding_ping *p;
+static void send_ping(grpc_transport *gt, grpc_iomgr_closure *on_recv) {
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
+ grpc_chttp2_outstanding_ping *p = gpr_malloc(sizeof(*p));
lock(t);
- if (t->ping_capacity == t->ping_count) {
- t->ping_capacity = GPR_MAX(1, t->ping_capacity * 3 / 2);
- t->pings =
- gpr_realloc(t->pings, sizeof(outstanding_ping) * t->ping_capacity);
- }
- p = &t->pings[t->ping_count++];
- p->id[0] = (t->ping_counter >> 56) & 0xff;
- p->id[1] = (t->ping_counter >> 48) & 0xff;
- p->id[2] = (t->ping_counter >> 40) & 0xff;
- p->id[3] = (t->ping_counter >> 32) & 0xff;
- p->id[4] = (t->ping_counter >> 24) & 0xff;
- p->id[5] = (t->ping_counter >> 16) & 0xff;
- p->id[6] = (t->ping_counter >> 8) & 0xff;
- p->id[7] = t->ping_counter & 0xff;
- p->cb = cb;
- p->user_data = user_data;
- gpr_slice_buffer_add(&t->qbuf, grpc_chttp2_ping_create(0, p->id));
+ p->next = &t->global.pings;
+ p->prev = p->next->prev;
+ p->prev->next = p->next->prev = p;
+ p->id[0] = (t->global.ping_counter >> 56) & 0xff;
+ p->id[1] = (t->global.ping_counter >> 48) & 0xff;
+ p->id[2] = (t->global.ping_counter >> 40) & 0xff;
+ p->id[3] = (t->global.ping_counter >> 32) & 0xff;
+ p->id[4] = (t->global.ping_counter >> 24) & 0xff;
+ p->id[5] = (t->global.ping_counter >> 16) & 0xff;
+ p->id[6] = (t->global.ping_counter >> 8) & 0xff;
+ p->id[7] = t->global.ping_counter & 0xff;
+ p->on_recv = on_recv;
+ gpr_slice_buffer_add(&t->global.qbuf, grpc_chttp2_ping_create(0, p->id));
unlock(t);
}
@@ -1207,760 +708,174 @@ static void send_ping(grpc_transport *gt, void (*cb)(void *user_data),
* INPUT PROCESSING
*/
-static void finalize_cancellations(transport *t) {
- stream *s;
-
- while ((s = stream_list_remove_head(t, CANCELLED))) {
- s->read_closed = 1;
- s->write_state = WRITE_STATE_SENT_CLOSE;
- maybe_finish_read(t, s);
- }
-}
-
-static void add_incoming_metadata(transport *t, stream *s, grpc_mdelem *elem) {
- if (s->incoming_metadata_capacity == s->incoming_metadata_count) {
- s->incoming_metadata_capacity =
- GPR_MAX(8, 2 * s->incoming_metadata_capacity);
- s->incoming_metadata =
- gpr_realloc(s->incoming_metadata, sizeof(*s->incoming_metadata) *
- s->incoming_metadata_capacity);
- }
- s->incoming_metadata[s->incoming_metadata_count++].md = elem;
-}
-
-static void cancel_stream_inner(transport *t, stream *s, gpr_uint32 id,
- grpc_status_code local_status,
- grpc_chttp2_error_code error_code,
- grpc_mdstr *optional_message, int send_rst) {
- int had_outgoing;
- char buffer[GPR_LTOA_MIN_BUFSIZE];
-
- if (s) {
- /* clear out any unreported input & output: nobody cares anymore */
- had_outgoing = s->outgoing_sopb && s->outgoing_sopb->nops != 0;
- if (error_code != GRPC_CHTTP2_NO_ERROR) {
- schedule_nuke_sopb(t, &s->parser.incoming_sopb);
- if (s->outgoing_sopb) {
- schedule_nuke_sopb(t, s->outgoing_sopb);
- s->outgoing_sopb = NULL;
- stream_list_remove(t, s, WRITABLE);
- schedule_cb(t, s->send_done_closure, 0);
- }
- }
- if (s->cancelled) {
- send_rst = 0;
- } else if (!s->read_closed || s->write_state != WRITE_STATE_SENT_CLOSE ||
- had_outgoing) {
- s->cancelled = 1;
- stream_list_join(t, s, CANCELLED);
-
- if (error_code != GRPC_CHTTP2_NO_ERROR) {
- /* synthesize a status if we don't believe we'll get one */
- gpr_ltoa(local_status, buffer);
- add_incoming_metadata(
- t, s,
- grpc_mdelem_from_strings(t->metadata_context, "grpc-status", buffer));
- if (!optional_message) {
- switch (local_status) {
- case GRPC_STATUS_CANCELLED:
- add_incoming_metadata(
- t, s, grpc_mdelem_from_strings(t->metadata_context,
- "grpc-message", "Cancelled"));
- break;
- default:
- break;
- }
- } else {
- add_incoming_metadata(
- t, s,
- grpc_mdelem_from_metadata_strings(
- t->metadata_context,
- grpc_mdstr_from_string(t->metadata_context, "grpc-message"),
- grpc_mdstr_ref(optional_message)));
- }
- add_metadata_batch(t, s);
- }
- }
- maybe_finish_read(t, s);
- }
- if (!id) send_rst = 0;
- if (send_rst) {
- gpr_slice_buffer_add(&t->qbuf,
- grpc_chttp2_rst_stream_create(id, error_code));
- }
- if (optional_message) {
- grpc_mdstr_unref(optional_message);
- }
-}
-
-static void cancel_stream_id(transport *t, gpr_uint32 id,
- grpc_status_code local_status,
- grpc_chttp2_error_code error_code, int send_rst) {
- cancel_stream_inner(t, lookup_stream(t, id), id, local_status, error_code,
- NULL, send_rst);
-}
-
-static void cancel_stream(transport *t, stream *s,
- grpc_status_code local_status,
- grpc_chttp2_error_code error_code,
- grpc_mdstr *optional_message, int send_rst) {
- cancel_stream_inner(t, s, s->id, local_status, error_code, optional_message,
- send_rst);
-}
-
-static void cancel_stream_cb(void *user_data, gpr_uint32 id, void *stream) {
- cancel_stream(user_data, stream, GRPC_STATUS_UNAVAILABLE,
- GRPC_CHTTP2_INTERNAL_ERROR, NULL, 0);
-}
-
-static void end_all_the_calls(transport *t) {
- grpc_chttp2_stream_map_for_each(&t->stream_map, cancel_stream_cb, t);
-}
-
-static void drop_connection(transport *t) {
- if (t->error_state == ERROR_STATE_NONE) {
- t->error_state = ERROR_STATE_SEEN;
- }
- end_all_the_calls(t);
-}
-
-static void maybe_finish_read(transport *t, stream *s) {
- if (s->incoming_sopb) {
- stream_list_join(t, s, FINISHED_READ_OP);
- }
-}
-
-static void maybe_join_window_updates(transport *t, stream *s) {
- if (s->incoming_sopb != NULL &&
- s->incoming_window <
- t->settings[LOCAL_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] *
- 3 / 4) {
- stream_list_join(t, s, WINDOW_UPDATE);
- }
-}
-
-static grpc_chttp2_parse_error update_incoming_window(transport *t, stream *s) {
- if (t->incoming_frame_size > t->incoming_window) {
- gpr_log(GPR_ERROR, "frame of size %d overflows incoming window of %d",
- t->incoming_frame_size, t->incoming_window);
- return GRPC_CHTTP2_CONNECTION_ERROR;
- }
-
- if (t->incoming_frame_size > s->incoming_window) {
- gpr_log(GPR_ERROR, "frame of size %d overflows incoming window of %d",
- t->incoming_frame_size, s->incoming_window);
- return GRPC_CHTTP2_CONNECTION_ERROR;
- }
-
- FLOWCTL_TRACE(t, t, incoming, 0, -(gpr_int64)t->incoming_frame_size);
- FLOWCTL_TRACE(t, s, incoming, s->id, -(gpr_int64)t->incoming_frame_size);
- t->incoming_window -= t->incoming_frame_size;
- s->incoming_window -= t->incoming_frame_size;
-
- /* if the stream incoming window is getting low, schedule an update */
- maybe_join_window_updates(t, s);
-
- return GRPC_CHTTP2_PARSE_OK;
-}
-
-static stream *lookup_stream(transport *t, gpr_uint32 id) {
- return grpc_chttp2_stream_map_find(&t->stream_map, id);
-}
-
-static grpc_chttp2_parse_error skip_parser(void *parser,
- grpc_chttp2_parse_state *st,
- gpr_slice slice, int is_last) {
- return GRPC_CHTTP2_PARSE_OK;
-}
-
-static void skip_header(void *tp, grpc_mdelem *md) { grpc_mdelem_unref(md); }
-
-static int init_skip_frame(transport *t, int is_header) {
- if (is_header) {
- int is_eoh = t->expect_continuation_stream_id != 0;
- t->parser = grpc_chttp2_header_parser_parse;
- t->parser_data = &t->hpack_parser;
- t->hpack_parser.on_header = skip_header;
- t->hpack_parser.on_header_user_data = NULL;
- t->hpack_parser.is_boundary = is_eoh;
- t->hpack_parser.is_eof = is_eoh ? t->header_eof : 0;
- } else {
- t->parser = skip_parser;
- }
- return 1;
-}
-
-static void become_skip_parser(transport *t) {
- init_skip_frame(t, t->parser == grpc_chttp2_header_parser_parse);
+static grpc_stream_state compute_state(gpr_uint8 write_closed,
+ gpr_uint8 read_closed) {
+ if (write_closed && read_closed) return GRPC_STREAM_CLOSED;
+ if (write_closed) return GRPC_STREAM_SEND_CLOSED;
+ if (read_closed) return GRPC_STREAM_RECV_CLOSED;
+ return GRPC_STREAM_OPEN;
}
-static int init_data_frame_parser(transport *t) {
- stream *s = lookup_stream(t, t->incoming_stream_id);
- grpc_chttp2_parse_error err = GRPC_CHTTP2_PARSE_OK;
- if (!s || s->read_closed) return init_skip_frame(t, 0);
- if (err == GRPC_CHTTP2_PARSE_OK) {
- err = update_incoming_window(t, s);
- }
- if (err == GRPC_CHTTP2_PARSE_OK) {
- err = grpc_chttp2_data_parser_begin_frame(&s->parser,
- t->incoming_frame_flags);
- }
- switch (err) {
- case GRPC_CHTTP2_PARSE_OK:
- t->incoming_stream = s;
- t->parser = grpc_chttp2_data_parser_parse;
- t->parser_data = &s->parser;
- return 1;
- case GRPC_CHTTP2_STREAM_ERROR:
- cancel_stream(t, s, grpc_chttp2_http2_error_to_grpc_status(
- GRPC_CHTTP2_INTERNAL_ERROR),
- GRPC_CHTTP2_INTERNAL_ERROR, NULL, 1);
- return init_skip_frame(t, 0);
- case GRPC_CHTTP2_CONNECTION_ERROR:
- drop_connection(t);
- return 0;
+static void remove_stream(grpc_chttp2_transport *t, gpr_uint32 id) {
+ size_t new_stream_count;
+ grpc_chttp2_stream *s =
+ grpc_chttp2_stream_map_delete(&t->parsing_stream_map, id);
+ if (!s) {
+ s = grpc_chttp2_stream_map_delete(&t->new_stream_map, id);
}
- gpr_log(GPR_ERROR, "should never reach here");
- abort();
- return 0;
-}
-
-static void free_timeout(void *p) { gpr_free(p); }
-
-static void on_header(void *tp, grpc_mdelem *md) {
- transport *t = tp;
- stream *s = t->incoming_stream;
-
GPR_ASSERT(s);
-
- IF_TRACING(gpr_log(
- GPR_INFO, "HTTP:%d:%s:HDR: %s: %s", s->id, t->is_client ? "CLI" : "SVR",
- grpc_mdstr_as_c_string(md->key), grpc_mdstr_as_c_string(md->value)));
-
- if (md->key == t->str_grpc_timeout) {
- gpr_timespec *cached_timeout = grpc_mdelem_get_user_data(md, free_timeout);
- if (!cached_timeout) {
- /* not already parsed: parse it now, and store the result away */
- cached_timeout = gpr_malloc(sizeof(gpr_timespec));
- if (!grpc_chttp2_decode_timeout(grpc_mdstr_as_c_string(md->value),
- cached_timeout)) {
- gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'",
- grpc_mdstr_as_c_string(md->value));
- *cached_timeout = gpr_inf_future;
- }
- grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
+ s->global.in_stream_map = 0;
+ if (t->parsing.incoming_stream == &s->parsing) {
+ t->parsing.incoming_stream = NULL;
+ grpc_chttp2_parsing_become_skip_parser(&t->parsing);
+ }
+
+ new_stream_count =
+ grpc_chttp2_stream_map_size(&t->parsing_stream_map) +
+ grpc_chttp2_stream_map_size(&t->new_stream_map);
+ if (new_stream_count != t->global.concurrent_stream_count) {
+ t->global.concurrent_stream_count = new_stream_count;
+ maybe_start_some_streams(&t->global);
+ }
+}
+
+static void unlock_check_read_write_state(grpc_chttp2_transport *t) {
+ grpc_chttp2_transport_global *transport_global = &t->global;
+ grpc_chttp2_stream_global *stream_global;
+ grpc_stream_state state;
+
+ if (!t->parsing_active) {
+ /* if a stream is in the stream map, and gets cancelled, we need to ensure
+ we are not parsing before continuing the cancellation to keep things in
+ a sane state */
+ while (grpc_chttp2_list_pop_closed_waiting_for_parsing(transport_global,
+ &stream_global)) {
+ GPR_ASSERT(stream_global->in_stream_map);
+ GPR_ASSERT(stream_global->write_state != GRPC_WRITE_STATE_OPEN);
+ GPR_ASSERT(stream_global->read_closed);
+ remove_stream(t, stream_global->id);
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
}
- s->incoming_deadline = gpr_time_add(gpr_now(), *cached_timeout);
- grpc_mdelem_unref(md);
- } else {
- add_incoming_metadata(t, s, md);
}
- maybe_finish_read(t, s);
-}
-static int init_header_frame_parser(transport *t, int is_continuation) {
- int is_eoh =
- (t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0;
- stream *s;
-
- if (is_eoh) {
- t->expect_continuation_stream_id = 0;
- } else {
- t->expect_continuation_stream_id = t->incoming_stream_id;
- }
-
- if (!is_continuation) {
- t->header_eof =
- (t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) != 0;
- }
-
- /* could be a new stream or an existing stream */
- s = lookup_stream(t, t->incoming_stream_id);
- if (!s) {
- if (is_continuation) {
- gpr_log(GPR_ERROR, "stream disbanded before CONTINUATION received");
- return init_skip_frame(t, 1);
+ while (grpc_chttp2_list_pop_read_write_state_changed(transport_global,
+ &stream_global)) {
+ if (stream_global->cancelled) {
+ stream_global->write_state = GRPC_WRITE_STATE_SENT_CLOSE;
+ stream_global->read_closed = 1;
+ if (!stream_global->published_cancelled) {
+ char buffer[GPR_LTOA_MIN_BUFSIZE];
+ gpr_ltoa(stream_global->cancelled_status, buffer);
+ grpc_chttp2_incoming_metadata_buffer_add(&stream_global->incoming_metadata,
+ grpc_mdelem_from_strings(t->metadata_context, "grpc-status", buffer));
+ grpc_chttp2_incoming_metadata_buffer_place_metadata_batch_into(
+ &stream_global->incoming_metadata,
+ &stream_global->incoming_sopb);
+ stream_global->published_cancelled = 1;
+ }
}
- if (t->is_client) {
- if ((t->incoming_stream_id & 1) &&
- t->incoming_stream_id < t->next_stream_id) {
- /* this is an old (probably cancelled) stream */
+ if (stream_global->write_state == GRPC_WRITE_STATE_SENT_CLOSE &&
+ stream_global->read_closed && stream_global->in_stream_map) {
+ if (t->parsing_active) {
+ grpc_chttp2_list_add_closed_waiting_for_parsing(transport_global,
+ stream_global);
} else {
- gpr_log(GPR_ERROR, "ignoring new stream creation on client");
+ remove_stream(t, stream_global->id);
}
- return init_skip_frame(t, 1);
- } else if (t->last_incoming_stream_id > t->incoming_stream_id) {
- gpr_log(GPR_ERROR,
- "ignoring out of order new stream request on server; last stream "
- "id=%d, new stream id=%d",
- t->last_incoming_stream_id, t->incoming_stream_id);
- return init_skip_frame(t, 1);
- } else if ((t->incoming_stream_id & 1) == 0) {
- gpr_log(GPR_ERROR, "ignoring stream with non-client generated index %d", t->incoming_stream_id);
- return init_skip_frame(t, 1);
}
- t->incoming_stream = NULL;
- /* if stream is accepted, we set incoming_stream in init_stream */
- t->cb->accept_stream(t->cb_user_data, &t->base,
- (void *)(gpr_uintptr)t->incoming_stream_id);
- s = t->incoming_stream;
- if (!s) {
- gpr_log(GPR_ERROR, "stream not accepted");
- return init_skip_frame(t, 1);
+ if (!stream_global->publish_sopb) {
+ continue;
}
- } else {
- t->incoming_stream = s;
- }
- if (t->incoming_stream->read_closed) {
- gpr_log(GPR_ERROR, "skipping already closed stream header");
- t->incoming_stream = NULL;
- return init_skip_frame(t, 1);
- }
- t->parser = grpc_chttp2_header_parser_parse;
- t->parser_data = &t->hpack_parser;
- t->hpack_parser.on_header = on_header;
- t->hpack_parser.on_header_user_data = t;
- t->hpack_parser.is_boundary = is_eoh;
- t->hpack_parser.is_eof = is_eoh ? t->header_eof : 0;
- if (!is_continuation &&
- (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY)) {
- grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
- }
- return 1;
-}
-
-static int init_window_update_frame_parser(transport *t) {
- int ok = GRPC_CHTTP2_PARSE_OK == grpc_chttp2_window_update_parser_begin_frame(
- &t->simple_parsers.window_update,
- t->incoming_frame_size,
- t->incoming_frame_flags);
- if (!ok) {
- drop_connection(t);
+ /* FIXME(ctiller): we include in_stream_map in our computation of
+ whether the stream is write-closed. This is completely bogus,
+ but has the effect of delaying stream-closed until the stream
+ is indeed evicted from the stream map, making it safe to delete.
+ To fix this will require having an edge after stream-closed
+ indicating that the stream is closed AND safe to delete. */
+ state = compute_state(
+ stream_global->write_state == GRPC_WRITE_STATE_SENT_CLOSE &&
+ !stream_global->in_stream_map,
+ stream_global->read_closed);
+ if (stream_global->incoming_sopb.nops == 0 &&
+ state == stream_global->published_state) {
+ continue;
+ }
+ grpc_chttp2_incoming_metadata_buffer_postprocess_sopb_and_begin_live_op(
+ &stream_global->incoming_metadata, &stream_global->incoming_sopb,
+ &stream_global->outstanding_metadata);
+ grpc_sopb_swap(stream_global->publish_sopb, &stream_global->incoming_sopb);
+ stream_global->published_state = *stream_global->publish_state = state;
+ grpc_chttp2_schedule_closure(transport_global,
+ stream_global->recv_done_closure, 1);
+ stream_global->recv_done_closure = NULL;
+ stream_global->publish_sopb = NULL;
+ stream_global->publish_state = NULL;
}
- t->parser = grpc_chttp2_window_update_parser_parse;
- t->parser_data = &t->simple_parsers.window_update;
- return ok;
}
-static int init_ping_parser(transport *t) {
- int ok = GRPC_CHTTP2_PARSE_OK ==
- grpc_chttp2_ping_parser_begin_frame(&t->simple_parsers.ping,
- t->incoming_frame_size,
- t->incoming_frame_flags);
- if (!ok) {
- drop_connection(t);
+static void cancel_from_api(grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global,
+ grpc_status_code status) {
+ stream_global->cancelled = 1;
+ stream_global->cancelled_status = status;
+ if (stream_global->id != 0) {
+ gpr_slice_buffer_add(&transport_global->qbuf,
+ grpc_chttp2_rst_stream_create(
+ stream_global->id,
+ grpc_chttp2_grpc_status_to_http2_error(status)));
}
- t->parser = grpc_chttp2_ping_parser_parse;
- t->parser_data = &t->simple_parsers.ping;
- return ok;
+ grpc_chttp2_list_add_read_write_state_changed(transport_global,
+ stream_global);
}
-static int init_rst_stream_parser(transport *t) {
- int ok = GRPC_CHTTP2_PARSE_OK ==
- grpc_chttp2_rst_stream_parser_begin_frame(&t->simple_parsers.rst_stream,
- t->incoming_frame_size,
- t->incoming_frame_flags);
- if (!ok) {
- drop_connection(t);
- }
- t->parser = grpc_chttp2_rst_stream_parser_parse;
- t->parser_data = &t->simple_parsers.rst_stream;
- return ok;
+static void cancel_stream_cb(grpc_chttp2_transport_global *transport_global,
+ void *user_data,
+ grpc_chttp2_stream_global *stream_global) {
+ cancel_from_api(transport_global, stream_global, GRPC_STATUS_UNAVAILABLE);
}
-static int init_goaway_parser(transport *t) {
- int ok =
- GRPC_CHTTP2_PARSE_OK ==
- grpc_chttp2_goaway_parser_begin_frame(
- &t->goaway_parser, t->incoming_frame_size, t->incoming_frame_flags);
- if (!ok) {
- drop_connection(t);
- }
- t->parser = grpc_chttp2_goaway_parser_parse;
- t->parser_data = &t->goaway_parser;
- return ok;
+static void end_all_the_calls(grpc_chttp2_transport *t) {
+ grpc_chttp2_for_all_streams(&t->global, NULL, cancel_stream_cb);
}
-static int init_settings_frame_parser(transport *t) {
- int ok;
-
- if (t->incoming_stream_id != 0) {
- gpr_log(GPR_ERROR, "settings frame received for stream %d", t->incoming_stream_id);
- drop_connection(t);
- return 0;
+static void drop_connection(grpc_chttp2_transport *t) {
+ if (t->global.error_state == GRPC_CHTTP2_ERROR_STATE_NONE) {
+ t->global.error_state = GRPC_CHTTP2_ERROR_STATE_SEEN;
}
-
- ok = GRPC_CHTTP2_PARSE_OK ==
- grpc_chttp2_settings_parser_begin_frame(
- &t->simple_parsers.settings, t->incoming_frame_size,
- t->incoming_frame_flags, t->settings[PEER_SETTINGS]);
- if (!ok) {
- drop_connection(t);
- return 0;
- }
- if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_ACK) {
- memcpy(t->settings[ACKED_SETTINGS], t->settings[SENT_SETTINGS],
- GRPC_CHTTP2_NUM_SETTINGS * sizeof(gpr_uint32));
- }
- t->parser = grpc_chttp2_settings_parser_parse;
- t->parser_data = &t->simple_parsers.settings;
- return ok;
-}
-
-static int init_frame_parser(transport *t) {
- if (t->expect_continuation_stream_id != 0) {
- if (t->incoming_frame_type != GRPC_CHTTP2_FRAME_CONTINUATION) {
- gpr_log(GPR_ERROR, "Expected CONTINUATION frame, got frame type %02x",
- t->incoming_frame_type);
- return 0;
- }
- if (t->expect_continuation_stream_id != t->incoming_stream_id) {
- gpr_log(GPR_ERROR,
- "Expected CONTINUATION frame for stream %08x, got stream %08x",
- t->expect_continuation_stream_id, t->incoming_stream_id);
- return 0;
- }
- return init_header_frame_parser(t, 1);
- }
- switch (t->incoming_frame_type) {
- case GRPC_CHTTP2_FRAME_DATA:
- return init_data_frame_parser(t);
- case GRPC_CHTTP2_FRAME_HEADER:
- return init_header_frame_parser(t, 0);
- case GRPC_CHTTP2_FRAME_CONTINUATION:
- gpr_log(GPR_ERROR, "Unexpected CONTINUATION frame");
- return 0;
- case GRPC_CHTTP2_FRAME_RST_STREAM:
- return init_rst_stream_parser(t);
- case GRPC_CHTTP2_FRAME_SETTINGS:
- return init_settings_frame_parser(t);
- case GRPC_CHTTP2_FRAME_WINDOW_UPDATE:
- return init_window_update_frame_parser(t);
- case GRPC_CHTTP2_FRAME_PING:
- return init_ping_parser(t);
- case GRPC_CHTTP2_FRAME_GOAWAY:
- return init_goaway_parser(t);
- default:
- gpr_log(GPR_ERROR, "Unknown frame type %02x", t->incoming_frame_type);
- return init_skip_frame(t, 0);
- }
-}
-
-static int is_window_update_legal(gpr_int64 window_update, gpr_int64 window) {
- return window + window_update < MAX_WINDOW;
+ close_transport_locked(t);
+ end_all_the_calls(t);
}
-static void add_metadata_batch(transport *t, stream *s) {
- grpc_metadata_batch b;
+/** update window from a settings change */
+static void update_global_window(void *args, gpr_uint32 id, void *stream) {
+ grpc_chttp2_transport *t = args;
+ grpc_chttp2_stream *s = stream;
+ grpc_chttp2_transport_global *transport_global = &t->global;
+ grpc_chttp2_stream_global *stream_global = &s->global;
- b.list.head = NULL;
- /* Store away the last element of the list, so that in patch_metadata_ops
- we can reconstitute the list.
- We can't do list building here as later incoming metadata may reallocate
- the underlying array. */
- b.list.tail = (void*)(gpr_intptr)s->incoming_metadata_count;
- b.garbage.head = b.garbage.tail = NULL;
- b.deadline = s->incoming_deadline;
- s->incoming_deadline = gpr_inf_future;
-
- grpc_sopb_add_metadata(&s->parser.incoming_sopb, b);
-}
-
-static int parse_frame_slice(transport *t, gpr_slice slice, int is_last) {
- grpc_chttp2_parse_state st;
- size_t i;
- memset(&st, 0, sizeof(st));
- switch (t->parser(t->parser_data, &st, slice, is_last)) {
- case GRPC_CHTTP2_PARSE_OK:
- if (st.end_of_stream) {
- t->incoming_stream->read_closed = 1;
- maybe_finish_read(t, t->incoming_stream);
- }
- if (st.need_flush_reads) {
- maybe_finish_read(t, t->incoming_stream);
- }
- if (st.metadata_boundary) {
- add_metadata_batch(t, t->incoming_stream);
- maybe_finish_read(t, t->incoming_stream);
- }
- if (st.ack_settings) {
- gpr_slice_buffer_add(&t->qbuf, grpc_chttp2_settings_ack_create());
- maybe_start_some_streams(t);
- }
- if (st.send_ping_ack) {
- gpr_slice_buffer_add(
- &t->qbuf,
- grpc_chttp2_ping_create(1, t->simple_parsers.ping.opaque_8bytes));
- }
- if (st.goaway) {
- add_goaway(t, st.goaway_error, st.goaway_text);
- }
- if (st.rst_stream) {
- cancel_stream_id(
- t, t->incoming_stream_id,
- grpc_chttp2_http2_error_to_grpc_status(st.rst_stream_reason),
- st.rst_stream_reason, 0);
- }
- if (st.process_ping_reply) {
- for (i = 0; i < t->ping_count; i++) {
- if (0 ==
- memcmp(t->pings[i].id, t->simple_parsers.ping.opaque_8bytes, 8)) {
- t->pings[i].cb(t->pings[i].user_data);
- memmove(&t->pings[i], &t->pings[i + 1],
- (t->ping_count - i - 1) * sizeof(outstanding_ping));
- t->ping_count--;
- break;
- }
- }
- }
- if (st.initial_window_update) {
- for (i = 0; i < t->stream_map.count; i++) {
- stream *s = (stream *)(t->stream_map.values[i]);
- int was_window_empty = s->outgoing_window <= 0;
- FLOWCTL_TRACE(t, s, outgoing, s->id, st.initial_window_update);
- s->outgoing_window += st.initial_window_update;
- if (was_window_empty && s->outgoing_window > 0 && s->outgoing_sopb &&
- s->outgoing_sopb->nops > 0) {
- stream_list_join(t, s, WRITABLE);
- }
- }
- }
- if (st.window_update) {
- if (t->incoming_stream_id) {
- /* if there was a stream id, this is for some stream */
- stream *s = lookup_stream(t, t->incoming_stream_id);
- if (s) {
- int was_window_empty = s->outgoing_window <= 0;
- if (!is_window_update_legal(st.window_update, s->outgoing_window)) {
- cancel_stream(t, s, grpc_chttp2_http2_error_to_grpc_status(
- GRPC_CHTTP2_FLOW_CONTROL_ERROR),
- GRPC_CHTTP2_FLOW_CONTROL_ERROR, NULL, 1);
- } else {
- FLOWCTL_TRACE(t, s, outgoing, s->id, st.window_update);
- s->outgoing_window += st.window_update;
- /* if this window update makes outgoing ops writable again,
- flag that */
- if (was_window_empty && s->outgoing_sopb &&
- s->outgoing_sopb->nops > 0) {
- stream_list_join(t, s, WRITABLE);
- }
- }
- }
- } else {
- /* transport level window update */
- if (!is_window_update_legal(st.window_update, t->outgoing_window)) {
- drop_connection(t);
- } else {
- FLOWCTL_TRACE(t, t, outgoing, 0, st.window_update);
- t->outgoing_window += st.window_update;
- }
- }
- }
- return 1;
- case GRPC_CHTTP2_STREAM_ERROR:
- become_skip_parser(t);
- cancel_stream_id(
- t, t->incoming_stream_id,
- grpc_chttp2_http2_error_to_grpc_status(GRPC_CHTTP2_INTERNAL_ERROR),
- GRPC_CHTTP2_INTERNAL_ERROR, 1);
- return 1;
- case GRPC_CHTTP2_CONNECTION_ERROR:
- drop_connection(t);
- return 0;
- }
- gpr_log(GPR_ERROR, "should never reach here");
- abort();
- return 0;
+ GRPC_CHTTP2_FLOWCTL_TRACE_STREAM("settings", transport_global, stream_global,
+ outgoing_window,
+ t->parsing.initial_window_update);
+ stream_global->outgoing_window += t->parsing.initial_window_update;
}
-static int process_read(transport *t, gpr_slice slice) {
- gpr_uint8 *beg = GPR_SLICE_START_PTR(slice);
- gpr_uint8 *end = GPR_SLICE_END_PTR(slice);
- gpr_uint8 *cur = beg;
-
- if (cur == end) return 1;
-
- switch (t->deframe_state) {
- case DTS_CLIENT_PREFIX_0:
- case DTS_CLIENT_PREFIX_1:
- case DTS_CLIENT_PREFIX_2:
- case DTS_CLIENT_PREFIX_3:
- case DTS_CLIENT_PREFIX_4:
- case DTS_CLIENT_PREFIX_5:
- case DTS_CLIENT_PREFIX_6:
- case DTS_CLIENT_PREFIX_7:
- case DTS_CLIENT_PREFIX_8:
- case DTS_CLIENT_PREFIX_9:
- case DTS_CLIENT_PREFIX_10:
- case DTS_CLIENT_PREFIX_11:
- case DTS_CLIENT_PREFIX_12:
- case DTS_CLIENT_PREFIX_13:
- case DTS_CLIENT_PREFIX_14:
- case DTS_CLIENT_PREFIX_15:
- case DTS_CLIENT_PREFIX_16:
- case DTS_CLIENT_PREFIX_17:
- case DTS_CLIENT_PREFIX_18:
- case DTS_CLIENT_PREFIX_19:
- case DTS_CLIENT_PREFIX_20:
- case DTS_CLIENT_PREFIX_21:
- case DTS_CLIENT_PREFIX_22:
- case DTS_CLIENT_PREFIX_23:
- while (cur != end && t->deframe_state != DTS_FH_0) {
- if (*cur != CLIENT_CONNECT_STRING[t->deframe_state]) {
- gpr_log(GPR_ERROR,
- "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
- "at byte %d",
- CLIENT_CONNECT_STRING[t->deframe_state],
- (int)(gpr_uint8)CLIENT_CONNECT_STRING[t->deframe_state], *cur,
- (int)*cur, t->deframe_state);
- drop_connection(t);
- return 0;
- }
- ++cur;
- ++t->deframe_state;
- }
- if (cur == end) {
- return 1;
- }
- /* fallthrough */
- dts_fh_0:
- case DTS_FH_0:
- GPR_ASSERT(cur < end);
- t->incoming_frame_size = ((gpr_uint32)*cur) << 16;
- if (++cur == end) {
- t->deframe_state = DTS_FH_1;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_1:
- GPR_ASSERT(cur < end);
- t->incoming_frame_size |= ((gpr_uint32)*cur) << 8;
- if (++cur == end) {
- t->deframe_state = DTS_FH_2;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_2:
- GPR_ASSERT(cur < end);
- t->incoming_frame_size |= *cur;
- if (++cur == end) {
- t->deframe_state = DTS_FH_3;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_3:
- GPR_ASSERT(cur < end);
- t->incoming_frame_type = *cur;
- if (++cur == end) {
- t->deframe_state = DTS_FH_4;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_4:
- GPR_ASSERT(cur < end);
- t->incoming_frame_flags = *cur;
- if (++cur == end) {
- t->deframe_state = DTS_FH_5;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_5:
- GPR_ASSERT(cur < end);
- t->incoming_stream_id = (((gpr_uint32)*cur) & 0x7f) << 24;
- if (++cur == end) {
- t->deframe_state = DTS_FH_6;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_6:
- GPR_ASSERT(cur < end);
- t->incoming_stream_id |= ((gpr_uint32)*cur) << 16;
- if (++cur == end) {
- t->deframe_state = DTS_FH_7;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_7:
- GPR_ASSERT(cur < end);
- t->incoming_stream_id |= ((gpr_uint32)*cur) << 8;
- if (++cur == end) {
- t->deframe_state = DTS_FH_8;
- return 1;
- }
- /* fallthrough */
- case DTS_FH_8:
- GPR_ASSERT(cur < end);
- t->incoming_stream_id |= ((gpr_uint32)*cur);
- t->deframe_state = DTS_FRAME;
- if (!init_frame_parser(t)) {
- return 0;
- }
- /* t->last_incoming_stream_id is used as last-stream-id when
- sending GOAWAY frame.
- https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-6.8
- says that last-stream-id is peer-initiated stream ID. So,
- since we don't have server pushed streams, client should send
- GOAWAY last-stream-id=0 in this case. */
- if (!t->is_client) {
- t->last_incoming_stream_id = t->incoming_stream_id;
- }
- if (t->incoming_frame_size == 0) {
- if (!parse_frame_slice(t, gpr_empty_slice(), 1)) {
- return 0;
- }
- if (++cur == end) {
- t->deframe_state = DTS_FH_0;
- return 1;
- }
- goto dts_fh_0; /* loop */
- }
- if (++cur == end) {
- return 1;
- }
- /* fallthrough */
- case DTS_FRAME:
- GPR_ASSERT(cur < end);
- if ((gpr_uint32)(end - cur) == t->incoming_frame_size) {
- if (!parse_frame_slice(
- t, gpr_slice_sub_no_ref(slice, cur - beg, end - beg), 1)) {
- return 0;
- }
- t->deframe_state = DTS_FH_0;
- return 1;
- } else if ((gpr_uint32)(end - cur) > t->incoming_frame_size) {
- if (!parse_frame_slice(
- t, gpr_slice_sub_no_ref(slice, cur - beg,
- cur + t->incoming_frame_size - beg),
- 1)) {
- return 0;
- }
- cur += t->incoming_frame_size;
- goto dts_fh_0; /* loop */
- } else {
- if (!parse_frame_slice(
- t, gpr_slice_sub_no_ref(slice, cur - beg, end - beg), 0)) {
- return 0;
- }
- t->incoming_frame_size -= (end - cur);
- return 1;
- }
- gpr_log(GPR_ERROR, "should never reach here");
- abort();
+static void read_error_locked(grpc_chttp2_transport *t) {
+ t->endpoint_reading = 0;
+ if (!t->writing_active && t->ep) {
+ grpc_endpoint_destroy(t->ep);
+ t->ep = NULL;
+ /* safe as we still have a ref for read */
+ UNREF_TRANSPORT(t, "disconnect");
}
-
- gpr_log(GPR_ERROR, "should never reach here");
- abort();
-
- return 0;
}
/* tcp read callback */
static void recv_data(void *tp, gpr_slice *slices, size_t nslices,
grpc_endpoint_cb_status error) {
- transport *t = tp;
+ grpc_chttp2_transport *t = tp;
size_t i;
- int keep_reading = 0;
+ int unref = 0;
switch (error) {
case GRPC_ENDPOINT_CB_SHUTDOWN:
@@ -1968,185 +883,201 @@ static void recv_data(void *tp, gpr_slice *slices, size_t nslices,
case GRPC_ENDPOINT_CB_ERROR:
lock(t);
drop_connection(t);
- t->reading = 0;
- if (!t->writing && t->ep) {
- grpc_endpoint_destroy(t->ep);
- t->ep = NULL;
- unref_transport(t); /* safe as we still have a ref for read */
- }
+ read_error_locked(t);
unlock(t);
- unref_transport(t);
+ unref = 1;
+ for (i = 0; i < nslices; i++) gpr_slice_unref(slices[i]);
break;
case GRPC_ENDPOINT_CB_OK:
lock(t);
- if (t->cb) {
- for (i = 0; i < nslices && process_read(t, slices[i]); i++)
- ;
+ i = 0;
+ GPR_ASSERT(!t->parsing_active);
+ if (t->global.error_state == GRPC_CHTTP2_ERROR_STATE_NONE) {
+ t->parsing_active = 1;
+ /* merge stream lists */
+ grpc_chttp2_stream_map_move_into(&t->new_stream_map,
+ &t->parsing_stream_map);
+ grpc_chttp2_prepare_to_read(&t->global, &t->parsing);
+ gpr_mu_unlock(&t->mu);
+ for (; i < nslices && grpc_chttp2_perform_read(&t->parsing, slices[i]);
+ i++) {
+ gpr_slice_unref(slices[i]);
+ }
+ gpr_mu_lock(&t->mu);
+ if (i != nslices) {
+ drop_connection(t);
+ }
+ /* merge stream lists */
+ grpc_chttp2_stream_map_move_into(&t->new_stream_map,
+ &t->parsing_stream_map);
+ t->global.concurrent_stream_count = grpc_chttp2_stream_map_size(&t->parsing_stream_map);
+ if (t->parsing.initial_window_update != 0) {
+ grpc_chttp2_stream_map_for_each(&t->parsing_stream_map,
+ update_global_window, t);
+ t->parsing.initial_window_update = 0;
+ }
+ /* handle higher level things */
+ grpc_chttp2_publish_reads(&t->global, &t->parsing);
+ t->parsing_active = 0;
+ }
+ if (i == nslices) {
+ grpc_chttp2_schedule_closure(&t->global, &t->reading_action, 1);
+ } else {
+ read_error_locked(t);
+ unref = 1;
}
unlock(t);
- keep_reading = 1;
+ for (; i < nslices; i++) gpr_slice_unref(slices[i]);
break;
}
-
- for (i = 0; i < nslices; i++) gpr_slice_unref(slices[i]);
-
- if (keep_reading) {
- grpc_endpoint_notify_on_read(t->ep, recv_data, t);
+ if (unref) {
+ UNREF_TRANSPORT(t, "recv_data");
}
}
+static void reading_action(void *pt, int iomgr_success_ignored) {
+ grpc_chttp2_transport *t = pt;
+ grpc_endpoint_notify_on_read(t->ep, recv_data, t);
+}
+
/*
* CALLBACK LOOP
*/
-static grpc_stream_state compute_state(gpr_uint8 write_closed,
- gpr_uint8 read_closed) {
- if (write_closed && read_closed) return GRPC_STREAM_CLOSED;
- if (write_closed) return GRPC_STREAM_SEND_CLOSED;
- if (read_closed) return GRPC_STREAM_RECV_CLOSED;
- return GRPC_STREAM_OPEN;
-}
+typedef struct {
+ grpc_chttp2_transport *t;
+ gpr_uint32 error;
+ gpr_slice text;
+ grpc_iomgr_closure closure;
+} notify_goaways_args;
-static void patch_metadata_ops(stream *s) {
- grpc_stream_op *ops = s->incoming_sopb->ops;
- size_t nops = s->incoming_sopb->nops;
- size_t i;
- size_t j;
- size_t mdidx = 0;
- size_t last_mdidx;
- int found_metadata = 0;
-
- /* rework the array of metadata into a linked list, making use
- of the breadcrumbs we left in metadata batches during
- add_metadata_batch */
- for (i = 0; i < nops; i++) {
- grpc_stream_op *op = &ops[i];
- if (op->type != GRPC_OP_METADATA) continue;
- found_metadata = 1;
- /* we left a breadcrumb indicating where the end of this list is,
- and since we add sequentially, we know from the end of the last
- segment where this segment begins */
- last_mdidx = (size_t)(gpr_intptr)(op->data.metadata.list.tail);
- GPR_ASSERT(last_mdidx > mdidx);
- GPR_ASSERT(last_mdidx <= s->incoming_metadata_count);
- /* turn the array into a doubly linked list */
- op->data.metadata.list.head = &s->incoming_metadata[mdidx];
- op->data.metadata.list.tail = &s->incoming_metadata[last_mdidx - 1];
- for (j = mdidx + 1; j < last_mdidx; j++) {
- s->incoming_metadata[j].prev = &s->incoming_metadata[j-1];
- s->incoming_metadata[j-1].next = &s->incoming_metadata[j];
- }
- s->incoming_metadata[mdidx].prev = NULL;
- s->incoming_metadata[last_mdidx-1].next = NULL;
- /* track where we're up to */
- mdidx = last_mdidx;
- }
- if (found_metadata) {
- s->old_incoming_metadata = s->incoming_metadata;
- if (mdidx != s->incoming_metadata_count) {
- /* we have a partially read metadata batch still in incoming_metadata */
- size_t new_count = s->incoming_metadata_count - mdidx;
- size_t copy_bytes = sizeof(*s->incoming_metadata) * new_count;
- GPR_ASSERT(mdidx < s->incoming_metadata_count);
- s->incoming_metadata = gpr_malloc(copy_bytes);
- memcpy(s->old_incoming_metadata + mdidx, s->incoming_metadata, copy_bytes);
- s->incoming_metadata_count = s->incoming_metadata_capacity = new_count;
- } else {
- s->incoming_metadata = NULL;
- s->incoming_metadata_count = 0;
- s->incoming_metadata_capacity = 0;
- }
- }
-}
+static void notify_goaways(void *p, int iomgr_success_ignored) {
+ notify_goaways_args *a = p;
+ grpc_chttp2_transport *t = a->t;
-static void finish_reads(transport *t) {
- stream *s;
-
- while ((s = stream_list_remove_head(t, FINISHED_READ_OP)) != NULL) {
- int publish = 0;
- GPR_ASSERT(s->incoming_sopb);
- *s->publish_state =
- compute_state(s->write_state == WRITE_STATE_SENT_CLOSE, s->read_closed);
- if (*s->publish_state != s->published_state) {
- s->published_state = *s->publish_state;
- publish = 1;
- if (s->published_state == GRPC_STREAM_CLOSED) {
- remove_from_stream_map(t, s);
- }
- }
- if (s->parser.incoming_sopb.nops > 0) {
- grpc_sopb_swap(s->incoming_sopb, &s->parser.incoming_sopb);
- publish = 1;
- }
- if (publish) {
- if (s->incoming_metadata_count > 0) {
- patch_metadata_ops(s);
- }
- s->incoming_sopb = NULL;
- schedule_cb(t, s->recv_done_closure, 1);
- }
- }
+ t->channel_callback.cb->goaway(t->channel_callback.cb_user_data, &t->base,
+ a->error, a->text);
-}
+ gpr_free(a);
-static void schedule_cb(transport *t, op_closure closure, int success) {
- if (t->pending_callbacks.capacity == t->pending_callbacks.count) {
- t->pending_callbacks.capacity =
- GPR_MAX(t->pending_callbacks.capacity * 2, 8);
- t->pending_callbacks.callbacks =
- gpr_realloc(t->pending_callbacks.callbacks,
- t->pending_callbacks.capacity *
- sizeof(*t->pending_callbacks.callbacks));
- }
- closure.success = success;
- t->pending_callbacks.callbacks[t->pending_callbacks.count++] = closure;
+ lock(t);
+ t->channel_callback.executing = 0;
+ unlock(t);
+
+ UNREF_TRANSPORT(t, "notify_goaways");
}
-static int prepare_callbacks(transport *t) {
- op_closure_array temp = t->pending_callbacks;
- t->pending_callbacks = t->executing_callbacks;
- t->executing_callbacks = temp;
- return t->executing_callbacks.count > 0;
+static void notify_closed(void *gt, int iomgr_success_ignored) {
+ grpc_chttp2_transport *t = gt;
+ t->channel_callback.cb->closed(t->channel_callback.cb_user_data, &t->base);
+
+ lock(t);
+ t->channel_callback.executing = 0;
+ unlock(t);
+
+ UNREF_TRANSPORT(t, "notify_closed");
}
-static void run_callbacks(transport *t) {
- size_t i;
- for (i = 0; i < t->executing_callbacks.count; i++) {
- op_closure c = t->executing_callbacks.callbacks[i];
- c.cb(c.user_data, c.success);
+static void unlock_check_channel_callbacks(grpc_chttp2_transport *t) {
+ if (t->channel_callback.executing) {
+ return;
+ }
+ if (t->global.goaway_state != GRPC_CHTTP2_ERROR_STATE_NONE) {
+ if (t->global.goaway_state == GRPC_CHTTP2_ERROR_STATE_SEEN &&
+ t->global.error_state != GRPC_CHTTP2_ERROR_STATE_NOTIFIED) {
+ notify_goaways_args *a = gpr_malloc(sizeof(*a));
+ a->t = t;
+ a->error = t->global.goaway_error;
+ a->text = t->global.goaway_text;
+ t->global.goaway_state = GRPC_CHTTP2_ERROR_STATE_NOTIFIED;
+ t->channel_callback.executing = 1;
+ grpc_iomgr_closure_init(&a->closure, notify_goaways, a);
+ REF_TRANSPORT(t, "notify_goaways");
+ grpc_chttp2_schedule_closure(&t->global, &a->closure, 1);
+ return;
+ } else if (t->global.goaway_state != GRPC_CHTTP2_ERROR_STATE_NOTIFIED) {
+ return;
+ }
+ }
+ if (t->global.error_state == GRPC_CHTTP2_ERROR_STATE_SEEN) {
+ t->global.error_state = GRPC_CHTTP2_ERROR_STATE_NOTIFIED;
+ t->channel_callback.executing = 1;
+ REF_TRANSPORT(t, "notify_closed");
+ grpc_chttp2_schedule_closure(&t->global, &t->channel_callback.notify_closed,
+ 1);
}
- t->executing_callbacks.count = 0;
}
-static void call_cb_closed(transport *t, const grpc_transport_callbacks *cb) {
- cb->closed(t->cb_user_data, &t->base);
+void grpc_chttp2_schedule_closure(
+ grpc_chttp2_transport_global *transport_global, grpc_iomgr_closure *closure,
+ int success) {
+ closure->success = success;
+ closure->next = transport_global->pending_closures;
+ transport_global->pending_closures = closure;
}
/*
* POLLSET STUFF
*/
-static void add_to_pollset_locked(transport *t, grpc_pollset *pollset) {
+static void add_to_pollset_locked(grpc_chttp2_transport *t,
+ grpc_pollset *pollset) {
if (t->ep) {
grpc_endpoint_add_to_pollset(t->ep, pollset);
}
}
static void add_to_pollset(grpc_transport *gt, grpc_pollset *pollset) {
- transport *t = (transport *)gt;
+ grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt;
lock(t);
add_to_pollset_locked(t, pollset);
unlock(t);
}
/*
+ * TRACING
+ */
+
+void grpc_chttp2_flowctl_trace(const char *file, int line, const char *reason,
+ const char *context, const char *var,
+ int is_client, gpr_uint32 stream_id,
+ gpr_int64 current_value, gpr_int64 delta) {
+ char *identifier;
+ char *context_scope;
+ char *context_thread;
+ char *underscore_pos = strchr(context, '_');
+ GPR_ASSERT(underscore_pos);
+ context_thread = gpr_strdup(underscore_pos + 1);
+ context_scope = gpr_strdup(context);
+ context_scope[underscore_pos - context] = 0;
+ if (stream_id) {
+ gpr_asprintf(&identifier, "%s[%d]", context_scope, stream_id);
+ } else {
+ identifier = gpr_strdup(context_scope);
+ }
+ gpr_log(GPR_INFO,
+ "FLOWCTL: %s %-10s %8s %-23s %8lld %c %8lld = %8lld %-10s [%s:%d]",
+ is_client ? "client" : "server", identifier, context_thread, var,
+ current_value, delta < 0 ? '-' : '+', delta < 0 ? -delta : delta,
+ current_value + delta, reason, file, line);
+ gpr_free(identifier);
+ gpr_free(context_thread);
+ gpr_free(context_scope);
+}
+
+/*
* INTEGRATION GLUE
*/
-static const grpc_transport_vtable vtable = {
- sizeof(stream), init_stream, perform_op,
- add_to_pollset, destroy_stream, goaway,
- close_transport, send_ping, destroy_transport};
+static const grpc_transport_vtable vtable = {sizeof(grpc_chttp2_stream),
+ init_stream,
+ perform_op,
+ add_to_pollset,
+ destroy_stream,
+ goaway,
+ close_transport,
+ send_ping,
+ destroy_transport};
void grpc_create_chttp2_transport(grpc_transport_setup_callback setup,
void *arg,
@@ -2154,7 +1085,7 @@ void grpc_create_chttp2_transport(grpc_transport_setup_callback setup,
grpc_endpoint *ep, gpr_slice *slices,
size_t nslices, grpc_mdctx *mdctx,
int is_client) {
- transport *t = gpr_malloc(sizeof(transport));
+ grpc_chttp2_transport *t = gpr_malloc(sizeof(grpc_chttp2_transport));
init_transport(t, setup, arg, channel_args, ep, slices, nslices, mdctx,
is_client);
}
diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h
index fad714fabf..18e19f03af 100644
--- a/src/core/transport/chttp2_transport.h
+++ b/src/core/transport/chttp2_transport.h
@@ -47,4 +47,4 @@ void grpc_create_chttp2_transport(grpc_transport_setup_callback setup,
size_t nslices, grpc_mdctx *metadata_context,
int is_client);
-#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H */
+#endif /* GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H */
diff --git a/src/core/transport/metadata.c b/src/core/transport/metadata.c
index e75b449e12..c80d67823f 100644
--- a/src/core/transport/metadata.c
+++ b/src/core/transport/metadata.c
@@ -120,7 +120,7 @@ static void unlock(grpc_mdctx *ctx) {
if (ctx->refs == 0) {
/* uncomment if you're having trouble diagnosing an mdelem leak to make
things clearer (slows down destruction a lot, however) */
- /* gc_mdtab(ctx); */
+ gc_mdtab(ctx);
if (ctx->mdtab_count && ctx->mdtab_count == ctx->mdtab_free) {
discard_metadata(ctx);
}
diff --git a/src/core/transport/stream_op.c b/src/core/transport/stream_op.c
index 8996ecac35..81df5455f6 100644
--- a/src/core/transport/stream_op.c
+++ b/src/core/transport/stream_op.c
@@ -65,7 +65,7 @@ void grpc_sopb_swap(grpc_stream_op_buffer *a, grpc_stream_op_buffer *b) {
if (a->ops == a->inlined_ops) {
if (b->ops == b->inlined_ops) {
/* swap contents of inlined buffer */
- gpr_slice temp[GRPC_SOPB_INLINE_ELEMENTS];
+ grpc_stream_op temp[GRPC_SOPB_INLINE_ELEMENTS];
memcpy(temp, a->ops, b->nops * sizeof(grpc_stream_op));
memcpy(a->ops, b->ops, a->nops * sizeof(grpc_stream_op));
memcpy(b->ops, temp, b->nops * sizeof(grpc_stream_op));
@@ -163,6 +163,18 @@ void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops,
sopb->nops = new_nops;
}
+void grpc_sopb_move_to(grpc_stream_op_buffer *src, grpc_stream_op_buffer *dst) {
+ if (src->nops == 0) {
+ return;
+ }
+ if (dst->nops == 0) {
+ grpc_sopb_swap(src, dst);
+ return;
+ }
+ grpc_sopb_append(dst, src->ops, src->nops);
+ src->nops = 0;
+}
+
static void assert_valid_list(grpc_mdelem_list *list) {
#ifndef NDEBUG
grpc_linked_mdelem *l;
@@ -184,34 +196,34 @@ static void assert_valid_list(grpc_mdelem_list *list) {
}
#ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch *comd) {
- assert_valid_list(&comd->list);
- assert_valid_list(&comd->garbage);
+void grpc_metadata_batch_assert_ok(grpc_metadata_batch *batch) {
+ assert_valid_list(&batch->list);
+ assert_valid_list(&batch->garbage);
}
#endif /* NDEBUG */
-void grpc_metadata_batch_init(grpc_metadata_batch *comd) {
- comd->list.head = comd->list.tail = comd->garbage.head = comd->garbage.tail =
+void grpc_metadata_batch_init(grpc_metadata_batch *batch) {
+ batch->list.head = batch->list.tail = batch->garbage.head = batch->garbage.tail =
NULL;
- comd->deadline = gpr_inf_future;
+ batch->deadline = gpr_inf_future;
}
-void grpc_metadata_batch_destroy(grpc_metadata_batch *comd) {
+void grpc_metadata_batch_destroy(grpc_metadata_batch *batch) {
grpc_linked_mdelem *l;
- for (l = comd->list.head; l; l = l->next) {
+ for (l = batch->list.head; l; l = l->next) {
grpc_mdelem_unref(l->md);
}
- for (l = comd->garbage.head; l; l = l->next) {
+ for (l = batch->garbage.head; l; l = l->next) {
grpc_mdelem_unref(l->md);
}
}
-void grpc_metadata_batch_add_head(grpc_metadata_batch *comd,
+void grpc_metadata_batch_add_head(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add) {
GPR_ASSERT(elem_to_add);
storage->md = elem_to_add;
- grpc_metadata_batch_link_head(comd, storage);
+ grpc_metadata_batch_link_head(batch, storage);
}
static void link_head(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
@@ -228,17 +240,17 @@ static void link_head(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
assert_valid_list(list);
}
-void grpc_metadata_batch_link_head(grpc_metadata_batch *comd,
+void grpc_metadata_batch_link_head(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage) {
- link_head(&comd->list, storage);
+ link_head(&batch->list, storage);
}
-void grpc_metadata_batch_add_tail(grpc_metadata_batch *comd,
+void grpc_metadata_batch_add_tail(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add) {
GPR_ASSERT(elem_to_add);
storage->md = elem_to_add;
- grpc_metadata_batch_link_tail(comd, storage);
+ grpc_metadata_batch_link_tail(batch, storage);
}
static void link_tail(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
@@ -255,9 +267,9 @@ static void link_tail(grpc_mdelem_list *list, grpc_linked_mdelem *storage) {
assert_valid_list(list);
}
-void grpc_metadata_batch_link_tail(grpc_metadata_batch *comd,
+void grpc_metadata_batch_link_tail(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage) {
- link_tail(&comd->list, storage);
+ link_tail(&batch->list, storage);
}
void grpc_metadata_batch_merge(grpc_metadata_batch *target,
@@ -274,16 +286,16 @@ void grpc_metadata_batch_merge(grpc_metadata_batch *target,
}
}
-void grpc_metadata_batch_filter(grpc_metadata_batch *comd,
+void grpc_metadata_batch_filter(grpc_metadata_batch *batch,
grpc_mdelem *(*filter)(void *user_data,
grpc_mdelem *elem),
void *user_data) {
grpc_linked_mdelem *l;
grpc_linked_mdelem *next;
- assert_valid_list(&comd->list);
- assert_valid_list(&comd->garbage);
- for (l = comd->list.head; l; l = next) {
+ assert_valid_list(&batch->list);
+ assert_valid_list(&batch->garbage);
+ for (l = batch->list.head; l; l = next) {
grpc_mdelem *orig = l->md;
grpc_mdelem *filt = filter(user_data, orig);
next = l->next;
@@ -294,19 +306,19 @@ void grpc_metadata_batch_filter(grpc_metadata_batch *comd,
if (l->next) {
l->next->prev = l->prev;
}
- if (comd->list.head == l) {
- comd->list.head = l->next;
+ if (batch->list.head == l) {
+ batch->list.head = l->next;
}
- if (comd->list.tail == l) {
- comd->list.tail = l->prev;
+ if (batch->list.tail == l) {
+ batch->list.tail = l->prev;
}
- assert_valid_list(&comd->list);
- link_head(&comd->garbage, l);
+ assert_valid_list(&batch->list);
+ link_head(&batch->garbage, l);
} else if (filt != orig) {
grpc_mdelem_unref(orig);
l->md = filt;
}
}
- assert_valid_list(&comd->list);
- assert_valid_list(&comd->garbage);
+ assert_valid_list(&batch->list);
+ assert_valid_list(&batch->garbage);
}
diff --git a/src/core/transport/stream_op.h b/src/core/transport/stream_op.h
index e080701e2d..842fc932b9 100644
--- a/src/core/transport/stream_op.h
+++ b/src/core/transport/stream_op.h
@@ -85,29 +85,62 @@ typedef struct grpc_mdelem_list {
} grpc_mdelem_list;
typedef struct grpc_metadata_batch {
+ /** Metadata elements in this batch */
grpc_mdelem_list list;
+ /** Elements that have been removed from the batch, but have
+ not yet been unreffed - used to allow collecting garbage
+ under a single metadata context lock */
grpc_mdelem_list garbage;
+ /** Used to calculate grpc-timeout at the point of sending,
+ or gpr_inf_future if this batch does not need to send a
+ grpc-timeout */
gpr_timespec deadline;
} grpc_metadata_batch;
-void grpc_metadata_batch_init(grpc_metadata_batch *comd);
-void grpc_metadata_batch_destroy(grpc_metadata_batch *comd);
+void grpc_metadata_batch_init(grpc_metadata_batch *batch);
+void grpc_metadata_batch_destroy(grpc_metadata_batch *batch);
void grpc_metadata_batch_merge(grpc_metadata_batch *target,
grpc_metadata_batch *add);
-void grpc_metadata_batch_link_head(grpc_metadata_batch *comd,
+/** Add \a storage to the beginning of \a batch. storage->md is
+ assumed to be valid.
+ \a storage is owned by the caller and must survive for the
+ lifetime of batch. This usually means it should be around
+ for the lifetime of the call. */
+void grpc_metadata_batch_link_head(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage);
-void grpc_metadata_batch_link_tail(grpc_metadata_batch *comd,
+/** Add \a storage to the end of \a batch. storage->md is
+ assumed to be valid.
+ \a storage is owned by the caller and must survive for the
+ lifetime of batch. This usually means it should be around
+ for the lifetime of the call. */
+void grpc_metadata_batch_link_tail(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage);
-void grpc_metadata_batch_add_head(grpc_metadata_batch *comd,
+/** Add \a elem_to_add as the first element in \a batch, using
+ \a storage as backing storage for the linked list element.
+ \a storage is owned by the caller and must survive for the
+ lifetime of batch. This usually means it should be around
+ for the lifetime of the call.
+ Takes ownership of \a elem_to_add */
+void grpc_metadata_batch_add_head(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add);
-void grpc_metadata_batch_add_tail(grpc_metadata_batch *comd,
+/** Add \a elem_to_add as the last element in \a batch, using
+ \a storage as backing storage for the linked list element.
+ \a storage is owned by the caller and must survive for the
+ lifetime of batch. This usually means it should be around
+ for the lifetime of the call.
+ Takes ownership of \a elem_to_add */
+void grpc_metadata_batch_add_tail(grpc_metadata_batch *batch,
grpc_linked_mdelem *storage,
grpc_mdelem *elem_to_add);
-void grpc_metadata_batch_filter(grpc_metadata_batch *comd,
+/** For each element in \a batch, execute \a filter.
+ The return value from \a filter will be substituted for the
+ grpc_mdelem passed to \a filter. If \a filter returns NULL,
+ the element will be moved to the garbage list. */
+void grpc_metadata_batch_filter(grpc_metadata_batch *batch,
grpc_mdelem *(*filter)(void *user_data,
grpc_mdelem *elem),
void *user_data);
@@ -166,6 +199,8 @@ void grpc_sopb_add_slice(grpc_stream_op_buffer *sopb, gpr_slice slice);
void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops,
size_t nops);
+void grpc_sopb_move_to(grpc_stream_op_buffer *src, grpc_stream_op_buffer *dst);
+
char *grpc_sopb_string(grpc_stream_op_buffer *sopb);
#endif /* GRPC_INTERNAL_CORE_TRANSPORT_STREAM_OP_H */
diff --git a/src/core/transport/transport.c b/src/core/transport/transport.c
index d9a1319c42..39d7b701f2 100644
--- a/src/core/transport/transport.c
+++ b/src/core/transport/transport.c
@@ -73,9 +73,8 @@ void grpc_transport_destroy_stream(grpc_transport *transport,
transport->vtable->destroy_stream(transport, stream);
}
-void grpc_transport_ping(grpc_transport *transport, void (*cb)(void *user_data),
- void *user_data) {
- transport->vtable->ping(transport, cb, user_data);
+void grpc_transport_ping(grpc_transport *transport, grpc_iomgr_closure *cb) {
+ transport->vtable->ping(transport, cb);
}
void grpc_transport_setup_cancel(grpc_transport_setup *setup) {
@@ -86,12 +85,25 @@ void grpc_transport_setup_initiate(grpc_transport_setup *setup) {
setup->vtable->initiate(setup);
}
+void grpc_transport_setup_add_interested_party(grpc_transport_setup *setup,
+ grpc_pollset *pollset) {
+ setup->vtable->add_interested_party(setup, pollset);
+}
+
+void grpc_transport_setup_del_interested_party(grpc_transport_setup *setup,
+ grpc_pollset *pollset) {
+ setup->vtable->del_interested_party(setup, pollset);
+}
+
void grpc_transport_op_finish_with_failure(grpc_transport_op *op) {
if (op->send_ops) {
- op->on_done_send(op->send_user_data, 0);
+ op->on_done_send->cb(op->on_done_send->cb_arg, 0);
}
if (op->recv_ops) {
- op->on_done_recv(op->recv_user_data, 0);
+ op->on_done_recv->cb(op->on_done_recv->cb_arg, 0);
+ }
+ if (op->on_consumed) {
+ op->on_consumed->cb(op->on_consumed->cb_arg, 0);
}
}
@@ -100,8 +112,8 @@ void grpc_transport_op_add_cancellation(grpc_transport_op *op,
grpc_mdstr *message) {
if (op->cancel_with_status == GRPC_STATUS_OK) {
op->cancel_with_status = status;
- op->cancel_message = message;
- } else if (message) {
+ }
+ if (message) {
grpc_mdstr_unref(message);
}
}
diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h
index 6f8d39e352..a2c41c47af 100644
--- a/src/core/transport/transport.h
+++ b/src/core/transport/transport.h
@@ -37,6 +37,7 @@
#include <stddef.h>
#include "src/core/iomgr/pollset.h"
+#include "src/core/iomgr/pollset_set.h"
#include "src/core/transport/stream_op.h"
#include "src/core/channel/context.h"
@@ -63,20 +64,19 @@ typedef enum grpc_stream_state {
/* Transport op: a set of operations to perform on a transport */
typedef struct grpc_transport_op {
+ grpc_iomgr_closure *on_consumed;
+
grpc_stream_op_buffer *send_ops;
int is_last_send;
- void (*on_done_send)(void *user_data, int success);
- void *send_user_data;
+ grpc_iomgr_closure *on_done_send;
grpc_stream_op_buffer *recv_ops;
grpc_stream_state *recv_state;
- void (*on_done_recv)(void *user_data, int success);
- void *recv_user_data;
+ grpc_iomgr_closure *on_done_recv;
grpc_pollset *bind_pollset;
grpc_status_code cancel_with_status;
- grpc_mdstr *cancel_message;
/* Indexes correspond to grpc_context_index enum values */
grpc_call_context_element *context;
@@ -163,11 +163,8 @@ void grpc_transport_perform_op(grpc_transport *transport, grpc_stream *stream,
/* Send a ping on a transport
- Calls cb with user data when a response is received.
- cb *MAY* be called with arbitrary transport level locks held. It is not safe
- to call into the transport during cb. */
-void grpc_transport_ping(grpc_transport *transport, void (*cb)(void *user_data),
- void *user_data);
+ Calls cb with user data when a response is received. */
+void grpc_transport_ping(grpc_transport *transport, grpc_iomgr_closure *cb);
/* Advise peer of pending connection termination. */
void grpc_transport_goaway(grpc_transport *transport, grpc_status_code status,
@@ -195,6 +192,10 @@ typedef struct grpc_transport_setup_vtable grpc_transport_setup_vtable;
struct grpc_transport_setup_vtable {
void (*initiate)(grpc_transport_setup *setup);
+ void (*add_interested_party)(grpc_transport_setup *setup,
+ grpc_pollset *pollset);
+ void (*del_interested_party)(grpc_transport_setup *setup,
+ grpc_pollset *pollset);
void (*cancel)(grpc_transport_setup *setup);
};
@@ -211,6 +212,12 @@ struct grpc_transport_setup {
This *may* be implemented as a no-op if the setup process monitors something
continuously. */
void grpc_transport_setup_initiate(grpc_transport_setup *setup);
+
+void grpc_transport_setup_add_interested_party(grpc_transport_setup *setup,
+ grpc_pollset *pollset);
+void grpc_transport_setup_del_interested_party(grpc_transport_setup *setup,
+ grpc_pollset *pollset);
+
/* Cancel transport setup. After this returns, no new transports should be
created, and all pending transport setup callbacks should be completed.
After this call completes, setup should be considered invalid (this can be
diff --git a/src/core/transport/transport_impl.h b/src/core/transport/transport_impl.h
index 479e15338f..c51951b7a7 100644
--- a/src/core/transport/transport_impl.h
+++ b/src/core/transport/transport_impl.h
@@ -63,8 +63,7 @@ typedef struct grpc_transport_vtable {
void (*close)(grpc_transport *self);
/* implementation of grpc_transport_ping */
- void (*ping)(grpc_transport *self, void (*cb)(void *user_data),
- void *user_data);
+ void (*ping)(grpc_transport *self, grpc_iomgr_closure *cb);
/* implementation of grpc_transport_destroy */
void (*destroy)(grpc_transport *self);
diff --git a/src/core/transport/transport_op_string.c b/src/core/transport/transport_op_string.c
index 5c4edb006a..a408b75790 100644
--- a/src/core/transport/transport_op_string.c
+++ b/src/core/transport/transport_op_string.c
@@ -144,11 +144,6 @@ char *grpc_transport_op_string(grpc_transport_op *op) {
first = 0;
gpr_asprintf(&tmp, "CANCEL:%d", op->cancel_with_status);
gpr_strvec_add(&b, tmp);
- if (op->cancel_message) {
- gpr_asprintf(&tmp, ";msg='%s'",
- grpc_mdstr_as_c_string(op->cancel_message));
- gpr_strvec_add(&b, tmp);
- }
}
out = gpr_strvec_flatten(&b, NULL);
diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c
index 63b4c42131..6156a39d09 100644
--- a/src/core/tsi/ssl_transport_security.c
+++ b/src/core/tsi/ssl_transport_security.c
@@ -54,8 +54,16 @@
#define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND 16384
#define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_LOWER_BOUND 1024
+
+/* Putting a macro like this and littering the source file with #if is really
+ bad practice.
+ TODO(jboeuf): refactor all the #if / #endif in a separate module. */
+#ifndef TSI_OPENSSL_ALPN_SUPPORT
+#define TSI_OPENSSL_ALPN_SUPPORT 1
+#endif
+
/* TODO(jboeuf): I have not found a way to get this number dynamically from the
- * SSL structure. This is what we would ultimately want though... */
+ SSL structure. This is what we would ultimately want though... */
#define TSI_SSL_MAX_PROTECTION_OVERHEAD 100
/* --- Structure definitions. ---*/
@@ -70,6 +78,8 @@ struct tsi_ssl_handshaker_factory {
typedef struct {
tsi_ssl_handshaker_factory base;
SSL_CTX* ssl_context;
+ unsigned char* alpn_protocol_list;
+ size_t alpn_protocol_list_length;
} tsi_ssl_client_handshaker_factory;
typedef struct {
@@ -841,7 +851,7 @@ static tsi_result ssl_handshaker_process_bytes_from_peer(
static tsi_result ssl_handshaker_extract_peer(tsi_handshaker* self,
tsi_peer* peer) {
tsi_result result = TSI_OK;
- const unsigned char* alpn_selected;
+ const unsigned char* alpn_selected = NULL;
unsigned int alpn_selected_len;
tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self;
X509* peer_cert = SSL_get_peer_certificate(impl->ssl);
@@ -850,7 +860,14 @@ static tsi_result ssl_handshaker_extract_peer(tsi_handshaker* self,
X509_free(peer_cert);
if (result != TSI_OK) return result;
}
+#if TSI_OPENSSL_ALPN_SUPPORT
SSL_get0_alpn_selected(impl->ssl, &alpn_selected, &alpn_selected_len);
+#endif /* TSI_OPENSSL_ALPN_SUPPORT */
+ if (alpn_selected == NULL) {
+ /* Try npn. */
+ SSL_get0_next_proto_negotiated(impl->ssl, &alpn_selected,
+ &alpn_selected_len);
+ }
if (alpn_selected != NULL) {
size_t i;
tsi_peer_property* new_properties =
@@ -1012,6 +1029,32 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
return TSI_OK;
}
+static int select_protocol_list(const unsigned char** out,
+ unsigned char* outlen,
+ const unsigned char* client_list,
+ unsigned int client_list_len,
+ const unsigned char* server_list,
+ unsigned int server_list_len) {
+ const unsigned char* client_current = client_list;
+ while ((unsigned int)(client_current - client_list) < client_list_len) {
+ unsigned char client_current_len = *(client_current++);
+ const unsigned char* server_current = server_list;
+ while ((server_current >= server_list) &&
+ (gpr_uintptr)(server_current - server_list) < server_list_len) {
+ unsigned char server_current_len = *(server_current++);
+ if ((client_current_len == server_current_len) &&
+ !memcmp(client_current, server_current, server_current_len)) {
+ *out = server_current;
+ *outlen = server_current_len;
+ return SSL_TLSEXT_ERR_OK;
+ }
+ server_current += server_current_len;
+ }
+ client_current += client_current_len;
+ }
+ return SSL_TLSEXT_ERR_NOACK;
+}
+
/* --- tsi_ssl__client_handshaker_factory methods implementation. --- */
static tsi_result ssl_client_handshaker_factory_create_handshaker(
@@ -1027,10 +1070,21 @@ static void ssl_client_handshaker_factory_destroy(
tsi_ssl_handshaker_factory* self) {
tsi_ssl_client_handshaker_factory* impl =
(tsi_ssl_client_handshaker_factory*)self;
- SSL_CTX_free(impl->ssl_context);
+ if (impl->ssl_context != NULL) SSL_CTX_free(impl->ssl_context);
+ if (impl->alpn_protocol_list != NULL) free(impl->alpn_protocol_list);
free(impl);
}
+static int client_handshaker_factory_npn_callback(
+ SSL* ssl, unsigned char** out, unsigned char* outlen,
+ const unsigned char* in, unsigned int inlen, void* arg) {
+ tsi_ssl_client_handshaker_factory* factory =
+ (tsi_ssl_client_handshaker_factory*)arg;
+ return select_protocol_list((const unsigned char**)out, outlen,
+ factory->alpn_protocol_list,
+ factory->alpn_protocol_list_length, in, inlen);
+}
+
/* --- tsi_ssl_server_handshaker_factory methods implementation. --- */
static tsi_result ssl_server_handshaker_factory_create_handshaker(
@@ -1134,30 +1188,25 @@ static int ssl_server_handshaker_factory_servername_callback(SSL* ssl, int* ap,
return SSL_TLSEXT_ERR_ALERT_WARNING;
}
+#if TSI_OPENSSL_ALPN_SUPPORT
static int server_handshaker_factory_alpn_callback(
SSL* ssl, const unsigned char** out, unsigned char* outlen,
const unsigned char* in, unsigned int inlen, void* arg) {
tsi_ssl_server_handshaker_factory* factory =
(tsi_ssl_server_handshaker_factory*)arg;
- const unsigned char* client_current = in;
- while ((unsigned int)(client_current - in) < inlen) {
- unsigned char client_current_len = *(client_current++);
- const unsigned char* server_current = factory->alpn_protocol_list;
- while ((server_current >= factory->alpn_protocol_list) &&
- (gpr_uintptr)(server_current - factory->alpn_protocol_list) <
- factory->alpn_protocol_list_length) {
- unsigned char server_current_len = *(server_current++);
- if ((client_current_len == server_current_len) &&
- !memcmp(client_current, server_current, server_current_len)) {
- *out = server_current;
- *outlen = server_current_len;
- return SSL_TLSEXT_ERR_OK;
- }
- server_current += server_current_len;
- }
- client_current += client_current_len;
- }
- return SSL_TLSEXT_ERR_NOACK;
+ return select_protocol_list(out, outlen, in, inlen,
+ factory->alpn_protocol_list,
+ factory->alpn_protocol_list_length);
+}
+#endif /* TSI_OPENSSL_ALPN_SUPPORT */
+
+static int server_handshaker_factory_npn_advertised_callback(
+ SSL* ssl, const unsigned char** out, unsigned int* outlen, void* arg) {
+ tsi_ssl_server_handshaker_factory* factory =
+ (tsi_ssl_server_handshaker_factory*)arg;
+ *out = factory->alpn_protocol_list;
+ *outlen = factory->alpn_protocol_list_length;
+ return SSL_TLSEXT_ERR_OK;
}
/* --- tsi_ssl_handshaker_factory constructors. --- */
@@ -1184,6 +1233,14 @@ tsi_result tsi_create_ssl_client_handshaker_factory(
gpr_log(GPR_ERROR, "Could not create ssl context.");
return TSI_INVALID_ARGUMENT;
}
+
+ impl = calloc(1, sizeof(tsi_ssl_client_handshaker_factory));
+ if (impl == NULL) {
+ SSL_CTX_free(ssl_context);
+ return TSI_OUT_OF_RESOURCES;
+ }
+ impl->ssl_context = ssl_context;
+
do {
result =
populate_ssl_context(ssl_context, pem_private_key, pem_private_key_size,
@@ -1197,41 +1254,33 @@ tsi_result tsi_create_ssl_client_handshaker_factory(
}
if (num_alpn_protocols != 0) {
- unsigned char* alpn_protocol_list = NULL;
- size_t alpn_protocol_list_length = 0;
- int ssl_failed;
result = build_alpn_protocol_name_list(
alpn_protocols, alpn_protocols_lengths, num_alpn_protocols,
- &alpn_protocol_list, &alpn_protocol_list_length);
+ &impl->alpn_protocol_list, &impl->alpn_protocol_list_length);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Building alpn list failed with error %s.",
tsi_result_to_string(result));
- free(alpn_protocol_list);
break;
}
- ssl_failed = SSL_CTX_set_alpn_protos(ssl_context, alpn_protocol_list,
- alpn_protocol_list_length);
- free(alpn_protocol_list);
- if (ssl_failed) {
+#if TSI_OPENSSL_ALPN_SUPPORT
+ if (SSL_CTX_set_alpn_protos(ssl_context, impl->alpn_protocol_list,
+ impl->alpn_protocol_list_length)) {
gpr_log(GPR_ERROR, "Could not set alpn protocol list to context.");
result = TSI_INVALID_ARGUMENT;
break;
}
+#endif /* TSI_OPENSSL_ALPN_SUPPORT */
+ SSL_CTX_set_next_proto_select_cb(
+ ssl_context, client_handshaker_factory_npn_callback, impl);
}
} while (0);
if (result != TSI_OK) {
- SSL_CTX_free(ssl_context);
+ ssl_client_handshaker_factory_destroy(&impl->base);
return result;
}
SSL_CTX_set_verify(ssl_context, SSL_VERIFY_PEER, NULL);
/* TODO(jboeuf): Add revocation verification. */
- impl = calloc(1, sizeof(tsi_ssl_client_handshaker_factory));
- if (impl == NULL) {
- SSL_CTX_free(ssl_context);
- return TSI_OUT_OF_RESOURCES;
- }
- impl->ssl_context = ssl_context;
impl->base.create_handshaker =
ssl_client_handshaker_factory_create_handshaker;
impl->base.destroy = ssl_client_handshaker_factory_destroy;
@@ -1322,8 +1371,13 @@ tsi_result tsi_create_ssl_server_handshaker_factory(
impl->ssl_contexts[i],
ssl_server_handshaker_factory_servername_callback);
SSL_CTX_set_tlsext_servername_arg(impl->ssl_contexts[i], impl);
+#if TSI_OPENSSL_ALPN_SUPPORT
SSL_CTX_set_alpn_select_cb(impl->ssl_contexts[i],
server_handshaker_factory_alpn_callback, impl);
+#endif /* TSI_OPENSSL_ALPN_SUPPORT */
+ SSL_CTX_set_next_protos_advertised_cb(
+ impl->ssl_contexts[i],
+ server_handshaker_factory_npn_advertised_callback, impl);
} while (0);
if (result != TSI_OK) {
diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc
index 475a20d883..72593f877e 100644
--- a/src/cpp/client/channel.cc
+++ b/src/cpp/client/channel.cc
@@ -36,12 +36,10 @@
#include <memory>
#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
#include <grpc/support/log.h>
#include <grpc/support/slice.h>
#include "src/core/profiling/timers.h"
-#include "src/cpp/proto/proto_utils.h"
#include <grpc++/channel_arguments.h>
#include <grpc++/client_context.h>
#include <grpc++/completion_queue.h>
@@ -75,14 +73,14 @@ Call Channel::CreateCall(const RpcMethod& method, ClientContext* context,
return Call(c_call, this, cq);
}
-void Channel::PerformOpsOnCall(CallOpBuffer* buf, Call* call) {
+void Channel::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) {
static const size_t MAX_OPS = 8;
- size_t nops = MAX_OPS;
- grpc_op ops[MAX_OPS];
+ size_t nops = 0;
+ grpc_op cops[MAX_OPS];
GRPC_TIMER_BEGIN(GRPC_PTAG_CPP_PERFORM_OPS, call->call());
- buf->FillOps(ops, &nops);
+ ops->FillOps(cops, &nops);
GPR_ASSERT(GRPC_CALL_OK ==
- grpc_call_start_batch(call->call(), ops, nops, buf));
+ grpc_call_start_batch(call->call(), cops, nops, ops));
GRPC_TIMER_END(GRPC_PTAG_CPP_PERFORM_OPS, call->call());
}
diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h
index cd239247c8..9108713c58 100644
--- a/src/cpp/client/channel.h
+++ b/src/cpp/client/channel.h
@@ -44,22 +44,22 @@ struct grpc_channel;
namespace grpc {
class Call;
-class CallOpBuffer;
+class CallOpSetInterface;
class ChannelArguments;
class CompletionQueue;
class Credentials;
class StreamContextInterface;
-class Channel GRPC_FINAL : public GrpcLibrary,
- public ChannelInterface {
+class Channel GRPC_FINAL : public GrpcLibrary, public ChannelInterface {
public:
Channel(const grpc::string& target, grpc_channel* c_channel);
~Channel() GRPC_OVERRIDE;
- virtual void *RegisterMethod(const char *method) GRPC_OVERRIDE;
+ virtual void* RegisterMethod(const char* method) GRPC_OVERRIDE;
virtual Call CreateCall(const RpcMethod& method, ClientContext* context,
CompletionQueue* cq) GRPC_OVERRIDE;
- virtual void PerformOpsOnCall(CallOpBuffer* ops, Call* call) GRPC_OVERRIDE;
+ virtual void PerformOpsOnCall(CallOpSetInterface* ops,
+ Call* call) GRPC_OVERRIDE;
private:
const grpc::string target_;
diff --git a/src/cpp/client/channel_arguments.cc b/src/cpp/client/channel_arguments.cc
index 679c4f1503..b271650673 100644
--- a/src/cpp/client/channel_arguments.cc
+++ b/src/cpp/client/channel_arguments.cc
@@ -33,28 +33,14 @@
#include <grpc++/channel_arguments.h>
-#include <grpc/grpc_security.h>
#include "src/core/channel/channel_args.h"
namespace grpc {
-void ChannelArguments::SetSslTargetNameOverride(const grpc::string& name) {
- SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, name);
-}
-
void ChannelArguments::SetCompressionLevel(grpc_compression_level level) {
SetInt(GRPC_COMPRESSION_LEVEL_ARG, level);
}
-grpc::string ChannelArguments::GetSslTargetNameOverride() const {
- for (unsigned int i = 0; i < args_.size(); i++) {
- if (grpc::string(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == args_[i].key) {
- return args_[i].value.string;
- }
- }
- return "";
-}
-
void ChannelArguments::SetInt(const grpc::string& key, int value) {
grpc_arg arg;
arg.type = GRPC_ARG_INTEGER;
diff --git a/src/cpp/client/secure_channel_arguments.cc b/src/cpp/client/secure_channel_arguments.cc
new file mode 100644
index 0000000000..d89df999ad
--- /dev/null
+++ b/src/cpp/client/secure_channel_arguments.cc
@@ -0,0 +1,54 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <grpc++/channel_arguments.h>
+#include <grpc/grpc_security.h>
+
+#include "src/core/channel/channel_args.h"
+
+namespace grpc {
+
+void ChannelArguments::SetSslTargetNameOverride(const grpc::string& name) {
+ SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, name);
+}
+
+grpc::string ChannelArguments::GetSslTargetNameOverride() const {
+ for (unsigned int i = 0; i < args_.size(); i++) {
+ if (grpc::string(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) == args_[i].key) {
+ return args_[i].value.string;
+ }
+ }
+ return "";
+}
+
+} // namespace grpc
diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc
index edce6396bd..0a5c976e01 100644
--- a/src/cpp/common/call.cc
+++ b/src/cpp/common/call.cc
@@ -39,107 +39,32 @@
#include <grpc++/channel_interface.h>
#include "src/core/profiling/timers.h"
-#include "src/cpp/proto/proto_utils.h"
namespace grpc {
-CallOpBuffer::CallOpBuffer()
- : return_tag_(this),
- send_initial_metadata_(false),
- initial_metadata_count_(0),
- initial_metadata_(nullptr),
- recv_initial_metadata_(nullptr),
- send_message_(nullptr),
- send_message_buffer_(nullptr),
- send_buf_(nullptr),
- recv_message_(nullptr),
- recv_message_buffer_(nullptr),
- recv_buf_(nullptr),
- max_message_size_(-1),
- client_send_close_(false),
- recv_trailing_metadata_(nullptr),
- recv_status_(nullptr),
- status_code_(GRPC_STATUS_OK),
- status_details_(nullptr),
- status_details_capacity_(0),
- send_status_available_(false),
- send_status_code_(GRPC_STATUS_OK),
- trailing_metadata_count_(0),
- trailing_metadata_(nullptr),
- cancelled_buf_(0),
- recv_closed_(nullptr) {
- memset(&recv_trailing_metadata_arr_, 0, sizeof(recv_trailing_metadata_arr_));
- memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_));
- recv_trailing_metadata_arr_.metadata = nullptr;
- recv_initial_metadata_arr_.metadata = nullptr;
-}
-
-void CallOpBuffer::Reset(void* next_return_tag) {
- return_tag_ = next_return_tag;
-
- send_initial_metadata_ = false;
- initial_metadata_count_ = 0;
- gpr_free(initial_metadata_);
-
- recv_initial_metadata_ = nullptr;
- recv_initial_metadata_arr_.count = 0;
-
- if (send_buf_ && send_message_) {
- grpc_byte_buffer_destroy(send_buf_);
- }
- send_message_ = nullptr;
- send_message_buffer_ = nullptr;
- send_buf_ = nullptr;
-
- got_message = false;
- if (recv_buf_ && recv_message_) {
- grpc_byte_buffer_destroy(recv_buf_);
- }
- recv_message_ = nullptr;
- recv_message_buffer_ = nullptr;
- recv_buf_ = nullptr;
-
- client_send_close_ = false;
-
- recv_trailing_metadata_ = nullptr;
- recv_status_ = nullptr;
- recv_trailing_metadata_arr_.count = 0;
-
- status_code_ = GRPC_STATUS_OK;
-
- send_status_available_ = false;
- send_status_code_ = GRPC_STATUS_OK;
- send_status_details_.clear();
- trailing_metadata_count_ = 0;
- trailing_metadata_ = nullptr;
-
- recv_closed_ = nullptr;
-}
-
-CallOpBuffer::~CallOpBuffer() {
- gpr_free(status_details_);
- gpr_free(recv_initial_metadata_arr_.metadata);
- gpr_free(recv_trailing_metadata_arr_.metadata);
- if (recv_buf_ && recv_message_) {
- grpc_byte_buffer_destroy(recv_buf_);
- }
- if (send_buf_ && send_message_) {
- grpc_byte_buffer_destroy(send_buf_);
+void FillMetadataMap(grpc_metadata_array* arr,
+ std::multimap<grpc::string, grpc::string>* metadata) {
+ for (size_t i = 0; i < arr->count; i++) {
+ // TODO(yangg) handle duplicates?
+ metadata->insert(std::pair<grpc::string, grpc::string>(
+ arr->metadata[i].key,
+ grpc::string(arr->metadata[i].value, arr->metadata[i].value_length)));
}
+ grpc_metadata_array_destroy(arr);
+ grpc_metadata_array_init(arr);
}
-namespace {
// TODO(yangg) if the map is changed before we send, the pointers will be a
// mess. Make sure it does not happen.
grpc_metadata* FillMetadataArray(
- std::multimap<grpc::string, grpc::string>* metadata) {
- if (metadata->empty()) {
+ const std::multimap<grpc::string, grpc::string>& metadata) {
+ if (metadata.empty()) {
return nullptr;
}
grpc_metadata* metadata_array =
- (grpc_metadata*)gpr_malloc(metadata->size() * sizeof(grpc_metadata));
+ (grpc_metadata*)gpr_malloc(metadata.size() * sizeof(grpc_metadata));
size_t i = 0;
- for (auto iter = metadata->cbegin(); iter != metadata->cend(); ++iter, ++i) {
+ for (auto iter = metadata.cbegin(); iter != metadata.cend(); ++iter, ++i) {
metadata_array[i].key = iter->first.c_str();
metadata_array[i].value = iter->second.c_str();
metadata_array[i].value_length = iter->second.size();
@@ -147,206 +72,6 @@ grpc_metadata* FillMetadataArray(
return metadata_array;
}
-void FillMetadataMap(grpc_metadata_array* arr,
- std::multimap<grpc::string, grpc::string>* metadata) {
- for (size_t i = 0; i < arr->count; i++) {
- // TODO(yangg) handle duplicates?
- metadata->insert(std::pair<grpc::string, grpc::string>(
- arr->metadata[i].key,
- grpc::string(arr->metadata[i].value, arr->metadata[i].value_length)));
- }
- grpc_metadata_array_destroy(arr);
- grpc_metadata_array_init(arr);
-}
-} // namespace
-
-void CallOpBuffer::AddSendInitialMetadata(
- std::multimap<grpc::string, grpc::string>* metadata) {
- send_initial_metadata_ = true;
- initial_metadata_count_ = metadata->size();
- initial_metadata_ = FillMetadataArray(metadata);
-}
-
-void CallOpBuffer::AddRecvInitialMetadata(ClientContext* ctx) {
- ctx->initial_metadata_received_ = true;
- recv_initial_metadata_ = &ctx->recv_initial_metadata_;
-}
-
-void CallOpBuffer::AddSendInitialMetadata(ClientContext* ctx) {
- AddSendInitialMetadata(&ctx->send_initial_metadata_);
-}
-
-void CallOpBuffer::AddSendMessage(const grpc::protobuf::Message& message) {
- send_message_ = &message;
-}
-
-void CallOpBuffer::AddSendMessage(const ByteBuffer& message) {
- send_message_buffer_ = &message;
-}
-
-void CallOpBuffer::AddRecvMessage(grpc::protobuf::Message* message) {
- recv_message_ = message;
- recv_message_->Clear();
-}
-
-void CallOpBuffer::AddRecvMessage(ByteBuffer* message) {
- recv_message_buffer_ = message;
- recv_message_buffer_->Clear();
-}
-
-void CallOpBuffer::AddClientSendClose() { client_send_close_ = true; }
-
-void CallOpBuffer::AddServerRecvClose(bool* cancelled) {
- recv_closed_ = cancelled;
-}
-
-void CallOpBuffer::AddClientRecvStatus(ClientContext* context, Status* status) {
- recv_trailing_metadata_ = &context->trailing_metadata_;
- recv_status_ = status;
-}
-
-void CallOpBuffer::AddServerSendStatus(
- std::multimap<grpc::string, grpc::string>* metadata, const Status& status) {
- if (metadata != NULL) {
- trailing_metadata_count_ = metadata->size();
- trailing_metadata_ = FillMetadataArray(metadata);
- } else {
- trailing_metadata_count_ = 0;
- }
- send_status_available_ = true;
- send_status_code_ = static_cast<grpc_status_code>(status.error_code());
- send_status_details_ = status.error_message();
-}
-
-void CallOpBuffer::FillOps(grpc_op* ops, size_t* nops) {
- *nops = 0;
- if (send_initial_metadata_) {
- ops[*nops].op = GRPC_OP_SEND_INITIAL_METADATA;
- ops[*nops].data.send_initial_metadata.count = initial_metadata_count_;
- ops[*nops].data.send_initial_metadata.metadata = initial_metadata_;
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (recv_initial_metadata_) {
- ops[*nops].op = GRPC_OP_RECV_INITIAL_METADATA;
- ops[*nops].data.recv_initial_metadata = &recv_initial_metadata_arr_;
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (send_message_ || send_message_buffer_) {
- if (send_message_) {
- GRPC_TIMER_BEGIN(GRPC_PTAG_PROTO_SERIALIZE, 0);
- bool success = SerializeProto(*send_message_, &send_buf_);
- if (!success) {
- abort();
- // TODO handle parse failure
- }
- GRPC_TIMER_END(GRPC_PTAG_PROTO_SERIALIZE, 0);
- } else {
- send_buf_ = send_message_buffer_->buffer();
- }
- ops[*nops].op = GRPC_OP_SEND_MESSAGE;
- ops[*nops].data.send_message = send_buf_;
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (recv_message_ || recv_message_buffer_) {
- ops[*nops].op = GRPC_OP_RECV_MESSAGE;
- ops[*nops].data.recv_message = &recv_buf_;
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (client_send_close_) {
- ops[*nops].op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (recv_status_) {
- ops[*nops].op = GRPC_OP_RECV_STATUS_ON_CLIENT;
- ops[*nops].data.recv_status_on_client.trailing_metadata =
- &recv_trailing_metadata_arr_;
- ops[*nops].data.recv_status_on_client.status = &status_code_;
- ops[*nops].data.recv_status_on_client.status_details = &status_details_;
- ops[*nops].data.recv_status_on_client.status_details_capacity =
- &status_details_capacity_;
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (send_status_available_) {
- ops[*nops].op = GRPC_OP_SEND_STATUS_FROM_SERVER;
- ops[*nops].data.send_status_from_server.trailing_metadata_count =
- trailing_metadata_count_;
- ops[*nops].data.send_status_from_server.trailing_metadata =
- trailing_metadata_;
- ops[*nops].data.send_status_from_server.status = send_status_code_;
- ops[*nops].data.send_status_from_server.status_details =
- send_status_details_.empty() ? nullptr : send_status_details_.c_str();
- ops[*nops].flags = 0;
- (*nops)++;
- }
- if (recv_closed_) {
- ops[*nops].op = GRPC_OP_RECV_CLOSE_ON_SERVER;
- ops[*nops].data.recv_close_on_server.cancelled = &cancelled_buf_;
- ops[*nops].flags = 0;
- (*nops)++;
- }
-}
-
-bool CallOpBuffer::FinalizeResult(void** tag, bool* status) {
- // Release send buffers.
- if (send_buf_ && send_message_) {
- if (send_message_) {
- grpc_byte_buffer_destroy(send_buf_);
- }
- send_buf_ = nullptr;
- }
- if (initial_metadata_) {
- gpr_free(initial_metadata_);
- initial_metadata_ = nullptr;
- }
- if (trailing_metadata_count_) {
- gpr_free(trailing_metadata_);
- trailing_metadata_ = nullptr;
- }
- // Set user-facing tag.
- *tag = return_tag_;
- // Process received initial metadata
- if (recv_initial_metadata_) {
- FillMetadataMap(&recv_initial_metadata_arr_, recv_initial_metadata_);
- }
- // Parse received message if any.
- if (recv_message_ || recv_message_buffer_) {
- if (recv_buf_) {
- got_message = *status;
- if (recv_message_) {
- GRPC_TIMER_BEGIN(GRPC_PTAG_PROTO_DESERIALIZE, 0);
- *status = *status &&
- DeserializeProto(recv_buf_, recv_message_, max_message_size_);
- grpc_byte_buffer_destroy(recv_buf_);
- GRPC_TIMER_END(GRPC_PTAG_PROTO_DESERIALIZE, 0);
- } else {
- recv_message_buffer_->set_buffer(recv_buf_);
- }
- recv_buf_ = nullptr;
- } else {
- // Read failed
- got_message = false;
- *status = false;
- }
- }
- // Parse received status.
- if (recv_status_) {
- FillMetadataMap(&recv_trailing_metadata_arr_, recv_trailing_metadata_);
- *recv_status_ = Status(
- static_cast<StatusCode>(status_code_),
- status_details_ ? grpc::string(status_details_) : grpc::string());
- }
- if (recv_closed_) {
- *recv_closed_ = cancelled_buf_ != 0;
- }
- return true;
-}
-
Call::Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq)
: call_hook_(call_hook), cq_(cq), call_(call), max_message_size_(-1) {}
@@ -357,11 +82,11 @@ Call::Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq,
call_(call),
max_message_size_(max_message_size) {}
-void Call::PerformOps(CallOpBuffer* buffer) {
+void Call::PerformOps(CallOpSetInterface* ops) {
if (max_message_size_ > 0) {
- buffer->set_max_message_size(max_message_size_);
+ ops->set_max_message_size(max_message_size_);
}
- call_hook_->PerformOpsOnCall(buffer, this);
+ call_hook_->PerformOpsOnCall(ops, this);
}
} // namespace grpc
diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc
index f4cf5cf17a..7b2a65e99b 100644
--- a/src/cpp/proto/proto_utils.cc
+++ b/src/cpp/proto/proto_utils.cc
@@ -31,7 +31,7 @@
*
*/
-#include "src/cpp/proto/proto_utils.h"
+#include <grpc++/impl/proto_utils.h>
#include <grpc++/config.h>
#include <grpc/grpc.h>
@@ -67,7 +67,7 @@ class GrpcBufferWriter GRPC_FINAL
slice_ = gpr_slice_malloc(block_size_);
}
*data = GPR_SLICE_START_PTR(slice_);
- byte_count_ += *size = GPR_SLICE_LENGTH(slice_);
+ byte_count_ += * size = GPR_SLICE_LENGTH(slice_);
gpr_slice_buffer_add(slice_buffer_, slice_);
return true;
}
@@ -118,7 +118,7 @@ class GrpcBufferReader GRPC_FINAL
}
gpr_slice_unref(slice_);
*data = GPR_SLICE_START_PTR(slice_);
- byte_count_ += *size = GPR_SLICE_LENGTH(slice_);
+ byte_count_ += * size = GPR_SLICE_LENGTH(slice_);
return true;
}
@@ -152,20 +152,32 @@ class GrpcBufferReader GRPC_FINAL
namespace grpc {
-bool SerializeProto(const grpc::protobuf::Message& msg, grpc_byte_buffer** bp) {
+Status SerializeProto(const grpc::protobuf::Message& msg, grpc_byte_buffer** bp) {
GrpcBufferWriter writer(bp);
- return msg.SerializeToZeroCopyStream(&writer);
+ return msg.SerializeToZeroCopyStream(&writer)
+ ? Status::OK
+ : Status(StatusCode::INVALID_ARGUMENT,
+ "Failed to serialize message");
}
-bool DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg,
- int max_message_size) {
- if (!buffer) return false;
+Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg,
+ int max_message_size) {
+ if (!buffer) {
+ return Status(StatusCode::INVALID_ARGUMENT, "No payload");
+ }
GrpcBufferReader reader(buffer);
::grpc::protobuf::io::CodedInputStream decoder(&reader);
if (max_message_size > 0) {
decoder.SetTotalBytesLimit(max_message_size, max_message_size);
}
- return msg->ParseFromCodedStream(&decoder) && decoder.ConsumedEntireMessage();
+ if (!msg->ParseFromCodedStream(&decoder)) {
+ return Status(StatusCode::INVALID_ARGUMENT,
+ msg->InitializationErrorString());
+ }
+ if (!decoder.ConsumedEntireMessage()) {
+ return Status(StatusCode::INVALID_ARGUMENT, "Did not read entire message");
+ }
+ return Status::OK;
}
} // namespace grpc
diff --git a/src/cpp/server/insecure_server_credentials.cc b/src/cpp/server/insecure_server_credentials.cc
index 55dd90d7a7..aca3568e59 100644
--- a/src/cpp/server/insecure_server_credentials.cc
+++ b/src/cpp/server/insecure_server_credentials.cc
@@ -31,9 +31,10 @@
*
*/
-#include <grpc/grpc_security.h>
#include <grpc++/server_credentials.h>
+#include <grpc/grpc.h>
+
namespace grpc {
namespace {
class InsecureServerCredentialsImpl GRPC_FINAL : public ServerCredentials {
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index dbd88c5b8c..1437b2dea7 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -35,7 +35,6 @@
#include <utility>
#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc++/completion_queue.h>
@@ -48,7 +47,6 @@
#include <grpc++/time.h>
#include "src/core/profiling/timers.h"
-#include "src/cpp/proto/proto_utils.h"
namespace grpc {
@@ -69,15 +67,11 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
has_request_payload_(method->method_type() == RpcMethod::NORMAL_RPC ||
method->method_type() ==
RpcMethod::SERVER_STREAMING),
- has_response_payload_(method->method_type() == RpcMethod::NORMAL_RPC ||
- method->method_type() ==
- RpcMethod::CLIENT_STREAMING) {
+ cq_(nullptr) {
grpc_metadata_array_init(&request_metadata_);
}
- ~SyncRequest() {
- grpc_metadata_array_destroy(&request_metadata_);
- }
+ ~SyncRequest() { grpc_metadata_array_destroy(&request_metadata_); }
static SyncRequest* Wait(CompletionQueue* cq, bool* ok) {
void* tag = nullptr;
@@ -90,10 +84,16 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
return mrd;
}
+ void SetupRequest() { cq_ = grpc_completion_queue_create(); }
+
+ void TeardownRequest() {
+ grpc_completion_queue_destroy(cq_);
+ cq_ = nullptr;
+ }
+
void Request(grpc_server* server, grpc_completion_queue* notify_cq) {
- GPR_ASSERT(!in_flight_);
+ GPR_ASSERT(cq_ && !in_flight_);
in_flight_ = true;
- cq_ = grpc_completion_queue_create();
GPR_ASSERT(GRPC_CALL_OK ==
grpc_server_request_registered_call(
server, tag_, &call_, &deadline_, &request_metadata_,
@@ -116,7 +116,6 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
ctx_(mrd->deadline_, mrd->request_metadata_.metadata,
mrd->request_metadata_.count),
has_request_payload_(mrd->has_request_payload_),
- has_response_payload_(mrd->has_response_payload_),
request_payload_(mrd->request_payload_),
method_(mrd->method_) {
ctx_.call_ = mrd->call_;
@@ -133,35 +132,10 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
}
void Run() {
- std::unique_ptr<grpc::protobuf::Message> req;
- std::unique_ptr<grpc::protobuf::Message> res;
- if (has_request_payload_) {
- GRPC_TIMER_BEGIN(GRPC_PTAG_PROTO_DESERIALIZE, call_.call());
- req.reset(method_->AllocateRequestProto());
- if (!DeserializeProto(request_payload_, req.get(),
- call_.max_message_size())) {
- // FIXME(yangg) deal with deserialization failure
- cq_.Shutdown();
- return;
- }
- GRPC_TIMER_END(GRPC_PTAG_PROTO_DESERIALIZE, call_.call());
- }
- if (has_response_payload_) {
- res.reset(method_->AllocateResponseProto());
- }
ctx_.BeginCompletionOp(&call_);
- auto status = method_->handler()->RunHandler(
- MethodHandler::HandlerParameter(&call_, &ctx_, req.get(), res.get()));
- CallOpBuffer buf;
- if (!ctx_.sent_initial_metadata_) {
- buf.AddSendInitialMetadata(&ctx_.initial_metadata_);
- }
- if (has_response_payload_) {
- buf.AddSendMessage(*res);
- }
- buf.AddServerSendStatus(&ctx_.trailing_metadata_, status);
- call_.PerformOps(&buf);
- cq_.Pluck(&buf); /* status ignored */
+ method_->handler()->RunHandler(MethodHandler::HandlerParameter(
+ &call_, &ctx_, request_payload_, call_.max_message_size()));
+ request_payload_ = nullptr;
void* ignored_tag;
bool ignored_ok;
cq_.Shutdown();
@@ -173,7 +147,6 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
Call call_;
ServerContext ctx_;
const bool has_request_payload_;
- const bool has_response_payload_;
grpc_byte_buffer* request_payload_;
RpcServiceMethod* const method_;
};
@@ -183,7 +156,6 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
void* const tag_;
bool in_flight_;
const bool has_request_payload_;
- const bool has_response_payload_;
grpc_call* call_;
gpr_timespec deadline_;
grpc_metadata_array request_metadata_;
@@ -251,9 +223,9 @@ bool Server::RegisterService(RpcService* service) {
}
bool Server::RegisterAsyncService(AsynchronousService* service) {
- GPR_ASSERT(service->dispatch_impl_ == nullptr &&
+ GPR_ASSERT(service->server_ == nullptr &&
"Can only register an asynchronous service against one server.");
- service->dispatch_impl_ = this;
+ service->server_ = this;
service->request_args_ = new void*[service->method_count_];
for (size_t i = 0; i < service->method_count_; ++i) {
void* tag = grpc_server_register_method(server_, service->method_names_[i],
@@ -288,6 +260,7 @@ bool Server::Start() {
// Start processing rpcs.
if (!sync_methods_->empty()) {
for (auto m = sync_methods_->begin(); m != sync_methods_->end(); m++) {
+ m->SetupRequest();
m->Request(server_, cq_.cq());
}
@@ -318,141 +291,90 @@ void Server::Wait() {
}
}
-void Server::PerformOpsOnCall(CallOpBuffer* buf, Call* call) {
+void Server::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) {
static const size_t MAX_OPS = 8;
- size_t nops = MAX_OPS;
- grpc_op ops[MAX_OPS];
- buf->FillOps(ops, &nops);
+ size_t nops = 0;
+ grpc_op cops[MAX_OPS];
+ ops->FillOps(cops, &nops);
GPR_ASSERT(GRPC_CALL_OK ==
- grpc_call_start_batch(call->call(), ops, nops, buf));
+ grpc_call_start_batch(call->call(), cops, nops, ops));
}
-class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag {
- public:
- AsyncRequest(Server* server, void* registered_method, ServerContext* ctx,
- grpc::protobuf::Message* request,
- ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq, void* tag)
- : tag_(tag),
- request_(request),
- stream_(stream),
- call_cq_(call_cq),
- ctx_(ctx),
- generic_ctx_(nullptr),
- server_(server),
- call_(nullptr),
- payload_(nullptr) {
- memset(&array_, 0, sizeof(array_));
- grpc_call_details_init(&call_details_);
- GPR_ASSERT(notification_cq);
- GPR_ASSERT(call_cq);
- grpc_server_request_registered_call(
- server->server_, registered_method, &call_, &call_details_.deadline,
- &array_, request ? &payload_ : nullptr, call_cq->cq(),
- notification_cq->cq(), this);
- }
+Server::BaseAsyncRequest::BaseAsyncRequest(
+ Server* server, ServerContext* context,
+ ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq, void* tag)
+ : server_(server),
+ context_(context),
+ stream_(stream),
+ call_cq_(call_cq),
+ tag_(tag),
+ call_(nullptr) {
+ memset(&initial_metadata_array_, 0, sizeof(initial_metadata_array_));
+}
- AsyncRequest(Server* server, GenericServerContext* ctx,
- ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq, void* tag)
- : tag_(tag),
- request_(nullptr),
- stream_(stream),
- call_cq_(call_cq),
- ctx_(nullptr),
- generic_ctx_(ctx),
- server_(server),
- call_(nullptr),
- payload_(nullptr) {
- memset(&array_, 0, sizeof(array_));
- grpc_call_details_init(&call_details_);
- GPR_ASSERT(notification_cq);
- GPR_ASSERT(call_cq);
- grpc_server_request_call(server->server_, &call_, &call_details_, &array_,
- call_cq->cq(), notification_cq->cq(), this);
- }
+Server::BaseAsyncRequest::~BaseAsyncRequest() {}
- ~AsyncRequest() {
- if (payload_) {
- grpc_byte_buffer_destroy(payload_);
+bool Server::BaseAsyncRequest::FinalizeResult(void** tag, bool* status) {
+ if (*status) {
+ for (size_t i = 0; i < initial_metadata_array_.count; i++) {
+ context_->client_metadata_.insert(std::make_pair(
+ grpc::string(initial_metadata_array_.metadata[i].key),
+ grpc::string(initial_metadata_array_.metadata[i].value,
+ initial_metadata_array_.metadata[i].value +
+ initial_metadata_array_.metadata[i].value_length)));
}
- grpc_metadata_array_destroy(&array_);
}
-
- bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
- *tag = tag_;
- bool orig_status = *status;
- if (*status && request_) {
- if (payload_) {
- GRPC_TIMER_BEGIN(GRPC_PTAG_PROTO_DESERIALIZE, call_);
- *status =
- DeserializeProto(payload_, request_, server_->max_message_size_);
- GRPC_TIMER_END(GRPC_PTAG_PROTO_DESERIALIZE, call_);
- } else {
- *status = false;
- }
- }
- ServerContext* ctx = ctx_ ? ctx_ : generic_ctx_;
- GPR_ASSERT(ctx);
- if (*status) {
- ctx->deadline_ = call_details_.deadline;
- for (size_t i = 0; i < array_.count; i++) {
- ctx->client_metadata_.insert(std::make_pair(
- grpc::string(array_.metadata[i].key),
- grpc::string(
- array_.metadata[i].value,
- array_.metadata[i].value + array_.metadata[i].value_length)));
- }
- if (generic_ctx_) {
- // TODO(yangg) remove the copy here.
- generic_ctx_->method_ = call_details_.method;
- generic_ctx_->host_ = call_details_.host;
- gpr_free(call_details_.method);
- gpr_free(call_details_.host);
- }
- }
- ctx->call_ = call_;
- ctx->cq_ = call_cq_;
- Call call(call_, server_, call_cq_, server_->max_message_size_);
- if (orig_status && call_) {
- ctx->BeginCompletionOp(&call);
- }
- // just the pointers inside call are copied here
- stream_->BindCall(&call);
- delete this;
- return true;
+ grpc_metadata_array_destroy(&initial_metadata_array_);
+ context_->call_ = call_;
+ context_->cq_ = call_cq_;
+ Call call(call_, server_, call_cq_, server_->max_message_size_);
+ if (*status && call_) {
+ context_->BeginCompletionOp(&call);
}
+ // just the pointers inside call are copied here
+ stream_->BindCall(&call);
+ *tag = tag_;
+ delete this;
+ return true;
+}
- private:
- void* const tag_;
- grpc::protobuf::Message* const request_;
- ServerAsyncStreamingInterface* const stream_;
- CompletionQueue* const call_cq_;
- ServerContext* const ctx_;
- GenericServerContext* const generic_ctx_;
- Server* const server_;
- grpc_call* call_;
- grpc_call_details call_details_;
- grpc_metadata_array array_;
- grpc_byte_buffer* payload_;
-};
+Server::RegisteredAsyncRequest::RegisteredAsyncRequest(
+ Server* server, ServerContext* context,
+ ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq, void* tag)
+ : BaseAsyncRequest(server, context, stream, call_cq, tag) {}
+
+void Server::RegisteredAsyncRequest::IssueRequest(
+ void* registered_method, grpc_byte_buffer** payload,
+ ServerCompletionQueue* notification_cq) {
+ grpc_server_request_registered_call(
+ server_->server_, registered_method, &call_, &context_->deadline_,
+ &initial_metadata_array_, payload, call_cq_->cq(), notification_cq->cq(),
+ this);
+}
-void Server::RequestAsyncCall(void* registered_method, ServerContext* context,
- grpc::protobuf::Message* request,
- ServerAsyncStreamingInterface* stream,
- CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq,
- void* tag) {
- new AsyncRequest(this, registered_method, context, request, stream, call_cq,
- notification_cq, tag);
+Server::GenericAsyncRequest::GenericAsyncRequest(
+ Server* server, GenericServerContext* context,
+ ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
+ ServerCompletionQueue* notification_cq, void* tag)
+ : BaseAsyncRequest(server, context, stream, call_cq, tag) {
+ grpc_call_details_init(&call_details_);
+ GPR_ASSERT(notification_cq);
+ GPR_ASSERT(call_cq);
+ grpc_server_request_call(server->server_, &call_, &call_details_,
+ &initial_metadata_array_, call_cq->cq(),
+ notification_cq->cq(), this);
}
-void Server::RequestAsyncGenericCall(GenericServerContext* context,
- ServerAsyncStreamingInterface* stream,
- CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq,
- void* tag) {
- new AsyncRequest(this, context, stream, call_cq, notification_cq, tag);
+bool Server::GenericAsyncRequest::FinalizeResult(void** tag, bool* status) {
+ // TODO(yangg) remove the copy here.
+ if (*status) {
+ static_cast<GenericServerContext*>(context_)->method_ =
+ call_details_.method;
+ static_cast<GenericServerContext*>(context_)->host_ = call_details_.host;
+ }
+ gpr_free(call_details_.method);
+ gpr_free(call_details_.host);
+ return BaseAsyncRequest::FinalizeResult(tag, status);
}
void Server::ScheduleCallback() {
@@ -472,9 +394,13 @@ void Server::RunRpc() {
if (ok) {
SyncRequest::CallData cd(this, mrd);
{
+ mrd->SetupRequest();
grpc::unique_lock<grpc::mutex> lock(mu_);
if (!shutdown_) {
mrd->Request(server_, cq_.cq());
+ } else {
+ // destroy the structure that was created
+ mrd->TeardownRequest();
}
}
cd.Run();
diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc
index d5a582ccd9..357d1a5a02 100644
--- a/src/cpp/server/server_context.cc
+++ b/src/cpp/server/server_context.cc
@@ -45,12 +45,12 @@ namespace grpc {
// CompletionOp
-class ServerContext::CompletionOp GRPC_FINAL : public CallOpBuffer {
+class ServerContext::CompletionOp GRPC_FINAL : public CallOpSetInterface {
public:
// initial refs: one in the server context, one in the cq
- CompletionOp() : refs_(2), finalized_(false), cancelled_(false) {
- AddServerRecvClose(&cancelled_);
- }
+ CompletionOp() : refs_(2), finalized_(false), cancelled_(0) {}
+
+ void FillOps(grpc_op* ops, size_t* nops) GRPC_OVERRIDE;
bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE;
bool CheckCancelled(CompletionQueue* cq);
@@ -61,7 +61,7 @@ class ServerContext::CompletionOp GRPC_FINAL : public CallOpBuffer {
grpc::mutex mu_;
int refs_;
bool finalized_;
- bool cancelled_;
+ int cancelled_;
};
void ServerContext::CompletionOp::Unref() {
@@ -75,14 +75,20 @@ void ServerContext::CompletionOp::Unref() {
bool ServerContext::CompletionOp::CheckCancelled(CompletionQueue* cq) {
cq->TryPluck(this);
grpc::lock_guard<grpc::mutex> g(mu_);
- return finalized_ ? cancelled_ : false;
+ return finalized_ ? cancelled_ != 0 : false;
+}
+
+void ServerContext::CompletionOp::FillOps(grpc_op* ops, size_t* nops) {
+ ops->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
+ ops->data.recv_close_on_server.cancelled = &cancelled_;
+ ops->flags = 0;
+ *nops = 1;
}
bool ServerContext::CompletionOp::FinalizeResult(void** tag, bool* status) {
- GPR_ASSERT(CallOpBuffer::FinalizeResult(tag, status));
grpc::unique_lock<grpc::mutex> lock(mu_);
finalized_ = true;
- if (!*status) cancelled_ = true;
+ if (!*status) cancelled_ = 1;
if (--refs_ == 0) {
lock.unlock();
delete this;
diff --git a/src/cpp/server/server_credentials.cc b/src/cpp/server/server_credentials.cc
index 6bdb465baa..be3a7425e0 100644
--- a/src/cpp/server/server_credentials.cc
+++ b/src/cpp/server/server_credentials.cc
@@ -31,8 +31,6 @@
*
*/
-#include <grpc/grpc_security.h>
-
#include <grpc++/server_credentials.h>
namespace grpc {
diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc
index a78e4226d2..a66c92c3e1 100644
--- a/src/cpp/util/byte_buffer.cc
+++ b/src/cpp/util/byte_buffer.cc
@@ -36,7 +36,7 @@
namespace grpc {
-ByteBuffer::ByteBuffer(Slice* slices, size_t nslices) {
+ByteBuffer::ByteBuffer(const Slice* slices, size_t nslices) {
// TODO(yangg) maybe expose some core API to simplify this
std::vector<gpr_slice> c_slices(nslices);
for (size_t i = 0; i < nslices; i++) {
@@ -52,20 +52,20 @@ void ByteBuffer::Clear() {
}
}
-void ByteBuffer::Dump(std::vector<Slice>* slices) {
+void ByteBuffer::Dump(std::vector<Slice>* slices) const {
slices->clear();
if (!buffer_) {
return;
}
grpc_byte_buffer_reader reader;
- grpc_byte_buffer_reader_init(&reader,buffer_);
+ grpc_byte_buffer_reader_init(&reader, buffer_);
gpr_slice s;
while (grpc_byte_buffer_reader_next(&reader, &s)) {
slices->push_back(Slice(s, Slice::STEAL_REF));
}
}
-size_t ByteBuffer::Length() {
+size_t ByteBuffer::Length() const {
if (buffer_) {
return grpc_byte_buffer_length(buffer_);
} else {
diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs
index c09d0b10d4..21f94d3cf5 100644
--- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs
+++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs
@@ -204,23 +204,21 @@ namespace Grpc.Core.Tests
BenchmarkUtil.RunBenchmark(100, 100,
() => { Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken)); });
}
-
-// TODO(jtattermusch): temporarily commented out for #1731
-// to be uncommented along with PR #1577
-// [Test]
-// public void UnknownMethodHandler()
-// {
-// var call = new Call<string, string>(ServiceName, NonexistentMethod, channel, Metadata.Empty);
-// try
-// {
-// Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken));
-// Assert.Fail();
-// }
-// catch (RpcException e)
-// {
-// Assert.AreEqual(StatusCode.Unimplemented, e.Status.StatusCode);
-// }
-// }
+
+ [Test]
+ public void UnknownMethodHandler()
+ {
+ var call = new Call<string, string>(ServiceName, NonexistentMethod, channel, Metadata.Empty);
+ try
+ {
+ Calls.BlockingUnaryCall(call, "ABC", default(CancellationToken));
+ Assert.Fail();
+ }
+ catch (RpcException e)
+ {
+ Assert.AreEqual(StatusCode.Unimplemented, e.Status.StatusCode);
+ }
+ }
private static async Task<string> EchoHandler(ServerCallContext context, string request)
{
diff --git a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
index db1b86937f..4f510ba40a 100644
--- a/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
+++ b/src/csharp/Grpc.Core/Internal/AsyncCallServer.cs
@@ -107,6 +107,7 @@ namespace Grpc.Core.Internal
call.StartSendStatusFromServer(status, HandleHalfclosed);
halfcloseRequested = true;
+ readingDone = true;
sendCompletionDelegate = completionDelegate;
}
}
diff --git a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs
index f494d9e0ff..c0e5bae13f 100644
--- a/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs
+++ b/src/csharp/Grpc.Core/Internal/ServerCallHandler.cs
@@ -267,8 +267,6 @@ namespace Grpc.Core.Internal
var responseStream = new ServerResponseStream<byte[], byte[]>(asyncCall);
await responseStream.WriteStatusAsync(new Status(StatusCode.Unimplemented, "No such method."));
- // TODO(jtattermusch): if we don't read what client has sent, the server call never gets disposed.
- await requestStream.ToList();
await finishedTask;
}
}
diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h
index 7b42498d42..cba53fa2f6 100644
--- a/src/objective-c/GRPCClient/GRPCCall.h
+++ b/src/objective-c/GRPCClient/GRPCCall.h
@@ -46,9 +46,7 @@
// transparently on the same TCP connection.
#import <Foundation/Foundation.h>
-#import <gRPC/GRXWriter.h>
-
-@class GRPCMethodName;
+#import <RxLibrary/GRXWriter.h>
// Key used in |NSError|'s |userInfo| dictionary to store the response metadata sent by the server.
extern id const kGRPCStatusMetadataKey;
@@ -90,7 +88,7 @@ extern id const kGRPCStatusMetadataKey;
// the specific remote method called).
// To finish a call right away, invoke cancel.
- (instancetype)initWithHost:(NSString *)host
- method:(GRPCMethodName *)method
+ path:(NSString *)path
requestsWriter:(id<GRXWriter>)requestsWriter NS_DESIGNATED_INITIALIZER;
// Finishes the request side of this call, notifies the server that the RPC
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index a9625a1799..4ac4e4d37f 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -34,13 +34,11 @@
#import "GRPCCall.h"
#include <grpc/grpc.h>
-#include <grpc/support/grpc_time.h>
+#include <grpc/support/time.h>
-#import "GRPCMethodName.h"
#import "private/GRPCChannel.h"
#import "private/GRPCCompletionQueue.h"
#import "private/GRPCDelegateWrapper.h"
-#import "private/GRPCMethodName+HTTP2Encoding.h"
#import "private/GRPCWrappedCall.h"
#import "private/NSData+GRPC.h"
#import "private/NSDictionary+GRPC.h"
@@ -90,14 +88,14 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
@synthesize state = _state;
- (instancetype)init {
- return [self initWithHost:nil method:nil requestsWriter:nil];
+ return [self initWithHost:nil path:nil requestsWriter:nil];
}
// Designated initializer
- (instancetype)initWithHost:(NSString *)host
- method:(GRPCMethodName *)method
+ path:(NSString *)path
requestsWriter:(id<GRXWriter>)requestWriter {
- if (!host || !method) {
+ if (!host || !path) {
[NSException raise:NSInvalidArgumentException format:@"Neither host nor method can be nil."];
}
if (requestWriter.state != GRXWriterStateNotStarted) {
@@ -114,7 +112,7 @@ NSString * const kGRPCStatusMetadataKey = @"io.grpc.StatusMetadataKey";
_channel = [GRPCChannel channelToHost:host];
_wrappedCall = [[GRPCWrappedCall alloc] initWithChannel:_channel
- method:method.HTTP2Path
+ path:path
host:host];
// Serial queue to invoke the non-reentrant methods of the grpc_call object.
diff --git a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
index 7d5ecb56d9..59c0565494 100644
--- a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
+++ b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
@@ -33,7 +33,7 @@
#import "GRPCDelegateWrapper.h"
-#import <gRPC/GRXWriteable.h>
+#import <RxLibrary/GRXWriteable.h>
@interface GRPCDelegateWrapper ()
// These are atomic so that cancellation can nillify them from any thread.
diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
index 2cbc6e0f83..43a8bd539e 100644
--- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
@@ -38,13 +38,17 @@
@implementation GRPCSecureChannel
- (instancetype)initWithHost:(NSString *)host {
- static const grpc_credentials *kCredentials;
+ static grpc_credentials *kCredentials;
static dispatch_once_t loading;
dispatch_once(&loading, ^{
// Do not use NSBundle.mainBundle, as it's nil for tests of library projects.
NSBundle *bundle = [NSBundle bundleForClass:self.class];
- NSString *certsPath = [bundle pathForResource:@"gRPC.bundle/roots" ofType:@"pem"];
+ NSString *certsPath = [bundle pathForResource:@"gRPCCertificates.bundle/roots" ofType:@"pem"];
+ NSAssert(certsPath.length,
+ @"gRPCCertificates.bundle/roots.pem not found under %@. This file, with the root "
+ "certificates, is needed to establish TLS (HTTPS) connections.", bundle.bundlePath);
NSData *certsData = [NSData dataWithContentsOfFile:certsPath];
+ NSAssert(certsData.length, @"No data read from %@", certsPath);
NSString *certsString = [[NSString alloc] initWithData:certsData encoding:NSUTF8StringEncoding];
kCredentials = grpc_ssl_credentials_create(certsString.UTF8String, NULL);
});
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
index 4deeec0475..18f8bb5531 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h
@@ -33,60 +33,58 @@
#import <Foundation/Foundation.h>
#include <grpc/grpc.h>
-#import "GRPCChannel.h"
-
-typedef void(^GRPCCompletionHandler)(NSDictionary *);
-
-@protocol GRPCOp <NSObject>
-- (void)getOp:(grpc_op *)op;
+#import "GRPCChannel.h"
+@interface GRPCOperation : NSObject
+@property(nonatomic, readonly) grpc_op op;
+// Guaranteed to be called when the operation has finished.
- (void)finish;
-
@end
-@interface GRPCOpSendMetadata : NSObject <GRPCOp>
+@interface GRPCOpSendMetadata : GRPCOperation
- (instancetype)initWithMetadata:(NSDictionary *)metadata
- handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
+ handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpSendMessage : NSObject <GRPCOp>
+@interface GRPCOpSendMessage : GRPCOperation
- (instancetype)initWithMessage:(NSData *)message
- handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
+ handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpSendClose : NSObject <GRPCOp>
+@interface GRPCOpSendClose : GRPCOperation
-- (instancetype)initWithHandler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithHandler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpRecvMetadata : NSObject <GRPCOp>
+@interface GRPCOpRecvMetadata : GRPCOperation
- (instancetype)initWithHandler:(void(^)(NSDictionary *))handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpRecvMessage : NSObject <GRPCOp>
+@interface GRPCOpRecvMessage : GRPCOperation
- (instancetype)initWithHandler:(void(^)(grpc_byte_buffer *))handler NS_DESIGNATED_INITIALIZER;
@end
-@interface GRPCOpRecvStatus : NSObject <GRPCOp>
+@interface GRPCOpRecvStatus : GRPCOperation
-- (instancetype)initWithHandler:(void(^)(NSError *, NSDictionary *))handler NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithHandler:(void(^)(NSError *, NSDictionary *))handler
+ NS_DESIGNATED_INITIALIZER;
@end
@interface GRPCWrappedCall : NSObject
- (instancetype)initWithChannel:(GRPCChannel *)channel
- method:(NSString *)method
+ path:(NSString *)path
host:(NSString *)host NS_DESIGNATED_INITIALIZER;
- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)())errorHandler;
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
index ea482b29ef..45f10f5d63 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
@@ -41,110 +41,85 @@
#import "NSData+GRPC.h"
#import "NSError+GRPC.h"
-@implementation GRPCOpSendMetadata{
- void(^_handler)(void);
- grpc_metadata *_sendMetadata;
- size_t _count;
+@implementation GRPCOperation {
+@protected
+ // Most operation subclasses don't set any flags in the grpc_op, and rely on the flag member being
+ // initialized to zero.
+ grpc_op _op;
+ void(^_handler)();
}
+- (void)finish {
+ if (_handler) {
+ _handler();
+ }
+}
+@end
+
+@implementation GRPCOpSendMetadata
+
- (instancetype)init {
return [self initWithMetadata:nil handler:nil];
}
-- (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)(void))handler {
+- (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)())handler {
if (self = [super init]) {
- _sendMetadata = [metadata grpc_metadataArray];
- _count = metadata.count;
+ _op.op = GRPC_OP_SEND_INITIAL_METADATA;
+ _op.data.send_initial_metadata.count = metadata.count;
+ _op.data.send_initial_metadata.metadata = metadata.grpc_metadataArray;
_handler = handler;
}
return self;
}
-- (void)getOp:(grpc_op *)op {
- op->op = GRPC_OP_SEND_INITIAL_METADATA;
- op->data.send_initial_metadata.count = _count;
- op->data.send_initial_metadata.metadata = _sendMetadata;
-}
-
-- (void)finish {
- if (_handler) {
- _handler();
- }
-}
-
- (void)dealloc {
- gpr_free(_sendMetadata);
+ gpr_free(_op.data.send_initial_metadata.metadata);
}
@end
-@implementation GRPCOpSendMessage{
- void(^_handler)(void);
- grpc_byte_buffer *_byteBuffer;
-}
+@implementation GRPCOpSendMessage
- (instancetype)init {
return [self initWithMessage:nil handler:nil];
}
-- (instancetype)initWithMessage:(NSData *)message handler:(void (^)(void))handler {
+- (instancetype)initWithMessage:(NSData *)message handler:(void (^)())handler {
if (!message) {
[NSException raise:NSInvalidArgumentException format:@"message cannot be nil"];
}
if (self = [super init]) {
- _byteBuffer = [message grpc_byteBuffer];
+ _op.op = GRPC_OP_SEND_MESSAGE;
+ _op.data.send_message = message.grpc_byteBuffer;
_handler = handler;
}
return self;
}
-- (void)getOp:(grpc_op *)op {
- op->op = GRPC_OP_SEND_MESSAGE;
- op->data.send_message = _byteBuffer;
-}
-
-- (void)finish {
- if (_handler) {
- _handler();
- }
-}
-
- (void)dealloc {
- gpr_free(_byteBuffer);
+ gpr_free(_op.data.send_message);
}
@end
-@implementation GRPCOpSendClose{
- void(^_handler)(void);
-}
+@implementation GRPCOpSendClose
- (instancetype)init {
return [self initWithHandler:nil];
}
-- (instancetype)initWithHandler:(void (^)(void))handler {
+- (instancetype)initWithHandler:(void (^)())handler {
if (self = [super init]) {
+ _op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
_handler = handler;
}
return self;
}
-- (void)getOp:(grpc_op *)op {
- op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
-}
-
-- (void)finish {
- if (_handler) {
- _handler();
- }
-}
-
@end
-@implementation GRPCOpRecvMetadata{
- void(^_handler)(NSDictionary *);
- grpc_metadata_array _recvInitialMetadata;
+@implementation GRPCOpRecvMetadata {
+ grpc_metadata_array _headers;
}
- (instancetype) init {
@@ -153,33 +128,31 @@
- (instancetype) initWithHandler:(void (^)(NSDictionary *))handler {
if (self = [super init]) {
- _handler = handler;
- grpc_metadata_array_init(&_recvInitialMetadata);
+ _op.op = GRPC_OP_RECV_INITIAL_METADATA;
+ grpc_metadata_array_init(&_headers);
+ _op.data.recv_initial_metadata = &_headers;
+ if (handler) {
+ // Prevent reference cycle with _handler
+ __weak typeof(self) weakSelf = self;
+ _handler = ^{
+ __strong typeof(self) strongSelf = weakSelf;
+ NSDictionary *metadata = [NSDictionary
+ grpc_dictionaryFromMetadataArray:strongSelf->_headers];
+ handler(metadata);
+ };
+ }
}
return self;
}
-- (void)getOp:(grpc_op *)op {
- op->op = GRPC_OP_RECV_INITIAL_METADATA;
- op->data.recv_initial_metadata = &_recvInitialMetadata;
-}
-
-- (void)finish {
- NSDictionary *metadata = [NSDictionary grpc_dictionaryFromMetadataArray:_recvInitialMetadata];
- if (_handler) {
- _handler(metadata);
- }
-}
-
- (void)dealloc {
- grpc_metadata_array_destroy(&_recvInitialMetadata);
+ grpc_metadata_array_destroy(&_headers);
}
@end
@implementation GRPCOpRecvMessage{
- void(^_handler)(grpc_byte_buffer *);
- grpc_byte_buffer *_recvMessage;
+ grpc_byte_buffer *_receivedMessage;
}
- (instancetype)init {
@@ -188,30 +161,27 @@
- (instancetype)initWithHandler:(void (^)(grpc_byte_buffer *))handler {
if (self = [super init]) {
- _handler = handler;
+ _op.op = GRPC_OP_RECV_MESSAGE;
+ _op.data.recv_message = &_receivedMessage;
+ if (handler) {
+ // Prevent reference cycle with _handler
+ __weak typeof(self) weakSelf = self;
+ _handler = ^{
+ __strong typeof(self) strongSelf = weakSelf;
+ handler(strongSelf->_receivedMessage);
+ };
+ }
}
return self;
}
-- (void)getOp:(grpc_op *)op {
- op->op = GRPC_OP_RECV_MESSAGE;
- op->data.recv_message = &_recvMessage;
-}
-
-- (void)finish {
- if (_handler) {
- _handler(_recvMessage);
- }
-}
-
@end
@implementation GRPCOpRecvStatus{
- void(^_handler)(NSError *, NSDictionary *);
grpc_status_code _statusCode;
char *_details;
size_t _detailsCapacity;
- grpc_metadata_array _metadata;
+ grpc_metadata_array _trailers;
}
- (instancetype) init {
@@ -220,30 +190,30 @@
- (instancetype) initWithHandler:(void (^)(NSError *, NSDictionary *))handler {
if (self = [super init]) {
- _handler = handler;
- grpc_metadata_array_init(&_metadata);
+ _op.op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ _op.data.recv_status_on_client.status = &_statusCode;
+ _op.data.recv_status_on_client.status_details = &_details;
+ _op.data.recv_status_on_client.status_details_capacity = &_detailsCapacity;
+ grpc_metadata_array_init(&_trailers);
+ _op.data.recv_status_on_client.trailing_metadata = &_trailers;
+ if (handler) {
+ // Prevent reference cycle with _handler
+ __weak typeof(self) weakSelf = self;
+ _handler = ^{
+ __strong typeof(self) strongSelf = weakSelf;
+ NSError *error = [NSError grpc_errorFromStatusCode:strongSelf->_statusCode
+ details:strongSelf->_details];
+ NSDictionary *trailers = [NSDictionary
+ grpc_dictionaryFromMetadataArray:strongSelf->_trailers];
+ handler(error, trailers);
+ };
+ }
}
return self;
}
-- (void)getOp:(grpc_op *)op {
- op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
- op->data.recv_status_on_client.status = &_statusCode;
- op->data.recv_status_on_client.status_details = &_details;
- op->data.recv_status_on_client.status_details_capacity = &_detailsCapacity;
- op->data.recv_status_on_client.trailing_metadata = &_metadata;
-}
-
-- (void)finish {
- if (_handler) {
- NSError *error = [NSError grpc_errorFromStatusCode:_statusCode details:_details];
- NSDictionary *trailers = [NSDictionary grpc_dictionaryFromMetadataArray:_metadata];
- _handler(error, trailers);
- }
-}
-
- (void)dealloc {
- grpc_metadata_array_destroy(&_metadata);
+ grpc_metadata_array_destroy(&_trailers);
gpr_free(_details);
}
@@ -255,13 +225,13 @@
}
- (instancetype)init {
- return [self initWithChannel:nil method:nil host:nil];
+ return [self initWithChannel:nil path:nil host:nil];
}
- (instancetype)initWithChannel:(GRPCChannel *)channel
- method:(NSString *)method
+ path:(NSString *)path
host:(NSString *)host {
- if (!channel || !method || !host) {
+ if (!channel || !path || !host) {
[NSException raise:NSInvalidArgumentException
format:@"channel, method, and host cannot be nil."];
}
@@ -277,7 +247,7 @@
return nil;
}
_call = grpc_channel_create_call(channel.unmanagedChannel, _queue.unmanagedQueue,
- method.UTF8String, host.UTF8String, gpr_inf_future);
+ path.UTF8String, host.UTF8String, gpr_inf_future);
if (_call == NULL) {
return nil;
}
@@ -293,8 +263,8 @@
size_t nops = operations.count;
grpc_op *ops_array = gpr_malloc(nops * sizeof(grpc_op));
size_t i = 0;
- for (id op in operations) {
- [op getOp:&ops_array[i++]];
+ for (GRPCOperation *operation in operations) {
+ ops_array[i++] = operation.op;
}
grpc_call_error error = grpc_call_start_batch(_call, ops_array, nops,
(__bridge_retained void *)(^(bool success){
@@ -305,14 +275,16 @@
return;
}
}
- for (id<GRPCOp> operation in operations) {
+ for (GRPCOperation *operation in operations) {
[operation finish];
}
}));
-
+ gpr_free(ops_array);
+
if (error != GRPC_CALL_OK) {
[NSException raise:NSInternalInconsistencyException
- format:@"A precondition for calling grpc_call_start_batch wasn't met"];
+ format:@"A precondition for calling grpc_call_start_batch wasn't met. Error %i",
+ error];
}
}
diff --git a/src/objective-c/GRPCClient/private/NSError+GRPC.m b/src/objective-c/GRPCClient/private/NSError+GRPC.m
index f7390476d9..638f41cb11 100644
--- a/src/objective-c/GRPCClient/private/NSError+GRPC.m
+++ b/src/objective-c/GRPCClient/private/NSError+GRPC.m
@@ -33,7 +33,7 @@
#import "NSError+GRPC.h"
-#include <grpc.h>
+#include <grpc/grpc.h>
NSString * const kGRPCErrorDomain = @"io.grpc";
diff --git a/src/objective-c/GRPCClient/GRPCMethodName.h b/src/objective-c/ProtoRPC/ProtoMethod.h
index fe153dd478..8f554a0483 100644
--- a/src/objective-c/GRPCClient/GRPCMethodName.h
+++ b/src/objective-c/ProtoRPC/ProtoMethod.h
@@ -33,17 +33,16 @@
#import <Foundation/Foundation.h>
-// See the README file for an introduction to this library.
-
-// A fully-qualified gRPC method name. Full qualification is needed because a gRPC endpoint can
-// implement multiple interfaces.
-// TODO(jcanizales): Move to ProtoRPC package.
-// TODO(jcanizales): Rename interface -> service.
-@interface GRPCMethodName : NSObject
+// A fully-qualified proto service method name. Full qualification is needed because a gRPC endpoint
+// can implement multiple services.
+@interface ProtoMethod : NSObject
@property(nonatomic, readonly) NSString *package;
-@property(nonatomic, readonly) NSString *interface;
+@property(nonatomic, readonly) NSString *service;
@property(nonatomic, readonly) NSString *method;
+
+@property(nonatomic, readonly) NSString *HTTPPath;
+
- (instancetype)initWithPackage:(NSString *)package
- interface:(NSString *)interface
+ service:(NSString *)service
method:(NSString *)method;
@end
diff --git a/src/objective-c/GRPCClient/GRPCMethodName.m b/src/objective-c/ProtoRPC/ProtoMethod.m
index 96724073a5..1113b4fbaa 100644
--- a/src/objective-c/GRPCClient/GRPCMethodName.m
+++ b/src/objective-c/ProtoRPC/ProtoMethod.m
@@ -31,17 +31,25 @@
*
*/
-#import "GRPCMethodName.h"
+#import "ProtoMethod.h"
-@implementation GRPCMethodName
+@implementation ProtoMethod
- (instancetype)initWithPackage:(NSString *)package
- interface:(NSString *)interface
+ service:(NSString *)service
method:(NSString *)method {
if ((self = [super init])) {
_package = [package copy];
- _interface = [interface copy];
+ _service = [service copy];
_method = [method copy];
}
return self;
}
+
+- (NSString *)HTTPPath {
+ if (_package) {
+ return [NSString stringWithFormat:@"/%@.%@/%@", _package, _service, _method];
+ } else {
+ return [NSString stringWithFormat:@"/%@/%@", _service, _method];
+ }
+}
@end
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h
index b6375f52d6..fcc0a507fe 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.h
+++ b/src/objective-c/ProtoRPC/ProtoRPC.h
@@ -32,12 +32,14 @@
*/
#import <Foundation/Foundation.h>
-#import <gRPC/GRPCCall.h>
+#import <GRPCClient/GRPCCall.h>
+
+#import "ProtoMethod.h"
@interface ProtoRPC : GRPCCall
- (instancetype)initWithHost:(NSString *)host
- method:(GRPCMethodName *)method
+ method:(ProtoMethod *)method
requestsWriter:(id<GRXWriter>)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable NS_DESIGNATED_INITIALIZER;
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m
index b8f8008422..fe3ccf0541 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.m
+++ b/src/objective-c/ProtoRPC/ProtoRPC.m
@@ -33,28 +33,29 @@
#import "ProtoRPC.h"
-#import <gRPC/GRXWriteable.h>
-#import <gRPC/GRXWriter.h>
-#import <gRPC/GRXWriter+Transformations.h>
-#import <Protobuf/GPBProtocolBuffers.h>
+#import <GPBProtocolBuffers.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter.h>
+#import <RxLibrary/GRXWriter+Transformations.h>
@implementation ProtoRPC {
id<GRXWriteable> _responseWriteable;
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
- (instancetype)initWithHost:(NSString *)host
- method:(GRPCMethodName *)method
+ path:(NSString *)path
requestsWriter:(id<GRXWriter>)requestsWriter {
- return [self initWithHost:host
- method:method
- requestsWriter:requestsWriter
- responseClass:nil
- responsesWriteable:nil];
+ [NSException raise:NSInvalidArgumentException
+ format:@"Please use ProtoRPC's designated initializer instead."];
+ return nil;
}
+#pragma clang diagnostic pop
// Designated initializer
- (instancetype)initWithHost:(NSString *)host
- method:(GRPCMethodName *)method
+ method:(ProtoMethod *)method
requestsWriter:(id<GRXWriter>)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable {
@@ -66,9 +67,11 @@
// A writer that serializes the proto messages to send.
id<GRXWriter> bytesWriter =
[[[GRXWriter alloc] initWithWriter:requestsWriter] map:^id(GPBMessage *proto) {
+ // TODO(jcanizales): Fail with an understandable error message if the requestsWriter isn't
+ // sending GPBMessages.
return [proto data];
}];
- if ((self = [super initWithHost:host method:method requestsWriter:bytesWriter])) {
+ if ((self = [super initWithHost:host path:method.HTTPPath requestsWriter:bytesWriter])) {
// A writeable that parses the proto messages received.
_responseWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
[responsesWriteable writeValue:[responseClass parseFromData:value error:NULL]];
diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m
index 453d7b3f1a..d7c5b6a850 100644
--- a/src/objective-c/ProtoRPC/ProtoService.m
+++ b/src/objective-c/ProtoRPC/ProtoService.m
@@ -33,10 +33,10 @@
#import "ProtoService.h"
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriteable.h>
-#import <gRPC/GRXWriter.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter.h>
+#import "ProtoMethod.h"
#import "ProtoRPC.h"
@implementation ProtoService {
@@ -69,9 +69,9 @@
requestsWriter:(id<GRXWriter>)requestsWriter
responseClass:(Class)responseClass
responsesWriteable:(id<GRXWriteable>)responsesWriteable {
- GRPCMethodName *methodName = [[GRPCMethodName alloc] initWithPackage:_packageName
- interface:_serviceName
- method:method];
+ ProtoMethod *methodName = [[ProtoMethod alloc] initWithPackage:_packageName
+ service:_serviceName
+ method:method];
return [[ProtoRPC alloc] initWithHost:_host
method:methodName
requestsWriter:requestsWriter
diff --git a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
index dcebb6132a..55f6f82f20 100644
--- a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
+++ b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
@@ -31,7 +31,7 @@
*
*/
-#import "GRXWriter.h"
+#import "RxLibrary/GRXWriter.h"
// A "proxy" writer that transforms all the values of its input writer by using a mapping function.
@interface GRXMappingWriter : GRXWriter
diff --git a/src/objective-c/examples/Sample/Sample/ViewController.m b/src/objective-c/examples/Sample/Sample/ViewController.m
index 0011a4508d..05bd6fa2db 100644
--- a/src/objective-c/examples/Sample/Sample/ViewController.m
+++ b/src/objective-c/examples/Sample/Sample/ViewController.m
@@ -33,12 +33,12 @@
#import "ViewController.h"
-#import <gRPC/GRPCCall.h>
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXWriteable.h>
+#import <GRPCClient/GRPCCall.h>
+#import <GRPCClient/GRPCMethodName.h>
#import <RemoteTest/Messages.pbobjc.h>
#import <RemoteTest/Test.pbrpc.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
+#import <RxLibrary/GRXWriteable.h>
@implementation ViewController
diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m
index 268e67af2f..f9c2d5d8d6 100644
--- a/src/objective-c/tests/GRPCClientTests.m
+++ b/src/objective-c/tests/GRPCClientTests.m
@@ -34,11 +34,11 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRPCCall.h>
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXWriteable.h>
+#import <GRPCClient/GRPCCall.h>
+#import <ProtoRPC/ProtoMethod.h>
#import <RemoteTest/Messages.pbobjc.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
// These are a few tests similar to InteropTests, but which use the generic gRPC client (GRPCCall)
// rather than a generated proto library on top of it.
@@ -47,9 +47,9 @@ static NSString * const kHostAddress = @"grpc-test.sandbox.google.com";
static NSString * const kPackage = @"grpc.testing";
static NSString * const kService = @"TestService";
-static GRPCMethodName *kInexistentMethod;
-static GRPCMethodName *kEmptyCallMethod;
-static GRPCMethodName *kUnaryCallMethod;
+static ProtoMethod *kInexistentMethod;
+static ProtoMethod *kEmptyCallMethod;
+static ProtoMethod *kUnaryCallMethod;
@interface GRPCClientTests : XCTestCase
@end
@@ -58,22 +58,22 @@ static GRPCMethodName *kUnaryCallMethod;
- (void)setUp {
// This method isn't implemented by the remote server.
- kInexistentMethod = [[GRPCMethodName alloc] initWithPackage:kPackage
- interface:kService
- method:@"Inexistent"];
- kEmptyCallMethod = [[GRPCMethodName alloc] initWithPackage:kPackage
- interface:kService
- method:@"EmptyCall"];
- kUnaryCallMethod = [[GRPCMethodName alloc] initWithPackage:kPackage
- interface:kService
- method:@"UnaryCall"];
+ kInexistentMethod = [[ProtoMethod alloc] initWithPackage:kPackage
+ service:kService
+ method:@"Inexistent"];
+ kEmptyCallMethod = [[ProtoMethod alloc] initWithPackage:kPackage
+ service:kService
+ method:@"EmptyCall"];
+ kUnaryCallMethod = [[ProtoMethod alloc] initWithPackage:kPackage
+ service:kService
+ method:@"UnaryCall"];
}
- (void)testConnectionToRemoteServer {
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress
- method:kInexistentMethod
+ path:kInexistentMethod.HTTPPath
requestsWriter:[GRXWriter writerWithValue:[NSData data]]];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
@@ -95,7 +95,7 @@ static GRPCMethodName *kUnaryCallMethod;
__weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress
- method:kEmptyCallMethod
+ path:kEmptyCallMethod.HTTPPath
requestsWriter:[GRXWriter writerWithValue:[NSData data]]];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
@@ -123,7 +123,7 @@ static GRPCMethodName *kUnaryCallMethod;
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[request data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress
- method:kUnaryCallMethod
+ path:kUnaryCallMethod.HTTPPath
requestsWriter:requestsWriter];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
@@ -153,7 +153,7 @@ static GRPCMethodName *kUnaryCallMethod;
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[request data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress
- method:kUnaryCallMethod
+ path:kUnaryCallMethod.HTTPPath
requestsWriter:requestsWriter];
call.requestMetadata[@"Authorization"] = @"Bearer bogusToken";
diff --git a/src/objective-c/tests/InteropTests.m b/src/objective-c/tests/InteropTests.m
index 0a512c17dc..74f6b231cf 100644
--- a/src/objective-c/tests/InteropTests.m
+++ b/src/objective-c/tests/InteropTests.m
@@ -36,13 +36,13 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXBufferedPipe.h>
-#import <gRPC/ProtoRPC.h>
+#import <ProtoRPC/ProtoRPC.h>
#import <RemoteTest/Empty.pbobjc.h>
#import <RemoteTest/Messages.pbobjc.h>
#import <RemoteTest/Test.pbobjc.h>
#import <RemoteTest/Test.pbrpc.h>
+#import <RxLibrary/GRXBufferedPipe.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
// Convenience constructors for the generated proto messages:
@@ -174,7 +174,7 @@
__block int index = 0;
[_service streamingOutputCallWithRequest:request
- handler:^(BOOL done,
+ eventHandler:^(BOOL done,
RMTStreamingOutputCallResponse *response,
NSError *error){
XCTAssertNil(error, @"Finished with unexpected error: %@", error);
@@ -211,7 +211,7 @@
[requestsBuffer writeValue:request];
[_service fullDuplexCallWithRequestsWriter:requestsBuffer
- handler:^(BOOL done,
+ eventHandler:^(BOOL done,
RMTStreamingOutputCallResponse *response,
NSError *error) {
XCTAssertNil(error, @"Finished with unexpected error: %@", error);
@@ -242,7 +242,7 @@
- (void)testEmptyStreamRPC {
__weak XCTestExpectation *expectation = [self expectationWithDescription:@"EmptyStream"];
[_service fullDuplexCallWithRequestsWriter:[GRXWriter emptyWriter]
- handler:^(BOOL done,
+ eventHandler:^(BOOL done,
RMTStreamingOutputCallResponse *response,
NSError *error) {
XCTAssertNil(error, @"Finished with unexpected error: %@", error);
@@ -283,7 +283,7 @@
[requestsBuffer writeValue:request];
__block ProtoRPC *call = [_service RPCToFullDuplexCallWithRequestsWriter:requestsBuffer
- handler:^(BOOL done,
+ eventHandler:^(BOOL done,
RMTStreamingOutputCallResponse *response,
NSError *error) {
if (receivedResponse) {
diff --git a/src/objective-c/tests/LocalClearTextTests.m b/src/objective-c/tests/LocalClearTextTests.m
index 68ffd23200..10c9f13ea3 100644
--- a/src/objective-c/tests/LocalClearTextTests.m
+++ b/src/objective-c/tests/LocalClearTextTests.m
@@ -34,12 +34,12 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRPCCall.h>
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXWriteable.h>
+#import <GRPCClient/GRPCCall.h>
+#import <ProtoRPC/ProtoMethod.h>
#import <RouteGuide/RouteGuide.pbobjc.h>
#import <RouteGuide/RouteGuide.pbrpc.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
// These tests require a gRPC "RouteGuide" sample server to be running locally. You can compile and
// run one by following the instructions here: https://github.com/grpc/grpc-common/blob/master/cpp/cpptutorial.md#try-it-out
@@ -87,14 +87,14 @@ static NSString * const kService = @"RouteGuide";
__weak XCTestExpectation *response = [self expectationWithDescription:@"Empty response received."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."];
- GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
- interface:kService
- method:@"RecordRoute"];
+ ProtoMethod *method = [[ProtoMethod alloc] initWithPackage:kPackage
+ service:kService
+ method:@"RecordRoute"];
id<GRXWriter> requestsWriter = [GRXWriter emptyWriter];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
- method:method
+ path:method.HTTPPath
requestsWriter:requestsWriter];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
@@ -115,9 +115,9 @@ static NSString * const kService = @"RouteGuide";
__weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."];
- GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
- interface:kService
- method:@"GetFeature"];
+ ProtoMethod *method = [[ProtoMethod alloc] initWithPackage:kPackage
+ service:kService
+ method:@"GetFeature"];
RGDPoint *point = [RGDPoint message];
point.latitude = 28E7;
@@ -125,7 +125,7 @@ static NSString * const kService = @"RouteGuide";
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[point data]];
GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
- method:method
+ path:method.HTTPPath
requestsWriter:requestsWriter];
id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
diff --git a/src/objective-c/tests/RxLibraryUnitTests.m b/src/objective-c/tests/RxLibraryUnitTests.m
index 89984d9481..5e3162875a 100644
--- a/src/objective-c/tests/RxLibraryUnitTests.m
+++ b/src/objective-c/tests/RxLibraryUnitTests.m
@@ -34,9 +34,9 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRXBufferedPipe.h>
-#import <gRPC/GRXWriter.h>
-#import <gRPC/GRXWriteable.h>
+#import <RxLibrary/GRXBufferedPipe.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter.h>
// A mock of a GRXSingleValueHandler block that can be queried for how many times it was called and
// what were the last values passed to it.
diff --git a/src/php/README.md b/src/php/README.md
index cb9b48aee3..1804606e09 100644
--- a/src/php/README.md
+++ b/src/php/README.md
@@ -5,16 +5,28 @@ This directory contains source code for PHP implementation of gRPC layered on sh
#Status
-Pre-Alpha : This gRPC PHP implementation is work-in-progress and is not expected to work yet.
+Alpha : Ready for early adopters
## ENVIRONMENT
-Install `php5` and `php5-dev`.
+Prerequisite: PHP 5.5 or later, `phpunit`, `pecl`
-To run the tests, additionally install `phpunit`.
+Linux:
-Alternatively, build and install PHP 5.5 or later from source with standard
-configuration options.
+```sh
+$ sudo apt-get install php5 php5-dev phpunit php-pear
+```
+
+OS X:
+
+```sh
+$ curl https://phar.phpunit.de/phpunit.phar -o phpunit.phar
+$ chmod +x phpunit.phar
+$ sudo mv phpunit.phar /usr/local/bin/phpunit
+
+$ curl -O http://pear.php.net/go-pear.phar
+$ sudo php -d detect_unicode=0 go-pear.phar
+```
## Build from Homebrew
@@ -48,7 +60,7 @@ $ make check
$ sudo make install
```
-Build and install the gRPC C core
+Build and install the gRPC C core libraries
```sh
$ cd grpc
@@ -56,7 +68,13 @@ $ make
$ sudo make install
```
-Build the gRPC PHP extension
+Install the gRPC PHP extension
+
+```sh
+$ sudo pecl install grpc
+```
+
+OR
```sh
$ cd grpc/src/php/ext/grpc
@@ -125,4 +143,3 @@ $ ./bin/run_gen_code_test.sh
[linuxbrew]:https://github.com/Homebrew/linuxbrew#installation
[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
[Node]:https://github.com/grpc/grpc/tree/master/src/node/examples
-
diff --git a/src/php/bin/determine_extension_dir.sh b/src/php/bin/determine_extension_dir.sh
new file mode 100755
index 0000000000..6bbd934bf1
--- /dev/null
+++ b/src/php/bin/determine_extension_dir.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+set -e
+default_extension_dir=$(php-config --extension-dir)
+if command -v brew >/dev/null && [ -d $(brew --prefix)/opt/grpc-php ]; then
+ # homebrew and the grpc-php formula are installed
+ extension_dir="-d extension_dir="$(brew --prefix)/opt/grpc-php
+elif [ ! -e $default_extension_dir/grpc.so ]; then
+ # the grpc extension is not found in the default PHP extension dir
+ # try the source modules directory
+ module_dir=../ext/grpc/modules
+ if [ ! -e $module_dir/grpc.so ]; then
+ echo "Please run 'phpize && ./configure && make' from ext/grpc first"
+ exit 1
+ fi
+ # sym-link in system supplied extensions
+ for f in $default_extension_dir/*.so; do
+ ln -s $f $module_dir/$(basename $f) &> /dev/null || true
+ done
+ extension_dir="-d extension_dir="$module_dir
+fi
diff --git a/src/php/bin/interop_client.sh b/src/php/bin/interop_client.sh
index 4fe63788c1..42e075cbe8 100755
--- a/src/php/bin/interop_client.sh
+++ b/src/php/bin/interop_client.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
@@ -28,11 +28,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-set +e
+set -e
cd $(dirname $0)
-
-module_dir=../ext/grpc/modules
-
-php -d extension_dir=$module_dir -d extension=grpc.so \
+source ./determine_extension_dir.sh
+php $extension_dir -d extension=grpc.so \
../tests/interop/interop_client.php $@ 1>&2
diff --git a/src/php/bin/run_gen_code_test.sh b/src/php/bin/run_gen_code_test.sh
index 1be2ed3f72..03a9101a45 100755
--- a/src/php/bin/run_gen_code_test.sh
+++ b/src/php/bin/run_gen_code_test.sh
@@ -1,4 +1,4 @@
-# Runs the generated code test against the ruby server
+#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
@@ -28,10 +28,11 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+set -e
cd $(dirname $0)
-GRPC_TEST_HOST=localhost:50051 php -d extension_dir=../ext/grpc/modules/ \
- -d extension=grpc.so `which phpunit` -v --debug --strict \
+source ./determine_extension_dir.sh
+export GRPC_TEST_HOST=localhost:7071
+php $extension_dir -d extension=grpc.so $(which phpunit) -v --debug --strict \
../tests/generated_code/GeneratedCodeTest.php
-GRPC_TEST_HOST=localhost:50051 php -d extension_dir=../ext/grpc/modules/ \
- -d extension=grpc.so `which phpunit` -v --debug --strict \
+php $extension_dir -d extension=grpc.so $(which phpunit) -v --debug --strict \
../tests/generated_code/GeneratedCodeWithCallbackTest.php
diff --git a/src/php/bin/run_tests.sh b/src/php/bin/run_tests.sh
index 551be12514..4c37285455 100755
--- a/src/php/bin/run_tests.sh
+++ b/src/php/bin/run_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
@@ -32,17 +32,6 @@
# against it
set -e
cd $(dirname $0)
-default_extension_dir=`php -i | grep extension_dir | sed 's/.*=> //g'`
-
-module_dir=../ext/grpc/modules
-
-# sym-link in system supplied extensions
-for f in $default_extension_dir/*.so
-do
- ln -s $f $module_dir/$(basename $f) &> /dev/null || true
-done
-
-php \
- -d extension_dir=$module_dir \
- -d extension=grpc.so \
- `which phpunit` -v --debug --strict ../tests/unit_tests
+source ./determine_extension_dir.sh
+php $extension_dir -d extension=grpc.so $(which phpunit) -v --debug --strict \
+ ../tests/unit_tests
diff --git a/src/php/ext/grpc/CREDITS b/src/php/ext/grpc/CREDITS
new file mode 100644
index 0000000000..17b94fedc0
--- /dev/null
+++ b/src/php/ext/grpc/CREDITS
@@ -0,0 +1,3 @@
+Michael Lumish (mlumish@google.com)
+Tim Emiola (temiola@google.com)
+Stanley Cheung (stanleycheung@google.com)
diff --git a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h b/src/php/ext/grpc/LICENSE
index 28c7374517..704b523970 100644
--- a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h
+++ b/src/php/ext/grpc/LICENSE
@@ -30,11 +30,3 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-#import <Foundation/Foundation.h>
-
-#import "GRPCMethodName.h"
-
-@interface GRPCMethodName (HTTP2Encoding)
-- (NSString *)HTTP2Path;
-@end
diff --git a/src/php/ext/grpc/README.md b/src/php/ext/grpc/README.md
new file mode 100644
index 0000000000..0ac09e1835
--- /dev/null
+++ b/src/php/ext/grpc/README.md
@@ -0,0 +1,72 @@
+gRPC PHP Extension
+==================
+
+# Requirements
+
+ * PHP 5.5+
+ * [gRPC core library](https://github.com/grpc/grpc) 0.9.1
+
+# Installation
+
+## Install PHP 5
+
+```
+$ sudo apt-get install git php5 php5-dev php-pear unzip
+```
+
+## Compile gRPC Core Library
+
+Clone the gRPC source code repository
+
+```
+$ git clone https://github.com/grpc/grpc.git
+```
+
+Build and install the Protocol Buffers compiler (protoc)
+
+```
+$ # from grpc
+$ git checkout --track origin/release-0_9
+$ git pull --recurse-submodules && git submodule update --init --recursive
+$ cd third_party/protobuf
+$ ./autogen.sh
+$ ./configure
+$ make
+$ make check
+$ sudo make install
+```
+
+Build and install the gRPC C core library
+
+```sh
+$ # from grpc
+$ make
+$ sudo make install
+```
+
+## Install the gRPC PHP extension
+
+Quick install
+
+```sh
+$ sudo pecl install grpc
+```
+
+Note: before a stable release, you may need to do
+
+```sh
+$ sudo pecl install grpc-0.5.0
+```
+
+OR
+
+Compile from source
+
+```sh
+$ # from grpc
+$ cd src/php/ext/grpc
+$ phpize
+$ ./configure
+$ make
+$ sudo make install
+```
diff --git a/src/php/ext/grpc/config.m4 b/src/php/ext/grpc/config.m4
index b485aabf40..8bacdfbfec 100755
--- a/src/php/ext/grpc/config.m4
+++ b/src/php/ext/grpc/config.m4
@@ -35,8 +35,13 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_LIBRARY(dl,,GRPC_SHARED_LIBADD)
PHP_ADD_LIBRARY(dl)
- PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
- PHP_ADD_LIBRARY(rt)
+ case $host in
+ *darwin*) ;;
+ *)
+ PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
+ PHP_ADD_LIBRARY(rt)
+ ;;
+ esac
GRPC_LIBDIR=$GRPC_DIR/${GRPC_LIB_SUBDIR-lib}
diff --git a/src/php/ext/grpc/package.xml b/src/php/ext/grpc/package.xml
new file mode 100644
index 0000000000..2c89829d51
--- /dev/null
+++ b/src/php/ext/grpc/package.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.9.5" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+ <name>grpc</name>
+ <channel>pecl.php.net</channel>
+ <summary>A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.</summary>
+ <description>Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages.</description>
+ <lead>
+ <name>Stanley Cheung</name>
+ <user>stanleycheung</user>
+ <email>grpc-packages@google.com</email>
+ <active>yes</active>
+ </lead>
+ <date>2015-06-16</date>
+ <time>20:12:55</time>
+ <version>
+ <release>0.5.0</release>
+ <api>0.5.0</api>
+ </version>
+ <stability>
+ <release>alpha</release>
+ <api>alpha</api>
+ </stability>
+ <license>BSD</license>
+ <notes>
+First alpha release
+ </notes>
+ <contents>
+ <dir baseinstalldir="/" name="/">
+ <file baseinstalldir="/" md5sum="6f19828fb869b7b8a590cbb76b4f996d" name="byte_buffer.c" role="src" />
+ <file baseinstalldir="/" md5sum="c8de0f819499c48adfc8d7f472c0196b" name="byte_buffer.h" role="src" />
+ <file baseinstalldir="/" md5sum="cb45b62f767ae7b4377761df696649fc" name="call.c" role="src" />
+ <file baseinstalldir="/" md5sum="26acbf04c30162c2d2aca4688bb2aec8" name="call.h" role="src" />
+ <file baseinstalldir="/" md5sum="50837fbdb2892795f1871b22e5979762" name="channel.c" role="src" />
+ <file baseinstalldir="/" md5sum="f1b66029daeced20b47cf00cc6523fc8" name="channel.h" role="src" />
+ <file baseinstalldir="/" md5sum="81a1193e93d8b6602add8ac360de565b" name="completion_queue.c" role="src" />
+ <file baseinstalldir="/" md5sum="f10b5bb232d74a6878e829e2e76cdaa2" name="completion_queue.h" role="src" />
+ <file baseinstalldir="/" md5sum="a9181ed994a072ac5f41e7c9705c170f" name="config.m4" role="src" />
+ <file baseinstalldir="/" md5sum="8c3f1e11dac623001378bfd53b554f08" name="credentials.c" role="src" />
+ <file baseinstalldir="/" md5sum="6988d6e97c19c8f8e3eb92371cf8246b" name="credentials.h" role="src" />
+ <file baseinstalldir="/" md5sum="38a1bc979d810c36ebc2a52d4b7b5319" name="CREDITS" role="doc" />
+ <file baseinstalldir="/" md5sum="3f35b472bbdef5a788cd90617d7d0847" name="LICENSE" role="doc" />
+ <file baseinstalldir="/" md5sum="6aaa7a290122d230f2d8c4e4e05da4a9" name="php_grpc.c" role="src" />
+ <file baseinstalldir="/" md5sum="673b07859d9f69232f8a754c56780686" name="php_grpc.h" role="src" />
+ <file baseinstalldir="/" md5sum="4d4d3382f8d10cae2e4378468e5516b9" name="README.md" role="doc" />
+ <file baseinstalldir="/" md5sum="53fda0ee6937f6ddc8e271886018d441" name="server.c" role="src" />
+ <file baseinstalldir="/" md5sum="4b730f06d14cbbb0642bdbd194749595" name="server.h" role="src" />
+ <file baseinstalldir="/" md5sum="f6930beafb6c0e061899262f2f077e98" name="server_credentials.c" role="src" />
+ <file baseinstalldir="/" md5sum="9c4b4cc06356a8a39a16a085a9b85996" name="server_credentials.h" role="src" />
+ <file baseinstalldir="/" md5sum="c89c623cd17177ebde18313fc5c17122" name="timeval.c" role="src" />
+ <file baseinstalldir="/" md5sum="496e27a100b4d93ca3fb35c924c5e163" name="timeval.h" role="src" />
+ </dir>
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.5.0</min>
+ </php>
+ <pearinstaller>
+ <min>1.4.0</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <providesextension>grpc</providesextension>
+ <extsrcrelease />
+ <changelog>
+ <release>
+ <version>
+ <release>0.5.0</release>
+ <api>0.5.0</api>
+ </version>
+ <stability>
+ <release>alpha</release>
+ <api>alpha</api>
+ </stability>
+ <date>2015-06-16</date>
+ <license>BSD</license>
+ <notes>
+First alpha release
+ </notes>
+ </release>
+ </changelog>
+</package>
diff --git a/src/python/src/grpc/_adapter/_c/types.h b/src/python/src/grpc/_adapter/_c/types.h
index e189ae2566..3449f0643f 100644
--- a/src/python/src/grpc/_adapter/_c/types.h
+++ b/src/python/src/grpc/_adapter/_c/types.h
@@ -241,10 +241,10 @@ double pygrpc_cast_gpr_timespec_to_double(gpr_timespec timespec);
gpr_timespec pygrpc_cast_double_to_gpr_timespec(double seconds);
/* Returns true on success, false on failure. */
-int pygrpc_cast_pylist_to_send_metadata(
- PyObject *pylist, grpc_metadata **metadata, size_t *count);
+int pygrpc_cast_pyseq_to_send_metadata(
+ PyObject *pyseq, grpc_metadata **metadata, size_t *count);
/* Returns a metadata array as a Python object on success, else NULL. */
-PyObject *pygrpc_cast_metadata_array_to_pylist(grpc_metadata_array metadata);
+PyObject *pygrpc_cast_metadata_array_to_pyseq(grpc_metadata_array metadata);
/* Transliterate from a list of python channel arguments (2-tuples of string
and string|integer|None) to a grpc_channel_args object. The strings placed
diff --git a/src/python/src/grpc/_adapter/_c/types/server.c b/src/python/src/grpc/_adapter/_c/types/server.c
index 26b38da8f1..2a00f34039 100644
--- a/src/python/src/grpc/_adapter/_c/types/server.c
+++ b/src/python/src/grpc/_adapter/_c/types/server.c
@@ -105,6 +105,7 @@ Server *pygrpc_Server_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
}
self = (Server *)type->tp_alloc(type, 0);
self->c_serv = grpc_server_create(&c_args);
+ grpc_server_register_completion_queue(self->c_serv, cq->c_cq);
pygrpc_discard_channel_args(c_args);
self->cq = cq;
Py_INCREF(self->cq);
diff --git a/src/python/src/grpc/_adapter/_c/utility.c b/src/python/src/grpc/_adapter/_c/utility.c
index a433f26d76..480a720c21 100644
--- a/src/python/src/grpc/_adapter/_c/utility.c
+++ b/src/python/src/grpc/_adapter/_c/utility.c
@@ -32,6 +32,7 @@
*/
#include <math.h>
+#include <string.h>
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@@ -118,7 +119,7 @@ PyObject *pygrpc_consume_event(grpc_event event) {
tag->request_call_details.method, tag->request_call_details.host,
pygrpc_cast_gpr_timespec_to_double(tag->request_call_details.deadline),
GRPC_OP_RECV_INITIAL_METADATA,
- pygrpc_cast_metadata_array_to_pylist(tag->request_metadata), Py_None,
+ pygrpc_cast_metadata_array_to_pyseq(tag->request_metadata), Py_None,
Py_None, Py_None, Py_None,
event.success ? Py_True : Py_False);
} else {
@@ -172,7 +173,7 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
c_op.flags = 0;
switch (type) {
case GRPC_OP_SEND_INITIAL_METADATA:
- if (!pygrpc_cast_pylist_to_send_metadata(
+ if (!pygrpc_cast_pyseq_to_send_metadata(
PyTuple_GetItem(op, INITIAL_METADATA_INDEX),
&c_op.data.send_initial_metadata.metadata,
&c_op.data.send_initial_metadata.count)) {
@@ -190,7 +191,7 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
/* Don't need to fill in any other fields. */
break;
case GRPC_OP_SEND_STATUS_FROM_SERVER:
- if (!pygrpc_cast_pylist_to_send_metadata(
+ if (!pygrpc_cast_pyseq_to_send_metadata(
PyTuple_GetItem(op, TRAILING_METADATA_INDEX),
&c_op.data.send_status_from_server.trailing_metadata,
&c_op.data.send_status_from_server.trailing_metadata_count)) {
@@ -247,8 +248,16 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
}
void pygrpc_discard_op(grpc_op op) {
+ size_t i;
switch(op.op) {
case GRPC_OP_SEND_INITIAL_METADATA:
+ /* Whenever we produce send-metadata, we allocate new strings (to handle
+ arbitrary sequence input as opposed to just lists or just tuples). We
+ thus must free those elements. */
+ for (i = 0; i < op.data.send_initial_metadata.count; ++i) {
+ gpr_free((void *)op.data.send_initial_metadata.metadata[i].key);
+ gpr_free((void *)op.data.send_initial_metadata.metadata[i].value);
+ }
gpr_free(op.data.send_initial_metadata.metadata);
break;
case GRPC_OP_SEND_MESSAGE:
@@ -258,6 +267,16 @@ void pygrpc_discard_op(grpc_op op) {
/* Don't need to free any fields. */
break;
case GRPC_OP_SEND_STATUS_FROM_SERVER:
+ /* Whenever we produce send-metadata, we allocate new strings (to handle
+ arbitrary sequence input as opposed to just lists or just tuples). We
+ thus must free those elements. */
+ for (i = 0; i < op.data.send_status_from_server.trailing_metadata_count;
+ ++i) {
+ gpr_free(
+ (void *)op.data.send_status_from_server.trailing_metadata[i].key);
+ gpr_free(
+ (void *)op.data.send_status_from_server.trailing_metadata[i].value);
+ }
gpr_free(op.data.send_status_from_server.trailing_metadata);
gpr_free((char *)op.data.send_status_from_server.status_details);
break;
@@ -419,31 +438,41 @@ void pygrpc_discard_channel_args(grpc_channel_args args) {
gpr_free(args.args);
}
-int pygrpc_cast_pylist_to_send_metadata(
- PyObject *pylist, grpc_metadata **metadata, size_t *count) {
+int pygrpc_cast_pyseq_to_send_metadata(
+ PyObject *pyseq, grpc_metadata **metadata, size_t *count) {
size_t i;
Py_ssize_t value_length;
- *count = PyList_Size(pylist);
+ char *key;
+ char *value;
+ if (!PySequence_Check(pyseq)) {
+ return 0;
+ }
+ *count = PySequence_Size(pyseq);
*metadata = gpr_malloc(sizeof(grpc_metadata) * *count);
for (i = 0; i < *count; ++i) {
- if (!PyArg_ParseTuple(
- PyList_GetItem(pylist, i), "ss#",
- &(*metadata)[i].key, &(*metadata)[i].value, &value_length)) {
+ PyObject *item = PySequence_GetItem(pyseq, i);
+ if (!PyArg_ParseTuple(item, "ss#", &key, &value, &value_length)) {
+ Py_DECREF(item);
gpr_free(*metadata);
*count = 0;
*metadata = NULL;
return 0;
+ } else {
+ (*metadata)[i].key = gpr_strdup(key);
+ (*metadata)[i].value = gpr_malloc(value_length);
+ memcpy((void *)(*metadata)[i].value, value, value_length);
+ Py_DECREF(item);
}
(*metadata)[i].value_length = value_length;
}
return 1;
}
-PyObject *pygrpc_cast_metadata_array_to_pylist(grpc_metadata_array metadata) {
- PyObject *result = PyList_New(metadata.count);
+PyObject *pygrpc_cast_metadata_array_to_pyseq(grpc_metadata_array metadata) {
+ PyObject *result = PyTuple_New(metadata.count);
size_t i;
for (i = 0; i < metadata.count; ++i) {
- PyList_SetItem(
+ PyTuple_SetItem(
result, i, Py_BuildValue(
"ss#", metadata.metadata[i].key, metadata.metadata[i].value,
(Py_ssize_t)metadata.metadata[i].value_length));
diff --git a/src/python/src/grpc/_adapter/_intermediary_low.py b/src/python/src/grpc/_adapter/_intermediary_low.py
index 6b96aef1d3..3c7f0a2619 100644
--- a/src/python/src/grpc/_adapter/_intermediary_low.py
+++ b/src/python/src/grpc/_adapter/_intermediary_low.py
@@ -144,10 +144,11 @@ class Call(object):
self._metadata.append((key, value))
def premetadata(self):
- return self._internal.start_batch([
+ result = self._internal.start_batch([
_types.OpArgs.send_initial_metadata(self._metadata)
], _IGNORE_ME_TAG)
self._metadata = []
+ return result
def read(self, tag):
return self._internal.start_batch([
diff --git a/src/python/src/grpc/_adapter/_intermediary_low_test.py b/src/python/src/grpc/_adapter/_intermediary_low_test.py
index 478346341b..27a5b82e9c 100644
--- a/src/python/src/grpc/_adapter/_intermediary_low_test.py
+++ b/src/python/src/grpc/_adapter/_intermediary_low_test.py
@@ -29,6 +29,8 @@
"""Tests for the old '_low'."""
+import Queue
+import threading
import time
import unittest
@@ -43,6 +45,7 @@ _BYTE_SEQUENCE_SEQUENCE = tuple(
bytes(bytearray((row + column) % 256 for column in range(row)))
for row in range(_STREAM_LENGTH))
+
class LonelyClientTest(unittest.TestCase):
def testLonelyClient(self):
@@ -79,6 +82,14 @@ class LonelyClientTest(unittest.TestCase):
del completion_queue
+def _drive_completion_queue(completion_queue, event_queue):
+ while True:
+ event = completion_queue.get(_FUTURE)
+ if event.kind is _low.Event.Kind.STOP:
+ break
+ event_queue.put(event)
+
+
class EchoTest(unittest.TestCase):
def setUp(self):
@@ -88,24 +99,26 @@ class EchoTest(unittest.TestCase):
self.server = _low.Server(self.server_completion_queue)
port = self.server.add_http2_addr('[::]:0')
self.server.start()
+ self.server_events = Queue.Queue()
+ self.server_completion_queue_thread = threading.Thread(
+ target=_drive_completion_queue,
+ args=(self.server_completion_queue, self.server_events))
+ self.server_completion_queue_thread.start()
self.client_completion_queue = _low.CompletionQueue()
self.channel = _low.Channel('%s:%d' % (self.host, port), None)
+ self.client_events = Queue.Queue()
+ self.client_completion_queue_thread = threading.Thread(
+ target=_drive_completion_queue,
+ args=(self.client_completion_queue, self.client_events))
+ self.client_completion_queue_thread.start()
def tearDown(self):
self.server.stop()
self.server_completion_queue.stop()
self.client_completion_queue.stop()
- while True:
- event = self.server_completion_queue.get(_FUTURE)
- if event is not None and event.kind is _low.Event.Kind.STOP:
- break
- while True:
- event = self.client_completion_queue.get(_FUTURE)
- if event is not None and event.kind is _low.Event.Kind.STOP:
- break
- self.server_completion_queue = None
- self.client_completion_queue = None
+ self.server_completion_queue_thread.join()
+ self.client_completion_queue_thread.join()
del self.server
def _perform_echo_test(self, test_data):
@@ -144,7 +157,7 @@ class EchoTest(unittest.TestCase):
client_call.invoke(self.client_completion_queue, metadata_tag, finish_tag)
self.server.service(service_tag)
- service_accepted = self.server_completion_queue.get(_FUTURE)
+ service_accepted = self.server_events.get()
self.assertIsNotNone(service_accepted)
self.assertIs(service_accepted.kind, _low.Event.Kind.SERVICE_ACCEPTED)
self.assertIs(service_accepted.tag, service_tag)
@@ -165,7 +178,7 @@ class EchoTest(unittest.TestCase):
server_leading_binary_metadata_value)
server_call.premetadata()
- metadata_accepted = self.client_completion_queue.get(_FUTURE)
+ metadata_accepted = self.client_events.get()
self.assertIsNotNone(metadata_accepted)
self.assertEqual(_low.Event.Kind.METADATA_ACCEPTED, metadata_accepted.kind)
self.assertEqual(metadata_tag, metadata_accepted.tag)
@@ -179,14 +192,14 @@ class EchoTest(unittest.TestCase):
for datum in test_data:
client_call.write(datum, write_tag)
- write_accepted = self.client_completion_queue.get(_FUTURE)
+ write_accepted = self.client_events.get()
self.assertIsNotNone(write_accepted)
self.assertIs(write_accepted.kind, _low.Event.Kind.WRITE_ACCEPTED)
self.assertIs(write_accepted.tag, write_tag)
self.assertIs(write_accepted.write_accepted, True)
server_call.read(read_tag)
- read_accepted = self.server_completion_queue.get(_FUTURE)
+ read_accepted = self.server_events.get()
self.assertIsNotNone(read_accepted)
self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind)
self.assertEqual(read_tag, read_accepted.tag)
@@ -194,14 +207,14 @@ class EchoTest(unittest.TestCase):
server_data.append(read_accepted.bytes)
server_call.write(read_accepted.bytes, write_tag)
- write_accepted = self.server_completion_queue.get(_FUTURE)
+ write_accepted = self.server_events.get()
self.assertIsNotNone(write_accepted)
self.assertEqual(_low.Event.Kind.WRITE_ACCEPTED, write_accepted.kind)
self.assertEqual(write_tag, write_accepted.tag)
self.assertTrue(write_accepted.write_accepted)
client_call.read(read_tag)
- read_accepted = self.client_completion_queue.get(_FUTURE)
+ read_accepted = self.client_events.get()
self.assertIsNotNone(read_accepted)
self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind)
self.assertEqual(read_tag, read_accepted.tag)
@@ -209,14 +222,14 @@ class EchoTest(unittest.TestCase):
client_data.append(read_accepted.bytes)
client_call.complete(complete_tag)
- complete_accepted = self.client_completion_queue.get(_FUTURE)
+ complete_accepted = self.client_events.get()
self.assertIsNotNone(complete_accepted)
self.assertIs(complete_accepted.kind, _low.Event.Kind.COMPLETE_ACCEPTED)
self.assertIs(complete_accepted.tag, complete_tag)
self.assertIs(complete_accepted.complete_accepted, True)
server_call.read(read_tag)
- read_accepted = self.server_completion_queue.get(_FUTURE)
+ read_accepted = self.server_events.get()
self.assertIsNotNone(read_accepted)
self.assertEqual(_low.Event.Kind.READ_ACCEPTED, read_accepted.kind)
self.assertEqual(read_tag, read_accepted.tag)
@@ -228,8 +241,8 @@ class EchoTest(unittest.TestCase):
server_trailing_binary_metadata_value)
server_call.status(_low.Status(_low.Code.OK, details), status_tag)
- server_terminal_event_one = self.server_completion_queue.get(_FUTURE)
- server_terminal_event_two = self.server_completion_queue.get(_FUTURE)
+ server_terminal_event_one = self.server_events.get()
+ server_terminal_event_two = self.server_events.get()
if server_terminal_event_one.kind == _low.Event.Kind.COMPLETE_ACCEPTED:
status_accepted = server_terminal_event_one
rpc_accepted = server_terminal_event_two
@@ -246,8 +259,8 @@ class EchoTest(unittest.TestCase):
self.assertEqual(_low.Status(_low.Code.OK, ''), rpc_accepted.status)
client_call.read(read_tag)
- client_terminal_event_one = self.client_completion_queue.get(_FUTURE)
- client_terminal_event_two = self.client_completion_queue.get(_FUTURE)
+ client_terminal_event_one = self.client_events.get()
+ client_terminal_event_two = self.client_events.get()
if client_terminal_event_one.kind == _low.Event.Kind.READ_ACCEPTED:
read_accepted = client_terminal_event_one
finish_accepted = client_terminal_event_two
@@ -269,6 +282,9 @@ class EchoTest(unittest.TestCase):
self.assertIn(server_trailing_binary_metadata_key, metadata)
self.assertEqual(server_trailing_binary_metadata_value,
metadata[server_trailing_binary_metadata_key])
+ self.assertSetEqual(set(key for key, _ in finish_accepted.metadata),
+ set((server_trailing_metadata_key,
+ server_trailing_binary_metadata_key,)))
server_timeout_none_event = self.server_completion_queue.get(0)
self.assertIsNone(server_timeout_none_event)
@@ -303,22 +319,26 @@ class CancellationTest(unittest.TestCase):
self.server = _low.Server(self.server_completion_queue)
port = self.server.add_http2_addr('[::]:0')
self.server.start()
+ self.server_events = Queue.Queue()
+ self.server_completion_queue_thread = threading.Thread(
+ target=_drive_completion_queue,
+ args=(self.server_completion_queue, self.server_events))
+ self.server_completion_queue_thread.start()
self.client_completion_queue = _low.CompletionQueue()
self.channel = _low.Channel('%s:%d' % (self.host, port), None)
+ self.client_events = Queue.Queue()
+ self.client_completion_queue_thread = threading.Thread(
+ target=_drive_completion_queue,
+ args=(self.client_completion_queue, self.client_events))
+ self.client_completion_queue_thread.start()
def tearDown(self):
self.server.stop()
self.server_completion_queue.stop()
self.client_completion_queue.stop()
- while True:
- event = self.server_completion_queue.get(0)
- if event is not None and event.kind is _low.Event.Kind.STOP:
- break
- while True:
- event = self.client_completion_queue.get(0)
- if event is not None and event.kind is _low.Event.Kind.STOP:
- break
+ self.server_completion_queue_thread.join()
+ self.client_completion_queue_thread.join()
del self.server
def testCancellation(self):
@@ -340,29 +360,29 @@ class CancellationTest(unittest.TestCase):
client_call.invoke(self.client_completion_queue, metadata_tag, finish_tag)
self.server.service(service_tag)
- service_accepted = self.server_completion_queue.get(_FUTURE)
+ service_accepted = self.server_events.get()
server_call = service_accepted.service_acceptance.call
server_call.accept(self.server_completion_queue, finish_tag)
server_call.premetadata()
- metadata_accepted = self.client_completion_queue.get(_FUTURE)
+ metadata_accepted = self.client_events.get()
self.assertIsNotNone(metadata_accepted)
for datum in test_data:
client_call.write(datum, write_tag)
- write_accepted = self.client_completion_queue.get(_FUTURE)
+ write_accepted = self.client_events.get()
server_call.read(read_tag)
- read_accepted = self.server_completion_queue.get(_FUTURE)
+ read_accepted = self.server_events.get()
server_data.append(read_accepted.bytes)
server_call.write(read_accepted.bytes, write_tag)
- write_accepted = self.server_completion_queue.get(_FUTURE)
+ write_accepted = self.server_events.get()
self.assertIsNotNone(write_accepted)
client_call.read(read_tag)
- read_accepted = self.client_completion_queue.get(_FUTURE)
+ read_accepted = self.client_events.get()
client_data.append(read_accepted.bytes)
client_call.cancel()
@@ -373,8 +393,8 @@ class CancellationTest(unittest.TestCase):
server_call.read(read_tag)
- server_terminal_event_one = self.server_completion_queue.get(_FUTURE)
- server_terminal_event_two = self.server_completion_queue.get(_FUTURE)
+ server_terminal_event_one = self.server_events.get()
+ server_terminal_event_two = self.server_events.get()
if server_terminal_event_one.kind == _low.Event.Kind.READ_ACCEPTED:
read_accepted = server_terminal_event_one
rpc_accepted = server_terminal_event_two
@@ -388,7 +408,7 @@ class CancellationTest(unittest.TestCase):
self.assertEqual(_low.Event.Kind.FINISH, rpc_accepted.kind)
self.assertEqual(_low.Status(_low.Code.CANCELLED, ''), rpc_accepted.status)
- finish_event = self.client_completion_queue.get(_FUTURE)
+ finish_event = self.client_events.get()
self.assertEqual(_low.Event.Kind.FINISH, finish_event.kind)
self.assertEqual(_low.Status(_low.Code.CANCELLED, 'Cancelled'),
finish_event.status)
diff --git a/src/python/src/grpc/_adapter/_low_test.py b/src/python/src/grpc/_adapter/_low_test.py
index 8a9f1a0c49..268e5fe765 100644
--- a/src/python/src/grpc/_adapter/_low_test.py
+++ b/src/python/src/grpc/_adapter/_low_test.py
@@ -27,6 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+import threading
import time
import unittest
@@ -34,6 +35,33 @@ from grpc._adapter import _types
from grpc._adapter import _low
+def WaitForEvents(completion_queues, deadline):
+ """
+ Args:
+ completion_queues: list of completion queues to wait for events on
+ deadline: absolute deadline to wait until
+
+ Returns:
+ a sequence of events of length len(completion_queues).
+ """
+
+ results = [None] * len(completion_queues)
+ lock = threading.Lock()
+ threads = []
+ def set_ith_result(i, completion_queue):
+ result = completion_queue.next(deadline)
+ with lock:
+ print i, completion_queue, result, time.time() - deadline
+ results[i] = result
+ for i, completion_queue in enumerate(completion_queues):
+ thread = threading.Thread(target=set_ith_result,
+ args=[i, completion_queue])
+ thread.start()
+ threads.append(thread)
+ for thread in threads:
+ thread.join()
+ return results
+
class InsecureServerInsecureClient(unittest.TestCase):
def setUp(self):
@@ -95,7 +123,8 @@ class InsecureServerInsecureClient(unittest.TestCase):
], client_call_tag)
self.assertEquals(_types.CallError.OK, client_start_batch_result)
- request_event = self.server_completion_queue.next(DEADLINE)
+ client_no_event, request_event, = WaitForEvents([self.client_completion_queue, self.server_completion_queue], time.time() + 2)
+ self.assertEquals(client_no_event, None)
self.assertEquals(_types.EventType.OP_COMPLETE, request_event.type)
self.assertIsInstance(request_event.call, _low.Call)
self.assertIs(server_request_tag, request_event.tag)
@@ -118,8 +147,7 @@ class InsecureServerInsecureClient(unittest.TestCase):
], server_call_tag)
self.assertEquals(_types.CallError.OK, server_start_batch_result)
- client_event = self.client_completion_queue.next(DEADLINE)
- server_event = self.server_completion_queue.next(DEADLINE)
+ client_event, server_event, = WaitForEvents([self.client_completion_queue, self.server_completion_queue], time.time() + 1)
self.assertEquals(6, len(client_event.results))
found_client_op_types = set()
diff --git a/src/ruby/.rubocop_todo.yml b/src/ruby/.rubocop_todo.yml
index c35e970df6..05db404582 100644
--- a/src/ruby/.rubocop_todo.yml
+++ b/src/ruby/.rubocop_todo.yml
@@ -12,7 +12,7 @@ Metrics/AbcSize:
# Offense count: 3
# Configuration parameters: CountComments.
Metrics/ClassLength:
- Max: 192
+ Max: 200
# Offense count: 35
# Configuration parameters: CountComments.
diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb
index 16fb1b199d..da4caa842b 100755
--- a/src/ruby/bin/interop/interop_client.rb
+++ b/src/ruby/bin/interop/interop_client.rb
@@ -284,7 +284,8 @@ class NamedTests
op = @stub.full_duplex_call(ppp.each_item, return_op: true)
ppp.canceller_op = op # causes ppp to cancel after the 1st message
op.execute.each { |r| ppp.queue.push(r) }
- assert(op.cancelled, 'call operation should be CANCELLED')
+ op.wait
+ assert(op.cancelled, 'call operation was not CANCELLED')
p 'OK: cancel_after_first_response'
end
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index 0ff8bb9aa7..6dd0234489 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -89,7 +89,7 @@ $CFLAGS << ' -Wno-return-type '
$CFLAGS << ' -Wall '
$CFLAGS << ' -pedantic '
-$LDFLAGS << ' -lgrpc -lgpr -ldl'
+$LDFLAGS << ' -lgrpc -lgpr -lz -ldl'
crash('need grpc lib') unless have_library('grpc', 'grpc_channel_destroy')
have_library('grpc', 'grpc_channel_destroy')
diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb
index 3814ef34b4..215c0069a3 100644
--- a/src/ruby/lib/grpc/generic/active_call.rb
+++ b/src/ruby/lib/grpc/generic/active_call.rb
@@ -120,6 +120,7 @@ module GRPC
@started = started
@unmarshal = unmarshal
@metadata_tag = metadata_tag
+ @op_notifier = nil
end
# output_metadata are provides access to hash that can be used to
@@ -148,6 +149,7 @@ module GRPC
# operation provides a restricted view of this ActiveCall for use as
# a Operation.
def operation
+ @op_notifier = Notifier.new
Operation.new(self)
end
@@ -167,6 +169,7 @@ module GRPC
batch_result = @call.run_batch(@cq, self, INFINITE_FUTURE, ops)
return unless assert_finished
@call.status = batch_result.status
+ op_is_done
batch_result.check_status
end
@@ -184,6 +187,7 @@ module GRPC
end
end
@call.status = batch_result.status
+ op_is_done
batch_result.check_status
end
@@ -415,7 +419,7 @@ module GRPC
def bidi_streamer(requests, **kw, &blk)
start_call(**kw) unless @started
bd = BidiCall.new(@call, @cq, @marshal, @unmarshal, @deadline)
- bd.run_on_client(requests, &blk)
+ bd.run_on_client(requests, @op_notifier, &blk)
end
# run_server_bidi orchestrates a BiDi stream processing on a server.
@@ -434,6 +438,19 @@ module GRPC
bd.run_on_server(gen_each_reply)
end
+ # Waits till an operation completes
+ def wait
+ return if @op_notifier.nil?
+ GRPC.logger.debug("active_call.wait: on #{@op_notifier}")
+ @op_notifier.wait
+ end
+
+ # Signals that an operation is done
+ def op_is_done
+ return if @op_notifier.nil?
+ @op_notifier.notify(self)
+ end
+
private
# Starts the call if not already started
@@ -468,6 +485,6 @@ module GRPC
# Operation limits access to an ActiveCall's methods for use as
# a Operation on the client.
Operation = view_class(:cancel, :cancelled, :deadline, :execute,
- :metadata, :status, :start_call)
+ :metadata, :status, :start_call, :wait)
end
end
diff --git a/src/ruby/lib/grpc/generic/bidi_call.rb b/src/ruby/lib/grpc/generic/bidi_call.rb
index 489dd5162a..3b0c71395c 100644
--- a/src/ruby/lib/grpc/generic/bidi_call.rb
+++ b/src/ruby/lib/grpc/generic/bidi_call.rb
@@ -66,6 +66,7 @@ module GRPC
@cq = q
@deadline = deadline
@marshal = marshal
+ @op_notifier = nil # signals completion on clients
@readq = Queue.new
@unmarshal = unmarshal
end
@@ -76,8 +77,10 @@ module GRPC
# block that can be invoked with each response.
#
# @param requests the Enumerable of requests to send
+ # @op_notifier a Notifier used to signal completion
# @return an Enumerator of requests to yield
- def run_on_client(requests, &blk)
+ def run_on_client(requests, op_notifier, &blk)
+ @op_notifier = op_notifier
@enq_th = Thread.new { write_loop(requests) }
@loop_th = start_read_loop
each_queued_msg(&blk)
@@ -105,6 +108,13 @@ module GRPC
END_OF_READS = :end_of_reads
END_OF_WRITES = :end_of_writes
+ # signals that bidi operation is complete
+ def notify_done
+ return unless @op_notifier
+ GRPC.logger.debug("bidi-notify-done: notifying #{@op_notifier}")
+ @op_notifier.notify(self)
+ end
+
# each_queued_msg yields each message on this instances readq
#
# - messages are added to the readq by #read_loop
@@ -143,11 +153,13 @@ module GRPC
@call.status = batch_result.status
batch_result.check_status
GRPC.logger.debug("bidi-write-loop: done status #{@call.status}")
+ notify_done
end
GRPC.logger.debug('bidi-write-loop: finished')
rescue StandardError => e
GRPC.logger.warn('bidi-write-loop: failed')
GRPC.logger.warn(e)
+ notify_done
raise e
end
diff --git a/src/ruby/lib/grpc/logconfig.rb b/src/ruby/lib/grpc/logconfig.rb
index 96812170ba..e9b4aa3c95 100644
--- a/src/ruby/lib/grpc/logconfig.rb
+++ b/src/ruby/lib/grpc/logconfig.rb
@@ -38,6 +38,6 @@ Logging.logger.root.appenders = Logging.appenders.stdout
Logging.logger.root.level = :info
# TODO: provide command-line configuration for logging
-Logging.logger['GRPC'].level = :debug
+Logging.logger['GRPC'].level = :info
Logging.logger['GRPC::ActiveCall'].level = :info
Logging.logger['GRPC::BidiCall'].level = :info
diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb
index 53265c792c..028fea5a4c 100644
--- a/src/ruby/lib/grpc/version.rb
+++ b/src/ruby/lib/grpc/version.rb
@@ -29,5 +29,5 @@
# GRPC contains the General RPC module.
module GRPC
- VERSION = '0.9.3'
+ VERSION = '0.9.4'
end
diff --git a/src/ruby/spec/client_server_spec.rb b/src/ruby/spec/client_server_spec.rb
index b22e510a6a..0e85441209 100644
--- a/src/ruby/spec/client_server_spec.rb
+++ b/src/ruby/spec/client_server_spec.rb
@@ -71,6 +71,12 @@ shared_examples 'basic GRPC message delivery is OK' do
it 'servers receive requests from clients and can respond' do
call = new_client_call
+ server_call = nil
+
+ server_thread = Thread.new do
+ server_call = server_allows_client_to_proceed
+ end
+
client_ops = {
CallOps::SEND_INITIAL_METADATA => {},
CallOps::SEND_MESSAGE => sent_message
@@ -81,7 +87,7 @@ shared_examples 'basic GRPC message delivery is OK' do
expect(batch_result.send_message).to be true
# confirm the server can read the inbound message
- server_call = server_allows_client_to_proceed
+ server_thread.join
server_ops = {
CallOps::RECV_MESSAGE => nil
}
@@ -92,6 +98,12 @@ shared_examples 'basic GRPC message delivery is OK' do
it 'responses written by servers are received by the client' do
call = new_client_call
+ server_call = nil
+
+ server_thread = Thread.new do
+ server_call = server_allows_client_to_proceed
+ end
+
client_ops = {
CallOps::SEND_INITIAL_METADATA => {},
CallOps::SEND_MESSAGE => sent_message
@@ -102,7 +114,7 @@ shared_examples 'basic GRPC message delivery is OK' do
expect(batch_result.send_message).to be true
# confirm the server can read the inbound message
- server_call = server_allows_client_to_proceed
+ server_thread.join
server_ops = {
CallOps::RECV_MESSAGE => nil,
CallOps::SEND_MESSAGE => reply_text
@@ -115,6 +127,12 @@ shared_examples 'basic GRPC message delivery is OK' do
it 'servers can ignore a client write and send a status' do
call = new_client_call
+ server_call = nil
+
+ server_thread = Thread.new do
+ server_call = server_allows_client_to_proceed
+ end
+
client_ops = {
CallOps::SEND_INITIAL_METADATA => {},
CallOps::SEND_MESSAGE => sent_message
@@ -126,7 +144,7 @@ shared_examples 'basic GRPC message delivery is OK' do
# confirm the server can read the inbound message
the_status = Struct::Status.new(StatusCodes::OK, 'OK')
- server_call = server_allows_client_to_proceed
+ server_thread.join
server_ops = {
CallOps::SEND_STATUS_FROM_SERVER => the_status
}
@@ -138,6 +156,12 @@ shared_examples 'basic GRPC message delivery is OK' do
it 'completes calls by sending status to client and server' do
call = new_client_call
+ server_call = nil
+
+ server_thread = Thread.new do
+ server_call = server_allows_client_to_proceed
+ end
+
client_ops = {
CallOps::SEND_INITIAL_METADATA => {},
CallOps::SEND_MESSAGE => sent_message
@@ -149,7 +173,7 @@ shared_examples 'basic GRPC message delivery is OK' do
# confirm the server can read the inbound message and respond
the_status = Struct::Status.new(StatusCodes::OK, 'OK', {})
- server_call = server_allows_client_to_proceed
+ server_thread.join
server_ops = {
CallOps::RECV_MESSAGE => nil,
CallOps::SEND_MESSAGE => reply_text,
@@ -218,6 +242,11 @@ shared_examples 'GRPC metadata delivery works OK' do
it 'sends all the metadata pairs when keys and values are valid' do
@valid_metadata.each do |md|
+ recvd_rpc = nil
+ rcv_thread = Thread.new do
+ recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ end
+
call = new_client_call
client_ops = {
CallOps::SEND_INITIAL_METADATA => md
@@ -227,7 +256,7 @@ shared_examples 'GRPC metadata delivery works OK' do
expect(batch_result.send_metadata).to be true
# confirm the server can receive the client metadata
- recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ rcv_thread.join
expect(recvd_rpc).to_not eq nil
recvd_md = recvd_rpc.metadata
replace_symbols = Hash[md.each_pair.collect { |x, y| [x.to_s, y] }]
@@ -254,6 +283,11 @@ shared_examples 'GRPC metadata delivery works OK' do
it 'raises an exception if a metadata key is invalid' do
@bad_keys.each do |md|
+ recvd_rpc = nil
+ rcv_thread = Thread.new do
+ recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ end
+
call = new_client_call
# client signals that it's done sending metadata to allow server to
# respond
@@ -263,7 +297,7 @@ shared_examples 'GRPC metadata delivery works OK' do
call.run_batch(@client_queue, @client_tag, deadline, client_ops)
# server gets the invocation
- recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ rcv_thread.join
expect(recvd_rpc).to_not eq nil
server_ops = {
CallOps::SEND_INITIAL_METADATA => md
@@ -277,6 +311,11 @@ shared_examples 'GRPC metadata delivery works OK' do
end
it 'sends an empty hash if no metadata is added' do
+ recvd_rpc = nil
+ rcv_thread = Thread.new do
+ recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ end
+
call = new_client_call
# client signals that it's done sending metadata to allow server to
# respond
@@ -286,7 +325,7 @@ shared_examples 'GRPC metadata delivery works OK' do
call.run_batch(@client_queue, @client_tag, deadline, client_ops)
# server gets the invocation but sends no metadata back
- recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ rcv_thread.join
expect(recvd_rpc).to_not eq nil
server_call = recvd_rpc.call
server_ops = {
@@ -305,6 +344,11 @@ shared_examples 'GRPC metadata delivery works OK' do
it 'sends all the pairs when keys and values are valid' do
@valid_metadata.each do |md|
+ recvd_rpc = nil
+ rcv_thread = Thread.new do
+ recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ end
+
call = new_client_call
# client signals that it's done sending metadata to allow server to
# respond
@@ -314,7 +358,7 @@ shared_examples 'GRPC metadata delivery works OK' do
call.run_batch(@client_queue, @client_tag, deadline, client_ops)
# server gets the invocation but sends no metadata back
- recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline)
+ rcv_thread.join
expect(recvd_rpc).to_not eq nil
server_call = recvd_rpc.call
server_ops = {
diff --git a/templates/BUILD.template b/templates/BUILD.template
index 075c399a18..dffdc1dddd 100644
--- a/templates/BUILD.template
+++ b/templates/BUILD.template
@@ -2,6 +2,8 @@
# This currently builds C and C++ code.
# This file has been automatically generated from a template file.
# Please look at the templates directory instead.
+# This file can be regenerated from the template by running
+# tools/buildgen/generate_projects.sh
# Copyright 2015, Google Inc.
# All rights reserved.
@@ -61,6 +63,12 @@ ${cc_library(lib)}
% endif
% endfor
+% for lib in libs:
+% if lib.name in ("grpc", "gpr"):
+${objc_library(lib)}
+% endif
+% endfor
+
% for tgt in targets:
% if tgt.build == 'protoc':
${cc_binary(tgt)}
@@ -95,6 +103,40 @@ cc_library(
)
</%def>
+<%def name="objc_library(lib)">
+objc_library(
+ name = "${lib.name}_objc",
+ srcs = [
+% for src in lib.src:
+ "${src}",
+% endfor
+ ],
+ hdrs = [
+% for hdr in lib.get("public_headers", []):
+ "${hdr}",
+% endfor
+% for hdr in lib.get("headers", []):
+ "${hdr}",
+% endfor
+ ],
+ includes = [
+ "include",
+ ".",
+ ],
+ deps = [
+% for dep in lib.get("deps", []):
+ ":${dep}_objc",
+% endfor
+% if lib.get('secure', 'no') == 'yes':
+ "//external:libssl_objc",
+% endif
+ ],
+% if lib.get("baselib", false):
+ sdk_dylibs = ["libz"],
+% endif
+)
+</%def>
+
<%def name="cc_binary(tgt)">
cc_binary(
name = "${tgt.name}",
@@ -110,3 +152,74 @@ cc_binary(
],
)
</%def>
+
+objc_path = "src/objective-c"
+
+rx_library_path = objc_path + "/RxLibrary"
+
+objc_library(
+ name = "rx_library",
+ hdrs = glob([
+ rx_library_path + "/*.h",
+ rx_library_path + "/transformations/*.h",
+ ]),
+ srcs = glob([
+ rx_library_path + "/*.m",
+ rx_library_path + "/transformations/*.m",
+ ]),
+ includes = [objc_path],
+ deps = [
+ ":rx_library_private",
+ ],
+)
+
+objc_library(
+ name = "rx_library_private",
+ hdrs = glob([rx_library_path + "/private/*.h"]),
+ srcs = glob([rx_library_path + "/private/*.m"]),
+ visibility = ["//visibility:private"],
+)
+
+objc_client_path = objc_path + "/GRPCClient"
+
+objc_library(
+ name = "grpc_client",
+ hdrs = glob([
+ objc_client_path + "/*.h",
+ objc_client_path + "/private/*.h",
+ ]),
+ srcs = glob([
+ objc_client_path + "/*.m",
+ objc_client_path + "/private/*.m",
+ ]),
+ includes = [objc_path],
+ bundles = [":gRPCCertificates"],
+ deps = [
+ ":grpc_objc",
+ ":rx_library",
+ ],
+)
+
+objc_bundle_library(
+ # The choice of name is signicant here, since it determines the bundle name.
+ name = "gRPCCertificates",
+ resources = ["etc/roots.pem"],
+)
+
+proto_objc_rpc_path = objc_path + "/ProtoRPC"
+
+objc_library(
+ name = "proto_objc_rpc",
+ hdrs = glob([
+ proto_objc_rpc_path + "/*.h",
+ ]),
+ srcs = glob([
+ proto_objc_rpc_path + "/*.m",
+ ]),
+ includes = [objc_path],
+ deps = [
+ ":grpc_client",
+ ":rx_library",
+ "//external:protobuf_objc",
+ ],
+)
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 3f8686f50c..f0cd0d97e3 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -2,6 +2,8 @@
# This currently builds C and C++ code.
# This file has been automatically generated from a template file.
# Please look at the templates directory instead.
+# This file can be regenerated from the template by running
+# tools/buildgen/generate_projects.sh
# Copyright 2015, Google Inc.
# All rights reserved.
@@ -157,7 +159,7 @@ CC_tsan = clang
CXX_tsan = clang++
LD_tsan = clang
LDXX_tsan = clang++
-CPPFLAGS_tsan = -O1 -fsanitize=thread -fno-omit-frame-pointer
+CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer
LDFLAGS_tsan = -fsanitize=thread
DEFINES_tsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
@@ -169,7 +171,7 @@ LD_asan = clang
LDXX_asan = clang++
CPPFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer
LDFLAGS_asan = -fsanitize=address
-DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=5
+DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3
VALID_CONFIG_msan = 1
REQUIRE_CUSTOM_LIBRARIES_msan = 1
@@ -180,7 +182,7 @@ LDXX_msan = clang++-libc++
CPPFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
OPENSSL_CFLAGS_msan = -DPURIFY
LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
-DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20
+DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=4
VALID_CONFIG_ubsan = 1
REQUIRE_CUSTOM_LIBRARIES_ubsan = 1
@@ -191,7 +193,7 @@ LDXX_ubsan = clang++
CPPFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer
OPENSSL_CFLAGS_ubsan = -DPURIFY
LDFLAGS_ubsan = -fsanitize=undefined
-DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10
+DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3
VALID_CONFIG_gcov = 1
CC_gcov = gcc
@@ -343,6 +345,32 @@ HOST_LDLIBS = $(LDLIBS)
# These are automatically computed variables.
# There shouldn't be any need to change anything from now on.
+HAS_PKG_CONFIG = $(shell command -v pkg-config >/dev/null 2>&1 && echo true || echo false)
+
+PC_TEMPLATE = prefix=$(prefix)\n\
+exec_prefix=${'\$${prefix}'}\n\
+includedir=${'\$${prefix}'}/include\n\
+libdir=${'\$${exec_prefix}'}/lib\n\
+\n\
+Name: $(PC_NAME)\n\
+Description: $(PC_DESCRIPTION)\n\
+Version: $(VERSION)\n\
+Cflags: -I${'\$${includedir}'} $(PC_CFLAGS)\n\
+Requires.private: $(PC_REQUIRES_PRIVATE)\n\
+Libs: -L${'\$${libdir}'}\n\
+Libs.private: $(PC_LIBS_PRIVATE)
+
+# gpr .pc file
+PC_NAME = gRPC Portable Runtime
+PC_DESCRIPTION = gRPC Portable Runtime
+PC_CFLAGS = -pthread
+PC_REQUIRES_PRIVATE =
+PC_LIBS_PRIVATE = -lpthread
+ifeq ($(SYSTEM),Darwin)
+PC_LIBS_PRIVATE += -lrt
+endif
+GPR_PC_FILE := $(PC_TEMPLATE)
+
ifeq ($(SYSTEM),MINGW32)
SHARED_EXT = dll
endif
@@ -367,6 +395,13 @@ ifeq ($(SYSTEM),Darwin)
OPENSSL_REQUIRES_DL = true
endif
+ifeq ($(HAS_PKG_CONFIG),true)
+OPENSSL_ALPN_CHECK_CMD = pkg-config --atleast-version=1.0.2 openssl
+ZLIB_CHECK_CMD = pkg-config --exists zlib
+PERFTOOLS_CHECK_CMD = pkg-config --exists profiler
+PROTOBUF_CHECK_CMD = pkg-config --atleast-version=3.0.0-alpha-3 protobuf
+else # HAS_PKG_CONFIG
+
ifeq ($(SYSTEM),MINGW32)
OPENSSL_LIBS = ssl32 eay32
else
@@ -377,15 +412,18 @@ OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/ope
ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS)
PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS)
PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS)
-PROTOC_CHECK_CMD = which protoc > /dev/null
-PROTOC_CHECK_VERSION_CMD = protoc --version | grep -q libprotoc.3
-DTRACE_CHECK_CMD = which dtrace > /dev/null
-SYSTEMTAP_HEADERS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/systemtap.c $(LDFLAGS)
ifeq ($(OPENSSL_REQUIRES_DL),true)
OPENSSL_ALPN_CHECK_CMD += -ldl
endif
+endif # HAS_PKG_CONFIG
+
+PROTOC_CHECK_CMD = which protoc > /dev/null
+PROTOC_CHECK_VERSION_CMD = protoc --version | grep -q libprotoc.3
+DTRACE_CHECK_CMD = which dtrace > /dev/null
+SYSTEMTAP_HEADERS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/systemtap.c $(LDFLAGS)
+
ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_SYSTEM_PERFTOOLS),true)
@@ -446,6 +484,9 @@ else
HAS_EMBEDDED_PROTOBUF = true
endif
+PC_REQUIRES_GRPC = gpr
+PC_LIBS_GRPC =
+
ifeq ($(HAS_SYSTEM_ZLIB),false)
ifeq ($(HAS_EMBEDDED_ZLIB),true)
ZLIB_DEP = $(LIBDIR)/$(CONFIG)/zlib/libz.a
@@ -454,9 +495,41 @@ LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib
else
DEP_MISSING += zlib
endif
+else
+ifeq ($(HAS_PKG_CONFIG),true)
+CPPFLAGS += $(shell pkg-config --cflags zlib)
+LDFLAGS += $(shell pkg-config --libs-only-L zlib)
+PC_REQUIRES_GRPC += zlib
+else
+PC_LIBS_GRPC += -lz
+endif
endif
-ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),false)
+OPENSSL_PKG_CONFIG = false
+
+PC_REQUIRES_SECURE =
+PC_LIBS_SECURE =
+
+ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true)
+ifeq ($(HAS_PKG_CONFIG),true)
+OPENSSL_PKG_CONFIG = true
+PC_REQUIRES_SECURE = openssl
+CPPFLAGS := $(shell pkg-config --cflags openssl) $(CPPFLAGS)
+LDFLAGS_OPENSSL_PKG_CONFIG = $(shell pkg-config --libs-only-L openssl)
+ifeq ($(SYSTEM),Linux)
+ifneq ($(LDFLAGS_OPENSSL_PKG_CONFIG),)
+LDFLAGS_OPENSSL_PKG_CONFIG += $(shell pkg-config --libs-only-L openssl | sed s/L/Wl,-rpath,/)
+endif
+endif
+LDFLAGS := $(LDFLAGS_OPENSSL_PKG_CONFIG) $(LDFLAGS)
+else
+LIBS_SECURE = $(OPENSSL_LIBS)
+ifeq ($(OPENSSL_REQUIRES_DL),true)
+LIBS_SECURE += dl
+PC_LIBS_SECURE = $(addprefix -l, $(LIBS_SECURE))
+endif
+endif
+else
ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true)
OPENSSL_DEP = $(LIBDIR)/$(CONFIG)/openssl/libssl.a
OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/openssl/libcrypto.a
@@ -469,16 +542,50 @@ endif
else
NO_SECURE = true
endif
-else
-LIBS_SECURE = $(OPENSSL_LIBS)
-ifeq ($(OPENSSL_REQUIRES_DL),true)
-LIBS_SECURE += dl
-endif
endif
+ifeq ($(OPENSSL_PKG_CONFIG),true)
+LDLIBS_SECURE += $(shell pkg-config --libs-only-l openssl)
+else
LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
+endif
-ifeq ($(HAS_SYSTEM_PROTOBUF),false)
+# grpc .pc file
+PC_NAME = gRPC
+PC_DESCRIPTION = high performance general RPC framework
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) $(PC_LIBS_SECURE)
+GRPC_PC_FILE := $(PC_TEMPLATE)
+
+# gprc_unsecure .pc file
+PC_NAME = gRPC unsecure
+PC_DESCRIPTION = high performance general RPC framework without SSL
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPC)
+GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE)
+
+PROTOBUF_PKG_CONFIG = false
+
+PC_REQUIRES_GRPCXX =
+PC_LIBS_GRPCXX =
+
+ifeq ($(HAS_SYSTEM_PROTOBUF),true)
+ifeq ($(HAS_PKG_CONFIG),true)
+PROTOBUF_PKG_CONFIG = true
+PC_REQUIRES_GRPCXX = protobuf
+CPPFLAGS := $(shell pkg-config --cflags protobuf) $(CPPFLAGS)
+LDFLAGS_PROTOBUF_PKG_CONFIG = $(shell pkg-config --libs-only-L protobuf)
+ifeq ($(SYSTEM),Linux)
+ifneq ($(LDFLAGS_PROTOBUF_PKG_CONFIG),)
+LDFLAGS_PROTOBUF_PKG_CONFIG += $(shell pkg-config --libs-only-L protobuf | sed s/L/Wl,-rpath,/)
+endif
+endif
+else
+PC_LIBS_GRPCXX = -lprotobuf
+endif
+else
ifeq ($(HAS_EMBEDDED_PROTOBUF),true)
PROTOBUF_DEP = $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a
CPPFLAGS := -Ithird_party/protobuf/src $(CPPFLAGS)
@@ -487,15 +594,35 @@ PROTOC = $(BINDIR)/$(CONFIG)/protobuf/protoc
else
NO_PROTOBUF = true
endif
-else
endif
LIBS_PROTOBUF = protobuf
LIBS_PROTOC = protoc protobuf
-LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF))
HOST_LDLIBS_PROTOC += $(addprefix -l, $(LIBS_PROTOC))
+ifeq ($(PROTOBUF_PKG_CONFIG),true)
+LDLIBS_PROTOBUF += $(shell pkg-config --libs-only-l protobuf)
+else
+LDLIBS_PROTOBUF += $(addprefix -l, $(LIBS_PROTOBUF))
+endif
+
+# grpc++ .pc file
+PC_NAME = gRPC++
+PC_DESCRIPTION = C++ wrapper for gRPC
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = grpc $(PC_REQUIRES_GRPCXX)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX)
+GRPCXX_PC_FILE := $(PC_TEMPLATE)
+
+# grpc++_unsecure .pc file
+PC_NAME = gRPC++ unsecure
+PC_DESCRIPTION = C++ wrapper for gRPC without SSL
+PC_CFLAGS =
+PC_REQUIRES_PRIVATE = grpc_unsecure $(PC_REQUIRES_GRPCXX)
+PC_LIBS_PRIVATE = $(PC_LIBS_GRPCXX)
+GRPCXX_UNSECURE_PC_FILE := $(PC_TEMPLATE)
+
ifeq ($(MAKECMDGOALS),clean)
NO_DEPS = true
endif
@@ -686,7 +813,7 @@ $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
static: static_c static_cxx
-static_c: \
+static_c: pc_c pc_c_unsecure \
% for lib in libs:
% if lib.build == 'all' and lib.language == 'c':
$(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
@@ -694,7 +821,7 @@ static_c: \
% endfor
-static_cxx: \
+static_cxx: pc_cxx pc_cxx_unsecure pc_gpr\
% for lib in libs:
% if lib.build == 'all' and lib.language == 'c++':
$(LIBDIR)/$(CONFIG)/lib${lib.name}.a\
@@ -704,7 +831,7 @@ static_cxx: \
shared: shared_c shared_cxx
-shared_c: \
+shared_c: pc_c pc_c_unsecure pc_gpr\
% for lib in libs:
% if lib.build == 'all' and lib.language == 'c':
$(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
@@ -712,7 +839,7 @@ shared_c: \
% endfor
-shared_cxx: \
+shared_cxx: pc_cxx pc_cxx_unsecure \
% for lib in libs:
% if lib.build == 'all' and lib.language == 'c++':
$(LIBDIR)/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
@@ -740,6 +867,15 @@ privatelibs_c: \
% endif
% endfor
+pc_gpr: $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc
+
+pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc
+
+pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc
+
+pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc
+
+pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc
privatelibs_cxx: \
% for lib in libs:
@@ -812,9 +948,20 @@ test_python: static_c
$(Q) tools/run_tests/run_tests.py -lpython -c$(CONFIG)
-tools: privatelibs\
+tools: tools_c tools_cxx
+
+
+tools_c: privatelibs_c\
% for tgt in targets:
-% if tgt.build == 'tool':
+% if tgt.build == 'tool' and not tgt.language=='c++':
+ $(BINDIR)/$(CONFIG)/${tgt.name}\
+% endif
+% endfor
+
+
+tools_cxx: privatelibs_cxx\
+% for tgt in targets:
+% if tgt.build == 'tool' and tgt.language=='c++':
$(BINDIR)/$(CONFIG)/${tgt.name}\
% endif
% endfor
@@ -901,6 +1048,31 @@ ifeq ($(CONFIG),opt)
% endfor
endif
+$(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GPR_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPC_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPC_UNSECURE_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPCXX_PC_FILE)" >$@
+
+$(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc:
+ $(E) "[MAKE] Generating $@"
+ $(Q) mkdir -p $(@D)
+ $(Q) echo -e "$(GRPCXX_UNSECURE_PC_FILE)" >$@
+
% for p in protos:
ifeq ($(NO_PROTOC),true)
$(GENDIR)/${p}.pb.cc: protoc_dep_error
@@ -975,7 +1147,7 @@ install-headers_cxx:
install-static: install-static_c install-static_cxx
-install-static_c: static_c strip-static_c
+install-static_c: static_c strip-static_c install-pkg-config_c
% for lib in libs:
% if lib.language == "c":
% if lib.build == "all":
@@ -986,7 +1158,7 @@ install-static_c: static_c strip-static_c
% endif
% endfor
-install-static_cxx: static_cxx strip-static_cxx
+install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx
% for lib in libs:
% if lib.language == "c++":
% if lib.build == "all":
@@ -1025,10 +1197,10 @@ endif
endif
</%def>
-install-shared_c: shared_c strip-shared_c
+install-shared_c: shared_c strip-shared_c install-pkg-config_c
${install_shared("c")}
-install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c
+install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx
${install_shared("c++")}
install-shared_csharp: shared_csharp strip-shared_csharp
@@ -1047,6 +1219,19 @@ else
% endfor
endif
+install-pkg-config_c: pc_gpr pc_c pc_c_unsecure
+ $(E) "[INSTALL] Installing C pkg-config files"
+ $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/gpr.pc $(prefix)/lib/pkgconfig/gpr.pc
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc $(prefix)/lib/pkgconfig/grpc.pc
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc $(prefix)/lib/pkgconfig/grpc_unsecure.pc
+
+install-pkg-config_cxx: pc_cxx pc_cxx_unsecure
+ $(E) "[INSTALL] Installing C++ pkg-config files"
+ $(Q) $(INSTALL) -d $(prefix)/lib/pkgconfig
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc $(prefix)/lib/pkgconfig/grpc++.pc
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc $(prefix)/lib/pkgconfig/grpc++_unsecure.pc
+
install-certs: etc/roots.pem
$(E) "[INSTALL] Installing root certificates"
$(Q) $(INSTALL) -d $(prefix)/share/grpc
diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template
index 84716c81e1..495ea49c9c 100644
--- a/templates/gRPC.podspec.template
+++ b/templates/gRPC.podspec.template
@@ -1,13 +1,64 @@
+# GRPC CocoaPods podspec
+# This file has been automatically generated from a template file.
+# Please look at the templates directory instead.
+# This file can be regenerated from the template by running
+# tools/buildgen/generate_projects.sh
+
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
<%!
bad_header_names = ('time.h', 'string.h')
def fix_header_name(name):
split_name = name.split('/')
if split_name[-1] in bad_header_names:
- return '/'.join(split_name[:-1] + ['grpc_' + split_name[-1]])
- else:
- return name
-%>
+ split_name[-1] = 'grpc_' + split_name[-1]
+ if split_name[0] == 'include':
+ split_name = split_name[1:]
+ return '/'.join(split_name)
+def grpc_files(libs):
+ out = []
+ for lib in libs:
+ if lib.name in ("grpc", "gpr"):
+ out.extend(fix_header_name(h) for h in lib.get('headers', []))
+ out.extend(fix_header_name(h) for h in lib.get('public_headers', []))
+ out.extend(lib.get('src', []))
+ return out;
+
+def grpc_private_headers(libs):
+ out = []
+ for lib in libs:
+ if lib.name in ("grpc", "gpr"):
+ out.extend(lib.get('headers', []))
+ return out
+%>
Pod::Spec.new do |s|
s.name = 'gRPC'
s.version = '0.6.0'
@@ -23,54 +74,27 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.8'
s.requires_arc = true
+ objc_dir = 'src/objective-c'
+
# Reactive Extensions library for iOS.
- s.subspec 'RxLibrary' do |rs|
- rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
- 'src/objective-c/RxLibrary/transformations/*.{h,m}',
- 'src/objective-c/RxLibrary/private/*.{h,m}'
- rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
+ s.subspec 'RxLibrary' do |ss|
+ src_dir = "#{objc_dir}/RxLibrary"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
end
# Core cross-platform gRPC library, written in C.
- s.subspec 'C-Core' do |cs|
- cs.source_files = \
-% for lib in libs:
-% if lib.name in ("grpc", "gpr"):
-% for hdr in lib.get("headers", []):
-'${fix_header_name(hdr)}', \
-% endfor
-% for hdr in lib.get("public_headers", []):
-'${fix_header_name(hdr)}', \
-% endfor
-% for src in lib.src:
-'${src}', \
-% endfor
-% endif
-% endfor
-
- cs.private_header_files = \
-% for lib in libs:
-% if lib.name in ("grpc", "gpr"):
-% for hdr in lib.get("headers", []):
-'${hdr}', \
-% endfor
-% endif
-% endfor
-
- cs.header_mappings_dir = '.'
- # The core library includes its headers as either "src/core/..." or "grpc/...", meaning we have
- # to tell XCode to look for headers under the "include" subdirectory too.
- #
- # TODO(jcanizales): Instead of doing this, during installation move everything under
- # "include/grpc" one directory up. The directory names under PODS_ROOT are implementation
- # details of Cocoapods, and have changed in the past, breaking this podspec.
- cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC" ' +
- '"$(PODS_ROOT)/Headers/Private/gRPC/include"' }
- cs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
-
- cs.requires_arc = false
- cs.libraries = 'z'
- cs.dependency 'OpenSSL', '~> 1.0.200'
+ s.subspec 'C-Core' do |ss|
+ ss.source_files = ${(',\n' + 22*' ').join('\'%s\'' % f for f in grpc_files(libs))}
+
+ ss.private_header_files = ${(',\n' + 30*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
+
+ ss.header_mappings_dir = '.'
+
+ ss.requires_arc = false
+ ss.libraries = 'z'
+ ss.dependency 'OpenSSL', '~> 1.0.200'
end
# This is a workaround for Cocoapods Issue #1437.
@@ -78,21 +102,24 @@ Pod::Spec.new do |s|
# It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
# prepare_command's of subspecs.
#
- # TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
+ # TODO(jcanizales): Try out others' solutions at Issue #1437.
s.prepare_command = <<-CMD
+ # Move contents of include up a level to avoid manually specifying include paths
+ cp -r "include/grpc" "."
+
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
- grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
- if [ -f "include/$BAD_TIME" ];
+ grep -rl "$BAD_TIME" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
+ if [ -f "$BAD_TIME" ];
then
- mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
+ mv -f "$BAD_TIME" "$GOOD_TIME"
fi
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
- grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
+ grep -rl "$BAD_STRING" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
mv -f "$BAD_STRING" "$GOOD_STRING"
@@ -100,28 +127,27 @@ Pod::Spec.new do |s|
CMD
# Objective-C wrapper around the core gRPC library.
- s.subspec 'GRPCClient' do |gs|
- gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
- 'src/objective-c/GRPCClient/private/*.{h,m}'
- gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
- gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
-
- gs.dependency 'gRPC/C-Core'
- # TODO(jcanizales): Remove this when the prepare_command moves everything under "include/grpc"
- # one directory up.
- gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' }
- gs.dependency 'gRPC/RxLibrary'
+ s.subspec 'GRPCClient' do |ss|
+ src_dir = "#{objc_dir}/GRPCClient"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
+
+ ss.dependency 'gRPC/C-Core'
+ ss.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections:
- gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
+ ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC
- s.subspec 'ProtoRPC' do |ps|
- ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
+ s.subspec 'ProtoRPC' do |ss|
+ src_dir = "#{objc_dir}/ProtoRPC"
+ ss.source_files = "#{src_dir}/*.{h,m}"
+ ss.header_mappings_dir = "#{objc_dir}"
- ps.dependency 'gRPC/GRPCClient'
- ps.dependency 'gRPC/RxLibrary'
- ps.dependency 'Protobuf', '~> 3.0.0-alpha-3'
+ ss.dependency 'gRPC/GRPCClient'
+ ss.dependency 'gRPC/RxLibrary'
+ ss.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end
end
diff --git a/templates/tools/doxygen/Doxyfile.include b/templates/tools/doxygen/Doxyfile.include
index 1391016348..2934ebe7d8 100644
--- a/templates/tools/doxygen/Doxyfile.include
+++ b/templates/tools/doxygen/Doxyfile.include
@@ -778,7 +778,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = ${' '.join(
+INPUT = ${' \\\n'.join(
itertools.chain.from_iterable(
target.public_headers +
([]
diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template
new file mode 100644
index 0000000000..1c0e04283a
--- /dev/null
+++ b/templates/tools/run_tests/sources_and_headers.json.template
@@ -0,0 +1,33 @@
+<%!
+import json
+import os
+
+def proto_headers(src):
+ out = []
+ for f in src:
+ name, ext = os.path.splitext(f)
+ if ext == '.proto':
+ out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
+ return out
+
+def no_protos(src):
+ out = []
+ for f in src:
+ if os.path.splitext(f)[1] != '.proto':
+ out.append(f)
+ return out
+%>
+
+${json.dumps([{"name": tgt.name,
+ "language": tgt.language,
+ "src": sorted(
+ no_protos(tgt.src) +
+ tgt.get('public_headers', []) +
+ tgt.get('headers', [])),
+ "headers": sorted(
+ tgt.get('public_headers', []) +
+ tgt.get('headers', []) +
+ proto_headers(tgt.src)),
+ "deps": sorted(tgt.get('deps', []))}
+ for tgt in (targets + libs)],
+ sort_keys=True, indent=2)}
diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c
index e9adcf34c7..5b836fefc3 100644
--- a/test/core/bad_client/bad_client.c
+++ b/test/core/bad_client/bad_client.c
@@ -41,6 +41,7 @@
#include "src/core/support/string.h"
#include "src/core/transport/chttp2_transport.h"
+#include <grpc/support/alloc.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
@@ -89,6 +90,8 @@ void grpc_run_bad_client_test(grpc_bad_client_server_side_validator validator,
/* Add a debug log */
gpr_log(GPR_INFO, "TEST: %s", hex);
+ gpr_free(hex);
+
/* Init grpc */
grpc_init();
diff --git a/test/core/bad_client/gen_build_json.py b/test/core/bad_client/gen_build_json.py
index a6fa266bec..33bf65ac04 100755
--- a/test/core/bad_client/gen_build_json.py
+++ b/test/core/bad_client/gen_build_json.py
@@ -54,6 +54,15 @@ def main():
'language': 'c',
'src': [
'test/core/bad_client/bad_client.c'
+ ],
+ 'headers': [
+ 'test/core/bad_client/bad_client.h'
+ ],
+ 'deps': [
+ 'grpc_test_util_unsecure',
+ 'grpc_unsecure',
+ 'gpr_test_util',
+ 'gpr'
]
}],
'targets': [
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c
index 8a30e012e9..33f7c02b61 100644
--- a/test/core/end2end/cq_verifier.c
+++ b/test/core/end2end/cq_verifier.c
@@ -167,6 +167,9 @@ static void verify_matches(expectation *e, grpc_event *ev) {
static void expectation_to_strvec(gpr_strvec *buf, expectation *e) {
char *tmp;
+ gpr_asprintf(&tmp, "%p ", e->tag);
+ gpr_strvec_add(buf, tmp);
+
switch (e->type) {
case GRPC_OP_COMPLETE:
gpr_asprintf(&tmp, "GRPC_OP_COMPLETE result=%d", e->success);
diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c
index 06cbba295e..7d3568c22e 100644
--- a/test/core/end2end/dualstack_socket_test.c
+++ b/test/core/end2end/dualstack_socket_test.c
@@ -62,12 +62,10 @@ void test_connect(const char *server_host, const char *client_host, int port,
char *server_hostport;
grpc_channel *client;
grpc_server *server;
- grpc_completion_queue *client_cq;
- grpc_completion_queue *server_cq;
+ grpc_completion_queue *cq;
grpc_call *c;
grpc_call *s;
- cq_verifier *v_client;
- cq_verifier *v_server;
+ cq_verifier *cqv;
gpr_timespec deadline;
int got_port;
grpc_op ops[6];
@@ -93,9 +91,9 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_call_details_init(&call_details);
/* Create server. */
- server_cq = grpc_completion_queue_create();
+ cq = grpc_completion_queue_create();
server = grpc_server_create(NULL);
- grpc_server_register_completion_queue(server, server_cq);
+ grpc_server_register_completion_queue(server, cq);
GPR_ASSERT((got_port = grpc_server_add_http2_port(server, server_hostport)) >
0);
if (port == 0) {
@@ -104,13 +102,11 @@ void test_connect(const char *server_host, const char *client_host, int port,
GPR_ASSERT(port == got_port);
}
grpc_server_start(server);
- v_server = cq_verifier_create(server_cq);
+ cqv = cq_verifier_create(cq);
/* Create client. */
gpr_join_host_port(&client_hostport, client_host, port);
- client_cq = grpc_completion_queue_create();
client = grpc_channel_create(client_hostport, NULL);
- v_client = cq_verifier_create(client_cq);
gpr_log(GPR_INFO, "Testing with server=%s client=%s (expecting %s)",
server_hostport, client_hostport, expect_ok ? "success" : "failure");
@@ -128,7 +124,7 @@ void test_connect(const char *server_host, const char *client_host, int port,
}
/* Send a trivial request. */
- c = grpc_channel_create_call(client, client_cq, "/foo", "foo.test.google.fr",
+ c = grpc_channel_create_call(client, cq, "/foo", "foo.test.google.fr",
deadline);
GPR_ASSERT(c);
@@ -155,12 +151,11 @@ void test_connect(const char *server_host, const char *client_host, int port,
if (expect_ok) {
/* Check for a successful request. */
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(server, &s, &call_details,
- &request_metadata_recv, server_cq,
- server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ server, &s, &call_details,
+ &request_metadata_recv, cq, cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -180,45 +175,41 @@ void test_connect(const char *server_host, const char *client_host, int port,
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
grpc_call_destroy(s);
} else {
/* Check for a failed connection. */
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED);
}
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
/* Destroy client. */
grpc_channel_destroy(client);
- grpc_completion_queue_shutdown(client_cq);
- drain_cq(client_cq);
- grpc_completion_queue_destroy(client_cq);
/* Destroy server. */
- grpc_server_shutdown_and_notify(server, server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(server, cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(server);
- grpc_completion_queue_shutdown(server_cq);
- drain_cq(server_cq);
- grpc_completion_queue_destroy(server_cq);
+ grpc_completion_queue_shutdown(cq);
+ drain_cq(cq);
+ grpc_completion_queue_destroy(cq);
grpc_call_details_destroy(&call_details);
gpr_free(details);
diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h
index a61c725aa2..a18c702951 100644
--- a/test/core/end2end/end2end_tests.h
+++ b/test/core/end2end/end2end_tests.h
@@ -44,8 +44,7 @@ typedef struct grpc_end2end_test_config grpc_end2end_test_config;
#define FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS 4
struct grpc_end2end_test_fixture {
- grpc_completion_queue *server_cq;
- grpc_completion_queue *client_cq;
+ grpc_completion_queue *cq;
grpc_server *server;
grpc_channel *client;
void *fixture_data;
@@ -65,4 +64,4 @@ struct grpc_end2end_test_config {
void grpc_end2end_tests(grpc_end2end_test_config config);
-#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */
+#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */
diff --git a/test/core/end2end/fixtures/chttp2_fake_security.c b/test/core/end2end/fixtures/chttp2_fake_security.c
index 5323e29e82..f879b43f79 100644
--- a/test/core/end2end/fixtures/chttp2_fake_security.c
+++ b/test/core/end2end/fixtures/chttp2_fake_security.c
@@ -60,8 +60,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -83,8 +82,9 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
- GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds));
+ grpc_server_register_completion_queue(f->server, f->cq);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
+ server_creds));
grpc_server_credentials_release(server_creds);
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_fullstack.c b/test/core/end2end/fixtures/chttp2_fullstack.c
index f92b40efeb..b83e227a89 100644
--- a/test/core/end2end/fixtures/chttp2_fullstack.c
+++ b/test/core/end2end/fixtures/chttp2_fullstack.c
@@ -65,8 +65,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -84,7 +83,7 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
index 02aa575065..94b54253e4 100644
--- a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
+++ b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
@@ -71,8 +71,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
unique++);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -90,7 +89,7 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c b/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c
index f92b40efeb..00322d4011 100644
--- a/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c
+++ b/test/core/end2end/fixtures/chttp2_fullstack_with_poll.c
@@ -65,8 +65,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -84,7 +83,7 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
GPR_ASSERT(grpc_server_add_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
}
@@ -105,6 +104,8 @@ static grpc_end2end_test_config configs[] = {
int main(int argc, char **argv) {
size_t i;
+ grpc_platform_become_multipoller = grpc_poll_become_multipoller;
+
grpc_test_init(argc, argv);
grpc_init();
diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c
index 6d1b7b5ff0..237d072702 100644
--- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c
+++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c
@@ -63,8 +63,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -86,8 +85,9 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
- GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds));
+ grpc_server_register_completion_queue(f->server, f->cq);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
+ server_creds));
grpc_server_credentials_release(server_creds);
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c
index a5865d37c8..ff5642642d 100644
--- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c
+++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c
@@ -63,8 +63,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -86,7 +85,7 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
server_creds));
grpc_server_credentials_release(server_creds);
diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c
index 4a15d502a5..d4bb5d3ef5 100644
--- a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c
+++ b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c
@@ -61,8 +61,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
return f;
}
@@ -84,8 +83,9 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server = grpc_server_create(server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
- GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds));
+ grpc_server_register_completion_queue(f->server, f->cq);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr,
+ server_creds));
grpc_server_credentials_release(server_creds);
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_socket_pair.c b/test/core/end2end/fixtures/chttp2_socket_pair.c
index 48c121c7c4..d84405224b 100644
--- a/test/core/end2end/fixtures/chttp2_socket_pair.c
+++ b/test/core/end2end/fixtures/chttp2_socket_pair.c
@@ -95,8 +95,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = sfd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
*sfd = grpc_iomgr_create_endpoint_pair("fixture", 65536);
@@ -119,7 +118,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
grpc_endpoint_pair *sfd = f->fixture_data;
GPR_ASSERT(!f->server);
f->server = grpc_server_create_from_filters(NULL, 0, server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
grpc_server_start(f->server);
grpc_create_chttp2_transport(server_setup_transport, f, server_args,
sfd->server, NULL, 0, grpc_mdctx_create(), 0);
diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c b/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c
index 1d2e6f51c1..ac8b5eb86d 100644
--- a/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c
+++ b/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c
@@ -95,8 +95,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = sfd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
*sfd = grpc_iomgr_create_endpoint_pair("fixture", 1);
@@ -119,7 +118,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
grpc_endpoint_pair *sfd = f->fixture_data;
GPR_ASSERT(!f->server);
f->server = grpc_server_create_from_filters(NULL, 0, server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
grpc_server_start(f->server);
grpc_create_chttp2_transport(server_setup_transport, f, server_args,
sfd->server, NULL, 0, grpc_mdctx_create(), 0);
diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c
index 0834987fbe..e160812fa3 100644
--- a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c
+++ b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c
@@ -96,8 +96,7 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f));
f.fixture_data = sfd;
- f.client_cq = grpc_completion_queue_create();
- f.server_cq = grpc_completion_queue_create();
+ f.cq = grpc_completion_queue_create();
*sfd = grpc_iomgr_create_endpoint_pair("fixture", 65536);
@@ -120,7 +119,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f,
grpc_endpoint_pair *sfd = f->fixture_data;
GPR_ASSERT(!f->server);
f->server = grpc_server_create_from_filters(NULL, 0, server_args);
- grpc_server_register_completion_queue(f->server, f->server_cq);
+ grpc_server_register_completion_queue(f->server, f->cq);
grpc_server_start(f->server);
grpc_create_chttp2_transport(server_setup_transport, f, server_args,
sfd->server, NULL, 0, grpc_mdctx_create(), 0);
diff --git a/test/core/end2end/gen_build_json.py b/test/core/end2end/gen_build_json.py
index 66447527e1..f1c7e85e08 100755
--- a/test/core/end2end/gen_build_json.py
+++ b/test/core/end2end/gen_build_json.py
@@ -60,7 +60,7 @@ default_test_options = TestOptions(False, False)
# maps test names to options
END2END_TESTS = {
'bad_hostname': default_test_options,
- 'cancel_after_accept': TestOptions(flaky=True, secure=False),
+ 'cancel_after_accept': default_test_options,
'cancel_after_accept_and_writes_closed': default_test_options,
'cancel_after_invoke': default_test_options,
'cancel_before_invoke': default_test_options,
@@ -71,7 +71,7 @@ END2END_TESTS = {
'early_server_shutdown_finishes_tags': default_test_options,
'empty_batch': default_test_options,
'graceful_server_shutdown': default_test_options,
- 'invoke_large_request': TestOptions(flaky=True, secure=False),
+ 'invoke_large_request': default_test_options,
'max_concurrent_streams': default_test_options,
'max_message_length': default_test_options,
'no_op': default_test_options,
@@ -93,6 +93,19 @@ END2END_TESTS = {
def main():
+ sec_deps = [
+ 'end2end_certs',
+ 'grpc_test_util',
+ 'grpc',
+ 'gpr_test_util',
+ 'gpr'
+ ]
+ unsec_deps = [
+ 'grpc_test_util_unsecure',
+ 'grpc_unsecure',
+ 'gpr_test_util',
+ 'gpr'
+ ]
json = {
'#': 'generated with test/end2end/gen_build_json.py',
'libs': [
@@ -103,6 +116,8 @@ def main():
'secure': 'check' if END2END_FIXTURES[f].secure else 'no',
'src': ['test/core/end2end/fixtures/%s.c' % f],
'platforms': [ 'posix' ] if f.endswith('_posix') else END2END_FIXTURES[f].platforms,
+ 'deps': sec_deps if END2END_FIXTURES[f].secure else unsec_deps,
+ 'headers': ['test/core/end2end/end2end_tests.h'],
}
for f in sorted(END2END_FIXTURES.keys())] + [
{
@@ -111,7 +126,9 @@ def main():
'language': 'c',
'secure': 'check' if END2END_TESTS[t].secure else 'no',
'src': ['test/core/end2end/tests/%s.c' % t],
- 'headers': ['test/core/end2end/tests/cancel_test_helpers.h']
+ 'headers': ['test/core/end2end/tests/cancel_test_helpers.h',
+ 'test/core/end2end/end2end_tests.h'],
+ 'deps': sec_deps if END2END_TESTS[t].secure else unsec_deps
}
for t in sorted(END2END_TESTS.keys())] + [
{
@@ -135,13 +152,7 @@ def main():
'platforms': END2END_FIXTURES[f].platforms,
'deps': [
'end2end_fixture_%s' % f,
- 'end2end_test_%s' % t,
- 'end2end_certs',
- 'grpc_test_util',
- 'grpc',
- 'gpr_test_util',
- 'gpr'
- ]
+ 'end2end_test_%s' % t] + sec_deps
}
for f in sorted(END2END_FIXTURES.keys())
for t in sorted(END2END_TESTS.keys())] + [
@@ -155,12 +166,7 @@ def main():
'platforms': END2END_FIXTURES[f].platforms,
'deps': [
'end2end_fixture_%s' % f,
- 'end2end_test_%s' % t,
- 'grpc_test_util_unsecure',
- 'grpc_unsecure',
- 'gpr_test_util',
- 'gpr'
- ]
+ 'end2end_test_%s' % t] + unsec_deps
}
for f in sorted(END2END_FIXTURES.keys()) if not END2END_FIXTURES[f].secure
for t in sorted(END2END_TESTS.keys()) if not END2END_TESTS[t].secure]}
diff --git a/test/core/end2end/multiple_server_queues_test.c b/test/core/end2end/multiple_server_queues_test.c
new file mode 100644
index 0000000000..2306015eed
--- /dev/null
+++ b/test/core/end2end/multiple_server_queues_test.c
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <grpc/grpc.h>
+#include "test/core/util/test_config.h"
+
+int main(int argc, char **argv) {
+ grpc_completion_queue *cq1;
+ grpc_completion_queue *cq2;
+ grpc_server *server;
+
+ grpc_test_init(argc, argv);
+ grpc_init();
+ cq1 = grpc_completion_queue_create();
+ cq2 = grpc_completion_queue_create();
+ server = grpc_server_create(NULL);
+ grpc_server_register_completion_queue(server, cq1);
+ grpc_server_add_http2_port(server, "[::]:0");
+ grpc_server_register_completion_queue(server, cq2);
+ grpc_server_start(server);
+ grpc_server_shutdown_and_notify(server, cq2, NULL);
+ grpc_completion_queue_next(cq2, gpr_inf_future); /* cue queue hang */
+ grpc_completion_queue_shutdown(cq1);
+ grpc_completion_queue_shutdown(cq2);
+ grpc_completion_queue_next(cq1, gpr_inf_future);
+ grpc_completion_queue_next(cq2, gpr_inf_future);
+ grpc_server_destroy(server);
+ grpc_completion_queue_destroy(cq1);
+ grpc_completion_queue_destroy(cq2);
+ grpc_shutdown();
+ return 0;
+}
diff --git a/test/core/end2end/tests/bad_hostname.c b/test/core/end2end/tests/bad_hostname.c
index 809c5bb7d4..2509ea06a0 100644
--- a/test/core/end2end/tests/bad_hostname.c
+++ b/test/core/end2end/tests/bad_hostname.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,18 +94,15 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call *c;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -114,8 +113,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
char *details = NULL;
size_t details_capacity = 0;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "slartibartfast.local", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "slartibartfast.local",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -144,8 +143,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNAUTHENTICATED);
@@ -157,7 +156,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
+ cq_verifier_destroy(cqv);
}
static void test_invoke_simple_request(grpc_end2end_test_config config) {
diff --git a/test/core/end2end/tests/cancel_after_accept.c b/test/core/end2end/tests/cancel_after_accept.c
index cc5586bd1b..1cc6b2d147 100644
--- a/test/core/end2end/tests/cancel_after_accept.c
+++ b/test/core/end2end/tests/cancel_after_accept.c
@@ -75,8 +75,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -91,12 +93,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Cancel after accept, no payload */
@@ -106,10 +105,10 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
grpc_op *op;
grpc_call *c;
grpc_call *s;
- grpc_end2end_test_fixture f = begin_test(config, "cancel_after_accept", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "cancel_after_accept", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
@@ -127,8 +126,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -162,12 +161,11 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(2)));
- cq_expect_completion(v_server, tag(2), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(2)));
+ cq_expect_completion(cqv, tag(2), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_MESSAGE;
@@ -190,11 +188,9 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
- cq_expect_completion(v_server, tag(3), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(3), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == mode.expect_status);
GPR_ASSERT(0 == strcmp(details, mode.expect_details));
@@ -214,8 +210,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
}
diff --git a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
index 9a2fcf68a4..015d437543 100644
--- a/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
+++ b/test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
@@ -75,8 +75,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -91,12 +93,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Cancel after accept with a writes closed, no payload */
@@ -106,10 +105,10 @@ static void test_cancel_after_accept_and_writes_closed(
grpc_op *op;
grpc_call *c;
grpc_call *s;
- grpc_end2end_test_fixture f = begin_test(config, "test_cancel_after_accept_and_writes_closed", NULL, NULL);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_cancel_after_accept_and_writes_closed", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
@@ -127,8 +126,8 @@ static void test_cancel_after_accept_and_writes_closed(
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -165,12 +164,11 @@ static void test_cancel_after_accept_and_writes_closed(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(2)));
- cq_expect_completion(v_server, tag(2), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(2)));
+ cq_expect_completion(cqv, tag(2), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_MESSAGE;
@@ -193,11 +191,9 @@ static void test_cancel_after_accept_and_writes_closed(
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
- cq_expect_completion(v_server, tag(3), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(3), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == mode.expect_status);
GPR_ASSERT(0 == strcmp(details, mode.expect_details));
@@ -217,8 +213,7 @@ static void test_cancel_after_accept_and_writes_closed(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
}
diff --git a/test/core/end2end/tests/cancel_after_invoke.c b/test/core/end2end/tests/cancel_after_invoke.c
index 9b3ad280cb..414ec706ce 100644
--- a/test/core/end2end/tests/cancel_after_invoke.c
+++ b/test/core/end2end/tests/cancel_after_invoke.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,12 +94,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Cancel after invoke, no payload */
@@ -109,7 +108,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
grpc_end2end_test_fixture f =
begin_test(config, "test_cancel_after_invoke", mode, NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
@@ -122,8 +121,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -162,8 +161,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == mode.expect_status);
GPR_ASSERT(0 == strcmp(details, mode.expect_details));
@@ -179,7 +178,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
}
diff --git a/test/core/end2end/tests/cancel_before_invoke.c b/test/core/end2end/tests/cancel_before_invoke.c
index ca19c469f6..3cfe56eca2 100644
--- a/test/core/end2end/tests/cancel_before_invoke.c
+++ b/test/core/end2end/tests/cancel_before_invoke.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Cancel before invoke */
@@ -104,9 +103,10 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
grpc_op ops[6];
grpc_op *op;
grpc_call *c;
- grpc_end2end_test_fixture f = begin_test(config, "cancel_before_invoke", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "cancel_before_invoke", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
@@ -119,8 +119,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c));
@@ -159,8 +159,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, test_ops, tag(1)));
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_CANCELLED);
@@ -175,7 +175,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config,
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
}
diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.c b/test/core/end2end/tests/cancel_in_a_vacuum.c
index 5d7d762e5f..8bffc3f4d3 100644
--- a/test/core/end2end/tests/cancel_in_a_vacuum.c
+++ b/test/core/end2end/tests/cancel_in_a_vacuum.c
@@ -75,8 +75,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -91,24 +93,22 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Cancel and do nothing */
static void test_cancel_in_a_vacuum(grpc_end2end_test_config config,
cancellation_mode mode) {
grpc_call *c;
- grpc_end2end_test_fixture f = begin_test(config, "test_cancel_in_a_vacuum", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_cancel_in_a_vacuum", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
+ cq_verifier *v_client = cq_verifier_create(f.cq);
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));
diff --git a/test/core/end2end/tests/census_simple_request.c b/test/core/end2end/tests/census_simple_request.c
index ac2574c804..b414755cd1 100644
--- a/test/core/end2end/tests/census_simple_request.c
+++ b/test/core/end2end/tests/census_simple_request.c
@@ -65,8 +65,10 @@ static void *tag(gpr_intptr t) { return (void *)t; }
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -88,20 +90,16 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_body(grpc_end2end_test_fixture f) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = n_seconds_time(5);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -113,7 +111,7 @@ static void test_body(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -143,12 +141,11 @@ static void test_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -167,17 +164,15 @@ static void test_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -188,8 +183,7 @@ static void test_body(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
static void test_invoke_request_with_census(
diff --git a/test/core/end2end/tests/disappearing_server.c b/test/core/end2end/tests/disappearing_server.c
index cf9b79f117..9acd18902a 100644
--- a/test/core/end2end/tests/disappearing_server.c
+++ b/test/core/end2end/tests/disappearing_server.c
@@ -76,17 +76,13 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
- cq_verifier *v_client,
- cq_verifier *v_server) {
+ cq_verifier *cqv) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
@@ -101,7 +97,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f->client, f->client_cq, "/foo",
+ c = grpc_channel_create_call(f->client, f->cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -131,16 +127,16 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f->server, &s, &call_details,
- &request_metadata_recv, f->server_cq,
- f->server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f->server, &s,
+ &call_details,
+ &request_metadata_recv,
+ f->cq, f->cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
/* should be able to shut down the server early
- and still complete the request */
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -159,18 +155,16 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_expect_completion(v_server, tag(1000), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_expect_completion(cqv, tag(1000), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -184,23 +178,21 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
static void disappearing_server_test(grpc_end2end_test_config config) {
grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
gpr_log(GPR_INFO, "%s/%s", "disappearing_server_test", config.name);
config.init_client(&f, NULL);
config.init_server(&f, NULL);
- do_request_and_shutdown_server(&f, v_client, v_server);
+ do_request_and_shutdown_server(&f, cqv);
/* now destroy and recreate the server */
config.init_server(&f, NULL);
- do_request_and_shutdown_server(&f, v_client, v_server);
+ do_request_and_shutdown_server(&f, cqv);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
index 5826ababaa..adc59b4e94 100644
--- a/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
+++ b/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
@@ -81,12 +81,9 @@ static void shutdown_client(grpc_end2end_test_fixture *f) {
static void end_test(grpc_end2end_test_fixture *f) {
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_early_server_shutdown_finishes_inflight_calls(
@@ -94,9 +91,9 @@ static void test_early_server_shutdown_finishes_inflight_calls(
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- grpc_end2end_test_fixture f = begin_test(config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -108,8 +105,8 @@ static void test_early_server_shutdown_finishes_inflight_calls(
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -139,12 +136,11 @@ static void test_early_server_shutdown_finishes_inflight_calls(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -154,18 +150,16 @@ static void test_early_server_shutdown_finishes_inflight_calls(
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
/* shutdown and destroy the server */
- grpc_server_shutdown_and_notify(f.server, f.server_cq, tag(1000));
+ grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
grpc_server_cancel_all_calls(f.server);
- cq_expect_completion(v_server, tag(102), 1);
- cq_expect_completion(v_server, tag(1000), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(1000), 1);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
grpc_server_destroy(f.server);
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
-
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
@@ -180,8 +174,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
diff --git a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c
index 0c2cdb78f0..fc03cb01a8 100644
--- a/test/core/end2end/tests/early_server_shutdown_finishes_tags.c
+++ b/test/core/end2end/tests/early_server_shutdown_finishes_tags.c
@@ -81,18 +81,16 @@ static void shutdown_client(grpc_end2end_test_fixture *f) {
static void end_test(grpc_end2end_test_fixture *f) {
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_early_server_shutdown_finishes_tags(
grpc_end2end_test_config config) {
- grpc_end2end_test_fixture f = begin_test(config, "test_early_server_shutdown_finishes_tags", NULL, NULL);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_early_server_shutdown_finishes_tags", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_call *s = (void *)1;
grpc_call_details call_details;
grpc_metadata_array request_metadata_recv;
@@ -102,21 +100,20 @@ static void test_early_server_shutdown_finishes_tags(
/* upon shutdown, the server should finish all requested calls indicating
no new call */
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- grpc_server_shutdown_and_notify(f.server, f.server_cq, tag(1000));
- cq_expect_completion(v_server, tag(101), 0);
- cq_expect_completion(v_server, tag(1000), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000));
+ cq_expect_completion(cqv, tag(101), 0);
+ cq_expect_completion(cqv, tag(1000), 1);
+ cq_verify(cqv);
GPR_ASSERT(s == NULL);
grpc_server_destroy(f.server);
end_test(&f);
config.tear_down_data(&f);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
void grpc_end2end_tests(grpc_end2end_test_config config) {
diff --git a/test/core/end2end/tests/empty_batch.c b/test/core/end2end/tests/empty_batch.c
index 79d1965981..db8458d3d9 100644
--- a/test/core/end2end/tests/empty_batch.c
+++ b/test/core/end2end/tests/empty_batch.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,31 +94,28 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void empty_batch_body(grpc_end2end_test_fixture f) {
grpc_call *c;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op *op = NULL;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, op, 0, tag(1)));
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
+ cq_verifier_destroy(cqv);
}
static void test_invoke_empty_body(grpc_end2end_test_config config) {
diff --git a/test/core/end2end/tests/graceful_server_shutdown.c b/test/core/end2end/tests/graceful_server_shutdown.c
index 6a5b4b15d3..8c1889add9 100644
--- a/test/core/end2end/tests/graceful_server_shutdown.c
+++ b/test/core/end2end/tests/graceful_server_shutdown.c
@@ -88,12 +88,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_early_server_shutdown_finishes_inflight_calls(
@@ -101,9 +98,9 @@ static void test_early_server_shutdown_finishes_inflight_calls(
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- grpc_end2end_test_fixture f = begin_test(config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_early_server_shutdown_finishes_inflight_calls", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -115,8 +112,8 @@ static void test_early_server_shutdown_finishes_inflight_calls(
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -146,16 +143,15 @@ static void test_early_server_shutdown_finishes_inflight_calls(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
/* shutdown and destroy the server */
- grpc_server_shutdown_and_notify(f.server, f.server_cq, tag(0xdead));
- cq_verify_empty(v_server);
+ grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead));
+ cq_verify_empty(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -174,19 +170,17 @@ static void test_early_server_shutdown_finishes_inflight_calls(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_expect_completion(v_server, tag(0xdead), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(0xdead), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
grpc_call_destroy(s);
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
-
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -196,8 +190,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c
index 812bdfa3e7..744a9ada57 100644
--- a/test/core/end2end/tests/invoke_large_request.c
+++ b/test/core/end2end/tests/invoke_large_request.c
@@ -72,8 +72,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -88,22 +90,20 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static gpr_slice large_slice(void) {
gpr_slice slice = gpr_slice_malloc(1000000);
- memset(GPR_SLICE_START_PTR(slice), 0xab, GPR_SLICE_LENGTH(slice));
+ memset(GPR_SLICE_START_PTR(slice), 'x', GPR_SLICE_LENGTH(slice));
return slice;
}
static void test_invoke_large_request(grpc_end2end_test_config config) {
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_large_request", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_invoke_large_request", NULL, NULL);
gpr_slice request_payload_slice = large_slice();
gpr_slice response_payload_slice = large_slice();
@@ -114,8 +114,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
gpr_timespec deadline = n_seconds_time(30);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -129,8 +128,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -141,71 +140,78 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
op++;
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = request_payload;
+ op->flags = 0;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ op->flags = 0;
op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &initial_metadata_recv;
+ op->flags = 0;
op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &response_payload_recv;
+ op->flags = 0;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
op->data.recv_status_on_client.status_details_capacity = &details_capacity;
+ op->flags = 0;
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
+ op->flags = 0;
op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &request_payload_recv;
+ op->flags = 0;
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled = &was_cancelled;
+ op->flags = 0;
op++;
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = response_payload;
+ op->flags = 0;
op++;
- op = ops;
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
op->data.send_status_from_server.trailing_metadata_count = 0;
op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED;
op->data.send_status_from_server.status_details = "xyz";
+ op->flags = 0;
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -216,8 +222,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
diff --git a/test/core/end2end/tests/max_concurrent_streams.c b/test/core/end2end/tests/max_concurrent_streams.c
index f8660bb901..1204c070af 100644
--- a/test/core/end2end/tests/max_concurrent_streams.c
+++ b/test/core/end2end/tests/max_concurrent_streams.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,20 +92,16 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -115,7 +113,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -145,12 +143,11 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -169,17 +166,15 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -190,8 +185,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
static void test_max_concurrent_streams(grpc_end2end_test_config config) {
@@ -204,8 +198,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
grpc_call *s2;
int live_call;
gpr_timespec deadline;
- cq_verifier *v_client;
- cq_verifier *v_server;
+ cq_verifier *cqv;
grpc_event ev;
grpc_call_details call_details;
grpc_metadata_array request_metadata_recv;
@@ -222,6 +215,8 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
grpc_op ops[6];
grpc_op *op;
int was_cancelled;
+ int got_client_start;
+ int got_server_start;
server_arg.key = GRPC_ARG_MAX_CONCURRENT_STREAMS;
server_arg.type = GRPC_ARG_INTEGER;
@@ -231,8 +226,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
server_args.args = &server_arg;
f = begin_test(config, "test_max_concurrent_streams", NULL, &server_args);
- v_client = cq_verifier_create(f.client_cq);
- v_server = cq_verifier_create(f.server_cq);
+ cqv = cq_verifier_create(f.cq);
grpc_metadata_array_init(&request_metadata_recv);
grpc_metadata_array_init(&initial_metadata_recv1);
@@ -249,18 +243,17 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
/* start two requests - ensuring that the second is not accepted until
the first completes */
- deadline = n_seconds_time(10);
- c1 = grpc_channel_create_call(f.client, f.client_cq, "/alpha",
+ deadline = n_seconds_time(1000);
+ c1 = grpc_channel_create_call(f.client, f.cq, "/alpha",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c1);
- c2 = grpc_channel_create_call(f.client, f.client_cq, "/beta",
+ c2 = grpc_channel_create_call(f.client, f.cq, "/beta",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c2);
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s1, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s1, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -314,18 +307,28 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(c2, ops, op - ops, tag(402)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
-
- ev = grpc_completion_queue_next(f.client_cq,
- GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3));
- GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
- GPR_ASSERT(ev.success);
- GPR_ASSERT(ev.tag == tag(301) || ev.tag == tag(401));
- /* The /alpha or /beta calls started above could be invoked (but NOT both);
- * check this here */
- /* We'll get tag 303 or 403, we want 300, 400 */
- live_call = ((int)(gpr_intptr)ev.tag) - 1;
+ got_client_start = 0;
+ got_server_start = 0;
+ live_call = -1;
+ while (!got_client_start || !got_server_start) {
+ ev = grpc_completion_queue_next(f.cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3));
+ GPR_ASSERT(ev.type == GRPC_OP_COMPLETE);
+ GPR_ASSERT(ev.success);
+ if (ev.tag == tag(101)) {
+ GPR_ASSERT(!got_server_start);
+ got_server_start = 1;
+ } else {
+ GPR_ASSERT(!got_client_start);
+ GPR_ASSERT(ev.tag == tag(301) || ev.tag == tag(401));
+ /* The /alpha or /beta calls started above could be invoked (but NOT
+ * both);
+ * check this here */
+ /* We'll get tag 303 or 403, we want 300, 400 */
+ live_call = ((int)(gpr_intptr)ev.tag) - 1;
+ got_client_start = 1;
+ }
+ }
+ GPR_ASSERT(live_call == 300 || live_call == 400);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -345,21 +348,18 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(s1, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(live_call + 2), 1);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(live_call + 2), 1);
/* first request is finished, we should be able to start the second */
live_call = (live_call == 300) ? 400 : 300;
- cq_expect_completion(v_client, tag(live_call + 1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(live_call + 1), 1);
+ cq_verify(cqv);
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s2, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(201)));
- cq_expect_completion(v_server, tag(201), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s2, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(201)));
+ cq_expect_completion(cqv, tag(201), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -379,14 +379,11 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(s2, ops, op - ops, tag(202)));
- cq_expect_completion(v_client, tag(live_call + 2), 1);
- cq_verify(v_client);
-
- cq_expect_completion(v_server, tag(202), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(live_call + 2), 1);
+ cq_expect_completion(cqv, tag(202), 1);
+ cq_verify(cqv);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_call_destroy(c1);
grpc_call_destroy(s1);
diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c
index 8d3d2f10d9..9d716f1135 100644
--- a/test/core/end2end/tests/max_message_length.c
+++ b/test/core/end2end/tests/max_message_length.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_max_message_length(grpc_end2end_test_config config) {
@@ -104,8 +103,7 @@ static void test_max_message_length(grpc_end2end_test_config config) {
grpc_channel_args server_args;
grpc_call *c;
grpc_call *s;
- cq_verifier *v_client;
- cq_verifier *v_server;
+ cq_verifier *cqv;
grpc_op ops[6];
grpc_op *op;
gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
@@ -128,10 +126,9 @@ static void test_max_message_length(grpc_end2end_test_config config) {
server_args.args = &server_arg;
f = begin_test(config, "test_max_message_length", NULL, &server_args);
- v_client = cq_verifier_create(f.client_cq);
- v_server = cq_verifier_create(f.server_cq);
+ cqv = cq_verifier_create(f.cq);
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", gpr_inf_future);
GPR_ASSERT(c);
@@ -165,12 +162,11 @@ static void test_max_message_length(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -179,11 +175,9 @@ static void test_max_message_length(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status != GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
@@ -200,8 +194,7 @@ static void test_max_message_length(grpc_end2end_test_config config) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
end_test(&f);
config.tear_down_data(&f);
diff --git a/test/core/end2end/tests/no_op.c b/test/core/end2end/tests/no_op.c
index 1f32691e63..8ead664758 100644
--- a/test/core/end2end/tests/no_op.c
+++ b/test/core/end2end/tests/no_op.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_no_op(grpc_end2end_test_config config) {
diff --git a/test/core/end2end/tests/ping_pong_streaming.c b/test/core/end2end/tests/ping_pong_streaming.c
index 2b617ce00b..8a3ec96212 100644
--- a/test/core/end2end/tests/ping_pong_streaming.c
+++ b/test/core/end2end/tests/ping_pong_streaming.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,23 +92,20 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Client pings and server pongs. Repeat messages rounds before finishing. */
static void test_pingpong_streaming(grpc_end2end_test_config config,
int messages) {
- grpc_end2end_test_fixture f = begin_test(config, "test_pingpong_streaming", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_pingpong_streaming", NULL, NULL);
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -125,7 +124,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
gpr_slice response_payload_slice = gpr_slice_from_copied_string("hello you");
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -152,12 +151,11 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(100)));
- cq_expect_completion(v_server, tag(100), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(100)));
+ cq_expect_completion(cqv, tag(100), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -192,8 +190,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_MESSAGE;
@@ -202,11 +200,9 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(2), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(2), 1);
+ cq_verify(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
@@ -232,19 +228,16 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(104)));
- cq_expect_completion(v_client, tag(1), 1);
- cq_expect_completion(v_client, tag(3), 1);
- cq_verify(v_client);
-
- cq_expect_completion(v_server, tag(101), 1);
- cq_expect_completion(v_server, tag(104), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_expect_completion(cqv, tag(3), 1);
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_expect_completion(cqv, tag(104), 1);
+ cq_verify(cqv);
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
diff --git a/test/core/end2end/tests/registered_call.c b/test/core/end2end/tests/registered_call.c
index 43e34ff673..f44fd3a224 100644
--- a/test/core/end2end/tests/registered_call.c
+++ b/test/core/end2end/tests/registered_call.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,20 +94,16 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f, void *rc) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -117,7 +115,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_registered_call(f.client, f.client_cq, rc, deadline);
+ c = grpc_channel_create_registered_call(f.client, f.cq, rc, deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -146,12 +144,11 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -170,17 +167,15 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -191,12 +186,12 @@ static void simple_request_body(grpc_end2end_test_fixture f, void *rc) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
static void test_invoke_simple_request(grpc_end2end_test_config config) {
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_simple_request", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_invoke_simple_request", NULL, NULL);
void *rc =
grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234");
@@ -207,7 +202,8 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) {
static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
int i;
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
void *rc =
grpc_channel_register_call(f.client, "/foo", "foo.test.google.fr:1234");
diff --git a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
index b1c6c98b0f..8b8a11babe 100644
--- a/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
+++ b/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Request/response with metadata and payload.*/
@@ -128,9 +127,9 @@ static void test_request_response_with_metadata_and_payload(
"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff",
16,
{{NULL, NULL, NULL}}}};
- grpc_end2end_test_fixture f = begin_test(config, "test_request_response_with_metadata_and_payload", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_request_response_with_metadata_and_payload", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -144,8 +143,8 @@ static void test_request_response_with_metadata_and_payload(
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -183,12 +182,11 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -202,8 +200,8 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -222,11 +220,9 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -257,8 +253,7 @@ static void test_request_response_with_metadata_and_payload(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
diff --git a/test/core/end2end/tests/request_response_with_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_metadata_and_payload.c
index d0a7b9a4b5..ef6dfe9561 100644
--- a/test/core/end2end/tests/request_response_with_metadata_and_payload.c
+++ b/test/core/end2end/tests/request_response_with_metadata_and_payload.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Request/response with metadata and payload.*/
@@ -114,9 +113,9 @@ static void test_request_response_with_metadata_and_payload(
{"key2", "val2", 4, {{NULL, NULL, NULL}}}};
grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}},
{"key4", "val4", 4, {{NULL, NULL, NULL}}}};
- grpc_end2end_test_fixture f = begin_test(config, "test_request_response_with_metadata_and_payload", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_request_response_with_metadata_and_payload", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -130,8 +129,8 @@ static void test_request_response_with_metadata_and_payload(
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -169,12 +168,11 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -188,8 +186,8 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -208,11 +206,9 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -235,8 +231,7 @@ static void test_request_response_with_metadata_and_payload(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
diff --git a/test/core/end2end/tests/request_response_with_payload.c b/test/core/end2end/tests/request_response_with_payload.c
index 9bf4816b4e..38d3432f94 100644
--- a/test/core/end2end/tests/request_response_with_payload.c
+++ b/test/core/end2end/tests/request_response_with_payload.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void request_response_with_payload(grpc_end2end_test_fixture f) {
@@ -108,8 +107,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -123,8 +121,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -161,12 +159,11 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -179,8 +176,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -199,11 +196,9 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -222,8 +217,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
@@ -235,7 +229,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
payload and status. */
static void test_invoke_request_response_with_payload(
grpc_end2end_test_config config) {
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_response_with_payload", NULL, NULL);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_invoke_request_response_with_payload", NULL, NULL);
request_response_with_payload(f);
end_test(&f);
config.tear_down_data(&f);
@@ -244,7 +239,8 @@ static void test_invoke_request_response_with_payload(
static void test_invoke_10_request_response_with_payload(
grpc_end2end_test_config config) {
int i;
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_request_response_with_payload", NULL, NULL);
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_invoke_10_request_response_with_payload", NULL, NULL);
for (i = 0; i < 10; i++) {
request_response_with_payload(f);
}
diff --git a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
index 3de1d86757..665ad3d2a6 100644
--- a/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
+++ b/test/core/end2end/tests/request_response_with_payload_and_call_creds.c
@@ -51,11 +51,7 @@ static const char iam_selector[] = "selector";
static const char overridden_iam_token[] = "overridden_token";
static const char overridden_iam_selector[] = "overridden_selector";
-typedef enum {
- NONE,
- OVERRIDE,
- DESTROY
-} override_mode;
+typedef enum { NONE, OVERRIDE, DESTROY } override_mode;
enum { TIMEOUT = 200000 };
@@ -88,8 +84,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -104,12 +102,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void print_auth_context(int is_client, const grpc_auth_context *ctx) {
@@ -132,10 +127,11 @@ static void print_auth_context(int is_client, const grpc_auth_context *ctx) {
static void test_call_creds_failure(grpc_end2end_test_config config) {
grpc_call *c;
grpc_credentials *creds = NULL;
- grpc_end2end_test_fixture f = begin_test(config, "test_call_creds_failure", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_call_creds_failure", NULL, NULL);
gpr_timespec deadline = five_seconds_time();
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
/* Try with credentials unfit to be set on a call (channel creds). */
@@ -163,8 +159,7 @@ static void request_response_with_payload_and_call_creds(
gpr_timespec deadline = five_seconds_time();
grpc_end2end_test_fixture f = begin_test(config, test_name, NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -180,8 +175,8 @@ static void request_response_with_payload_and_call_creds(
grpc_credentials *creds = NULL;
const grpc_auth_context *s_auth_context = NULL;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
creds = grpc_iam_credentials_create(iam_token, iam_selector);
GPR_ASSERT(creds != NULL);
@@ -236,13 +231,11 @@ static void request_response_with_payload_and_call_creds(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, &s,
- &call_details,
- &request_metadata_recv,
- f.server_cq, f.server_cq,
- tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
s_auth_context = grpc_call_auth_context(s);
GPR_ASSERT(s_auth_context != NULL);
print_auth_context(0, s_auth_context);
@@ -261,8 +254,8 @@ static void request_response_with_payload_and_call_creds(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -281,11 +274,9 @@ static void request_response_with_payload_and_call_creds(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -337,8 +328,7 @@ static void request_response_with_payload_and_call_creds(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
@@ -351,17 +341,22 @@ static void request_response_with_payload_and_call_creds(
void test_request_response_with_payload_and_call_creds(
grpc_end2end_test_config config) {
- request_response_with_payload_and_call_creds("test_request_response_with_payload_and_call_creds", config, NONE);
+ request_response_with_payload_and_call_creds(
+ "test_request_response_with_payload_and_call_creds", config, NONE);
}
void test_request_response_with_payload_and_overridden_call_creds(
grpc_end2end_test_config config) {
- request_response_with_payload_and_call_creds("test_request_response_with_payload_and_overridden_call_creds", config, OVERRIDE);
+ request_response_with_payload_and_call_creds(
+ "test_request_response_with_payload_and_overridden_call_creds", config,
+ OVERRIDE);
}
void test_request_response_with_payload_and_deleted_call_creds(
grpc_end2end_test_config config) {
- request_response_with_payload_and_call_creds("test_request_response_with_payload_and_deleted_call_creds", config, DESTROY);
+ request_response_with_payload_and_call_creds(
+ "test_request_response_with_payload_and_deleted_call_creds", config,
+ DESTROY);
}
void grpc_end2end_tests(grpc_end2end_test_config config) {
@@ -372,4 +367,3 @@ void grpc_end2end_tests(grpc_end2end_test_config config) {
test_request_response_with_payload_and_deleted_call_creds(config);
}
}
-
diff --git a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
index e91ebf41c6..a5c0851d05 100644
--- a/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
+++ b/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Request/response with metadata and payload.*/
@@ -110,12 +109,15 @@ static void test_request_response_with_metadata_and_payload(
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
- grpc_metadata meta_c[2] = {{"key1", "val1", 4, {{NULL, NULL, NULL}}}, {"key2", "val2", 4, {{NULL, NULL, NULL}}}};
- grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}}, {"key4", "val4", 4, {{NULL, NULL, NULL}}}};
- grpc_metadata meta_t[2] = {{"key5", "val5", 4, {{NULL, NULL, NULL}}}, {"key6", "val6", 4, {{NULL, NULL, NULL}}}};
- grpc_end2end_test_fixture f = begin_test(config, "test_request_response_with_metadata_and_payload", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_metadata meta_c[2] = {{"key1", "val1", 4, {{NULL, NULL, NULL}}},
+ {"key2", "val2", 4, {{NULL, NULL, NULL}}}};
+ grpc_metadata meta_s[2] = {{"key3", "val3", 4, {{NULL, NULL, NULL}}},
+ {"key4", "val4", 4, {{NULL, NULL, NULL}}}};
+ grpc_metadata meta_t[2] = {{"key5", "val5", 4, {{NULL, NULL, NULL}}},
+ {"key6", "val6", 4, {{NULL, NULL, NULL}}}};
+ grpc_end2end_test_fixture f = begin_test(
+ config, "test_request_response_with_metadata_and_payload", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -129,8 +131,8 @@ static void test_request_response_with_metadata_and_payload(
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -168,13 +170,11 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f.server, &s,
- &call_details,
- &request_metadata_recv,
- f.server_cq, f.server_cq,
- tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -188,8 +188,8 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -209,11 +209,9 @@ static void test_request_response_with_metadata_and_payload(
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -237,8 +235,7 @@ static void test_request_response_with_metadata_and_payload(
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
diff --git a/test/core/end2end/tests/request_with_flags.c b/test/core/end2end/tests/request_with_flags.c
index 5ad475544c..fb55a6512f 100644
--- a/test/core/end2end/tests/request_with_flags.c
+++ b/test/core/end2end/tests/request_with_flags.c
@@ -75,8 +75,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -91,12 +93,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void test_invoke_request_with_flags(
@@ -106,11 +105,10 @@ static void test_invoke_request_with_flags(
gpr_slice request_payload_slice = gpr_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
- gpr_timespec deadline = five_seconds_time();
+ gpr_timespec deadline = GRPC_TIMEOUT_MILLIS_TO_DEADLINE(100);
grpc_end2end_test_fixture f =
begin_test(config, "test_invoke_request_with_flags", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -123,8 +121,8 @@ static void test_invoke_request_with_flags(
size_t details_capacity = 0;
grpc_call_error expectation;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -158,6 +156,11 @@ static void test_invoke_request_with_flags(
expectation = call_start_batch_expected_result;
GPR_ASSERT(expectation == grpc_call_start_batch(c, ops, op - ops, tag(1)));
+ if (expectation == GRPC_CALL_OK) {
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
+ }
+
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
@@ -166,8 +169,7 @@ static void test_invoke_request_with_flags(
grpc_call_destroy(c);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(request_payload_recv);
@@ -178,7 +180,7 @@ static void test_invoke_request_with_flags(
void grpc_end2end_tests(grpc_end2end_test_config config) {
size_t i;
- gpr_uint32 flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER+1];
+ gpr_uint32 flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER + 1];
{
/* check that all grpc_op_types fail when their flag value is set to an
diff --git a/test/core/end2end/tests/request_with_large_metadata.c b/test/core/end2end/tests/request_with_large_metadata.c
index cf6f4b23e4..ad34c69774 100644
--- a/test/core/end2end/tests/request_with_large_metadata.c
+++ b/test/core/end2end/tests/request_with_large_metadata.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Request with a large amount of metadata.*/
@@ -107,9 +106,9 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
grpc_metadata meta;
- grpc_end2end_test_fixture f = begin_test(config, "test_request_with_large_metadata", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_request_with_large_metadata", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -123,8 +122,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
int was_cancelled = 2;
const int large_size = 64 * 1024;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
meta.key = "key";
@@ -164,12 +163,11 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -182,8 +180,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -198,11 +196,9 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -221,8 +217,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(request_payload_recv);
diff --git a/test/core/end2end/tests/request_with_payload.c b/test/core/end2end/tests/request_with_payload.c
index 935aa5878b..8db6457830 100644
--- a/test/core/end2end/tests/request_with_payload.c
+++ b/test/core/end2end/tests/request_with_payload.c
@@ -74,8 +74,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -90,12 +92,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
/* Client sends a request with payload, server reads then returns status. */
@@ -106,9 +105,9 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_invoke_request_with_payload", NULL, NULL);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -121,8 +120,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f.client, f.cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -155,12 +154,11 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -173,8 +171,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
@@ -189,11 +187,9 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(103)));
- cq_expect_completion(v_server, tag(103), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(103), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
GPR_ASSERT(0 == strcmp(details, "xyz"));
@@ -211,8 +207,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(request_payload_recv);
diff --git a/test/core/end2end/tests/server_finishes_request.c b/test/core/end2end/tests/server_finishes_request.c
index 973f024b4d..062a59aca2 100644
--- a/test/core/end2end/tests/server_finishes_request.c
+++ b/test/core/end2end/tests/server_finishes_request.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,20 +94,16 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -117,7 +115,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -144,12 +142,11 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -168,17 +165,15 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -189,8 +184,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
static void test_invoke_simple_request(grpc_end2end_test_config config) {
diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c
index 36558eca1d..a2665d7564 100644
--- a/test/core/end2end/tests/simple_delayed_request.c
+++ b/test/core/end2end/tests/simple_delayed_request.c
@@ -62,8 +62,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -78,12 +80,9 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_delayed_request_body(grpc_end2end_test_config config,
@@ -94,8 +93,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f->client_cq);
- cq_verifier *v_server = cq_verifier_create(f->server_cq);
+ cq_verifier *cqv = cq_verifier_create(f->cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -109,8 +107,8 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
config.init_client(f, client_args);
- c = grpc_channel_create_call(f->client, f->client_cq, "/foo",
- "foo.test.google.fr", deadline);
+ c = grpc_channel_create_call(f->client, f->cq, "/foo", "foo.test.google.fr",
+ deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@@ -141,12 +139,12 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
config.init_server(f, server_args);
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f->server, &s, &call_details,
- &request_metadata_recv, f->server_cq,
- f->server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(f->server, &s,
+ &call_details,
+ &request_metadata_recv,
+ f->cq, f->cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -165,17 +163,15 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -186,8 +182,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
static void test_simple_delayed_request_short(grpc_end2end_test_config config) {
diff --git a/test/core/end2end/tests/simple_request.c b/test/core/end2end/tests/simple_request.c
index 06f922351e..6194b841d8 100644
--- a/test/core/end2end/tests/simple_request.c
+++ b/test/core/end2end/tests/simple_request.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,20 +94,16 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -117,7 +115,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -147,12 +145,11 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -171,17 +168,15 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -192,8 +187,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
static void test_invoke_simple_request(grpc_end2end_test_config config) {
@@ -207,7 +201,8 @@ static void test_invoke_simple_request(grpc_end2end_test_config config) {
static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
int i;
- grpc_end2end_test_fixture f = begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
+ grpc_end2end_test_fixture f =
+ begin_test(config, "test_invoke_10_simple_requests", NULL, NULL);
for (i = 0; i < 10; i++) {
simple_request_body(f);
gpr_log(GPR_INFO, "Passed simple request %d", i);
@@ -217,6 +212,9 @@ static void test_invoke_10_simple_requests(grpc_end2end_test_config config) {
}
void grpc_end2end_tests(grpc_end2end_test_config config) {
- test_invoke_simple_request(config);
+ int i;
+ for (i = 0; i < 10; i++) {
+ test_invoke_simple_request(config);
+ }
test_invoke_10_simple_requests(config);
}
diff --git a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
index 1d7a150d7e..2cd638cbb9 100644
--- a/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
+++ b/test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c
@@ -76,8 +76,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
- grpc_server_shutdown_and_notify(f->server, f->server_cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(f->server_cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
+ GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(1000),
+ GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
@@ -92,20 +94,16 @@ static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
- grpc_completion_queue_shutdown(f->server_cq);
- drain_cq(f->server_cq);
- grpc_completion_queue_destroy(f->server_cq);
- grpc_completion_queue_shutdown(f->client_cq);
- drain_cq(f->client_cq);
- grpc_completion_queue_destroy(f->client_cq);
+ grpc_completion_queue_shutdown(f->cq);
+ drain_cq(f->cq);
+ grpc_completion_queue_destroy(f->cq);
}
static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call *c;
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
- cq_verifier *v_client = cq_verifier_create(f.client_cq);
- cq_verifier *v_server = cq_verifier_create(f.server_cq);
+ cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
@@ -117,7 +115,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
- c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
+ c = grpc_channel_create_call(f.client, f.cq, "/foo",
"foo.test.google.fr:1234", deadline);
GPR_ASSERT(c);
@@ -147,12 +145,11 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(c, ops, op - ops, tag(1)));
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_server_request_call(f.server, &s, &call_details,
- &request_metadata_recv, f.server_cq,
- f.server_cq, tag(101)));
- cq_expect_completion(v_server, tag(101), 1);
- cq_verify(v_server);
+ GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(
+ f.server, &s, &call_details,
+ &request_metadata_recv, f.cq, f.cq, tag(101)));
+ cq_expect_completion(cqv, tag(101), 1);
+ cq_verify(cqv);
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
@@ -171,17 +168,15 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
op++;
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(s, ops, op - ops, tag(102)));
- cq_expect_completion(v_server, tag(102), 1);
- cq_verify(v_server);
-
- cq_expect_completion(v_client, tag(1), 1);
- cq_verify(v_client);
+ cq_expect_completion(cqv, tag(102), 1);
+ cq_expect_completion(cqv, tag(1), 1);
+ cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234"));
- GPR_ASSERT(was_cancelled == 0);
+ GPR_ASSERT(was_cancelled == 1);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
@@ -192,11 +187,11 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
grpc_call_destroy(c);
grpc_call_destroy(s);
- cq_verifier_destroy(v_client);
- cq_verifier_destroy(v_server);
+ cq_verifier_destroy(cqv);
}
-static void test_invoke_10_simple_requests(grpc_end2end_test_config config, int initial_sequence_number) {
+static void test_invoke_10_simple_requests(grpc_end2end_test_config config,
+ int initial_sequence_number) {
int i;
grpc_end2end_test_fixture f;
grpc_arg client_arg;
diff --git a/test/core/fling/server.c b/test/core/fling/server.c
index e58d721c86..9542e15ad0 100644
--- a/test/core/fling/server.c
+++ b/test/core/fling/server.c
@@ -234,7 +234,9 @@ int main(int argc, char **argv) {
if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT");
grpc_server_shutdown_and_notify(server, cq, tag(1000));
- GPR_ASSERT(grpc_completion_queue_pluck(cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5)).type == GRPC_OP_COMPLETE);
+ GPR_ASSERT(grpc_completion_queue_pluck(
+ cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5))
+ .type == GRPC_OP_COMPLETE);
grpc_completion_queue_shutdown(cq);
shutdown_started = 1;
}
diff --git a/test/core/httpcli/httpcli_test.c b/test/core/httpcli/httpcli_test.c
index 76820916a1..6e579bc045 100644
--- a/test/core/httpcli/httpcli_test.c
+++ b/test/core/httpcli/httpcli_test.c
@@ -35,6 +35,7 @@
#include <string.h>
+#include <grpc/grpc.h>
#include "src/core/iomgr/iomgr.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -44,14 +45,16 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-static gpr_event g_done;
+static int g_done = 0;
+static grpc_httpcli_context g_context;
+static grpc_pollset g_pollset;
static gpr_timespec n_seconds_time(int seconds) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(seconds);
}
static void on_finish(void *arg, const grpc_httpcli_response *response) {
- const char *expect =
+ const char *expect =
"<html><head><title>Hello world!</title></head>"
"<body><p>This is a test</p></body></html>";
GPR_ASSERT(arg == (void *)42);
@@ -59,54 +62,69 @@ static void on_finish(void *arg, const grpc_httpcli_response *response) {
GPR_ASSERT(response->status == 200);
GPR_ASSERT(response->body_length == strlen(expect));
GPR_ASSERT(0 == memcmp(expect, response->body, response->body_length));
- gpr_event_set(&g_done, (void *)1);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ g_done = 1;
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
static void test_get(int use_ssl, int port) {
grpc_httpcli_request req;
- char* host;
+ char *host;
+ g_done = 0;
gpr_log(GPR_INFO, "running %s with use_ssl=%d.", "test_get", use_ssl);
gpr_asprintf(&host, "localhost:%d", port);
gpr_log(GPR_INFO, "requesting from %s", host);
- gpr_event_init(&g_done);
memset(&req, 0, sizeof(req));
req.host = host;
req.path = "/get";
req.use_ssl = use_ssl;
- grpc_httpcli_get(&req, n_seconds_time(15), on_finish, (void *)42);
+ grpc_httpcli_get(&g_context, &g_pollset, &req, n_seconds_time(15), on_finish,
+ (void *)42);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (!g_done) {
+ grpc_pollset_work(&g_pollset, n_seconds_time(20));
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
gpr_free(host);
- GPR_ASSERT(gpr_event_wait(&g_done, n_seconds_time(20)));
}
static void test_post(int use_ssl, int port) {
grpc_httpcli_request req;
- char* host;
+ char *host;
+ g_done = 0;
gpr_log(GPR_INFO, "running %s with use_ssl=%d.", "test_post", (int)use_ssl);
gpr_asprintf(&host, "localhost:%d", port);
gpr_log(GPR_INFO, "posting to %s", host);
- gpr_event_init(&g_done);
memset(&req, 0, sizeof(req));
req.host = host;
req.path = "/post";
req.use_ssl = use_ssl;
- grpc_httpcli_post(&req, "hello", 5, n_seconds_time(15), on_finish,
- (void *)42);
- GPR_ASSERT(gpr_event_wait(&g_done, n_seconds_time(20)));
+ grpc_httpcli_post(&g_context, &g_pollset, &req, "hello", 5,
+ n_seconds_time(15), on_finish, (void *)42);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (!g_done) {
+ grpc_pollset_work(&g_pollset, n_seconds_time(20));
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
+ gpr_free(host);
}
+static void destroy_pollset(void *ignored) { grpc_pollset_destroy(&g_pollset); }
+
int main(int argc, char **argv) {
- gpr_subprocess* server;
+ gpr_subprocess *server;
char *me = argv[0];
char *lslash = strrchr(me, '/');
- char* args[4];
+ char *args[4];
char root[1024];
int port = grpc_pick_unused_port_or_die();
@@ -122,7 +140,7 @@ int main(int argc, char **argv) {
gpr_asprintf(&args[0], "%s/../../test/core/httpcli/test_server.py", root);
args[1] = "--port";
gpr_asprintf(&args[2], "%d", port);
- server = gpr_subprocess_create(3, (const char**)args);
+ server = gpr_subprocess_create(3, (const char **)args);
GPR_ASSERT(server);
gpr_free(args[0]);
gpr_free(args[2]);
@@ -130,12 +148,16 @@ int main(int argc, char **argv) {
gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(5)));
grpc_test_init(argc, argv);
- grpc_iomgr_init();
+ grpc_init();
+ grpc_httpcli_context_init(&g_context);
+ grpc_pollset_init(&g_pollset);
test_get(0, port);
test_post(0, port);
- grpc_iomgr_shutdown();
+ grpc_httpcli_context_destroy(&g_context);
+ grpc_pollset_shutdown(&g_pollset, destroy_pollset, NULL);
+ grpc_shutdown();
gpr_subprocess_destroy(server);
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c
index f9c5282f19..8198c24752 100644
--- a/test/core/iomgr/endpoint_tests.c
+++ b/test/core/iomgr/endpoint_tests.c
@@ -57,6 +57,8 @@
*/
+static grpc_pollset *g_pollset;
+
size_t count_and_unref_slices(gpr_slice *slices, size_t nslices,
int *current_data) {
size_t num_bytes = 0;
@@ -111,8 +113,6 @@ static gpr_slice *allocate_blocks(size_t num_bytes, size_t slice_size,
struct read_and_write_test_state {
grpc_endpoint *read_ep;
grpc_endpoint *write_ep;
- gpr_mu mu;
- gpr_cv cv;
size_t target_bytes;
size_t bytes_read;
size_t current_write_size;
@@ -130,10 +130,10 @@ static void read_and_write_test_read_handler(void *data, gpr_slice *slices,
GPR_ASSERT(error != GRPC_ENDPOINT_CB_ERROR);
if (error == GRPC_ENDPOINT_CB_SHUTDOWN) {
gpr_log(GPR_INFO, "Read handler shutdown");
- gpr_mu_lock(&state->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
state->read_done = 1;
- gpr_cv_signal(&state->cv);
- gpr_mu_unlock(&state->mu);
+ grpc_pollset_kick(g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
return;
}
@@ -141,10 +141,10 @@ static void read_and_write_test_read_handler(void *data, gpr_slice *slices,
count_and_unref_slices(slices, nslices, &state->current_read_data);
if (state->bytes_read == state->target_bytes) {
gpr_log(GPR_INFO, "Read handler done");
- gpr_mu_lock(&state->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
state->read_done = 1;
- gpr_cv_signal(&state->cv);
- gpr_mu_unlock(&state->mu);
+ grpc_pollset_kick(g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
} else {
grpc_endpoint_notify_on_read(state->read_ep,
read_and_write_test_read_handler, data);
@@ -160,14 +160,15 @@ static void read_and_write_test_write_handler(void *data,
GPR_ASSERT(error != GRPC_ENDPOINT_CB_ERROR);
- gpr_log(GPR_DEBUG, "%s: error=%d", "read_and_write_test_write_handler", error);
+ gpr_log(GPR_DEBUG, "%s: error=%d", "read_and_write_test_write_handler",
+ error);
if (error == GRPC_ENDPOINT_CB_SHUTDOWN) {
gpr_log(GPR_INFO, "Write handler shutdown");
- gpr_mu_lock(&state->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
state->write_done = 1;
- gpr_cv_signal(&state->cv);
- gpr_mu_unlock(&state->mu);
+ grpc_pollset_kick(g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
return;
}
@@ -198,10 +199,10 @@ static void read_and_write_test_write_handler(void *data,
GPR_ASSERT(state->bytes_written == state->target_bytes);
gpr_log(GPR_INFO, "Write handler done");
- gpr_mu_lock(&state->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
state->write_done = 1;
- gpr_cv_signal(&state->cv);
- gpr_mu_unlock(&state->mu);
+ grpc_pollset_kick(g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
}
/* Do both reading and writing using the grpc_endpoint API.
@@ -213,7 +214,8 @@ static void read_and_write_test(grpc_endpoint_test_config config,
size_t slice_size, int shutdown) {
struct read_and_write_test_state state;
gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20);
- grpc_endpoint_test_fixture f = begin_test(config, "read_and_write_test", slice_size);
+ grpc_endpoint_test_fixture f =
+ begin_test(config, "read_and_write_test", slice_size);
if (shutdown) {
gpr_log(GPR_INFO, "Start read and write shutdown test");
@@ -222,9 +224,6 @@ static void read_and_write_test(grpc_endpoint_test_config config,
num_bytes, slice_size);
}
- gpr_mu_init(&state.mu);
- gpr_cv_init(&state.cv);
-
state.read_ep = f.client_ep;
state.write_ep = f.server_ep;
state.target_bytes = num_bytes;
@@ -253,29 +252,24 @@ static void read_and_write_test(grpc_endpoint_test_config config,
grpc_endpoint_shutdown(state.write_ep);
}
- gpr_mu_lock(&state.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
while (!state.read_done || !state.write_done) {
- if (gpr_cv_wait(&state.cv, &state.mu, deadline)) {
- gpr_log(GPR_ERROR, "timeout: read_done=%d, write_done=%d",
- state.read_done, state.write_done);
- abort();
- }
+ GPR_ASSERT(gpr_time_cmp(gpr_now(), deadline) < 0);
+ grpc_pollset_work(g_pollset, deadline);
}
- gpr_mu_unlock(&state.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
grpc_endpoint_destroy(state.read_ep);
grpc_endpoint_destroy(state.write_ep);
- gpr_mu_destroy(&state.mu);
- gpr_cv_destroy(&state.cv);
end_test(config);
}
struct timeout_test_state {
- gpr_event io_done;
+ int io_done;
};
typedef struct {
- gpr_event ev;
+ int done;
grpc_endpoint *ep;
} shutdown_during_write_test_state;
@@ -291,7 +285,10 @@ static void shutdown_during_write_test_read_handler(
if (error != GRPC_ENDPOINT_CB_OK) {
grpc_endpoint_destroy(st->ep);
- gpr_event_set(&st->ev, (void *)(gpr_intptr) error);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
+ st->done = error;
+ grpc_pollset_kick(g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
} else {
grpc_endpoint_notify_on_read(
st->ep, shutdown_during_write_test_read_handler, user_data);
@@ -310,7 +307,10 @@ static void shutdown_during_write_test_write_handler(
gpr_log(GPR_ERROR,
"shutdown_during_write_test_write_handler completed unexpectedly");
}
- gpr_event_set(&st->ev, (void *)(gpr_intptr) 1);
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
+ st->done = 1;
+ grpc_pollset_kick(g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
}
static void shutdown_during_write_test(grpc_endpoint_test_config config,
@@ -323,14 +323,15 @@ static void shutdown_during_write_test(grpc_endpoint_test_config config,
shutdown_during_write_test_state read_st;
shutdown_during_write_test_state write_st;
gpr_slice *slices;
- grpc_endpoint_test_fixture f = begin_test(config, "shutdown_during_write_test", slice_size);
+ grpc_endpoint_test_fixture f =
+ begin_test(config, "shutdown_during_write_test", slice_size);
gpr_log(GPR_INFO, "testing shutdown during a write");
read_st.ep = f.client_ep;
write_st.ep = f.server_ep;
- gpr_event_init(&read_st.ev);
- gpr_event_init(&write_st.ev);
+ read_st.done = 0;
+ write_st.done = 0;
grpc_endpoint_notify_on_read(
read_st.ep, shutdown_during_write_test_read_handler, &read_st);
@@ -347,9 +348,19 @@ static void shutdown_during_write_test(grpc_endpoint_test_config config,
case GRPC_ENDPOINT_WRITE_PENDING:
grpc_endpoint_shutdown(write_st.ep);
deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10);
- GPR_ASSERT(gpr_event_wait(&write_st.ev, deadline));
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
+ while (!write_st.done) {
+ GPR_ASSERT(gpr_time_cmp(gpr_now(), deadline) < 0);
+ grpc_pollset_work(g_pollset, deadline);
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
grpc_endpoint_destroy(write_st.ep);
- GPR_ASSERT(gpr_event_wait(&read_st.ev, deadline));
+ gpr_mu_lock(GRPC_POLLSET_MU(g_pollset));
+ while (!read_st.done) {
+ GPR_ASSERT(gpr_time_cmp(gpr_now(), deadline) < 0);
+ grpc_pollset_work(g_pollset, deadline);
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(g_pollset));
gpr_free(slices);
end_test(config);
return;
@@ -361,9 +372,12 @@ static void shutdown_during_write_test(grpc_endpoint_test_config config,
abort();
}
-void grpc_endpoint_tests(grpc_endpoint_test_config config) {
+void grpc_endpoint_tests(grpc_endpoint_test_config config,
+ grpc_pollset *pollset) {
+ g_pollset = pollset;
read_and_write_test(config, 10000000, 100000, 8192, 0);
read_and_write_test(config, 1000000, 100000, 1, 0);
read_and_write_test(config, 100000000, 100000, 1, 1);
shutdown_during_write_test(config, 1000);
+ g_pollset = NULL;
}
diff --git a/test/core/iomgr/endpoint_tests.h b/test/core/iomgr/endpoint_tests.h
index 1679d7bd4f..700f854891 100644
--- a/test/core/iomgr/endpoint_tests.h
+++ b/test/core/iomgr/endpoint_tests.h
@@ -52,6 +52,7 @@ struct grpc_endpoint_test_config {
void (*clean_up)();
};
-void grpc_endpoint_tests(grpc_endpoint_test_config config);
+void grpc_endpoint_tests(grpc_endpoint_test_config config,
+ grpc_pollset *pollset);
-#endif /* GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H */
+#endif /* GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H */
diff --git a/src/cpp/proto/proto_utils.h b/test/core/iomgr/fd_conservation_posix_test.c
index 67a775b3ca..aa4551f2f1 100644
--- a/src/cpp/proto/proto_utils.h
+++ b/test/core/iomgr/fd_conservation_posix_test.c
@@ -31,25 +31,33 @@
*
*/
-#ifndef GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H
-#define GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H
-
-#include <grpc++/config.h>
-
-struct grpc_byte_buffer;
-
-namespace grpc {
-
-// Serialize the msg into a buffer created inside the function. The caller
-// should destroy the returned buffer when done with it. If serialization fails,
-// false is returned and buffer is left unchanged.
-bool SerializeProto(const grpc::protobuf::Message& msg,
- grpc_byte_buffer** buffer);
-
-// The caller keeps ownership of buffer and msg.
-bool DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg,
- int max_message_size);
-
-} // namespace grpc
-
-#endif // GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H
+#include <sys/resource.h>
+
+#include <grpc/support/log.h>
+
+#include "test/core/util/test_config.h"
+#include "src/core/iomgr/endpoint_pair.h"
+#include "src/core/iomgr/iomgr.h"
+
+int main(int argc, char **argv) {
+ int i;
+ struct rlimit rlim;
+ grpc_endpoint_pair p;
+ grpc_test_init(argc, argv);
+ grpc_iomgr_init();
+
+ /* set max # of file descriptors to a low value, and
+ verify we can create and destroy many more than this number
+ of descriptors */
+ rlim.rlim_cur = rlim.rlim_max = 10;
+ GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim));
+
+ for (i = 0; i < 100; i++) {
+ p = grpc_iomgr_create_endpoint_pair("test", 1);
+ grpc_endpoint_destroy(p.client);
+ grpc_endpoint_destroy(p.server);
+ }
+
+ grpc_iomgr_shutdown();
+ return 0;
+}
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index 2c8a89e4cd..fe08ec495f 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -51,6 +51,8 @@
#include <grpc/support/time.h>
#include "test/core/util/test_config.h"
+static grpc_pollset g_pollset;
+
/* buffer size used to send and receive data.
1024 is the minimal value to set TCP send and receive buffer. */
#define BUF_SIZE 1024
@@ -94,16 +96,12 @@ void no_op_cb(void *arg, int success) {}
typedef struct {
grpc_fd *em_fd; /* listening fd */
ssize_t read_bytes_total; /* total number of received bytes */
- gpr_mu mu; /* protect done and done_cv */
- gpr_cv done_cv; /* signaled when a server finishes serving */
int done; /* set to 1 when a server finishes serving */
grpc_iomgr_closure listen_closure;
} server;
static void server_init(server *sv) {
sv->read_bytes_total = 0;
- gpr_mu_init(&sv->mu);
- gpr_cv_init(&sv->done_cv);
sv->done = 0;
}
@@ -122,7 +120,7 @@ static void session_shutdown_cb(void *arg, /*session*/
int success) {
session *se = arg;
server *sv = se->sv;
- grpc_fd_orphan(se->em_fd, NULL, NULL);
+ grpc_fd_orphan(se->em_fd, NULL, "a");
gpr_free(se);
/* Start to shutdown listen fd. */
grpc_fd_shutdown(sv->em_fd);
@@ -177,12 +175,12 @@ static void session_read_cb(void *arg, /*session*/
static void listen_shutdown_cb(void *arg /*server*/, int success) {
server *sv = arg;
- grpc_fd_orphan(sv->em_fd, NULL, NULL);
+ grpc_fd_orphan(sv->em_fd, NULL, "b");
- gpr_mu_lock(&sv->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
sv->done = 1;
- gpr_cv_signal(&sv->done_cv);
- gpr_mu_unlock(&sv->mu);
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
/* Called when a new TCP connection request arrives in the listening port. */
@@ -209,6 +207,7 @@ static void listen_cb(void *arg, /*=sv_arg*/
se = gpr_malloc(sizeof(*se));
se->sv = sv;
se->em_fd = grpc_fd_create(fd, "listener");
+ grpc_pollset_add_fd(&g_pollset, se->em_fd);
se->session_read_closure.cb = session_read_cb;
se->session_read_closure.cb_arg = se;
grpc_fd_notify_on_read(se->em_fd, &se->session_read_closure);
@@ -237,6 +236,7 @@ static int server_start(server *sv) {
GPR_ASSERT(listen(fd, MAX_NUM_FD) == 0);
sv->em_fd = grpc_fd_create(fd, "server");
+ grpc_pollset_add_fd(&g_pollset, sv->em_fd);
/* Register to be interested in reading from listen_fd. */
sv->listen_closure.cb = listen_cb;
sv->listen_closure.cb_arg = sv;
@@ -247,12 +247,11 @@ static int server_start(server *sv) {
/* Wait and shutdown a sever. */
static void server_wait_and_shutdown(server *sv) {
- gpr_mu_lock(&sv->mu);
- while (!sv->done) gpr_cv_wait(&sv->done_cv, &sv->mu, gpr_inf_future);
- gpr_mu_unlock(&sv->mu);
-
- gpr_mu_destroy(&sv->mu);
- gpr_cv_destroy(&sv->done_cv);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (!sv->done) {
+ grpc_pollset_work(&g_pollset, gpr_inf_future);
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
/* ===An upload client to test notify_on_write=== */
@@ -271,9 +270,7 @@ typedef struct {
notify_on_write to schedule another write. */
int client_write_cnt;
- gpr_mu mu; /* protect done and done_cv */
- gpr_cv done_cv; /* signaled when a client finishes sending */
- int done; /* set to 1 when a client finishes sending */
+ int done; /* set to 1 when a client finishes sending */
grpc_iomgr_closure write_closure;
} client;
@@ -281,17 +278,15 @@ static void client_init(client *cl) {
memset(cl->write_buf, 0, sizeof(cl->write_buf));
cl->write_bytes_total = 0;
cl->client_write_cnt = 0;
- gpr_mu_init(&cl->mu);
- gpr_cv_init(&cl->done_cv);
cl->done = 0;
}
/* Called when a client upload session is ready to shutdown. */
static void client_session_shutdown_cb(void *arg /*client*/, int success) {
client *cl = arg;
- grpc_fd_orphan(cl->em_fd, NULL, NULL);
+ grpc_fd_orphan(cl->em_fd, NULL, "c");
cl->done = 1;
- gpr_cv_signal(&cl->done_cv);
+ grpc_pollset_kick(&g_pollset);
}
/* Write as much as possible, then register notify_on_write. */
@@ -302,9 +297,9 @@ static void client_session_write(void *arg, /*client*/
ssize_t write_once = 0;
if (!success) {
- gpr_mu_lock(&cl->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
client_session_shutdown_cb(arg, 1);
- gpr_mu_unlock(&cl->mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
return;
}
@@ -314,7 +309,7 @@ static void client_session_write(void *arg, /*client*/
} while (write_once > 0);
if (errno == EAGAIN) {
- gpr_mu_lock(&cl->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
if (cl->client_write_cnt < CLIENT_TOTAL_WRITE_CNT) {
cl->write_closure.cb = client_session_write;
cl->write_closure.cb_arg = cl;
@@ -323,7 +318,7 @@ static void client_session_write(void *arg, /*client*/
} else {
client_session_shutdown_cb(arg, 1);
}
- gpr_mu_unlock(&cl->mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
} else {
gpr_log(GPR_ERROR, "unknown errno %s", strerror(errno));
abort();
@@ -352,18 +347,18 @@ static void client_start(client *cl, int port) {
}
cl->em_fd = grpc_fd_create(fd, "client");
+ grpc_pollset_add_fd(&g_pollset, cl->em_fd);
client_session_write(cl, 1);
}
/* Wait for the signal to shutdown a client. */
static void client_wait_and_shutdown(client *cl) {
- gpr_mu_lock(&cl->mu);
- while (!cl->done) gpr_cv_wait(&cl->done_cv, &cl->mu, gpr_inf_future);
- gpr_mu_unlock(&cl->mu);
-
- gpr_mu_destroy(&cl->mu);
- gpr_cv_destroy(&cl->done_cv);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (!cl->done) {
+ grpc_pollset_work(&g_pollset, gpr_inf_future);
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
/* Test grpc_fd. Start an upload server and client, upload a stream of
@@ -385,38 +380,29 @@ static void test_grpc_fd(void) {
}
typedef struct fd_change_data {
- gpr_mu mu;
- gpr_cv cv;
void (*cb_that_ran)(void *, int success);
} fd_change_data;
-void init_change_data(fd_change_data *fdc) {
- gpr_mu_init(&fdc->mu);
- gpr_cv_init(&fdc->cv);
- fdc->cb_that_ran = NULL;
-}
+void init_change_data(fd_change_data *fdc) { fdc->cb_that_ran = NULL; }
-void destroy_change_data(fd_change_data *fdc) {
- gpr_mu_destroy(&fdc->mu);
- gpr_cv_destroy(&fdc->cv);
-}
+void destroy_change_data(fd_change_data *fdc) {}
static void first_read_callback(void *arg /* fd_change_data */, int success) {
fd_change_data *fdc = arg;
- gpr_mu_lock(&fdc->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
fdc->cb_that_ran = first_read_callback;
- gpr_cv_signal(&fdc->cv);
- gpr_mu_unlock(&fdc->mu);
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
static void second_read_callback(void *arg /* fd_change_data */, int success) {
fd_change_data *fdc = arg;
- gpr_mu_lock(&fdc->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
fdc->cb_that_ran = second_read_callback;
- gpr_cv_signal(&fdc->cv);
- gpr_mu_unlock(&fdc->mu);
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
/* Test that changing the callback we use for notify_on_read actually works.
@@ -448,6 +434,7 @@ static void test_grpc_fd_change(void) {
GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change");
+ grpc_pollset_add_fd(&g_pollset, em_fd);
/* Register the first callback, then make its FD readable */
grpc_fd_notify_on_read(em_fd, &first_closure);
@@ -456,12 +443,12 @@ static void test_grpc_fd_change(void) {
GPR_ASSERT(result == 1);
/* And now wait for it to run. */
- gpr_mu_lock(&a.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
while (a.cb_that_ran == NULL) {
- gpr_cv_wait(&a.cv, &a.mu, gpr_inf_future);
+ grpc_pollset_work(&g_pollset, gpr_inf_future);
}
GPR_ASSERT(a.cb_that_ran == first_read_callback);
- gpr_mu_unlock(&a.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
/* And drain the socket so we can generate a new read edge */
result = read(sv[0], &data, 1);
@@ -474,25 +461,29 @@ static void test_grpc_fd_change(void) {
result = write(sv[1], &data, 1);
GPR_ASSERT(result == 1);
- gpr_mu_lock(&b.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
while (b.cb_that_ran == NULL) {
- gpr_cv_wait(&b.cv, &b.mu, gpr_inf_future);
+ grpc_pollset_work(&g_pollset, gpr_inf_future);
}
/* Except now we verify that second_read_callback ran instead */
GPR_ASSERT(b.cb_that_ran == second_read_callback);
- gpr_mu_unlock(&b.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
- grpc_fd_orphan(em_fd, NULL, NULL);
+ grpc_fd_orphan(em_fd, NULL, "d");
destroy_change_data(&a);
destroy_change_data(&b);
close(sv[1]);
}
+static void destroy_pollset(void *p) { grpc_pollset_destroy(p); }
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_iomgr_init();
+ grpc_pollset_init(&g_pollset);
test_grpc_fd();
test_grpc_fd_change();
+ grpc_pollset_shutdown(&g_pollset, destroy_pollset, &g_pollset);
grpc_iomgr_shutdown();
return 0;
}
diff --git a/test/core/iomgr/poll_kick_posix_test.c b/test/core/iomgr/poll_kick_posix_test.c
index 2c5b444d3a..3aa6807806 100644
--- a/test/core/iomgr/poll_kick_posix_test.c
+++ b/test/core/iomgr/poll_kick_posix_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/iomgr/pollset_kick.h"
+#include "src/core/iomgr/pollset_kick_posix.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -45,31 +45,31 @@ static void test_allocation(void) {
static void test_non_kick(void) {
grpc_pollset_kick_state state;
- int fd;
+ grpc_kick_fd_info *kfd;
grpc_pollset_kick_init(&state);
- fd = grpc_pollset_kick_pre_poll(&state);
- GPR_ASSERT(fd >= 0);
+ kfd = grpc_pollset_kick_pre_poll(&state);
+ GPR_ASSERT(kfd != NULL);
- grpc_pollset_kick_post_poll(&state);
+ grpc_pollset_kick_post_poll(&state, kfd);
grpc_pollset_kick_destroy(&state);
}
static void test_basic_kick(void) {
/* Kicked during poll */
grpc_pollset_kick_state state;
- int fd;
+ grpc_kick_fd_info *kfd;
grpc_pollset_kick_init(&state);
- fd = grpc_pollset_kick_pre_poll(&state);
- GPR_ASSERT(fd >= 0);
+ kfd = grpc_pollset_kick_pre_poll(&state);
+ GPR_ASSERT(kfd != NULL);
grpc_pollset_kick_kick(&state);
/* Now hypothetically we polled and found that we were kicked */
- grpc_pollset_kick_consume(&state);
+ grpc_pollset_kick_consume(&state, kfd);
- grpc_pollset_kick_post_poll(&state);
+ grpc_pollset_kick_post_poll(&state, kfd);
grpc_pollset_kick_destroy(&state);
}
@@ -77,13 +77,13 @@ static void test_basic_kick(void) {
static void test_non_poll_kick(void) {
/* Kick before entering poll */
grpc_pollset_kick_state state;
- int fd;
+ grpc_kick_fd_info *kfd;
grpc_pollset_kick_init(&state);
grpc_pollset_kick_kick(&state);
- fd = grpc_pollset_kick_pre_poll(&state);
- GPR_ASSERT(fd < 0);
+ kfd = grpc_pollset_kick_pre_poll(&state);
+ GPR_ASSERT(kfd == NULL);
grpc_pollset_kick_destroy(&state);
}
@@ -92,20 +92,20 @@ static void test_non_poll_kick(void) {
static void test_over_free(void) {
/* Check high watermark pipe free logic */
int i;
- struct grpc_pollset_kick_state *kick_state =
- gpr_malloc(sizeof(grpc_pollset_kick_state) * GRPC_MAX_CACHED_PIPES);
+ grpc_kick_fd_info **kfds =
+ gpr_malloc(sizeof(grpc_kick_fd_info *) * GRPC_MAX_CACHED_PIPES);
+ grpc_pollset_kick_state state;
+ grpc_pollset_kick_init(&state);
for (i = 0; i < GRPC_MAX_CACHED_PIPES; ++i) {
- int fd;
- grpc_pollset_kick_init(&kick_state[i]);
- fd = grpc_pollset_kick_pre_poll(&kick_state[i]);
- GPR_ASSERT(fd >= 0);
+ kfds[i] = grpc_pollset_kick_pre_poll(&state);
+ GPR_ASSERT(kfds[i] != NULL);
}
for (i = 0; i < GRPC_MAX_CACHED_PIPES; ++i) {
- grpc_pollset_kick_post_poll(&kick_state[i]);
- grpc_pollset_kick_destroy(&kick_state[i]);
+ grpc_pollset_kick_post_poll(&state, kfds[i]);
}
- gpr_free(kick_state);
+ grpc_pollset_kick_destroy(&state);
+ gpr_free(kfds);
}
static void run_tests(void) {
diff --git a/test/core/iomgr/tcp_client_posix_test.c b/test/core/iomgr/tcp_client_posix_test.c
index 3c4d8fed4f..b673c032b2 100644
--- a/test/core/iomgr/tcp_client_posix_test.c
+++ b/test/core/iomgr/tcp_client_posix_test.c
@@ -45,20 +45,31 @@
#include <grpc/support/time.h>
#include "test/core/util/test_config.h"
+static grpc_pollset_set g_pollset_set;
+static grpc_pollset g_pollset;
+static int g_connections_complete = 0;
+
static gpr_timespec test_deadline(void) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10);
}
+static void finish_connection() {
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ g_connections_complete++;
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
+}
+
static void must_succeed(void *arg, grpc_endpoint *tcp) {
GPR_ASSERT(tcp);
grpc_endpoint_shutdown(tcp);
grpc_endpoint_destroy(tcp);
- gpr_event_set(arg, (void *)1);
+ finish_connection();
}
static void must_fail(void *arg, grpc_endpoint *tcp) {
GPR_ASSERT(!tcp);
- gpr_event_set(arg, (void *)1);
+ finish_connection();
}
void test_succeeds(void) {
@@ -66,9 +77,7 @@ void test_succeeds(void) {
socklen_t addr_len = sizeof(addr);
int svr_fd;
int r;
- gpr_event ev;
-
- gpr_event_init(&ev);
+ int connections_complete_before;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
@@ -79,10 +88,14 @@ void test_succeeds(void) {
GPR_ASSERT(0 == bind(svr_fd, (struct sockaddr *)&addr, addr_len));
GPR_ASSERT(0 == listen(svr_fd, 1));
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ connections_complete_before = g_connections_complete;
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
+
/* connect to it */
GPR_ASSERT(getsockname(svr_fd, (struct sockaddr *)&addr, &addr_len) == 0);
- grpc_tcp_client_connect(must_succeed, &ev, (struct sockaddr *)&addr, addr_len,
- gpr_inf_future);
+ grpc_tcp_client_connect(must_succeed, NULL, &g_pollset_set,
+ (struct sockaddr *)&addr, addr_len, gpr_inf_future);
/* await the connection */
do {
@@ -92,26 +105,39 @@ void test_succeeds(void) {
GPR_ASSERT(r >= 0);
close(r);
- /* wait for the connection callback to finish */
- GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+
+ while (g_connections_complete == connections_complete_before) {
+ grpc_pollset_work(&g_pollset, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5));
+ }
+
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
void test_fails(void) {
struct sockaddr_in addr;
socklen_t addr_len = sizeof(addr);
- gpr_event ev;
-
- gpr_event_init(&ev);
+ int connections_complete_before;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ connections_complete_before = g_connections_complete;
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
+
/* connect to a broken address */
- grpc_tcp_client_connect(must_fail, &ev, (struct sockaddr *)&addr, addr_len,
- gpr_inf_future);
+ grpc_tcp_client_connect(must_fail, NULL, &g_pollset_set,
+ (struct sockaddr *)&addr, addr_len, gpr_inf_future);
+
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
/* wait for the connection callback to finish */
- GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
+ while (g_connections_complete == connections_complete_before) {
+ grpc_pollset_work(&g_pollset, test_deadline());
+ }
+
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
void test_times_out(void) {
@@ -122,11 +148,9 @@ void test_times_out(void) {
int client_fd[NUM_CLIENT_CONNECTS];
int i;
int r;
- gpr_event ev;
+ int connections_complete_before;
gpr_timespec connect_deadline;
- gpr_event_init(&ev);
-
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
@@ -153,28 +177,50 @@ void test_times_out(void) {
connect_deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1);
- grpc_tcp_client_connect(must_fail, &ev, (struct sockaddr *)&addr, addr_len,
- connect_deadline);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ connections_complete_before = g_connections_complete;
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
+
+ grpc_tcp_client_connect(must_fail, NULL, &g_pollset_set,
+ (struct sockaddr *)&addr, addr_len, connect_deadline);
+
/* Make sure the event doesn't trigger early */
- GPR_ASSERT(!gpr_event_wait(&ev, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(500)));
- /* Now wait until it should have triggered */
- sleep(1);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (gpr_time_cmp(gpr_time_add(connect_deadline, gpr_time_from_seconds(2)),
+ gpr_now()) > 0) {
+ int is_after_deadline = gpr_time_cmp(connect_deadline, gpr_now()) <= 0;
+ if (is_after_deadline &&
+ gpr_time_cmp(gpr_time_add(connect_deadline, gpr_time_from_seconds(1)),
+ gpr_now()) > 0) {
+ /* allow some slack before insisting that things be done */
+ } else {
+ GPR_ASSERT(g_connections_complete ==
+ connections_complete_before + is_after_deadline);
+ }
+ grpc_pollset_work(&g_pollset, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10));
+ }
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
- /* wait for the connection callback to finish */
- GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
close(svr_fd);
for (i = 0; i < NUM_CLIENT_CONNECTS; ++i) {
close(client_fd[i]);
}
}
+static void destroy_pollset(void *p) { grpc_pollset_destroy(p); }
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_iomgr_init();
+ grpc_pollset_set_init(&g_pollset_set);
+ grpc_pollset_init(&g_pollset);
+ grpc_pollset_set_add_pollset(&g_pollset_set, &g_pollset);
test_succeeds();
gpr_log(GPR_ERROR, "End of first test");
test_fails();
test_times_out();
+ grpc_pollset_set_destroy(&g_pollset_set);
+ grpc_pollset_shutdown(&g_pollset, destroy_pollset, &g_pollset);
grpc_iomgr_shutdown();
return 0;
}
diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c
index 2cfcc8311c..a23c64928e 100644
--- a/test/core/iomgr/tcp_posix_test.c
+++ b/test/core/iomgr/tcp_posix_test.c
@@ -48,6 +48,8 @@
#include "test/core/util/test_config.h"
#include "test/core/iomgr/endpoint_tests.h"
+static grpc_pollset g_pollset;
+
/*
General test notes:
@@ -114,8 +116,6 @@ static size_t fill_socket_partial(int fd, size_t bytes) {
struct read_socket_state {
grpc_endpoint *ep;
- gpr_mu mu;
- gpr_cv cv;
ssize_t read_bytes;
ssize_t target_read_bytes;
};
@@ -145,18 +145,18 @@ static void read_cb(void *user_data, gpr_slice *slices, size_t nslices,
GPR_ASSERT(error == GRPC_ENDPOINT_CB_OK);
- gpr_mu_lock(&state->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
current_data = state->read_bytes % 256;
read_bytes = count_and_unref_slices(slices, nslices, &current_data);
state->read_bytes += read_bytes;
gpr_log(GPR_INFO, "Read %d bytes of %d", read_bytes,
state->target_read_bytes);
if (state->read_bytes >= state->target_read_bytes) {
- gpr_cv_signal(&state->cv);
+ /* empty */
} else {
grpc_endpoint_notify_on_read(state->ep, read_cb, state);
}
- gpr_mu_unlock(&state->mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
/* Write to a socket, then read from it using the grpc_tcp API. */
@@ -173,31 +173,25 @@ static void read_test(ssize_t num_bytes, ssize_t slice_size) {
create_sockets(sv);
ep = grpc_tcp_create(grpc_fd_create(sv[1], "read_test"), slice_size);
+ grpc_endpoint_add_to_pollset(ep, &g_pollset);
+
written_bytes = fill_socket_partial(sv[0], num_bytes);
gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes);
- gpr_mu_init(&state.mu);
- gpr_cv_init(&state.cv);
state.ep = ep;
state.read_bytes = 0;
state.target_read_bytes = written_bytes;
grpc_endpoint_notify_on_read(ep, read_cb, &state);
- gpr_mu_lock(&state.mu);
- for (;;) {
- GPR_ASSERT(gpr_cv_wait(&state.cv, &state.mu, deadline) == 0);
- if (state.read_bytes >= state.target_read_bytes) {
- break;
- }
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (state.read_bytes < state.target_read_bytes) {
+ grpc_pollset_work(&g_pollset, deadline);
}
GPR_ASSERT(state.read_bytes == state.target_read_bytes);
- gpr_mu_unlock(&state.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
grpc_endpoint_destroy(ep);
-
- gpr_mu_destroy(&state.mu);
- gpr_cv_destroy(&state.cv);
}
/* Write to a socket until it fills up, then read from it using the grpc_tcp
@@ -214,37 +208,29 @@ static void large_read_test(ssize_t slice_size) {
create_sockets(sv);
ep = grpc_tcp_create(grpc_fd_create(sv[1], "large_read_test"), slice_size);
+ grpc_endpoint_add_to_pollset(ep, &g_pollset);
+
written_bytes = fill_socket(sv[0]);
gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes);
- gpr_mu_init(&state.mu);
- gpr_cv_init(&state.cv);
state.ep = ep;
state.read_bytes = 0;
state.target_read_bytes = written_bytes;
grpc_endpoint_notify_on_read(ep, read_cb, &state);
- gpr_mu_lock(&state.mu);
- for (;;) {
- GPR_ASSERT(gpr_cv_wait(&state.cv, &state.mu, deadline) == 0);
- if (state.read_bytes >= state.target_read_bytes) {
- break;
- }
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ while (state.read_bytes < state.target_read_bytes) {
+ grpc_pollset_work(&g_pollset, deadline);
}
GPR_ASSERT(state.read_bytes == state.target_read_bytes);
- gpr_mu_unlock(&state.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
grpc_endpoint_destroy(ep);
-
- gpr_mu_destroy(&state.mu);
- gpr_cv_destroy(&state.cv);
}
struct write_socket_state {
grpc_endpoint *ep;
- gpr_mu mu;
- gpr_cv cv;
int write_done;
};
@@ -275,11 +261,11 @@ static void write_done(void *user_data /* write_socket_state */,
grpc_endpoint_cb_status error) {
struct write_socket_state *state = (struct write_socket_state *)user_data;
gpr_log(GPR_INFO, "Write done callback called");
- gpr_mu_lock(&state->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
gpr_log(GPR_INFO, "Signalling write done");
state->write_done = 1;
- gpr_cv_signal(&state->cv);
- gpr_mu_unlock(&state->mu);
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) {
@@ -294,6 +280,9 @@ void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) {
GPR_ASSERT(fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) == 0);
for (;;) {
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ grpc_pollset_work(&g_pollset, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(10));
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
do {
bytes_read =
read(fd, buf, bytes_left > read_size ? read_size : bytes_left);
@@ -352,9 +341,8 @@ static void write_test(ssize_t num_bytes, ssize_t slice_size) {
ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_test"),
GRPC_TCP_DEFAULT_READ_SLICE_SIZE);
+ grpc_endpoint_add_to_pollset(ep, &g_pollset);
- gpr_mu_init(&state.mu);
- gpr_cv_init(&state.cv);
state.ep = ep;
state.write_done = 0;
@@ -367,19 +355,17 @@ static void write_test(ssize_t num_bytes, ssize_t slice_size) {
GPR_ASSERT(read_bytes == num_bytes);
} else {
drain_socket_blocking(sv[0], num_bytes, num_bytes);
- gpr_mu_lock(&state.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
for (;;) {
if (state.write_done) {
break;
}
- GPR_ASSERT(gpr_cv_wait(&state.cv, &state.mu, deadline) == 0);
+ grpc_pollset_work(&g_pollset, deadline);
}
- gpr_mu_unlock(&state.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
grpc_endpoint_destroy(ep);
- gpr_mu_destroy(&state.mu);
- gpr_cv_destroy(&state.cv);
gpr_free(slices);
}
@@ -409,10 +395,10 @@ static void write_error_test(ssize_t num_bytes, ssize_t slice_size) {
ep = grpc_tcp_create(grpc_fd_create(sv[1], "write_error_test"),
GRPC_TCP_DEFAULT_READ_SLICE_SIZE);
+ grpc_endpoint_add_to_pollset(ep, &g_pollset);
+
close(sv[0]);
- gpr_mu_init(&state.mu);
- gpr_cv_init(&state.cv);
state.ep = ep;
state.write_done = 0;
@@ -425,20 +411,18 @@ static void write_error_test(ssize_t num_bytes, ssize_t slice_size) {
break;
case GRPC_ENDPOINT_WRITE_PENDING:
grpc_endpoint_notify_on_read(ep, read_done_for_write_error, NULL);
- gpr_mu_lock(&state.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
for (;;) {
if (state.write_done) {
break;
}
- GPR_ASSERT(gpr_cv_wait(&state.cv, &state.mu, deadline) == 0);
+ grpc_pollset_work(&g_pollset, deadline);
}
- gpr_mu_unlock(&state.mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
break;
}
grpc_endpoint_destroy(ep);
- gpr_mu_destroy(&state.mu);
- gpr_cv_destroy(&state.cv);
free(slices);
}
@@ -479,6 +463,8 @@ static grpc_endpoint_test_fixture create_fixture_tcp_socketpair(
grpc_tcp_create(grpc_fd_create(sv[0], "fixture:client"), slice_size);
f.server_ep =
grpc_tcp_create(grpc_fd_create(sv[1], "fixture:server"), slice_size);
+ grpc_endpoint_add_to_pollset(f.client_ep, &g_pollset);
+ grpc_endpoint_add_to_pollset(f.server_ep, &g_pollset);
return f;
}
@@ -487,11 +473,15 @@ static grpc_endpoint_test_config configs[] = {
{"tcp/tcp_socketpair", create_fixture_tcp_socketpair, clean_up},
};
+static void destroy_pollset(void *p) { grpc_pollset_destroy(p); }
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
+ grpc_pollset_init(&g_pollset);
run_tests();
- grpc_endpoint_tests(configs[0]);
+ grpc_endpoint_tests(configs[0], &g_pollset);
+ grpc_pollset_shutdown(&g_pollset, destroy_pollset, &g_pollset);
grpc_shutdown();
return 0;
diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c
index 328b19f68a..fb262711c0 100644
--- a/test/core/iomgr/tcp_server_posix_test.c
+++ b/test/core/iomgr/tcp_server_posix_test.c
@@ -45,18 +45,17 @@
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x)
-static gpr_mu mu;
-static gpr_cv cv;
-static int nconnects = 0;
+static grpc_pollset g_pollset;
+static int g_nconnects = 0;
static void on_connect(void *arg, grpc_endpoint *tcp) {
grpc_endpoint_shutdown(tcp);
grpc_endpoint_destroy(tcp);
- gpr_mu_lock(&mu);
- nconnects++;
- gpr_cv_broadcast(&cv);
- gpr_mu_unlock(&mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
+ g_nconnects++;
+ grpc_pollset_kick(&g_pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
}
static void test_no_op(void) {
@@ -106,12 +105,11 @@ static void test_connect(int n) {
grpc_tcp_server *s = grpc_tcp_server_create();
int nconnects_before;
gpr_timespec deadline;
+ grpc_pollset *pollsets[1];
int i;
LOG_TEST("test_connect");
gpr_log(GPR_INFO, "clients=%d", n);
- gpr_mu_lock(&mu);
-
memset(&addr, 0, sizeof(addr));
addr.ss_family = AF_INET;
GPR_ASSERT(grpc_tcp_server_add_port(s, (struct sockaddr *)&addr, addr_len));
@@ -121,38 +119,42 @@ static void test_connect(int n) {
GPR_ASSERT(getsockname(svrfd, (struct sockaddr *)&addr, &addr_len) == 0);
GPR_ASSERT(addr_len <= sizeof(addr));
- grpc_tcp_server_start(s, NULL, 0, on_connect, NULL);
+ pollsets[0] = &g_pollset;
+ grpc_tcp_server_start(s, pollsets, 1, on_connect, NULL);
+
+ gpr_mu_lock(GRPC_POLLSET_MU(&g_pollset));
for (i = 0; i < n; i++) {
- deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1);
+ deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(4000);
- nconnects_before = nconnects;
+ nconnects_before = g_nconnects;
clifd = socket(addr.ss_family, SOCK_STREAM, 0);
GPR_ASSERT(clifd >= 0);
+ gpr_log(GPR_DEBUG, "start connect");
GPR_ASSERT(connect(clifd, (struct sockaddr *)&addr, addr_len) == 0);
- while (nconnects == nconnects_before) {
- GPR_ASSERT(gpr_cv_wait(&cv, &mu, deadline) == 0);
+ gpr_log(GPR_DEBUG, "wait");
+ while (g_nconnects == nconnects_before &&
+ gpr_time_cmp(deadline, gpr_now()) > 0) {
+ grpc_pollset_work(&g_pollset, deadline);
}
+ gpr_log(GPR_DEBUG, "wait done");
- GPR_ASSERT(nconnects == nconnects_before + 1);
+ GPR_ASSERT(g_nconnects == nconnects_before + 1);
close(clifd);
-
- if (i != n - 1) {
- sleep(1);
- }
}
- gpr_mu_unlock(&mu);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&g_pollset));
grpc_tcp_server_destroy(s, NULL, NULL);
}
+static void destroy_pollset(void *p) { grpc_pollset_destroy(p); }
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_iomgr_init();
- gpr_mu_init(&mu);
- gpr_cv_init(&cv);
+ grpc_pollset_init(&g_pollset);
test_no_op();
test_no_op_with_start();
@@ -161,8 +163,7 @@ int main(int argc, char **argv) {
test_connect(1);
test_connect(10);
+ grpc_pollset_shutdown(&g_pollset, destroy_pollset, &g_pollset);
grpc_iomgr_shutdown();
- gpr_mu_destroy(&mu);
- gpr_cv_destroy(&cv);
return 0;
}
diff --git a/test/core/json/json_rewrite_test.c b/test/core/json/json_rewrite_test.c
index ec6deebe76..f5859322ea 100644
--- a/test/core/json/json_rewrite_test.c
+++ b/test/core/json/json_rewrite_test.c
@@ -64,6 +64,11 @@ typedef struct json_reader_userdata {
static void json_writer_output_char(void* userdata, char c) {
json_writer_userdata* state = userdata;
int cmp = fgetc(state->cmp);
+
+ /* treat CRLF as LF */
+ if (cmp == '\r' && c == '\n') {
+ cmp = fgetc(state->cmp);
+ }
GPR_ASSERT(cmp == c);
}
diff --git a/test/core/security/auth_context_test.c b/test/core/security/auth_context_test.c
index 2fb0c01f6f..2b12551a06 100644
--- a/test/core/security/auth_context_test.c
+++ b/test/core/security/auth_context_test.c
@@ -52,7 +52,7 @@ static void test_empty_context(void) {
GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
it = grpc_auth_context_find_properties_by_name(ctx, "foo");
GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
- grpc_auth_context_unref(ctx);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
}
static void test_simple_context(void) {
@@ -86,7 +86,7 @@ static void test_simple_context(void) {
GPR_ASSERT(grpc_auth_property_iterator_next(&it) == &ctx->properties[1]);
GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
- grpc_auth_context_unref(ctx);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
}
static void test_chained_context(void) {
@@ -96,7 +96,7 @@ static void test_chained_context(void) {
size_t i;
gpr_log(GPR_INFO, "test_chained_context");
- grpc_auth_context_unref(chained);
+ GRPC_AUTH_CONTEXT_UNREF(chained, "chained");
chained->properties[0] =
grpc_auth_property_init_from_cstring("name", "padapo");
chained->properties[1] = grpc_auth_property_init_from_cstring("foo", "baz");
@@ -129,7 +129,7 @@ static void test_chained_context(void) {
GPR_ASSERT(grpc_auth_property_iterator_next(&it) == &chained->properties[0]);
GPR_ASSERT(grpc_auth_property_iterator_next(&it) == NULL);
- grpc_auth_context_unref(ctx);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
}
diff --git a/test/core/security/base64_test.c b/test/core/security/base64_test.c
index a922896bc3..f8b7ebf554 100644
--- a/test/core/security/base64_test.c
+++ b/test/core/security/base64_test.c
@@ -169,6 +169,43 @@ static void test_rfc4648_test_vectors(void) {
gpr_free(b64);
}
+static void test_unpadded_decode(void) {
+ gpr_slice decoded;
+
+ decoded = grpc_base64_decode("Zm9vYmFy", 0);
+ GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(gpr_slice_str_cmp(decoded, "foobar") == 0);
+ gpr_slice_unref(decoded);
+
+ decoded = grpc_base64_decode("Zm9vYmE", 0);
+ GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(gpr_slice_str_cmp(decoded, "fooba") == 0);
+ gpr_slice_unref(decoded);
+
+ decoded = grpc_base64_decode("Zm9vYg", 0);
+ GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(gpr_slice_str_cmp(decoded, "foob") == 0);
+ gpr_slice_unref(decoded);
+
+ decoded = grpc_base64_decode("Zm9v", 0);
+ GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(gpr_slice_str_cmp(decoded, "foo") == 0);
+ gpr_slice_unref(decoded);
+
+ decoded = grpc_base64_decode("Zm8", 0);
+ GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(gpr_slice_str_cmp(decoded, "fo") == 0);
+ gpr_slice_unref(decoded);
+
+ decoded = grpc_base64_decode("Zg", 0);
+ GPR_ASSERT(!GPR_SLICE_IS_EMPTY(decoded));
+ GPR_ASSERT(gpr_slice_str_cmp(decoded, "f") == 0);
+ gpr_slice_unref(decoded);
+
+ decoded = grpc_base64_decode("", 0);
+ GPR_ASSERT(GPR_SLICE_IS_EMPTY(decoded));
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_simple_encode_decode_b64_no_multiline();
@@ -181,5 +218,6 @@ int main(int argc, char **argv) {
test_full_range_encode_decode_b64_urlsafe_multiline();
test_url_safe_unsafe_mismtach_failure();
test_rfc4648_test_vectors();
+ test_unpadded_decode();
return 0;
}
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index 69ec680c18..4253be6b07 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -210,8 +210,7 @@ static void test_oauth2_token_fetcher_creds_parsing_ok(void) {
grpc_httpcli_response response =
http_response(200, valid_oauth2_json_response);
GPR_ASSERT(grpc_oauth2_token_fetcher_credentials_parse_server_response(
- &response, &token_md, &token_lifetime) ==
- GRPC_CREDENTIALS_OK);
+ &response, &token_md, &token_lifetime) == GRPC_CREDENTIALS_OK);
GPR_ASSERT(token_lifetime.tv_sec == 3599);
GPR_ASSERT(token_lifetime.tv_nsec == 0);
GPR_ASSERT(token_md->num_entries == 1);
@@ -328,7 +327,7 @@ static void test_iam_creds(void) {
test_iam_authorization_token, test_iam_authority_selector);
GPR_ASSERT(grpc_credentials_has_request_metadata(creds));
GPR_ASSERT(grpc_credentials_has_request_metadata_only(creds));
- grpc_credentials_get_request_metadata(creds, test_service_url,
+ grpc_credentials_get_request_metadata(creds, NULL, test_service_url,
check_iam_metadata, creds);
}
@@ -354,8 +353,8 @@ static void test_ssl_oauth2_composite_creds(void) {
grpc_composite_credentials_create(ssl_creds, oauth2_creds);
grpc_credentials_unref(ssl_creds);
grpc_credentials_unref(oauth2_creds);
- GPR_ASSERT(strcmp(composite_creds->type,
- GRPC_CREDENTIALS_TYPE_COMPOSITE) == 0);
+ GPR_ASSERT(strcmp(composite_creds->type, GRPC_CREDENTIALS_TYPE_COMPOSITE) ==
+ 0);
GPR_ASSERT(grpc_credentials_has_request_metadata(composite_creds));
GPR_ASSERT(!grpc_credentials_has_request_metadata_only(composite_creds));
creds_array = grpc_composite_credentials_get_credentials(composite_creds);
@@ -364,14 +363,13 @@ static void test_ssl_oauth2_composite_creds(void) {
GRPC_CREDENTIALS_TYPE_SSL) == 0);
GPR_ASSERT(strcmp(creds_array->creds_array[1]->type,
GRPC_CREDENTIALS_TYPE_OAUTH2) == 0);
- grpc_credentials_get_request_metadata(composite_creds, test_service_url,
+ grpc_credentials_get_request_metadata(composite_creds, NULL, test_service_url,
check_ssl_oauth2_composite_metadata,
composite_creds);
}
void test_ssl_fake_transport_security_composite_creds_failure(void) {
- grpc_credentials *ssl_creds =
- grpc_ssl_credentials_create(NULL, NULL);
+ grpc_credentials *ssl_creds = grpc_ssl_credentials_create(NULL, NULL);
grpc_credentials *fake_transport_security_creds =
grpc_fake_transport_security_credentials_create();
@@ -412,8 +410,8 @@ static void test_ssl_oauth2_iam_composite_creds(void) {
grpc_credentials_unref(oauth2_creds);
grpc_credentials_unref(aux_creds);
grpc_credentials_unref(iam_creds);
- GPR_ASSERT(strcmp(composite_creds->type,
- GRPC_CREDENTIALS_TYPE_COMPOSITE) == 0);
+ GPR_ASSERT(strcmp(composite_creds->type, GRPC_CREDENTIALS_TYPE_COMPOSITE) ==
+ 0);
GPR_ASSERT(grpc_credentials_has_request_metadata(composite_creds));
GPR_ASSERT(!grpc_credentials_has_request_metadata_only(composite_creds));
creds_array = grpc_composite_credentials_get_credentials(composite_creds);
@@ -424,7 +422,7 @@ static void test_ssl_oauth2_iam_composite_creds(void) {
GRPC_CREDENTIALS_TYPE_OAUTH2) == 0);
GPR_ASSERT(strcmp(creds_array->creds_array[2]->type,
GRPC_CREDENTIALS_TYPE_IAM) == 0);
- grpc_credentials_get_request_metadata(composite_creds, test_service_url,
+ grpc_credentials_get_request_metadata(composite_creds, NULL, test_service_url,
check_ssl_oauth2_iam_composite_metadata,
composite_creds);
}
@@ -455,9 +453,10 @@ static void validate_compute_engine_http_request(
const grpc_httpcli_request *request) {
GPR_ASSERT(!request->use_ssl);
GPR_ASSERT(strcmp(request->host, "metadata") == 0);
- GPR_ASSERT(strcmp(request->path,
- "/computeMetadata/v1/instance/service-accounts/default/token")
- == 0);
+ GPR_ASSERT(
+ strcmp(request->path,
+ "/computeMetadata/v1/instance/service-accounts/default/token") ==
+ 0);
GPR_ASSERT(request->hdr_count == 1);
GPR_ASSERT(strcmp(request->hdrs[0].key, "Metadata-Flavor") == 0);
GPR_ASSERT(strcmp(request->hdrs[0].value, "Google") == 0);
@@ -506,16 +505,16 @@ static void test_compute_engine_creds_success(void) {
/* First request: http get should be called. */
grpc_httpcli_set_override(compute_engine_httpcli_get_success_override,
httpcli_post_should_not_be_called);
- grpc_credentials_get_request_metadata(compute_engine_creds, test_service_url,
- on_oauth2_creds_get_metadata_success,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ compute_engine_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_success, (void *)test_user_data);
/* Second request: the cached token should be served directly. */
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
httpcli_post_should_not_be_called);
- grpc_credentials_get_request_metadata(compute_engine_creds, test_service_url,
- on_oauth2_creds_get_metadata_success,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ compute_engine_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_success, (void *)test_user_data);
grpc_credentials_unref(compute_engine_creds);
grpc_httpcli_set_override(NULL, NULL);
@@ -528,9 +527,9 @@ static void test_compute_engine_creds_failure(void) {
httpcli_post_should_not_be_called);
GPR_ASSERT(grpc_credentials_has_request_metadata(compute_engine_creds));
GPR_ASSERT(grpc_credentials_has_request_metadata_only(compute_engine_creds));
- grpc_credentials_get_request_metadata(compute_engine_creds, test_service_url,
- on_oauth2_creds_get_metadata_failure,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ compute_engine_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_failure, (void *)test_user_data);
grpc_credentials_unref(compute_engine_creds);
grpc_httpcli_set_override(NULL, NULL);
}
@@ -553,8 +552,8 @@ static void validate_refresh_token_http_request(
GPR_ASSERT(strcmp(request->path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
GPR_ASSERT(request->hdr_count == 1);
GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
}
static int refresh_token_httpcli_post_success(
@@ -587,16 +586,16 @@ static void test_refresh_token_creds_success(void) {
/* First request: http get should be called. */
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
refresh_token_httpcli_post_success);
- grpc_credentials_get_request_metadata(refresh_token_creds, test_service_url,
- on_oauth2_creds_get_metadata_success,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ refresh_token_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_success, (void *)test_user_data);
/* Second request: the cached token should be served directly. */
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
httpcli_post_should_not_be_called);
- grpc_credentials_get_request_metadata(refresh_token_creds, test_service_url,
- on_oauth2_creds_get_metadata_success,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ refresh_token_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_success, (void *)test_user_data);
grpc_credentials_unref(refresh_token_creds);
grpc_httpcli_set_override(NULL, NULL);
@@ -609,9 +608,9 @@ static void test_refresh_token_creds_failure(void) {
refresh_token_httpcli_post_failure);
GPR_ASSERT(grpc_credentials_has_request_metadata(refresh_token_creds));
GPR_ASSERT(grpc_credentials_has_request_metadata_only(refresh_token_creds));
- grpc_credentials_get_request_metadata(refresh_token_creds, test_service_url,
- on_oauth2_creds_get_metadata_failure,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ refresh_token_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_failure, (void *)test_user_data);
grpc_credentials_unref(refresh_token_creds);
grpc_httpcli_set_override(NULL, NULL);
}
@@ -667,8 +666,8 @@ static void validate_service_account_http_request(
char *expected_body = NULL;
GPR_ASSERT(body != NULL);
GPR_ASSERT(body_size != 0);
- gpr_asprintf(&expected_body, "%s%s",
- GRPC_SERVICE_ACCOUNT_POST_BODY_PREFIX, test_signed_jwt);
+ gpr_asprintf(&expected_body, "%s%s", GRPC_SERVICE_ACCOUNT_POST_BODY_PREFIX,
+ test_signed_jwt);
GPR_ASSERT(strlen(expected_body) == body_size);
GPR_ASSERT(memcmp(expected_body, body, body_size) == 0);
gpr_free(expected_body);
@@ -677,8 +676,8 @@ static void validate_service_account_http_request(
GPR_ASSERT(strcmp(request->path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
GPR_ASSERT(request->hdr_count == 1);
GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
- GPR_ASSERT(strcmp(request->hdrs[0].value,
- "application/x-www-form-urlencoded") == 0);
+ GPR_ASSERT(
+ strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0);
}
static int service_account_httpcli_post_success(
@@ -714,18 +713,18 @@ static void test_service_account_creds_success(void) {
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
service_account_httpcli_post_success);
- grpc_credentials_get_request_metadata(service_account_creds, test_service_url,
- on_oauth2_creds_get_metadata_success,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ service_account_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_success, (void *)test_user_data);
/* Second request: the cached token should be served directly. */
grpc_jwt_encode_and_sign_set_override(
encode_and_sign_jwt_should_not_be_called);
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
httpcli_post_should_not_be_called);
- grpc_credentials_get_request_metadata(service_account_creds, test_service_url,
- on_oauth2_creds_get_metadata_success,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ service_account_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_success, (void *)test_user_data);
gpr_free(json_key_string);
grpc_credentials_unref(service_account_creds);
@@ -744,9 +743,9 @@ static void test_service_account_creds_http_failure(void) {
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
service_account_httpcli_post_failure);
- grpc_credentials_get_request_metadata(service_account_creds, test_service_url,
- on_oauth2_creds_get_metadata_failure,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ service_account_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_failure, (void *)test_user_data);
gpr_free(json_key_string);
grpc_credentials_unref(service_account_creds);
@@ -764,9 +763,9 @@ static void test_service_account_creds_signing_failure(void) {
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_failure);
grpc_httpcli_set_override(httpcli_get_should_not_be_called,
httpcli_post_should_not_be_called);
- grpc_credentials_get_request_metadata(service_account_creds, test_service_url,
- on_oauth2_creds_get_metadata_failure,
- (void *)test_user_data);
+ grpc_credentials_get_request_metadata(
+ service_account_creds, NULL, test_service_url,
+ on_oauth2_creds_get_metadata_failure, (void *)test_user_data);
gpr_free(json_key_string);
grpc_credentials_unref(service_account_creds);
@@ -808,21 +807,21 @@ static void test_jwt_creds_success(void) {
/* First request: jwt_encode_and_sign should be called. */
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
- grpc_credentials_get_request_metadata(jwt_creds, test_service_url,
+ grpc_credentials_get_request_metadata(jwt_creds, NULL, test_service_url,
on_jwt_creds_get_metadata_success,
(void *)test_user_data);
/* Second request: the cached token should be served directly. */
grpc_jwt_encode_and_sign_set_override(
encode_and_sign_jwt_should_not_be_called);
- grpc_credentials_get_request_metadata(jwt_creds, test_service_url,
+ grpc_credentials_get_request_metadata(jwt_creds, NULL, test_service_url,
on_jwt_creds_get_metadata_success,
(void *)test_user_data);
/* Third request: Different service url so jwt_encode_and_sign should be
called again (no caching). */
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success);
- grpc_credentials_get_request_metadata(jwt_creds, other_test_service_url,
+ grpc_credentials_get_request_metadata(jwt_creds, NULL, other_test_service_url,
on_jwt_creds_get_metadata_success,
(void *)test_user_data);
@@ -839,7 +838,7 @@ static void test_jwt_creds_signing_failure(void) {
GPR_ASSERT(grpc_credentials_has_request_metadata_only(jwt_creds));
grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_failure);
- grpc_credentials_get_request_metadata(jwt_creds, test_service_url,
+ grpc_credentials_get_request_metadata(jwt_creds, NULL, test_service_url,
on_jwt_creds_get_metadata_failure,
(void *)test_user_data);
diff --git a/test/core/security/fetch_oauth2.c b/test/core/security/fetch_oauth2.c
index 3202df3328..767f724b62 100644
--- a/test/core/security/fetch_oauth2.c
+++ b/test/core/security/fetch_oauth2.c
@@ -46,8 +46,7 @@
#include "src/core/support/file.h"
typedef struct {
- gpr_cv cv;
- gpr_mu mu;
+ grpc_pollset pollset;
int is_done;
} synchronizer;
@@ -69,10 +68,10 @@ static void on_oauth2_response(void *user_data,
printf("Got token: %s.\n", token);
gpr_free(token);
}
- gpr_mu_lock(&sync->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&sync->pollset));
sync->is_done = 1;
- gpr_mu_unlock(&sync->mu);
- gpr_cv_signal(&sync->cv);
+ grpc_pollset_kick(&sync->pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&sync->pollset));
}
static grpc_credentials *create_service_account_creds(
@@ -176,18 +175,16 @@ int main(int argc, char **argv) {
}
GPR_ASSERT(creds != NULL);
- gpr_mu_init(&sync.mu);
- gpr_cv_init(&sync.cv);
+ grpc_pollset_init(&sync.pollset);
sync.is_done = 0;
- grpc_credentials_get_request_metadata(creds, "", on_oauth2_response, &sync);
+ grpc_credentials_get_request_metadata(creds, &sync.pollset, "", on_oauth2_response, &sync);
- gpr_mu_lock(&sync.mu);
- while (!sync.is_done) gpr_cv_wait(&sync.cv, &sync.mu, gpr_inf_future);
- gpr_mu_unlock(&sync.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&sync.pollset));
+ while (!sync.is_done) grpc_pollset_work(&sync.pollset, gpr_inf_future);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&sync.pollset));
- gpr_mu_destroy(&sync.mu);
- gpr_cv_destroy(&sync.cv);
+ grpc_pollset_destroy(&sync.pollset);
grpc_credentials_release(creds);
gpr_cmdline_destroy(cl);
grpc_shutdown();
diff --git a/test/core/security/print_google_default_creds_token.c b/test/core/security/print_google_default_creds_token.c
index 051e8607c4..a0da5b2d93 100644
--- a/test/core/security/print_google_default_creds_token.c
+++ b/test/core/security/print_google_default_creds_token.c
@@ -44,8 +44,7 @@
#include <grpc/support/sync.h>
typedef struct {
- gpr_cv cv;
- gpr_mu mu;
+ grpc_pollset pollset;
int is_done;
} synchronizer;
@@ -61,10 +60,10 @@ static void on_metadata_response(void *user_data,
printf("\nGot token: %s\n\n",
(const char *)GPR_SLICE_START_PTR(md_elems[0].value));
}
- gpr_mu_lock(&sync->mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&sync->pollset));
sync->is_done = 1;
- gpr_mu_unlock(&sync->mu);
- gpr_cv_signal(&sync->cv);
+ grpc_pollset_kick(&sync->pollset);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&sync->pollset));
}
int main(int argc, char **argv) {
@@ -86,18 +85,16 @@ int main(int argc, char **argv) {
goto end;
}
- gpr_mu_init(&sync.mu);
- gpr_cv_init(&sync.cv);
+ grpc_pollset_init(&sync.pollset);
sync.is_done = 0;
- grpc_credentials_get_request_metadata(creds, "", on_metadata_response, &sync);
+ grpc_credentials_get_request_metadata(creds, &sync.pollset, "", on_metadata_response, &sync);
- gpr_mu_lock(&sync.mu);
- while (!sync.is_done) gpr_cv_wait(&sync.cv, &sync.mu, gpr_inf_future);
- gpr_mu_unlock(&sync.mu);
+ gpr_mu_lock(GRPC_POLLSET_MU(&sync.pollset));
+ while (!sync.is_done) grpc_pollset_work(&sync.pollset, gpr_inf_future);
+ gpr_mu_unlock(GRPC_POLLSET_MU(&sync.pollset));
- gpr_mu_destroy(&sync.mu);
- gpr_cv_destroy(&sync.cv);
+ grpc_pollset_destroy(&sync.pollset);
grpc_credentials_release(creds);
end:
diff --git a/test/core/security/secure_endpoint_test.c b/test/core/security/secure_endpoint_test.c
index 30b23624d8..a8368fc842 100644
--- a/test/core/security/secure_endpoint_test.c
+++ b/test/core/security/secure_endpoint_test.c
@@ -44,6 +44,8 @@
#include "test/core/util/test_config.h"
#include "src/core/tsi/fake_transport_security.h"
+static grpc_pollset g_pollset;
+
static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
size_t slice_size, gpr_slice *leftover_slices, size_t leftover_nslices) {
tsi_frame_protector *fake_read_protector = tsi_create_fake_protector(NULL);
@@ -52,6 +54,8 @@ static grpc_endpoint_test_fixture secure_endpoint_create_fixture_tcp_socketpair(
grpc_endpoint_pair tcp;
tcp = grpc_iomgr_create_endpoint_pair("fixture", slice_size);
+ grpc_endpoint_add_to_pollset(tcp.client, &g_pollset);
+ grpc_endpoint_add_to_pollset(tcp.server, &g_pollset);
if (leftover_nslices == 0) {
f.client_ep =
@@ -190,13 +194,17 @@ static void test_destroy_ep_early(grpc_endpoint_test_config config,
clean_up();
}
+static void destroy_pollset(void *p) { grpc_pollset_destroy(p); }
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_iomgr_init();
- grpc_endpoint_tests(configs[0]);
+ grpc_pollset_init(&g_pollset);
+ grpc_endpoint_tests(configs[0], &g_pollset);
test_leftover(configs[1], 1);
test_destroy_ep_early(configs[1], 1);
+ grpc_pollset_shutdown(&g_pollset, destroy_pollset, &g_pollset);
grpc_iomgr_shutdown();
return 0;
diff --git a/test/core/security/security_connector_test.c b/test/core/security/security_connector_test.c
new file mode 100644
index 0000000000..b37fd7213d
--- /dev/null
+++ b/test/core/security/security_connector_test.c
@@ -0,0 +1,256 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "src/core/security/security_connector.h"
+#include "src/core/security/security_context.h"
+#include "src/core/tsi/ssl_transport_security.h"
+#include "src/core/tsi/transport_security.h"
+#include "test/core/util/test_config.h"
+
+#include <grpc/grpc_security.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/useful.h>
+
+static int check_transport_security_type(const grpc_auth_context *ctx) {
+ grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+ ctx, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME);
+ const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
+ if (prop == NULL) return 0;
+ if (strncmp(prop->value, GRPC_SSL_TRANSPORT_SECURITY_TYPE,
+ prop->value_length) != 0) {
+ return 0;
+ }
+ /* Check that we have only one property with this name. */
+ if (grpc_auth_property_iterator_next(&it) != NULL) return 0;
+ return 1;
+}
+
+static void test_unauthenticated_ssl_peer(void) {
+ tsi_peer peer;
+ grpc_auth_context *ctx;
+ GPR_ASSERT(tsi_construct_peer(1, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+ &peer.properties[0]) == TSI_OK);
+ ctx = tsi_ssl_peer_to_auth_context(&peer);
+ GPR_ASSERT(ctx != NULL);
+ GPR_ASSERT(!grpc_auth_context_peer_is_authenticated(ctx));
+ GPR_ASSERT(check_transport_security_type(ctx));
+
+ tsi_peer_destruct(&peer);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static int check_identity(const grpc_auth_context *ctx,
+ const char *expected_property_name,
+ const char **expected_identities,
+ size_t num_identities) {
+ grpc_auth_property_iterator it;
+ const grpc_auth_property *prop;
+ size_t i;
+ GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+ it = grpc_auth_context_peer_identity(ctx);
+ for (i = 0; i < num_identities; i++) {
+ prop = grpc_auth_property_iterator_next(&it);
+ if (prop == NULL) {
+ gpr_log(GPR_ERROR, "Expected identity value %s not found.",
+ expected_identities[i]);
+ return 0;
+ }
+ if (strcmp(prop->name, expected_property_name) != 0) {
+ gpr_log(GPR_ERROR, "Expected peer identity property name %s and got %s.",
+ expected_property_name, prop->name);
+ return 0;
+ }
+ if (strncmp(prop->value, expected_identities[i], prop->value_length) != 0) {
+ gpr_log(GPR_ERROR, "Expected peer identity %s and got %s.",
+ expected_identities[i], prop->value);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int check_x509_cn(const grpc_auth_context *ctx,
+ const char *expected_cn) {
+ grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(
+ ctx, GRPC_X509_CN_PROPERTY_NAME);
+ const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it);
+ if (prop == NULL) {
+ gpr_log(GPR_ERROR, "CN property not found.");
+ return 0;
+ }
+ if (strncmp(prop->value, expected_cn, prop->value_length) != 0) {
+ gpr_log(GPR_ERROR, "Expected CN %s and got %s", expected_cn, prop->value);
+ return 0;
+ }
+ if (grpc_auth_property_iterator_next(&it) != NULL) {
+ gpr_log(GPR_ERROR, "Expected only one property for CN.");
+ return 0;
+ }
+ return 1;
+}
+
+static void test_cn_only_ssl_peer_to_auth_context(void) {
+ tsi_peer peer;
+ grpc_auth_context *ctx;
+ const char *expected_cn = "cn1";
+ GPR_ASSERT(tsi_construct_peer(2, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+ &peer.properties[1]) == TSI_OK);
+ ctx = tsi_ssl_peer_to_auth_context(&peer);
+ GPR_ASSERT(ctx != NULL);
+ GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+ GPR_ASSERT(check_identity(ctx, GRPC_X509_CN_PROPERTY_NAME, &expected_cn, 1));
+ GPR_ASSERT(check_transport_security_type(ctx));
+ GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+
+ tsi_peer_destruct(&peer);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_cn_and_one_san_ssl_peer_to_auth_context(void) {
+ tsi_peer peer;
+ grpc_auth_context *ctx;
+ const char *expected_cn = "cn1";
+ const char *expected_san = "san1";
+ GPR_ASSERT(tsi_construct_peer(3, &peer) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+ &peer.properties[1]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, expected_san,
+ &peer.properties[2]) == TSI_OK);
+ ctx = tsi_ssl_peer_to_auth_context(&peer);
+ GPR_ASSERT(ctx != NULL);
+ GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+ GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, &expected_san, 1));
+ GPR_ASSERT(check_transport_security_type(ctx));
+ GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+
+ tsi_peer_destruct(&peer);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_cn_and_multiple_sans_ssl_peer_to_auth_context(void) {
+ tsi_peer peer;
+ grpc_auth_context *ctx;
+ const char *expected_cn = "cn1";
+ const char *expected_sans[] = {"san1", "san2", "san3"};
+ size_t i;
+ GPR_ASSERT(tsi_construct_peer(2 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
+ TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+ &peer.properties[1]) == TSI_OK);
+ for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
+ expected_sans[i], &peer.properties[2 + i]) == TSI_OK);
+ }
+ ctx = tsi_ssl_peer_to_auth_context(&peer);
+ GPR_ASSERT(ctx != NULL);
+ GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+ GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans,
+ GPR_ARRAY_SIZE(expected_sans)));
+ GPR_ASSERT(check_transport_security_type(ctx));
+ GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+
+ tsi_peer_destruct(&peer);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+static void test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context(
+ void) {
+ tsi_peer peer;
+ grpc_auth_context *ctx;
+ const char *expected_cn = "cn1";
+ const char *expected_sans[] = {"san1", "san2", "san3"};
+ size_t i;
+ GPR_ASSERT(tsi_construct_peer(4 + GPR_ARRAY_SIZE(expected_sans), &peer) ==
+ TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_CERTIFICATE_TYPE_PEER_PROPERTY, TSI_X509_CERTIFICATE_TYPE,
+ &peer.properties[0]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ "foo", "bar", &peer.properties[1]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, expected_cn,
+ &peer.properties[2]) == TSI_OK);
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ "chapi", "chapo", &peer.properties[3]) == TSI_OK);
+ for (i = 0; i < GPR_ARRAY_SIZE(expected_sans); i++) {
+ GPR_ASSERT(tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY,
+ expected_sans[i], &peer.properties[4 + i]) == TSI_OK);
+ }
+ ctx = tsi_ssl_peer_to_auth_context(&peer);
+ GPR_ASSERT(ctx != NULL);
+ GPR_ASSERT(grpc_auth_context_peer_is_authenticated(ctx));
+ GPR_ASSERT(check_identity(ctx, GRPC_X509_SAN_PROPERTY_NAME, expected_sans,
+ GPR_ARRAY_SIZE(expected_sans)));
+ GPR_ASSERT(check_transport_security_type(ctx));
+ GPR_ASSERT(check_x509_cn(ctx, expected_cn));
+
+ tsi_peer_destruct(&peer);
+ GRPC_AUTH_CONTEXT_UNREF(ctx, "test");
+}
+
+int main(int argc, char **argv) {
+ grpc_test_init(argc, argv);
+ grpc_init();
+
+ test_unauthenticated_ssl_peer();
+ test_cn_only_ssl_peer_to_auth_context();
+ test_cn_and_one_san_ssl_peer_to_auth_context();
+ test_cn_and_multiple_sans_ssl_peer_to_auth_context();
+ test_cn_and_multiple_sans_and_others_ssl_peer_to_auth_context();
+
+ grpc_shutdown();
+ return 0;
+}
diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c
index 87a2cd7a43..d9c60e4212 100644
--- a/test/core/surface/byte_buffer_reader_test.c
+++ b/test/core/surface/byte_buffer_reader_test.c
@@ -127,11 +127,11 @@ static void read_compressed_slice(grpc_compression_algorithm algorithm,
input_slice = gpr_slice_malloc(input_size);
memset(GPR_SLICE_START_PTR(input_slice), 'a', input_size);
- gpr_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
+ gpr_slice_buffer_add(&sliceb_in, input_slice); /* takes ownership */
GPR_ASSERT(grpc_msg_compress(algorithm, &sliceb_in, &sliceb_out));
- buffer = grpc_raw_compressed_byte_buffer_create(
- sliceb_out.slices, sliceb_out.count, algorithm);
+ buffer = grpc_raw_compressed_byte_buffer_create(sliceb_out.slices,
+ sliceb_out.count, algorithm);
grpc_byte_buffer_reader_init(&reader, buffer);
while (grpc_byte_buffer_reader_next(&reader, &read_slice)) {
@@ -160,6 +160,30 @@ static void test_read_deflate_compressed_slice(void) {
read_compressed_slice(GRPC_COMPRESS_DEFLATE, INPUT_SIZE);
}
+static void test_byte_buffer_from_reader(void) {
+ gpr_slice slice;
+ grpc_byte_buffer *buffer, *buffer_from_reader;
+ grpc_byte_buffer_reader reader;
+
+ LOG_TEST("test_byte_buffer_from_reader");
+ slice = gpr_slice_malloc(4);
+ memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
+ buffer = grpc_raw_byte_buffer_create(&slice, 1);
+ gpr_slice_unref(slice);
+ grpc_byte_buffer_reader_init(&reader, buffer);
+
+ buffer_from_reader = grpc_raw_byte_buffer_from_reader(&reader);
+ GPR_ASSERT(buffer->type == buffer_from_reader->type);
+ GPR_ASSERT(buffer_from_reader->data.raw.compression == GRPC_COMPRESS_NONE);
+ GPR_ASSERT(buffer_from_reader->data.raw.slice_buffer.count == 1);
+ GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(
+ buffer_from_reader->data.raw.slice_buffer.slices[0]),
+ "test", 4) == 0);
+
+ grpc_byte_buffer_destroy(buffer);
+ grpc_byte_buffer_destroy(buffer_from_reader);
+}
+
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_read_one_slice();
@@ -167,6 +191,7 @@ int main(int argc, char **argv) {
test_read_none_compressed_slice();
test_read_gzip_compressed_slice();
test_read_deflate_compressed_slice();
+ test_byte_buffer_from_reader();
return 0;
}
diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c
index 9e7b2ea1df..eba24f5c6e 100644
--- a/test/core/surface/completion_queue_test.c
+++ b/test/core/surface/completion_queue_test.c
@@ -100,7 +100,8 @@ static void test_shutdown_then_next_polling(void) {
cc = grpc_completion_queue_create();
grpc_completion_queue_shutdown(cc);
- GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_past).type == GRPC_QUEUE_SHUTDOWN);
+ GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_past).type ==
+ GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(cc);
}
@@ -110,7 +111,8 @@ static void test_shutdown_then_next_with_timeout(void) {
cc = grpc_completion_queue_create();
grpc_completion_queue_shutdown(cc);
- GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_future).type == GRPC_QUEUE_SHUTDOWN);
+ GPR_ASSERT(grpc_completion_queue_next(cc, gpr_inf_future).type ==
+ GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(cc);
}
@@ -177,7 +179,7 @@ static void producer_thread(void *arg) {
int i;
gpr_log(GPR_INFO, "producer %d started", opt->id);
- gpr_event_set(&opt->on_started, (void *)(gpr_intptr) 1);
+ gpr_event_set(&opt->on_started, (void *)(gpr_intptr)1);
GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time()));
gpr_log(GPR_INFO, "producer %d phase 1", opt->id);
@@ -186,7 +188,7 @@ static void producer_thread(void *arg) {
}
gpr_log(GPR_INFO, "producer %d phase 1 done", opt->id);
- gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr) 1);
+ gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr)1);
GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time()));
gpr_log(GPR_INFO, "producer %d phase 2", opt->id);
@@ -196,7 +198,7 @@ static void producer_thread(void *arg) {
}
gpr_log(GPR_INFO, "producer %d phase 2 done", opt->id);
- gpr_event_set(&opt->on_finished, (void *)(gpr_intptr) 1);
+ gpr_event_set(&opt->on_finished, (void *)(gpr_intptr)1);
}
static void consumer_thread(void *arg) {
@@ -204,13 +206,13 @@ static void consumer_thread(void *arg) {
grpc_event ev;
gpr_log(GPR_INFO, "consumer %d started", opt->id);
- gpr_event_set(&opt->on_started, (void *)(gpr_intptr) 1);
+ gpr_event_set(&opt->on_started, (void *)(gpr_intptr)1);
GPR_ASSERT(gpr_event_wait(opt->phase1, ten_seconds_time()));
gpr_log(GPR_INFO, "consumer %d phase 1", opt->id);
gpr_log(GPR_INFO, "consumer %d phase 1 done", opt->id);
- gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr) 1);
+ gpr_event_set(&opt->on_phase1_done, (void *)(gpr_intptr)1);
GPR_ASSERT(gpr_event_wait(opt->phase2, ten_seconds_time()));
gpr_log(GPR_INFO, "consumer %d phase 2", opt->id);
@@ -223,7 +225,7 @@ static void consumer_thread(void *arg) {
break;
case GRPC_QUEUE_SHUTDOWN:
gpr_log(GPR_INFO, "consumer %d phase 2 done", opt->id);
- gpr_event_set(&opt->on_finished, (void *)(gpr_intptr) 1);
+ gpr_event_set(&opt->on_finished, (void *)(gpr_intptr)1);
return;
case GRPC_QUEUE_TIMEOUT:
gpr_log(GPR_ERROR, "Invalid timeout received");
@@ -242,10 +244,8 @@ static void test_threading(int producers, int consumers) {
int total_consumed = 0;
static int optid = 101;
- gpr_log(GPR_INFO, "%s: %d producers, %d consumers", "test_threading", producers,
- consumers);
-
- grpc_completion_queue_dont_poll_test_only(cc);
+ gpr_log(GPR_INFO, "%s: %d producers, %d consumers", "test_threading",
+ producers, consumers);
/* start all threads: they will wait for phase1 */
for (i = 0; i < producers + consumers; i++) {
@@ -267,7 +267,7 @@ static void test_threading(int producers, int consumers) {
/* start phase1: producers will pre-declare all operations they will
complete */
gpr_log(GPR_INFO, "start phase 1");
- gpr_event_set(&phase1, (void *)(gpr_intptr) 1);
+ gpr_event_set(&phase1, (void *)(gpr_intptr)1);
gpr_log(GPR_INFO, "wait phase 1");
for (i = 0; i < producers + consumers; i++) {
@@ -277,7 +277,7 @@ static void test_threading(int producers, int consumers) {
/* start phase2: operations will complete, and consumers will consume them */
gpr_log(GPR_INFO, "start phase 2");
- gpr_event_set(&phase2, (void *)(gpr_intptr) 1);
+ gpr_event_set(&phase2, (void *)(gpr_intptr)1);
/* in parallel, we shutdown the completion channel - all events should still
be consumed */
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 871f956491..117d8bb9fa 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -67,27 +67,45 @@ namespace {
void* tag(int i) { return (void*)(gpr_intptr) i; }
-void verify_ok(CompletionQueue* cq, int i, bool expect_ok) {
- bool ok;
- void* got_tag;
- EXPECT_TRUE(cq->Next(&got_tag, &ok));
- EXPECT_EQ(expect_ok, ok);
- EXPECT_EQ(tag(i), got_tag);
-}
-
-void verify_timed_ok(
- CompletionQueue* cq, int i, bool expect_ok,
- std::chrono::system_clock::time_point deadline =
- std::chrono::system_clock::time_point::max(),
- CompletionQueue::NextStatus expected_outcome = CompletionQueue::GOT_EVENT) {
- bool ok;
- void* got_tag;
- EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), expected_outcome);
- if (expected_outcome == CompletionQueue::GOT_EVENT) {
- EXPECT_EQ(expect_ok, ok);
- EXPECT_EQ(tag(i), got_tag);
+class Verifier {
+ public:
+ Verifier& Expect(int i, bool expect_ok) {
+ expectations_[tag(i)] = expect_ok;
+ return *this;
}
-}
+ void Verify(CompletionQueue *cq) {
+ GPR_ASSERT(!expectations_.empty());
+ while (!expectations_.empty()) {
+ bool ok;
+ void* got_tag;
+ EXPECT_TRUE(cq->Next(&got_tag, &ok));
+ auto it = expectations_.find(got_tag);
+ EXPECT_TRUE(it != expectations_.end());
+ EXPECT_EQ(it->second, ok);
+ expectations_.erase(it);
+ }
+ }
+ void Verify(CompletionQueue *cq, std::chrono::system_clock::time_point deadline) {
+ if (expectations_.empty()) {
+ bool ok;
+ void *got_tag;
+ EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), CompletionQueue::TIMEOUT);
+ } else {
+ while (!expectations_.empty()) {
+ bool ok;
+ void *got_tag;
+ EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), CompletionQueue::GOT_EVENT);
+ auto it = expectations_.find(got_tag);
+ EXPECT_TRUE(it != expectations_.end());
+ EXPECT_EQ(it->second, ok);
+ expectations_.erase(it);
+ }
+ }
+ }
+
+ private:
+ std::map<void*, bool> expectations_;
+};
class AsyncEnd2endTest : public ::testing::Test {
protected:
@@ -100,7 +118,7 @@ class AsyncEnd2endTest : public ::testing::Test {
ServerBuilder builder;
builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials());
builder.RegisterAsyncService(&service_);
- srv_cq_ = builder.AddCompletionQueue();
+ cq_ = builder.AddCompletionQueue();
server_ = builder.BuildAndStart();
}
@@ -108,11 +126,8 @@ class AsyncEnd2endTest : public ::testing::Test {
server_->Shutdown();
void* ignored_tag;
bool ignored_ok;
- cli_cq_.Shutdown();
- srv_cq_->Shutdown();
- while (cli_cq_.Next(&ignored_tag, &ignored_ok))
- ;
- while (srv_cq_->Next(&ignored_tag, &ignored_ok))
+ cq_->Shutdown();
+ while (cq_->Next(&ignored_tag, &ignored_ok))
;
}
@@ -122,11 +137,6 @@ class AsyncEnd2endTest : public ::testing::Test {
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}
- void server_ok(int i) { verify_ok(srv_cq_.get(), i, true); }
- void client_ok(int i) { verify_ok(&cli_cq_, i, true); }
- void server_fail(int i) { verify_ok(srv_cq_.get(), i, false); }
- void client_fail(int i) { verify_ok(&cli_cq_, i, false); }
-
void SendRpc(int num_rpcs) {
for (int i = 0; i < num_rpcs; i++) {
EchoRequest send_request;
@@ -141,28 +151,27 @@ class AsyncEnd2endTest : public ::testing::Test {
send_request.set_message("Hello");
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader(
- stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_));
+ stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
service_.RequestEcho(&srv_ctx, &recv_request, &response_writer,
- srv_cq_.get(), srv_cq_.get(), tag(2));
+ cq_.get(), cq_.get(), tag(2));
- server_ok(2);
+ Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
send_response.set_message(recv_request.message());
response_writer.Finish(send_response, Status::OK, tag(3));
- server_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
response_reader->Finish(&recv_response, &recv_status, tag(4));
- client_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
}
}
- CompletionQueue cli_cq_;
- std::unique_ptr<ServerCompletionQueue> srv_cq_;
+ std::unique_ptr<ServerCompletionQueue> cq_;
std::unique_ptr<grpc::cpp::test::util::TestService::Stub> stub_;
std::unique_ptr<Server> server_;
grpc::cpp::test::util::TestService::AsyncService service_;
@@ -195,27 +204,27 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) {
send_request.set_message("Hello");
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader(
- stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_));
+ stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
std::chrono::system_clock::time_point time_now(
std::chrono::system_clock::now());
std::chrono::system_clock::time_point time_limit(
std::chrono::system_clock::now() + std::chrono::seconds(10));
- verify_timed_ok(srv_cq_.get(), -1, true, time_now, CompletionQueue::TIMEOUT);
- verify_timed_ok(&cli_cq_, -1, true, time_now, CompletionQueue::TIMEOUT);
+ Verifier().Verify(cq_.get(), time_now);
+ Verifier().Verify(cq_.get(), time_now);
- service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, srv_cq_.get(),
- srv_cq_.get(), tag(2));
+ service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, cq_.get(),
+ cq_.get(), tag(2));
- verify_timed_ok(srv_cq_.get(), 2, true, time_limit);
+ Verifier().Expect(2, true).Verify(cq_.get(), time_limit);
EXPECT_EQ(send_request.message(), recv_request.message());
send_response.set_message(recv_request.message());
response_writer.Finish(send_response, Status::OK, tag(3));
- verify_timed_ok(srv_cq_.get(), 3, true);
+ Verifier().Expect(3, true).Verify(cq_.get(), std::chrono::system_clock::time_point::max());
response_reader->Finish(&recv_response, &recv_status, tag(4));
- verify_timed_ok(&cli_cq_, 4, true);
+ Verifier().Expect(4, true).Verify(cq_.get(), std::chrono::system_clock::time_point::max());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
@@ -236,40 +245,39 @@ TEST_F(AsyncEnd2endTest, SimpleClientStreaming) {
send_request.set_message("Hello");
std::unique_ptr<ClientAsyncWriter<EchoRequest> > cli_stream(
- stub_->AsyncRequestStream(&cli_ctx, &recv_response, &cli_cq_, tag(1)));
+ stub_->AsyncRequestStream(&cli_ctx, &recv_response, cq_.get(), tag(1)));
- service_.RequestRequestStream(&srv_ctx, &srv_stream, srv_cq_.get(),
- srv_cq_.get(), tag(2));
+ service_.RequestRequestStream(&srv_ctx, &srv_stream, cq_.get(),
+ cq_.get(), tag(2));
- server_ok(2);
- client_ok(1);
+ Verifier().Expect(2, true).Expect(1, true).Verify(cq_.get());
cli_stream->Write(send_request, tag(3));
- client_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
srv_stream.Read(&recv_request, tag(4));
- server_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
cli_stream->Write(send_request, tag(5));
- client_ok(5);
+ Verifier().Expect(5, true).Verify(cq_.get());
srv_stream.Read(&recv_request, tag(6));
- server_ok(6);
+ Verifier().Expect(6, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
cli_stream->WritesDone(tag(7));
- client_ok(7);
+ Verifier().Expect(7, true).Verify(cq_.get());
srv_stream.Read(&recv_request, tag(8));
- server_fail(8);
+ Verifier().Expect(8, false).Verify(cq_.get());
send_response.set_message(recv_request.message());
srv_stream.Finish(send_response, Status::OK, tag(9));
- server_ok(9);
+ Verifier().Expect(9, true).Verify(cq_.get());
cli_stream->Finish(&recv_status, tag(10));
- client_ok(10);
+ Verifier().Expect(10, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
@@ -290,38 +298,37 @@ TEST_F(AsyncEnd2endTest, SimpleServerStreaming) {
send_request.set_message("Hello");
std::unique_ptr<ClientAsyncReader<EchoResponse> > cli_stream(
- stub_->AsyncResponseStream(&cli_ctx, send_request, &cli_cq_, tag(1)));
+ stub_->AsyncResponseStream(&cli_ctx, send_request, cq_.get(), tag(1)));
service_.RequestResponseStream(&srv_ctx, &recv_request, &srv_stream,
- srv_cq_.get(), srv_cq_.get(), tag(2));
+ cq_.get(), cq_.get(), tag(2));
- server_ok(2);
- client_ok(1);
+ Verifier().Expect(1, true).Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
send_response.set_message(recv_request.message());
srv_stream.Write(send_response, tag(3));
- server_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
cli_stream->Read(&recv_response, tag(4));
- client_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
srv_stream.Write(send_response, tag(5));
- server_ok(5);
+ Verifier().Expect(5, true).Verify(cq_.get());
cli_stream->Read(&recv_response, tag(6));
- client_ok(6);
+ Verifier().Expect(6, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
srv_stream.Finish(Status::OK, tag(7));
- server_ok(7);
+ Verifier().Expect(7, true).Verify(cq_.get());
cli_stream->Read(&recv_response, tag(8));
- client_fail(8);
+ Verifier().Expect(8, false).Verify(cq_.get());
cli_stream->Finish(&recv_status, tag(9));
- client_ok(9);
+ Verifier().Expect(9, true).Verify(cq_.get());
EXPECT_TRUE(recv_status.ok());
}
@@ -341,40 +348,39 @@ TEST_F(AsyncEnd2endTest, SimpleBidiStreaming) {
send_request.set_message("Hello");
std::unique_ptr<ClientAsyncReaderWriter<EchoRequest, EchoResponse> >
- cli_stream(stub_->AsyncBidiStream(&cli_ctx, &cli_cq_, tag(1)));
+ cli_stream(stub_->AsyncBidiStream(&cli_ctx, cq_.get(), tag(1)));
- service_.RequestBidiStream(&srv_ctx, &srv_stream, srv_cq_.get(),
- srv_cq_.get(), tag(2));
+ service_.RequestBidiStream(&srv_ctx, &srv_stream, cq_.get(),
+ cq_.get(), tag(2));
- server_ok(2);
- client_ok(1);
+ Verifier().Expect(1, true).Expect(2, true).Verify(cq_.get());
cli_stream->Write(send_request, tag(3));
- client_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
srv_stream.Read(&recv_request, tag(4));
- server_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
send_response.set_message(recv_request.message());
srv_stream.Write(send_response, tag(5));
- server_ok(5);
+ Verifier().Expect(5, true).Verify(cq_.get());
cli_stream->Read(&recv_response, tag(6));
- client_ok(6);
+ Verifier().Expect(6, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
cli_stream->WritesDone(tag(7));
- client_ok(7);
+ Verifier().Expect(7, true).Verify(cq_.get());
srv_stream.Read(&recv_request, tag(8));
- server_fail(8);
+ Verifier().Expect(8, false).Verify(cq_.get());
srv_stream.Finish(Status::OK, tag(9));
- server_ok(9);
+ Verifier().Expect(9, true).Verify(cq_.get());
cli_stream->Finish(&recv_status, tag(10));
- client_ok(10);
+ Verifier().Expect(10, true).Verify(cq_.get());
EXPECT_TRUE(recv_status.ok());
}
@@ -400,11 +406,11 @@ TEST_F(AsyncEnd2endTest, ClientInitialMetadataRpc) {
cli_ctx.AddMetadata(meta2.first, meta2.second);
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader(
- stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_));
+ stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
- service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, srv_cq_.get(),
- srv_cq_.get(), tag(2));
- server_ok(2);
+ service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, cq_.get(),
+ cq_.get(), tag(2));
+ Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
auto client_initial_metadata = srv_ctx.client_metadata();
EXPECT_EQ(meta1.second, client_initial_metadata.find(meta1.first)->second);
@@ -414,10 +420,10 @@ TEST_F(AsyncEnd2endTest, ClientInitialMetadataRpc) {
send_response.set_message(recv_request.message());
response_writer.Finish(send_response, Status::OK, tag(3));
- server_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
response_reader->Finish(&recv_response, &recv_status, tag(4));
- client_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
@@ -441,19 +447,19 @@ TEST_F(AsyncEnd2endTest, ServerInitialMetadataRpc) {
std::pair<grpc::string, grpc::string> meta2("key2", "val2");
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader(
- stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_));
+ stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
- service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, srv_cq_.get(),
- srv_cq_.get(), tag(2));
- server_ok(2);
+ service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, cq_.get(),
+ cq_.get(), tag(2));
+ Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
srv_ctx.AddInitialMetadata(meta1.first, meta1.second);
srv_ctx.AddInitialMetadata(meta2.first, meta2.second);
response_writer.SendInitialMetadata(tag(3));
- server_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
response_reader->ReadInitialMetadata(tag(4));
- client_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
auto server_initial_metadata = cli_ctx.GetServerInitialMetadata();
EXPECT_EQ(meta1.second, server_initial_metadata.find(meta1.first)->second);
EXPECT_EQ(meta2.second, server_initial_metadata.find(meta2.first)->second);
@@ -461,10 +467,10 @@ TEST_F(AsyncEnd2endTest, ServerInitialMetadataRpc) {
send_response.set_message(recv_request.message());
response_writer.Finish(send_response, Status::OK, tag(5));
- server_ok(5);
+ Verifier().Expect(5, true).Verify(cq_.get());
response_reader->Finish(&recv_response, &recv_status, tag(6));
- client_ok(6);
+ Verifier().Expect(6, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
@@ -488,24 +494,24 @@ TEST_F(AsyncEnd2endTest, ServerTrailingMetadataRpc) {
std::pair<grpc::string, grpc::string> meta2("key2", "val2");
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader(
- stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_));
+ stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
- service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, srv_cq_.get(),
- srv_cq_.get(), tag(2));
- server_ok(2);
+ service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, cq_.get(),
+ cq_.get(), tag(2));
+ Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
response_writer.SendInitialMetadata(tag(3));
- server_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
send_response.set_message(recv_request.message());
srv_ctx.AddTrailingMetadata(meta1.first, meta1.second);
srv_ctx.AddTrailingMetadata(meta2.first, meta2.second);
response_writer.Finish(send_response, Status::OK, tag(4));
- server_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
response_reader->Finish(&recv_response, &recv_status, tag(5));
- client_ok(5);
+ Verifier().Expect(5, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata();
@@ -548,11 +554,11 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) {
cli_ctx.AddMetadata(meta2.first, meta2.second);
std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader(
- stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_));
+ stub_->AsyncEcho(&cli_ctx, send_request, cq_.get()));
- service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, srv_cq_.get(),
- srv_cq_.get(), tag(2));
- server_ok(2);
+ service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, cq_.get(),
+ cq_.get(), tag(2));
+ Verifier().Expect(2, true).Verify(cq_.get());
EXPECT_EQ(send_request.message(), recv_request.message());
auto client_initial_metadata = srv_ctx.client_metadata();
EXPECT_EQ(meta1.second, client_initial_metadata.find(meta1.first)->second);
@@ -562,9 +568,9 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) {
srv_ctx.AddInitialMetadata(meta3.first, meta3.second);
srv_ctx.AddInitialMetadata(meta4.first, meta4.second);
response_writer.SendInitialMetadata(tag(3));
- server_ok(3);
+ Verifier().Expect(3, true).Verify(cq_.get());
response_reader->ReadInitialMetadata(tag(4));
- client_ok(4);
+ Verifier().Expect(4, true).Verify(cq_.get());
auto server_initial_metadata = cli_ctx.GetServerInitialMetadata();
EXPECT_EQ(meta3.second, server_initial_metadata.find(meta3.first)->second);
EXPECT_EQ(meta4.second, server_initial_metadata.find(meta4.first)->second);
@@ -575,10 +581,10 @@ TEST_F(AsyncEnd2endTest, MetadataRpc) {
srv_ctx.AddTrailingMetadata(meta6.first, meta6.second);
response_writer.Finish(send_response, Status::OK, tag(5));
- server_ok(5);
+ Verifier().Expect(5, true).Verify(cq_.get());
response_reader->Finish(&recv_response, &recv_status, tag(6));
- client_ok(6);
+ Verifier().Expect(6, true).Verify(cq_.get());
EXPECT_EQ(send_response.message(), recv_response.message());
EXPECT_TRUE(recv_status.ok());
auto server_trailing_metadata = cli_ctx.GetServerTrailingMetadata();
diff --git a/test/cpp/end2end/client_crash_test.cc b/test/cpp/end2end/client_crash_test.cc
index aeba295947..645226f375 100644
--- a/test/cpp/end2end/client_crash_test.cc
+++ b/test/cpp/end2end/client_crash_test.cc
@@ -90,15 +90,13 @@ class CrashTest : public ::testing::Test {
void KillServer() {
server_.reset();
- // give some time for the TCP connection to drop
- gpr_sleep_until(gpr_time_add(gpr_now(), gpr_time_from_seconds(1)));
}
private:
std::unique_ptr<SubProcess> server_;
};
-TEST_F(CrashTest, KillAfterWrite) {
+TEST_F(CrashTest, KillBeforeWrite) {
auto stub = CreateServerAndStub();
EchoRequest request;
@@ -112,17 +110,18 @@ TEST_F(CrashTest, KillAfterWrite) {
EXPECT_TRUE(stream->Read(&response));
EXPECT_EQ(response.message(), request.message());
- request.set_message("I'm going to kill you");
- EXPECT_TRUE(stream->Write(request));
-
KillServer();
+ request.set_message("You should be dead");
+ // This may succeed or fail depending on the state of the TCP connection
+ stream->Write(request);
+ // But the read will definitely fail
EXPECT_FALSE(stream->Read(&response));
EXPECT_FALSE(stream->Finish().ok());
}
-TEST_F(CrashTest, KillBeforeWrite) {
+TEST_F(CrashTest, KillAfterWrite) {
auto stub = CreateServerAndStub();
EchoRequest request;
@@ -136,11 +135,13 @@ TEST_F(CrashTest, KillBeforeWrite) {
EXPECT_TRUE(stream->Read(&response));
EXPECT_EQ(response.message(), request.message());
+ request.set_message("I'm going to kill you");
+ EXPECT_TRUE(stream->Write(request));
+
KillServer();
- request.set_message("You should be dead");
- EXPECT_FALSE(stream->Write(request));
- EXPECT_FALSE(stream->Read(&response));
+ // This may succeed or fail depending on how quick the server was
+ stream->Read(&response);
EXPECT_FALSE(stream->Finish().ok());
}
@@ -161,5 +162,11 @@ int main(int argc, char** argv) {
grpc_test_init(argc, argv);
::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
+ // Order seems to matter on these tests: run three times to eliminate that
+ for (int i = 0; i < 3; i++) {
+ if (RUN_ALL_TESTS() != 0) {
+ return 1;
+ }
+ }
+ return 0;
}
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 45ba8b0878..5e850ea30a 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -68,6 +68,8 @@ namespace testing {
namespace {
+const char* kServerCancelAfterReads = "cancel_after_reads";
+
// When echo_deadline is requested, deadline seen in the ServerContext is set in
// the response in seconds.
void MaybeEchoDeadline(ServerContext* context, const EchoRequest* request,
@@ -131,7 +133,23 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
EchoResponse* response) GRPC_OVERRIDE {
EchoRequest request;
response->set_message("");
+ int cancel_after_reads = 0;
+ const std::multimap<grpc::string, grpc::string> client_initial_metadata =
+ context->client_metadata();
+ if (client_initial_metadata.find(kServerCancelAfterReads) !=
+ client_initial_metadata.end()) {
+ std::istringstream iss(
+ client_initial_metadata.find(kServerCancelAfterReads)->second);
+ iss >> cancel_after_reads;
+ gpr_log(GPR_INFO, "cancel_after_reads %d", cancel_after_reads);
+ }
while (reader->Read(&request)) {
+ if (cancel_after_reads == 1) {
+ gpr_log(GPR_INFO, "return cancel status");
+ return Status::CANCELLED;
+ } else if (cancel_after_reads > 0) {
+ cancel_after_reads--;
+ }
response->mutable_message()->append(request.message());
}
return Status::OK;
@@ -687,6 +705,27 @@ TEST_F(End2endTest, OverridePerCallCredentials) {
EXPECT_TRUE(s.ok());
}
+// Client sends 20 requests and the server returns CANCELLED status after
+// reading 10 requests.
+TEST_F(End2endTest, RequestStreamServerEarlyCancelTest) {
+ ResetStub();
+ EchoRequest request;
+ EchoResponse response;
+ ClientContext context;
+
+ context.AddMetadata(kServerCancelAfterReads, "10");
+ auto stream = stub_->RequestStream(&context, &response);
+ request.set_message("hello");
+ int send_messages = 20;
+ while (send_messages > 0) {
+ EXPECT_TRUE(stream->Write(request));
+ send_messages--;
+ }
+ stream->WritesDone();
+ Status s = stream->Finish();
+ EXPECT_EQ(s.error_code(), StatusCode::CANCELLED);
+}
+
} // namespace testing
} // namespace grpc
diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc
index 7132b6b1f1..b9d47b32de 100644
--- a/test/cpp/end2end/generic_end2end_test.cc
+++ b/test/cpp/end2end/generic_end2end_test.cc
@@ -33,10 +33,10 @@
#include <memory>
-#include "src/cpp/proto/proto_utils.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/echo.grpc.pb.h"
+#include <grpc++/impl/proto_utils.h>
#include <grpc++/async_generic_service.h>
#include <grpc++/async_unary_call.h>
#include <grpc++/byte_buffer.h>
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 1b7a8d26b2..e1e44f9ac0 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -168,7 +168,7 @@ class AsyncClient : public Client {
if (!closed_loop_) {
rpc_deadlines_.emplace_back();
next_channel_.push_back(i % channel_count_);
- issue_allowed_.push_back(true);
+ issue_allowed_.emplace_back(true);
grpc_time next_issue;
NextIssueTime(i, &next_issue);
@@ -199,6 +199,15 @@ class AsyncClient : public Client {
delete ClientRpcContext::detag(got_tag);
}
}
+ // Now clear out all the pre-allocated idle contexts
+ for (int ch = 0; ch < channel_count_; ch++) {
+ while (!contexts_[ch].empty()) {
+ // Get an idle context from the front of the list
+ auto* ctx = *(contexts_[ch].begin());
+ contexts_[ch].pop_front();
+ delete ctx;
+ }
+ }
}
bool ThreadFunc(Histogram* histogram,
@@ -234,12 +243,6 @@ class AsyncClient : public Client {
GPR_ASSERT(false);
break;
}
- if ((closed_loop_ || !rpc_deadlines_[thread_idx].empty()) &&
- grpc_time_source::now() > deadline) {
- // we have missed some 1-second deadline, which is worth noting
- gpr_log(GPR_INFO, "Missed an RPC deadline");
- // Don't give up, as there might be some truly heavy tails
- }
if (got_event) {
ClientRpcContext* ctx = ClientRpcContext::detag(got_tag);
if (ctx->RunNextState(ok, histogram) == false) {
@@ -313,11 +316,20 @@ class AsyncClient : public Client {
}
private:
+ class boolean { // exists only to avoid data-race on vector<bool>
+ public:
+ boolean(): val_(false) {}
+ boolean(bool b): val_(b) {}
+ operator bool() const {return val_;}
+ boolean& operator=(bool b) {val_=b; return *this;}
+ private:
+ bool val_;
+ };
std::vector<std::unique_ptr<CompletionQueue>> cli_cqs_;
std::vector<deadline_list> rpc_deadlines_; // per thread deadlines
std::vector<int> next_channel_; // per thread round-robin channel ctr
- std::vector<bool> issue_allowed_; // may this thread attempt to issue
+ std::vector<boolean> issue_allowed_; // may this thread attempt to issue
std::vector<grpc_time> next_issue_; // when should it issue?
std::vector<std::mutex> channel_lock_;
diff --git a/test/cpp/qps/perf_db.proto b/test/cpp/qps/perf_db.proto
new file mode 100644
index 0000000000..60e038406a
--- /dev/null
+++ b/test/cpp/qps/perf_db.proto
@@ -0,0 +1,71 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+syntax = "proto3";
+
+import "test/cpp/qps/qpstest.proto";
+
+package grpc.testing;
+
+service PerfDbTransfer {
+ // Sends client info
+ rpc RecordSingleClientData(SingleUserRecordRequest)
+ returns (SingleUserRecordReply) {
+ }
+}
+
+// Metrics to be stored
+message Metrics {
+ double qps = 1;
+ double qps_per_core = 2;
+ double perc_lat_50 = 3;
+ double perc_lat_90 = 4;
+ double perc_lat_95 = 5;
+ double perc_lat_99 = 6;
+ double perc_lat_99_point_9 = 7;
+ double server_system_time = 8;
+ double server_user_time = 9;
+ double client_system_time = 10;
+ double client_user_time = 11;
+}
+
+// Request for storing a single user's data
+message SingleUserRecordRequest {
+ string hashed_id = 1;
+ string test_name = 2;
+ string sys_info = 3;
+ string tag = 4;
+ Metrics metrics = 5;
+ ClientConfig client_config = 6;
+ ServerConfig server_config = 7;
+}
+
+// Reply to request for storing single user's data
+message SingleUserRecordReply {
+}
diff --git a/test/cpp/qps/perf_db_client.cc b/test/cpp/qps/perf_db_client.cc
new file mode 100644
index 0000000000..08d20f0b8d
--- /dev/null
+++ b/test/cpp/qps/perf_db_client.cc
@@ -0,0 +1,143 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "test/cpp/qps/perf_db_client.h"
+
+namespace grpc {
+namespace testing {
+
+// sets the client and server config information
+void PerfDbClient::setConfigs(const ClientConfig& client_config,
+ const ServerConfig& server_config) {
+ client_config_ = client_config;
+ server_config_ = server_config;
+}
+
+// sets the QPS
+void PerfDbClient::setQps(double qps) {
+ qps_ = qps;
+}
+
+// sets the QPS per core
+void PerfDbClient::setQpsPerCore(double qps_per_core) {
+ qps_per_core_ = qps_per_core;
+}
+
+// sets the 50th, 90th, 95th, 99th and 99.9th percentile latency
+void PerfDbClient::setLatencies(double perc_lat_50,
+ double perc_lat_90,
+ double perc_lat_95,
+ double perc_lat_99,
+ double perc_lat_99_point_9) {
+ perc_lat_50_ = perc_lat_50;
+ perc_lat_90_ = perc_lat_90;
+ perc_lat_95_ = perc_lat_95;
+ perc_lat_99_ = perc_lat_99;
+ perc_lat_99_point_9_ = perc_lat_99_point_9;
+}
+
+// sets the server and client, user and system times
+void PerfDbClient::setTimes(double server_system_time, double server_user_time,
+ double client_system_time, double client_user_time) {
+ server_system_time_ = server_system_time;
+ server_user_time_ = server_user_time;
+ client_system_time_ = client_system_time;
+ client_user_time_ = client_user_time;
+}
+
+// sends the data to the performance database server
+bool PerfDbClient::sendData(std::string hashed_id, std::string test_name,
+ std::string sys_info, std::string tag) {
+ // Data record request object
+ SingleUserRecordRequest single_user_record_request;
+
+ // setting access token, name of the test and the system information
+ single_user_record_request.set_hashed_id(hashed_id);
+ single_user_record_request.set_test_name(test_name);
+ single_user_record_request.set_sys_info(sys_info);
+ single_user_record_request.set_tag(tag);
+
+ // setting configs
+ *(single_user_record_request.mutable_client_config()) = client_config_;
+ *(single_user_record_request.mutable_server_config()) = server_config_;
+
+ Metrics* metrics = single_user_record_request.mutable_metrics();
+
+ // setting metrcs in data record request
+ if (qps_ != DBL_MIN) {
+ metrics->set_qps(qps_);
+ }
+ if (qps_per_core_ != DBL_MIN) {
+ metrics->set_qps_per_core(qps_per_core_);
+ }
+ if (perc_lat_50_ != DBL_MIN) {
+ metrics->set_perc_lat_50(perc_lat_50_);
+ }
+ if (perc_lat_90_ != DBL_MIN) {
+ metrics->set_perc_lat_90(perc_lat_90_);
+ }
+ if (perc_lat_95_ != DBL_MIN) {
+ metrics->set_perc_lat_95(perc_lat_95_);
+ }
+ if (perc_lat_99_ != DBL_MIN) {
+ metrics->set_perc_lat_99(perc_lat_99_);
+ }
+ if (perc_lat_99_point_9_ != DBL_MIN) {
+ metrics->set_perc_lat_99_point_9(perc_lat_99_point_9_);
+ }
+ if (server_system_time_ != DBL_MIN) {
+ metrics->set_server_system_time(server_system_time_);
+ }
+ if (server_user_time_ != DBL_MIN) {
+ metrics->set_server_user_time(server_user_time_);
+ }
+ if (client_system_time_ != DBL_MIN) {
+ metrics->set_client_system_time(client_system_time_);
+ }
+ if (client_user_time_ != DBL_MIN) {
+ metrics->set_client_user_time(client_user_time_);
+ }
+
+ SingleUserRecordReply single_user_record_reply;
+ ClientContext context;
+
+ Status status = stub_->RecordSingleClientData(
+ &context, single_user_record_request, &single_user_record_reply);
+ if (status.ok()) {
+ return true; // data sent to database successfully
+ } else {
+ return false; // error in data sending
+ }
+}
+} // testing
+} // grpc
diff --git a/test/cpp/qps/perf_db_client.h b/test/cpp/qps/perf_db_client.h
new file mode 100644
index 0000000000..ce7a88bbff
--- /dev/null
+++ b/test/cpp/qps/perf_db_client.h
@@ -0,0 +1,115 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <iostream>
+#include <memory>
+#include <string>
+#include <cfloat>
+
+#include <grpc/grpc.h>
+#include <grpc++/channel_arguments.h>
+#include <grpc++/channel_interface.h>
+#include <grpc++/client_context.h>
+#include <grpc++/create_channel.h>
+#include <grpc++/credentials.h>
+#include <grpc++/status.h>
+#include "test/cpp/qps/perf_db.grpc.pb.h"
+
+namespace grpc {
+namespace testing {
+
+// Manages data sending to performance database server
+class PerfDbClient {
+ public:
+ PerfDbClient() {
+ qps_ = DBL_MIN;
+ qps_per_core_ = DBL_MIN;
+ perc_lat_50_ = DBL_MIN;
+ perc_lat_90_ = DBL_MIN;
+ perc_lat_95_ = DBL_MIN;
+ perc_lat_99_ = DBL_MIN;
+ perc_lat_99_point_9_ = DBL_MIN;
+ server_system_time_ = DBL_MIN;
+ server_user_time_ = DBL_MIN;
+ client_system_time_ = DBL_MIN;
+ client_user_time_ = DBL_MIN;
+ }
+
+ void init(std::shared_ptr<ChannelInterface> channel) {
+ stub_ = PerfDbTransfer::NewStub(channel);
+ }
+
+ ~PerfDbClient() {}
+
+ // sets the client and server config information
+ void setConfigs(const ClientConfig& client_config,
+ const ServerConfig& server_config);
+
+ // sets the qps
+ void setQps(double qps);
+
+ // sets the qps per core
+ void setQpsPerCore(double qps_per_core);
+
+ // sets the 50th, 90th, 95th, 99th and 99.9th percentile latency
+ void setLatencies(double perc_lat_50, double perc_lat_90,
+ double perc_lat_95, double perc_lat_99,
+ double perc_lat_99_point_9);
+
+ // sets the server and client, user and system times
+ void setTimes(double server_system_time, double server_user_time,
+ double client_system_time, double client_user_time);
+
+ // sends the data to the performance database server
+ bool sendData(std::string hashed_id, std::string test_name,
+ std::string sys_info, std::string tag);
+
+ private:
+ std::unique_ptr<PerfDbTransfer::Stub> stub_;
+ ClientConfig client_config_;
+ ServerConfig server_config_;
+ double qps_;
+ double qps_per_core_;
+ double perc_lat_50_;
+ double perc_lat_90_;
+ double perc_lat_95_;
+ double perc_lat_99_;
+ double perc_lat_99_point_9_;
+ double server_system_time_;
+ double server_user_time_;
+ double client_system_time_;
+ double client_user_time_;
+};
+
+} // namespace testing
+} // namespace grpc
diff --git a/test/cpp/qps/qps_test_openloop.cc b/test/cpp/qps/qps_test_openloop.cc
index 52873b2987..96a9b4504c 100644
--- a/test/cpp/qps/qps_test_openloop.cc
+++ b/test/cpp/qps/qps_test_openloop.cc
@@ -60,7 +60,7 @@ static void RunQPS() {
client_config.set_rpc_type(UNARY);
client_config.set_load_type(POISSON);
client_config.mutable_load_params()->
- mutable_poisson()->set_offered_load(10000.0);
+ mutable_poisson()->set_offered_load(1000.0);
ServerConfig server_config;
server_config.set_server_type(ASYNC_SERVER);
diff --git a/test/cpp/qps/qps_test_with_poll.cc b/test/cpp/qps/qps_test_with_poll.cc
new file mode 100644
index 0000000000..90a8da8d11
--- /dev/null
+++ b/test/cpp/qps/qps_test_with_poll.cc
@@ -0,0 +1,90 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <set>
+
+#include <grpc/support/log.h>
+
+#include <signal.h>
+
+#include "test/cpp/qps/driver.h"
+#include "test/cpp/qps/report.h"
+#include "test/cpp/util/benchmark_config.h"
+
+extern "C" {
+#include "src/core/iomgr/pollset_posix.h"
+}
+
+namespace grpc {
+namespace testing {
+
+static const int WARMUP = 5;
+static const int BENCHMARK = 5;
+
+static void RunQPS() {
+ gpr_log(GPR_INFO, "Running QPS test");
+
+ ClientConfig client_config;
+ client_config.set_client_type(ASYNC_CLIENT);
+ client_config.set_enable_ssl(false);
+ client_config.set_outstanding_rpcs_per_channel(1000);
+ client_config.set_client_channels(8);
+ client_config.set_payload_size(1);
+ client_config.set_async_client_threads(8);
+ client_config.set_rpc_type(UNARY);
+
+ ServerConfig server_config;
+ server_config.set_server_type(ASYNC_SERVER);
+ server_config.set_enable_ssl(false);
+ server_config.set_threads(4);
+
+ const auto result =
+ RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
+
+ GetReporter()->ReportQPSPerCore(*result);
+ GetReporter()->ReportLatency(*result);
+}
+
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ grpc::testing::InitBenchmark(&argc, &argv, true);
+
+ grpc_platform_become_multipoller = grpc_poll_become_multipoller;
+
+ signal(SIGPIPE, SIG_IGN);
+ grpc::testing::RunQPS();
+
+ return 0;
+}
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index 423275ee85..f1cea5ee66 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -31,7 +31,7 @@
*
*/
-#include "qps_worker.h"
+#include "test/cpp/qps/qps_worker.h"
#include <cassert>
#include <memory>
diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc
index 678ea080d1..ff01ec1501 100644
--- a/test/cpp/qps/report.cc
+++ b/test/cpp/qps/report.cc
@@ -43,49 +43,47 @@ void CompositeReporter::add(std::unique_ptr<Reporter> reporter) {
reporters_.emplace_back(std::move(reporter));
}
-void CompositeReporter::ReportQPS(const ScenarioResult& result) const {
+void CompositeReporter::ReportQPS(const ScenarioResult& result) {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportQPS(result);
}
}
-void CompositeReporter::ReportQPSPerCore(const ScenarioResult& result) const {
+void CompositeReporter::ReportQPSPerCore(const ScenarioResult& result) {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportQPSPerCore(result);
}
}
-void CompositeReporter::ReportLatency(const ScenarioResult& result) const {
+void CompositeReporter::ReportLatency(const ScenarioResult& result) {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportLatency(result);
}
}
-void CompositeReporter::ReportTimes(const ScenarioResult& result) const {
+void CompositeReporter::ReportTimes(const ScenarioResult& result) {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportTimes(result);
}
}
-
-void GprLogReporter::ReportQPS(const ScenarioResult& result) const {
+void GprLogReporter::ReportQPS(const ScenarioResult& result) {
gpr_log(GPR_INFO, "QPS: %.1f",
result.latencies.Count() /
average(result.client_resources,
[](ResourceUsage u) { return u.wall_time; }));
}
-void GprLogReporter::ReportQPSPerCore(const ScenarioResult& result) const {
- auto qps =
- result.latencies.Count() /
- average(result.client_resources,
- [](ResourceUsage u) { return u.wall_time; });
+void GprLogReporter::ReportQPSPerCore(const ScenarioResult& result) {
+ auto qps = result.latencies.Count() /
+ average(result.client_resources,
+ [](ResourceUsage u) { return u.wall_time; });
gpr_log(GPR_INFO, "QPS: %.1f (%.1f/server core)", qps,
qps / result.server_config.threads());
}
-void GprLogReporter::ReportLatency(const ScenarioResult& result) const {
+void GprLogReporter::ReportLatency(const ScenarioResult& result) {
gpr_log(GPR_INFO,
"Latencies (50/90/95/99/99.9%%-ile): %.1f/%.1f/%.1f/%.1f/%.1f us",
result.latencies.Percentile(50) / 1000,
@@ -95,7 +93,7 @@ void GprLogReporter::ReportLatency(const ScenarioResult& result) const {
result.latencies.Percentile(99.9) / 1000);
}
-void GprLogReporter::ReportTimes(const ScenarioResult& result) const {
+void GprLogReporter::ReportTimes(const ScenarioResult& result) {
gpr_log(GPR_INFO, "Server system time: %.2f%%",
100.0 * sum(result.server_resources,
[](ResourceUsage u) { return u.system_time; }) /
@@ -118,5 +116,71 @@ void GprLogReporter::ReportTimes(const ScenarioResult& result) const {
[](ResourceUsage u) { return u.wall_time; }));
}
+void PerfDbReporter::ReportQPS(const ScenarioResult& result) {
+ auto qps = result.latencies.Count() /
+ average(result.client_resources,
+ [](ResourceUsage u) { return u.wall_time; });
+
+ perf_db_client_.setQps(qps);
+ perf_db_client_.setConfigs(result.client_config, result.server_config);
+}
+
+void PerfDbReporter::ReportQPSPerCore(const ScenarioResult& result) {
+ auto qps = result.latencies.Count() /
+ average(result.client_resources,
+ [](ResourceUsage u) { return u.wall_time; });
+
+ auto qpsPerCore = qps / result.server_config.threads();
+
+ perf_db_client_.setQps(qps);
+ perf_db_client_.setQpsPerCore(qpsPerCore);
+ perf_db_client_.setConfigs(result.client_config, result.server_config);
+}
+
+void PerfDbReporter::ReportLatency(const ScenarioResult& result) {
+ perf_db_client_.setLatencies(result.latencies.Percentile(50) / 1000,
+ result.latencies.Percentile(90) / 1000,
+ result.latencies.Percentile(95) / 1000,
+ result.latencies.Percentile(99) / 1000,
+ result.latencies.Percentile(99.9) / 1000);
+ perf_db_client_.setConfigs(result.client_config, result.server_config);
+}
+
+void PerfDbReporter::ReportTimes(const ScenarioResult& result) {
+ double server_system_time =
+ 100.0 * sum(result.server_resources,
+ [](ResourceUsage u) { return u.system_time; }) /
+ sum(result.server_resources, [](ResourceUsage u) { return u.wall_time; });
+ double server_user_time =
+ 100.0 * sum(result.server_resources,
+ [](ResourceUsage u) { return u.user_time; }) /
+ sum(result.server_resources, [](ResourceUsage u) { return u.wall_time; });
+ double client_system_time =
+ 100.0 * sum(result.client_resources,
+ [](ResourceUsage u) { return u.system_time; }) /
+ sum(result.client_resources, [](ResourceUsage u) { return u.wall_time; });
+ double client_user_time =
+ 100.0 * sum(result.client_resources,
+ [](ResourceUsage u) { return u.user_time; }) /
+ sum(result.client_resources, [](ResourceUsage u) { return u.wall_time; });
+
+ perf_db_client_.setTimes(server_system_time, server_user_time, client_system_time,
+ client_user_time);
+ perf_db_client_.setConfigs(result.client_config, result.server_config);
+}
+
+void PerfDbReporter::SendData() {
+ // send data to performance database
+ bool data_state =
+ perf_db_client_.sendData(hashed_id_, test_name_, sys_info_, tag_);
+
+ // check state of data sending
+ if (data_state) {
+ gpr_log(GPR_INFO, "Data sent to performance database successfully");
+ } else {
+ gpr_log(GPR_INFO, "Data could not be sent to performance database");
+ }
+}
+
} // namespace testing
} // namespace grpc
diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h
index 0cce08816a..aec3cbe80a 100644
--- a/test/cpp/qps/report.h
+++ b/test/cpp/qps/report.h
@@ -41,6 +41,7 @@
#include "test/cpp/qps/driver.h"
#include "test/cpp/qps/qpstest.grpc.pb.h"
+#include "test/cpp/qps/perf_db_client.h"
namespace grpc {
namespace testing {
@@ -59,16 +60,16 @@ class Reporter {
string name() const { return name_; }
/** Reports QPS for the given \a result. */
- virtual void ReportQPS(const ScenarioResult& result) const = 0;
+ virtual void ReportQPS(const ScenarioResult& result) = 0;
/** Reports QPS per core as (YYY/server core). */
- virtual void ReportQPSPerCore(const ScenarioResult& result) const = 0;
+ virtual void ReportQPSPerCore(const ScenarioResult& result) = 0;
/** Reports latencies for the 50, 90, 95, 99 and 99.9 percentiles, in ms. */
- virtual void ReportLatency(const ScenarioResult& result) const = 0;
+ virtual void ReportLatency(const ScenarioResult& result) = 0;
/** Reports system and user time for client and server systems. */
- virtual void ReportTimes(const ScenarioResult& result) const = 0;
+ virtual void ReportTimes(const ScenarioResult& result) = 0;
private:
const string name_;
@@ -82,10 +83,10 @@ class CompositeReporter : public Reporter {
/** Adds a \a reporter to the composite. */
void add(std::unique_ptr<Reporter> reporter);
- void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE;
- void ReportQPSPerCore(const ScenarioResult& result) const GRPC_OVERRIDE;
- void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE;
- void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE;
+ void ReportQPS(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportQPSPerCore(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportLatency(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportTimes(const ScenarioResult& result) GRPC_OVERRIDE;
private:
std::vector<std::unique_ptr<Reporter> > reporters_;
@@ -97,10 +98,39 @@ class GprLogReporter : public Reporter {
GprLogReporter(const string& name) : Reporter(name) {}
private:
- void ReportQPS(const ScenarioResult& result) const GRPC_OVERRIDE;
- void ReportQPSPerCore(const ScenarioResult& result) const GRPC_OVERRIDE;
- void ReportLatency(const ScenarioResult& result) const GRPC_OVERRIDE;
- void ReportTimes(const ScenarioResult& result) const GRPC_OVERRIDE;
+ void ReportQPS(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportQPSPerCore(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportLatency(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportTimes(const ScenarioResult& result) GRPC_OVERRIDE;
+};
+
+/** Reporter for performance database tool */
+class PerfDbReporter : public Reporter {
+ public:
+ PerfDbReporter(const string& name, const string& hashed_id,
+ const string& test_name, const string& sys_info,
+ const string& server_address, const string& tag)
+ : Reporter(name),
+ hashed_id_(hashed_id),
+ test_name_(test_name),
+ sys_info_(sys_info),
+ tag_(tag) {
+ perf_db_client_.init(grpc::CreateChannel(
+ server_address, grpc::InsecureCredentials(), ChannelArguments()));
+ }
+ ~PerfDbReporter() GRPC_OVERRIDE { SendData(); };
+
+ private:
+ PerfDbClient perf_db_client_;
+ std::string hashed_id_;
+ std::string test_name_;
+ std::string sys_info_;
+ std::string tag_;
+ void ReportQPS(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportQPSPerCore(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportLatency(const ScenarioResult& result) GRPC_OVERRIDE;
+ void ReportTimes(const ScenarioResult& result) GRPC_OVERRIDE;
+ void SendData();
};
} // namespace testing
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 210aef4fd6..f5251e961b 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -64,7 +64,7 @@ namespace testing {
class AsyncQpsServerTest : public Server {
public:
- AsyncQpsServerTest(const ServerConfig &config, int port) : shutdown_(false) {
+ AsyncQpsServerTest(const ServerConfig &config, int port) {
char *server_address = NULL;
gpr_join_host_port(&server_address, "::", port);
@@ -97,6 +97,9 @@ class AsyncQpsServerTest : public Server {
}
}
for (int i = 0; i < config.threads(); i++) {
+ shutdown_state_.emplace_back(new PerThreadShutdownState());
+ }
+ for (int i = 0; i < config.threads(); i++) {
threads_.push_back(std::thread([=]() {
// Wait until work is available or we are shutting down
bool ok;
@@ -105,11 +108,9 @@ class AsyncQpsServerTest : public Server {
ServerRpcContext *ctx = detag(got_tag);
// The tag is a pointer to an RPC context to invoke
bool still_going = ctx->RunNextState(ok);
- std::unique_lock<std::mutex> g(shutdown_mutex_);
- if (!shutdown_) {
+ if (!shutdown_state_[i]->shutdown()) {
// this RPC context is done, so refresh it
if (!still_going) {
- g.unlock();
ctx->Reset();
}
} else {
@@ -122,9 +123,8 @@ class AsyncQpsServerTest : public Server {
}
~AsyncQpsServerTest() {
server_->Shutdown();
- {
- std::lock_guard<std::mutex> g(shutdown_mutex_);
- shutdown_ = true;
+ for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
+ (*ss)->set_shutdown();
}
for (auto thr = threads_.begin(); thr != threads_.end(); thr++) {
thr->join();
@@ -316,8 +316,25 @@ class AsyncQpsServerTest : public Server {
TestService::AsyncService async_service_;
std::forward_list<ServerRpcContext *> contexts_;
- std::mutex shutdown_mutex_;
- bool shutdown_;
+ class PerThreadShutdownState {
+ public:
+ PerThreadShutdownState() : shutdown_(false) {}
+
+ bool shutdown() const {
+ std::lock_guard<std::mutex> lock(mutex_);
+ return shutdown_;
+ }
+
+ void set_shutdown() {
+ std::lock_guard<std::mutex> lock(mutex_);
+ shutdown_ = true;
+ }
+
+ private:
+ mutable std::mutex mutex_;
+ bool shutdown_;
+ };
+ std::vector<std::unique_ptr<PerThreadShutdownState>> shutdown_state_;
};
std::unique_ptr<Server> CreateAsyncServer(const ServerConfig &config,
diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc
index dfc102fc17..14a8b0b089 100644
--- a/test/cpp/qps/worker.cc
+++ b/test/cpp/qps/worker.cc
@@ -40,7 +40,7 @@
#include <grpc/support/time.h>
#include <gflags/gflags.h>
-#include "qps_worker.h"
+#include "test/cpp/qps/qps_worker.h"
#include "test/cpp/util/test_config.h"
DEFINE_int32(driver_port, 0, "Driver server port.");
diff --git a/test/cpp/util/benchmark_config.cc b/test/cpp/util/benchmark_config.cc
index 5b3c1daf5d..91fbbf9677 100644
--- a/test/cpp/util/benchmark_config.cc
+++ b/test/cpp/util/benchmark_config.cc
@@ -37,6 +37,18 @@
DEFINE_bool(enable_log_reporter, true,
"Enable reporting of benchmark results through GprLog");
+DEFINE_bool(report_metrics_db, false, "True if metrics to be reported to performance database");
+
+DEFINE_string(hashed_id, "", "Hash of the user id");
+
+DEFINE_string(test_name, "", "Name of the test being executed");
+
+DEFINE_string(sys_info, "", "System information");
+
+DEFINE_string(server_address, "localhost:50052", "Address of the performance database server");
+
+DEFINE_string(tag, "", "Optional tag for the test");
+
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
namespace google {}
@@ -57,6 +69,12 @@ static std::shared_ptr<Reporter> InitBenchmarkReporters() {
composite_reporter->add(
std::unique_ptr<Reporter>(new GprLogReporter("LogReporter")));
}
+ if(FLAGS_report_metrics_db) {
+ composite_reporter->add(
+ std::unique_ptr<Reporter>(new PerfDbReporter("PerfDbReporter", FLAGS_hashed_id, FLAGS_test_name,
+ FLAGS_sys_info, FLAGS_server_address, FLAGS_tag)));
+ }
+
return std::shared_ptr<Reporter>(composite_reporter);
}
diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc
new file mode 100644
index 0000000000..13eb49730a
--- /dev/null
+++ b/test/cpp/util/byte_buffer_test.cc
@@ -0,0 +1,115 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <grpc++/byte_buffer.h>
+
+#include <cstring>
+#include <vector>
+
+#include <grpc/support/slice.h>
+#include <grpc++/slice.h>
+#include <gtest/gtest.h>
+
+namespace grpc {
+namespace {
+
+const char* kContent1 = "hello xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
+const char* kContent2 = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy world";
+
+class ByteBufferTest : public ::testing::Test {
+};
+
+TEST_F(ByteBufferTest, CreateFromSingleSlice) {
+ gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ Slice s(hello, Slice::STEAL_REF);
+ ByteBuffer buffer(&s, 1);
+}
+
+TEST_F(ByteBufferTest, CreateFromVector) {
+ gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ std::vector<Slice> slices;
+ slices.push_back(Slice(hello, Slice::STEAL_REF));
+ slices.push_back(Slice(world, Slice::STEAL_REF));
+ ByteBuffer buffer(&slices[0], 2);
+}
+
+TEST_F(ByteBufferTest, Clear) {
+ gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ Slice s(hello, Slice::STEAL_REF);
+ ByteBuffer buffer(&s, 1);
+ buffer.Clear();
+}
+
+TEST_F(ByteBufferTest, Length) {
+ gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ std::vector<Slice> slices;
+ slices.push_back(Slice(hello, Slice::STEAL_REF));
+ slices.push_back(Slice(world, Slice::STEAL_REF));
+ ByteBuffer buffer(&slices[0], 2);
+ EXPECT_EQ(strlen(kContent1) + strlen(kContent2), buffer.Length());
+}
+
+bool SliceEqual(const Slice& a, gpr_slice b) {
+ if (a.size() != GPR_SLICE_LENGTH(b)) {
+ return false;
+ }
+ for (size_t i = 0; i < a.size(); i++) {
+ if (a.begin()[i] != GPR_SLICE_START_PTR(b)[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+
+TEST_F(ByteBufferTest, Dump) {
+ gpr_slice hello = gpr_slice_from_copied_string(kContent1);
+ gpr_slice world = gpr_slice_from_copied_string(kContent2);
+ std::vector<Slice> slices;
+ slices.push_back(Slice(hello, Slice::STEAL_REF));
+ slices.push_back(Slice(world, Slice::STEAL_REF));
+ ByteBuffer buffer(&slices[0], 2);
+ slices.clear();
+ buffer.Dump(&slices);
+ EXPECT_TRUE(SliceEqual(slices[0], hello));
+ EXPECT_TRUE(SliceEqual(slices[1], world));
+}
+
+} // namespace
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/test/cpp/util/grpc_cli.cc b/test/cpp/util/grpc_cli.cc
index 32d61b0307..3c3baeb769 100644
--- a/test/cpp/util/grpc_cli.cc
+++ b/test/cpp/util/grpc_cli.cc
@@ -88,7 +88,7 @@ void ParseMetadataFlag(
return;
}
std::vector<grpc::string> fields;
- grpc::string delim(":");
+ const char* delim = ":";
size_t cur, next = -1;
do {
cur = next + 1;
diff --git a/src/cpp/client/client_unary_call.cc b/test/cpp/util/slice_test.cc
index 55e589306f..eb328490e1 100644
--- a/src/cpp/client/client_unary_call.cc
+++ b/test/cpp/util/slice_test.cc
@@ -31,34 +31,47 @@
*
*/
-#include <grpc++/impl/client_unary_call.h>
-#include <grpc++/impl/call.h>
-#include <grpc++/channel_interface.h>
-#include <grpc++/client_context.h>
-#include <grpc++/completion_queue.h>
-#include <grpc++/status.h>
-#include <grpc/support/log.h>
+#include <grpc++/slice.h>
+
+#include <grpc/support/slice.h>
+#include <gtest/gtest.h>
namespace grpc {
+namespace {
+
+const char* kContent = "hello xxxxxxxxxxxxxxxxxxxx world";
+
+class SliceTest : public ::testing::Test {
+ protected:
+ void CheckSlice(const Slice& s, const grpc::string& content) {
+ EXPECT_EQ(content.size(), s.size());
+ EXPECT_EQ(content,
+ grpc::string(reinterpret_cast<const char*>(s.begin()), s.size()));
+ }
+};
+
+TEST_F(SliceTest, Steal) {
+ gpr_slice s = gpr_slice_from_copied_string(kContent);
+ Slice spp(s, Slice::STEAL_REF);
+ CheckSlice(spp, kContent);
+}
-// Wrapper that performs a blocking unary call
-Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
- ClientContext* context,
- const grpc::protobuf::Message& request,
- grpc::protobuf::Message* result) {
- CompletionQueue cq;
- Call call(channel->CreateCall(method, context, &cq));
- CallOpBuffer buf;
- Status status;
- buf.AddSendInitialMetadata(context);
- buf.AddSendMessage(request);
- buf.AddRecvInitialMetadata(context);
- buf.AddRecvMessage(result);
- buf.AddClientSendClose();
- buf.AddClientRecvStatus(context, &status);
- call.PerformOps(&buf);
- GPR_ASSERT((cq.Pluck(&buf) && buf.got_message) || !status.ok());
- return status;
+TEST_F(SliceTest, Add) {
+ gpr_slice s = gpr_slice_from_copied_string(kContent);
+ Slice spp(s, Slice::ADD_REF);
+ gpr_slice_unref(s);
+ CheckSlice(spp, kContent);
}
+TEST_F(SliceTest, Empty) {
+ Slice empty_slice;
+ CheckSlice(empty_slice, "");
+}
+
+} // namespace
} // namespace grpc
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/test/proto/messages.proto b/test/proto/messages.proto
index 65a8140465..500e79cc81 100644
--- a/test/proto/messages.proto
+++ b/test/proto/messages.proto
@@ -46,6 +46,14 @@ enum PayloadType {
RANDOM = 2;
}
+// Compression algorithms
+enum CompressionType {
+ // No compression
+ NONE = 0;
+ GZIP = 1;
+ DEFLATE = 2;
+}
+
// A block of data, to simply increase gRPC message size.
message Payload {
// The type of data in body.
@@ -54,6 +62,13 @@ message Payload {
optional bytes body = 2;
}
+// A protobuf representation for grpc status. This is used by test
+// clients to specify a status that the server should attempt to return.
+message EchoStatus {
+ optional int32 code = 1;
+ optional string message = 2;
+}
+
// Unary request.
message SimpleRequest {
// Desired payload type in the response from the server.
@@ -72,6 +87,12 @@ message SimpleRequest {
// Whether SimpleResponse should include OAuth scope.
optional bool fill_oauth_scope = 5;
+
+ // Compression algorithm to be used by the server for the response (stream)
+ optional CompressionType response_compression = 6;
+
+ // Whether server should return a given status
+ optional EchoStatus response_status = 7;
}
// Unary response, as configured by the request.
@@ -123,6 +144,12 @@ message StreamingOutputCallRequest {
// Optional input payload sent along with the request.
optional Payload payload = 3;
+
+ // Compression algorithm to be used by the server for the response (stream)
+ optional CompressionType response_compression = 6;
+
+ // Whether server should return a given status
+ optional EchoStatus response_status = 7;
}
// Server-streaming response, as configured by the request and parameters.
diff --git a/test/proto/test.proto b/test/proto/test.proto
index b9483d8437..1214152513 100644
--- a/test/proto/test.proto
+++ b/test/proto/test.proto
@@ -71,3 +71,11 @@ service TestService {
rpc HalfDuplexCall(stream StreamingOutputCallRequest)
returns (stream StreamingOutputCallResponse);
}
+
+
+// A simple service NOT implemented at servers so clients can test for
+// that case.
+service UnimplementedService {
+ // A call that no server should implement
+ rpc UnimplementedCall(grpc.testing.Empty) returns(grpc.testing.Empty);
+}
diff --git a/src/core/transport/chttp2/gen_hpack_tables.c b/tools/codegen/core/gen_hpack_tables.c
index bdaa3cf094..555f1e71c5 100644
--- a/src/core/transport/chttp2/gen_hpack_tables.c
+++ b/tools/codegen/core/gen_hpack_tables.c
@@ -55,19 +55,15 @@ typedef struct {
unsigned char index;
} spec;
-static const spec fields[] = {{"INDEXED_FIELD", 0X80, 1, 1},
- {"INDEXED_FIELD_X", 0X80, 1, 2},
- {"LITHDR_INCIDX", 0X40, 2, 1},
- {"LITHDR_INCIDX_X", 0X40, 2, 2},
- {"LITHDR_INCIDX_V", 0X40, 2, 0},
- {"LITHDR_NOTIDX", 0X00, 4, 1},
- {"LITHDR_NOTIDX_X", 0X00, 4, 2},
- {"LITHDR_NOTIDX_V", 0X00, 4, 0},
- {"LITHDR_NVRIDX", 0X10, 4, 1},
- {"LITHDR_NVRIDX_X", 0X10, 4, 2},
- {"LITHDR_NVRIDX_V", 0X10, 4, 0},
- {"MAX_TBL_SIZE", 0X20, 3, 1},
- {"MAX_TBL_SIZE_X", 0X20, 3, 2}, };
+static const spec fields[] = {
+ {"INDEXED_FIELD", 0X80, 1, 1}, {"INDEXED_FIELD_X", 0X80, 1, 2},
+ {"LITHDR_INCIDX", 0X40, 2, 1}, {"LITHDR_INCIDX_X", 0X40, 2, 2},
+ {"LITHDR_INCIDX_V", 0X40, 2, 0}, {"LITHDR_NOTIDX", 0X00, 4, 1},
+ {"LITHDR_NOTIDX_X", 0X00, 4, 2}, {"LITHDR_NOTIDX_V", 0X00, 4, 0},
+ {"LITHDR_NVRIDX", 0X10, 4, 1}, {"LITHDR_NVRIDX_X", 0X10, 4, 2},
+ {"LITHDR_NVRIDX_V", 0X10, 4, 0}, {"MAX_TBL_SIZE", 0X20, 3, 1},
+ {"MAX_TBL_SIZE_X", 0X20, 3, 2},
+};
static const int num_fields = sizeof(fields) / sizeof(*fields);
@@ -129,13 +125,9 @@ static void generate_first_byte_lut(void) {
#define MAXHUFFSTATES 1024
/* represents a set of symbols as an array of booleans indicating inclusion */
-typedef struct {
- char included[GRPC_CHTTP2_NUM_HUFFSYMS];
-} symset;
+typedef struct { char included[GRPC_CHTTP2_NUM_HUFFSYMS]; } symset;
/* represents a lookup table indexed by a nibble */
-typedef struct {
- int values[16];
-} nibblelut;
+typedef struct { int values[16]; } nibblelut;
/* returns a symset that includes all possible symbols */
static symset symset_all(void) {
@@ -268,8 +260,7 @@ static void build_dec_tbl(int state, int nibble, int nibbits, unsigned bitofs,
/* recurse down for this bit */
build_dec_tbl(state, (nibble << 1) | bit, nibbits + 1, bitofs + 1, emit,
nextsyms);
- next:
- ;
+ next:;
}
}
diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++
index e3337235e5..feb7ad8bb9 100644
--- a/tools/doxygen/Doxyfile.c++
+++ b/tools/doxygen/Doxyfile.c++
@@ -760,7 +760,44 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/auth_context.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h
+INPUT = include/grpc++/async_generic_service.h \
+include/grpc++/async_unary_call.h \
+include/grpc++/auth_context.h \
+include/grpc++/byte_buffer.h \
+include/grpc++/channel_arguments.h \
+include/grpc++/channel_interface.h \
+include/grpc++/client_context.h \
+include/grpc++/completion_queue.h \
+include/grpc++/config.h \
+include/grpc++/config_protobuf.h \
+include/grpc++/create_channel.h \
+include/grpc++/credentials.h \
+include/grpc++/generic_stub.h \
+include/grpc++/impl/call.h \
+include/grpc++/impl/client_unary_call.h \
+include/grpc++/impl/grpc_library.h \
+include/grpc++/impl/internal_stub.h \
+include/grpc++/impl/proto_utils.h \
+include/grpc++/impl/rpc_method.h \
+include/grpc++/impl/rpc_service_method.h \
+include/grpc++/impl/serialization_traits.h \
+include/grpc++/impl/service_type.h \
+include/grpc++/impl/sync.h \
+include/grpc++/impl/sync_cxx11.h \
+include/grpc++/impl/sync_no_cxx11.h \
+include/grpc++/impl/thd.h \
+include/grpc++/impl/thd_cxx11.h \
+include/grpc++/impl/thd_no_cxx11.h \
+include/grpc++/server.h \
+include/grpc++/server_builder.h \
+include/grpc++/server_context.h \
+include/grpc++/server_credentials.h \
+include/grpc++/slice.h \
+include/grpc++/status.h \
+include/grpc++/status_code_enum.h \
+include/grpc++/stream.h \
+include/grpc++/thread_pool_interface.h \
+include/grpc++/time.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index 2e682edb67..67718d8976 100644
--- a/tools/doxygen/Doxyfile.c++.internal
+++ b/tools/doxygen/Doxyfile.c++.internal
@@ -760,7 +760,79 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/auth_context.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h src/cpp/client/secure_credentials.h src/cpp/common/secure_auth_context.h src/cpp/server/secure_server_credentials.h src/cpp/client/channel.h src/cpp/common/create_auth_context.h src/cpp/proto/proto_utils.h src/cpp/server/thread_pool.h src/cpp/client/secure_credentials.cc src/cpp/common/secure_auth_context.cc src/cpp/common/secure_create_auth_context.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel.cc src/cpp/client/channel_arguments.cc src/cpp/client/client_context.cc src/cpp/client/client_unary_call.cc src/cpp/client/create_channel.cc src/cpp/client/credentials.cc src/cpp/client/generic_stub.cc src/cpp/client/insecure_credentials.cc src/cpp/client/internal_stub.cc src/cpp/common/call.cc src/cpp/common/completion_queue.cc src/cpp/common/rpc_method.cc src/cpp/proto/proto_utils.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/server.cc src/cpp/server/server_builder.cc src/cpp/server/server_context.cc src/cpp/server/server_credentials.cc src/cpp/server/thread_pool.cc src/cpp/util/byte_buffer.cc src/cpp/util/slice.cc src/cpp/util/status.cc src/cpp/util/time.cc
+INPUT = include/grpc++/async_generic_service.h \
+include/grpc++/async_unary_call.h \
+include/grpc++/auth_context.h \
+include/grpc++/byte_buffer.h \
+include/grpc++/channel_arguments.h \
+include/grpc++/channel_interface.h \
+include/grpc++/client_context.h \
+include/grpc++/completion_queue.h \
+include/grpc++/config.h \
+include/grpc++/config_protobuf.h \
+include/grpc++/create_channel.h \
+include/grpc++/credentials.h \
+include/grpc++/generic_stub.h \
+include/grpc++/impl/call.h \
+include/grpc++/impl/client_unary_call.h \
+include/grpc++/impl/grpc_library.h \
+include/grpc++/impl/internal_stub.h \
+include/grpc++/impl/proto_utils.h \
+include/grpc++/impl/rpc_method.h \
+include/grpc++/impl/rpc_service_method.h \
+include/grpc++/impl/serialization_traits.h \
+include/grpc++/impl/service_type.h \
+include/grpc++/impl/sync.h \
+include/grpc++/impl/sync_cxx11.h \
+include/grpc++/impl/sync_no_cxx11.h \
+include/grpc++/impl/thd.h \
+include/grpc++/impl/thd_cxx11.h \
+include/grpc++/impl/thd_no_cxx11.h \
+include/grpc++/server.h \
+include/grpc++/server_builder.h \
+include/grpc++/server_context.h \
+include/grpc++/server_credentials.h \
+include/grpc++/slice.h \
+include/grpc++/status.h \
+include/grpc++/status_code_enum.h \
+include/grpc++/stream.h \
+include/grpc++/thread_pool_interface.h \
+include/grpc++/time.h \
+src/cpp/client/secure_credentials.h \
+src/cpp/common/secure_auth_context.h \
+src/cpp/server/secure_server_credentials.h \
+src/cpp/client/channel.h \
+src/cpp/common/create_auth_context.h \
+src/cpp/server/thread_pool.h \
+src/cpp/client/secure_channel_arguments.cc \
+src/cpp/client/secure_credentials.cc \
+src/cpp/common/secure_auth_context.cc \
+src/cpp/common/secure_create_auth_context.cc \
+src/cpp/server/secure_server_credentials.cc \
+src/cpp/client/channel.cc \
+src/cpp/client/channel_arguments.cc \
+src/cpp/client/client_context.cc \
+src/cpp/client/create_channel.cc \
+src/cpp/client/credentials.cc \
+src/cpp/client/generic_stub.cc \
+src/cpp/client/insecure_credentials.cc \
+src/cpp/client/internal_stub.cc \
+src/cpp/common/call.cc \
+src/cpp/common/completion_queue.cc \
+src/cpp/common/rpc_method.cc \
+src/cpp/proto/proto_utils.cc \
+src/cpp/server/async_generic_service.cc \
+src/cpp/server/create_default_thread_pool.cc \
+src/cpp/server/insecure_server_credentials.cc \
+src/cpp/server/server.cc \
+src/cpp/server/server_builder.cc \
+src/cpp/server/server_context.cc \
+src/cpp/server/server_credentials.cc \
+src/cpp/server/thread_pool.cc \
+src/cpp/util/byte_buffer.cc \
+src/cpp/util/slice.cc \
+src/cpp/util/status.cc \
+src/cpp/util/time.cc
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core
index 7cc96b2e06..1bfd787528 100644
--- a/tools/doxygen/Doxyfile.core
+++ b/tools/doxygen/Doxyfile.core
@@ -760,7 +760,41 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc/grpc_security.h include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h include/grpc/grpc.h include/grpc/status.h include/grpc/census.h include/grpc/support/alloc.h include/grpc/support/atm.h include/grpc/support/atm_gcc_atomic.h include/grpc/support/atm_gcc_sync.h include/grpc/support/atm_win32.h include/grpc/support/cancellable_platform.h include/grpc/support/cmdline.h include/grpc/support/cpu.h include/grpc/support/histogram.h include/grpc/support/host_port.h include/grpc/support/log.h include/grpc/support/log_win32.h include/grpc/support/port_platform.h include/grpc/support/slice.h include/grpc/support/slice_buffer.h include/grpc/support/string_util.h include/grpc/support/subprocess.h include/grpc/support/sync.h include/grpc/support/sync_generic.h include/grpc/support/sync_posix.h include/grpc/support/sync_win32.h include/grpc/support/thd.h include/grpc/support/time.h include/grpc/support/tls.h include/grpc/support/tls_gcc.h include/grpc/support/tls_msvc.h include/grpc/support/tls_pthread.h include/grpc/support/useful.h
+INPUT = include/grpc/grpc_security.h \
+include/grpc/byte_buffer.h \
+include/grpc/byte_buffer_reader.h \
+include/grpc/compression.h \
+include/grpc/grpc.h \
+include/grpc/status.h \
+include/grpc/census.h \
+include/grpc/support/alloc.h \
+include/grpc/support/atm.h \
+include/grpc/support/atm_gcc_atomic.h \
+include/grpc/support/atm_gcc_sync.h \
+include/grpc/support/atm_win32.h \
+include/grpc/support/cancellable_platform.h \
+include/grpc/support/cmdline.h \
+include/grpc/support/cpu.h \
+include/grpc/support/histogram.h \
+include/grpc/support/host_port.h \
+include/grpc/support/log.h \
+include/grpc/support/log_win32.h \
+include/grpc/support/port_platform.h \
+include/grpc/support/slice.h \
+include/grpc/support/slice_buffer.h \
+include/grpc/support/string_util.h \
+include/grpc/support/subprocess.h \
+include/grpc/support/sync.h \
+include/grpc/support/sync_generic.h \
+include/grpc/support/sync_posix.h \
+include/grpc/support/sync_win32.h \
+include/grpc/support/thd.h \
+include/grpc/support/time.h \
+include/grpc/support/tls.h \
+include/grpc/support/tls_gcc.h \
+include/grpc/support/tls_msvc.h \
+include/grpc/support/tls_pthread.h \
+include/grpc/support/useful.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index ff8bc7e44d..832f1e3590 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -760,7 +760,308 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc/grpc_security.h include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/compression.h include/grpc/grpc.h include/grpc/status.h include/grpc/census.h src/core/httpcli/format_request.h src/core/httpcli/httpcli.h src/core/httpcli/httpcli_security_connector.h src/core/httpcli/parser.h src/core/security/auth_filters.h src/core/security/base64.h src/core/security/credentials.h src/core/security/json_token.h src/core/security/secure_endpoint.h src/core/security/secure_transport_setup.h src/core/security/security_connector.h src/core/security/security_context.h src/core/tsi/fake_transport_security.h src/core/tsi/ssl_transport_security.h src/core/tsi/transport_security.h src/core/tsi/transport_security_interface.h src/core/census/grpc_context.h src/core/channel/channel_args.h src/core/channel/channel_stack.h src/core/channel/child_channel.h src/core/channel/client_channel.h src/core/channel/client_setup.h src/core/channel/connected_channel.h src/core/channel/http_client_filter.h src/core/channel/http_server_filter.h src/core/channel/noop_filter.h src/core/compression/message_compress.h src/core/debug/trace.h src/core/iomgr/alarm.h src/core/iomgr/alarm_heap.h src/core/iomgr/alarm_internal.h src/core/iomgr/endpoint.h src/core/iomgr/endpoint_pair.h src/core/iomgr/fd_posix.h src/core/iomgr/iocp_windows.h src/core/iomgr/iomgr.h src/core/iomgr/iomgr_internal.h src/core/iomgr/iomgr_posix.h src/core/iomgr/pollset.h src/core/iomgr/pollset_kick.h src/core/iomgr/pollset_kick_posix.h src/core/iomgr/pollset_kick_windows.h src/core/iomgr/pollset_posix.h src/core/iomgr/pollset_windows.h src/core/iomgr/resolve_address.h src/core/iomgr/sockaddr.h src/core/iomgr/sockaddr_posix.h src/core/iomgr/sockaddr_utils.h src/core/iomgr/sockaddr_win32.h src/core/iomgr/socket_utils_posix.h src/core/iomgr/socket_windows.h src/core/iomgr/tcp_client.h src/core/iomgr/tcp_posix.h src/core/iomgr/tcp_server.h src/core/iomgr/tcp_windows.h src/core/iomgr/time_averaged_stats.h src/core/iomgr/wakeup_fd_pipe.h src/core/iomgr/wakeup_fd_posix.h src/core/json/json.h src/core/json/json_common.h src/core/json/json_reader.h src/core/json/json_writer.h src/core/profiling/timers.h src/core/profiling/timers_preciseclock.h src/core/surface/byte_buffer_queue.h src/core/surface/call.h src/core/surface/channel.h src/core/surface/client.h src/core/surface/completion_queue.h src/core/surface/event_string.h src/core/surface/init.h src/core/surface/server.h src/core/surface/surface_trace.h src/core/transport/chttp2/alpn.h src/core/transport/chttp2/bin_encoder.h src/core/transport/chttp2/frame.h src/core/transport/chttp2/frame_data.h src/core/transport/chttp2/frame_goaway.h src/core/transport/chttp2/frame_ping.h src/core/transport/chttp2/frame_rst_stream.h src/core/transport/chttp2/frame_settings.h src/core/transport/chttp2/frame_window_update.h src/core/transport/chttp2/hpack_parser.h src/core/transport/chttp2/hpack_table.h src/core/transport/chttp2/http2_errors.h src/core/transport/chttp2/huffsyms.h src/core/transport/chttp2/status_conversion.h src/core/transport/chttp2/stream_encoder.h src/core/transport/chttp2/stream_map.h src/core/transport/chttp2/timeout_encoding.h src/core/transport/chttp2/varint.h src/core/transport/chttp2_transport.h src/core/transport/metadata.h src/core/transport/stream_op.h src/core/transport/transport.h src/core/transport/transport_impl.h src/core/census/context.h src/core/httpcli/format_request.c src/core/httpcli/httpcli.c src/core/httpcli/httpcli_security_connector.c src/core/httpcli/parser.c src/core/security/base64.c src/core/security/client_auth_filter.c src/core/security/credentials.c src/core/security/credentials_metadata.c src/core/security/credentials_posix.c src/core/security/credentials_win32.c src/core/security/google_default_credentials.c src/core/security/json_token.c src/core/security/secure_endpoint.c src/core/security/secure_transport_setup.c src/core/security/security_connector.c src/core/security/security_context.c src/core/security/server_auth_filter.c src/core/security/server_secure_chttp2.c src/core/surface/init_secure.c src/core/surface/secure_channel_create.c src/core/tsi/fake_transport_security.c src/core/tsi/ssl_transport_security.c src/core/tsi/transport_security.c src/core/census/grpc_context.c src/core/channel/channel_args.c src/core/channel/channel_stack.c src/core/channel/child_channel.c src/core/channel/client_channel.c src/core/channel/client_setup.c src/core/channel/connected_channel.c src/core/channel/http_client_filter.c src/core/channel/http_server_filter.c src/core/channel/noop_filter.c src/core/compression/algorithm.c src/core/compression/message_compress.c src/core/debug/trace.c src/core/iomgr/alarm.c src/core/iomgr/alarm_heap.c src/core/iomgr/endpoint.c src/core/iomgr/endpoint_pair_posix.c src/core/iomgr/endpoint_pair_windows.c src/core/iomgr/fd_posix.c src/core/iomgr/iocp_windows.c src/core/iomgr/iomgr.c src/core/iomgr/iomgr_posix.c src/core/iomgr/iomgr_windows.c src/core/iomgr/pollset_kick.c src/core/iomgr/pollset_multipoller_with_epoll.c src/core/iomgr/pollset_multipoller_with_poll_posix.c src/core/iomgr/pollset_posix.c src/core/iomgr/pollset_windows.c src/core/iomgr/resolve_address_posix.c src/core/iomgr/resolve_address_windows.c src/core/iomgr/sockaddr_utils.c src/core/iomgr/socket_utils_common_posix.c src/core/iomgr/socket_utils_linux.c src/core/iomgr/socket_utils_posix.c src/core/iomgr/socket_windows.c src/core/iomgr/tcp_client_posix.c src/core/iomgr/tcp_client_windows.c src/core/iomgr/tcp_posix.c src/core/iomgr/tcp_server_posix.c src/core/iomgr/tcp_server_windows.c src/core/iomgr/tcp_windows.c src/core/iomgr/time_averaged_stats.c src/core/iomgr/wakeup_fd_eventfd.c src/core/iomgr/wakeup_fd_nospecial.c src/core/iomgr/wakeup_fd_pipe.c src/core/iomgr/wakeup_fd_posix.c src/core/json/json.c src/core/json/json_reader.c src/core/json/json_string.c src/core/json/json_writer.c src/core/profiling/basic_timers.c src/core/profiling/stap_timers.c src/core/surface/byte_buffer.c src/core/surface/byte_buffer_queue.c src/core/surface/byte_buffer_reader.c src/core/surface/call.c src/core/surface/call_details.c src/core/surface/call_log_batch.c src/core/surface/channel.c src/core/surface/channel_create.c src/core/surface/client.c src/core/surface/completion_queue.c src/core/surface/event_string.c src/core/surface/init.c src/core/surface/lame_client.c src/core/surface/metadata_array.c src/core/surface/server.c src/core/surface/server_chttp2.c src/core/surface/server_create.c src/core/surface/surface_trace.c src/core/transport/chttp2/alpn.c src/core/transport/chttp2/bin_encoder.c src/core/transport/chttp2/frame_data.c src/core/transport/chttp2/frame_goaway.c src/core/transport/chttp2/frame_ping.c src/core/transport/chttp2/frame_rst_stream.c src/core/transport/chttp2/frame_settings.c src/core/transport/chttp2/frame_window_update.c src/core/transport/chttp2/hpack_parser.c src/core/transport/chttp2/hpack_table.c src/core/transport/chttp2/huffsyms.c src/core/transport/chttp2/status_conversion.c src/core/transport/chttp2/stream_encoder.c src/core/transport/chttp2/stream_map.c src/core/transport/chttp2/timeout_encoding.c src/core/transport/chttp2/varint.c src/core/transport/chttp2_transport.c src/core/transport/metadata.c src/core/transport/stream_op.c src/core/transport/transport.c src/core/transport/transport_op_string.c src/core/census/context.c src/core/census/initialize.c include/grpc/support/alloc.h include/grpc/support/atm.h include/grpc/support/atm_gcc_atomic.h include/grpc/support/atm_gcc_sync.h include/grpc/support/atm_win32.h include/grpc/support/cancellable_platform.h include/grpc/support/cmdline.h include/grpc/support/cpu.h include/grpc/support/histogram.h include/grpc/support/host_port.h include/grpc/support/log.h include/grpc/support/log_win32.h include/grpc/support/port_platform.h include/grpc/support/slice.h include/grpc/support/slice_buffer.h include/grpc/support/string_util.h include/grpc/support/subprocess.h include/grpc/support/sync.h include/grpc/support/sync_generic.h include/grpc/support/sync_posix.h include/grpc/support/sync_win32.h include/grpc/support/thd.h include/grpc/support/time.h include/grpc/support/tls.h include/grpc/support/tls_gcc.h include/grpc/support/tls_msvc.h include/grpc/support/tls_pthread.h include/grpc/support/useful.h src/core/support/env.h src/core/support/file.h src/core/support/murmur_hash.h src/core/support/string.h src/core/support/string_win32.h src/core/support/thd_internal.h src/core/support/alloc.c src/core/support/cancellable.c src/core/support/cmdline.c src/core/support/cpu_iphone.c src/core/support/cpu_linux.c src/core/support/cpu_posix.c src/core/support/cpu_windows.c src/core/support/env_linux.c src/core/support/env_posix.c src/core/support/env_win32.c src/core/support/file.c src/core/support/file_posix.c src/core/support/file_win32.c src/core/support/histogram.c src/core/support/host_port.c src/core/support/log.c src/core/support/log_android.c src/core/support/log_linux.c src/core/support/log_posix.c src/core/support/log_win32.c src/core/support/murmur_hash.c src/core/support/slice.c src/core/support/slice_buffer.c src/core/support/string.c src/core/support/string_posix.c src/core/support/string_win32.c src/core/support/subprocess_posix.c src/core/support/sync.c src/core/support/sync_posix.c src/core/support/sync_win32.c src/core/support/thd.c src/core/support/thd_posix.c src/core/support/thd_win32.c src/core/support/time.c src/core/support/time_posix.c src/core/support/time_win32.c src/core/support/tls_pthread.c
+INPUT = include/grpc/grpc_security.h \
+include/grpc/byte_buffer.h \
+include/grpc/byte_buffer_reader.h \
+include/grpc/compression.h \
+include/grpc/grpc.h \
+include/grpc/status.h \
+include/grpc/census.h \
+src/core/httpcli/format_request.h \
+src/core/httpcli/httpcli.h \
+src/core/httpcli/httpcli_security_connector.h \
+src/core/httpcli/parser.h \
+src/core/security/auth_filters.h \
+src/core/security/base64.h \
+src/core/security/credentials.h \
+src/core/security/json_token.h \
+src/core/security/secure_endpoint.h \
+src/core/security/secure_transport_setup.h \
+src/core/security/security_connector.h \
+src/core/security/security_context.h \
+src/core/tsi/fake_transport_security.h \
+src/core/tsi/ssl_transport_security.h \
+src/core/tsi/transport_security.h \
+src/core/tsi/transport_security_interface.h \
+src/core/census/grpc_context.h \
+src/core/channel/census_filter.h \
+src/core/channel/channel_args.h \
+src/core/channel/channel_stack.h \
+src/core/channel/child_channel.h \
+src/core/channel/client_channel.h \
+src/core/channel/client_setup.h \
+src/core/channel/connected_channel.h \
+src/core/channel/context.h \
+src/core/channel/http_client_filter.h \
+src/core/channel/http_server_filter.h \
+src/core/channel/noop_filter.h \
+src/core/compression/message_compress.h \
+src/core/debug/trace.h \
+src/core/iomgr/alarm.h \
+src/core/iomgr/alarm_heap.h \
+src/core/iomgr/alarm_internal.h \
+src/core/iomgr/endpoint.h \
+src/core/iomgr/endpoint_pair.h \
+src/core/iomgr/fd_posix.h \
+src/core/iomgr/iocp_windows.h \
+src/core/iomgr/iomgr.h \
+src/core/iomgr/iomgr_internal.h \
+src/core/iomgr/iomgr_posix.h \
+src/core/iomgr/pollset.h \
+src/core/iomgr/pollset_kick_posix.h \
+src/core/iomgr/pollset_posix.h \
+src/core/iomgr/pollset_set.h \
+src/core/iomgr/pollset_set_posix.h \
+src/core/iomgr/pollset_set_windows.h \
+src/core/iomgr/pollset_windows.h \
+src/core/iomgr/resolve_address.h \
+src/core/iomgr/sockaddr.h \
+src/core/iomgr/sockaddr_posix.h \
+src/core/iomgr/sockaddr_utils.h \
+src/core/iomgr/sockaddr_win32.h \
+src/core/iomgr/socket_utils_posix.h \
+src/core/iomgr/socket_windows.h \
+src/core/iomgr/tcp_client.h \
+src/core/iomgr/tcp_posix.h \
+src/core/iomgr/tcp_server.h \
+src/core/iomgr/tcp_windows.h \
+src/core/iomgr/time_averaged_stats.h \
+src/core/iomgr/wakeup_fd_pipe.h \
+src/core/iomgr/wakeup_fd_posix.h \
+src/core/json/json.h \
+src/core/json/json_common.h \
+src/core/json/json_reader.h \
+src/core/json/json_writer.h \
+src/core/profiling/timers.h \
+src/core/profiling/timers_preciseclock.h \
+src/core/surface/byte_buffer_queue.h \
+src/core/surface/call.h \
+src/core/surface/channel.h \
+src/core/surface/client.h \
+src/core/surface/completion_queue.h \
+src/core/surface/event_string.h \
+src/core/surface/init.h \
+src/core/surface/server.h \
+src/core/surface/surface_trace.h \
+src/core/transport/chttp2/alpn.h \
+src/core/transport/chttp2/bin_encoder.h \
+src/core/transport/chttp2/frame.h \
+src/core/transport/chttp2/frame_data.h \
+src/core/transport/chttp2/frame_goaway.h \
+src/core/transport/chttp2/frame_ping.h \
+src/core/transport/chttp2/frame_rst_stream.h \
+src/core/transport/chttp2/frame_settings.h \
+src/core/transport/chttp2/frame_window_update.h \
+src/core/transport/chttp2/hpack_parser.h \
+src/core/transport/chttp2/hpack_table.h \
+src/core/transport/chttp2/http2_errors.h \
+src/core/transport/chttp2/huffsyms.h \
+src/core/transport/chttp2/incoming_metadata.h \
+src/core/transport/chttp2/internal.h \
+src/core/transport/chttp2/status_conversion.h \
+src/core/transport/chttp2/stream_encoder.h \
+src/core/transport/chttp2/stream_map.h \
+src/core/transport/chttp2/timeout_encoding.h \
+src/core/transport/chttp2/varint.h \
+src/core/transport/chttp2_transport.h \
+src/core/transport/metadata.h \
+src/core/transport/stream_op.h \
+src/core/transport/transport.h \
+src/core/transport/transport_impl.h \
+src/core/census/context.h \
+src/core/httpcli/format_request.c \
+src/core/httpcli/httpcli.c \
+src/core/httpcli/httpcli_security_connector.c \
+src/core/httpcli/parser.c \
+src/core/security/base64.c \
+src/core/security/client_auth_filter.c \
+src/core/security/credentials.c \
+src/core/security/credentials_metadata.c \
+src/core/security/credentials_posix.c \
+src/core/security/credentials_win32.c \
+src/core/security/google_default_credentials.c \
+src/core/security/json_token.c \
+src/core/security/secure_endpoint.c \
+src/core/security/secure_transport_setup.c \
+src/core/security/security_connector.c \
+src/core/security/security_context.c \
+src/core/security/server_auth_filter.c \
+src/core/security/server_secure_chttp2.c \
+src/core/surface/init_secure.c \
+src/core/surface/secure_channel_create.c \
+src/core/tsi/fake_transport_security.c \
+src/core/tsi/ssl_transport_security.c \
+src/core/tsi/transport_security.c \
+src/core/census/grpc_context.c \
+src/core/channel/channel_args.c \
+src/core/channel/channel_stack.c \
+src/core/channel/child_channel.c \
+src/core/channel/client_channel.c \
+src/core/channel/client_setup.c \
+src/core/channel/connected_channel.c \
+src/core/channel/http_client_filter.c \
+src/core/channel/http_server_filter.c \
+src/core/channel/noop_filter.c \
+src/core/compression/algorithm.c \
+src/core/compression/message_compress.c \
+src/core/debug/trace.c \
+src/core/iomgr/alarm.c \
+src/core/iomgr/alarm_heap.c \
+src/core/iomgr/endpoint.c \
+src/core/iomgr/endpoint_pair_posix.c \
+src/core/iomgr/endpoint_pair_windows.c \
+src/core/iomgr/fd_posix.c \
+src/core/iomgr/iocp_windows.c \
+src/core/iomgr/iomgr.c \
+src/core/iomgr/iomgr_posix.c \
+src/core/iomgr/iomgr_windows.c \
+src/core/iomgr/pollset_kick_posix.c \
+src/core/iomgr/pollset_multipoller_with_epoll.c \
+src/core/iomgr/pollset_multipoller_with_poll_posix.c \
+src/core/iomgr/pollset_posix.c \
+src/core/iomgr/pollset_set_posix.c \
+src/core/iomgr/pollset_set_windows.c \
+src/core/iomgr/pollset_windows.c \
+src/core/iomgr/resolve_address_posix.c \
+src/core/iomgr/resolve_address_windows.c \
+src/core/iomgr/sockaddr_utils.c \
+src/core/iomgr/socket_utils_common_posix.c \
+src/core/iomgr/socket_utils_linux.c \
+src/core/iomgr/socket_utils_posix.c \
+src/core/iomgr/socket_windows.c \
+src/core/iomgr/tcp_client_posix.c \
+src/core/iomgr/tcp_client_windows.c \
+src/core/iomgr/tcp_posix.c \
+src/core/iomgr/tcp_server_posix.c \
+src/core/iomgr/tcp_server_windows.c \
+src/core/iomgr/tcp_windows.c \
+src/core/iomgr/time_averaged_stats.c \
+src/core/iomgr/wakeup_fd_eventfd.c \
+src/core/iomgr/wakeup_fd_nospecial.c \
+src/core/iomgr/wakeup_fd_pipe.c \
+src/core/iomgr/wakeup_fd_posix.c \
+src/core/json/json.c \
+src/core/json/json_reader.c \
+src/core/json/json_string.c \
+src/core/json/json_writer.c \
+src/core/profiling/basic_timers.c \
+src/core/profiling/stap_timers.c \
+src/core/surface/byte_buffer.c \
+src/core/surface/byte_buffer_queue.c \
+src/core/surface/byte_buffer_reader.c \
+src/core/surface/call.c \
+src/core/surface/call_details.c \
+src/core/surface/call_log_batch.c \
+src/core/surface/channel.c \
+src/core/surface/channel_create.c \
+src/core/surface/client.c \
+src/core/surface/completion_queue.c \
+src/core/surface/event_string.c \
+src/core/surface/init.c \
+src/core/surface/lame_client.c \
+src/core/surface/metadata_array.c \
+src/core/surface/server.c \
+src/core/surface/server_chttp2.c \
+src/core/surface/server_create.c \
+src/core/surface/surface_trace.c \
+src/core/transport/chttp2/alpn.c \
+src/core/transport/chttp2/bin_encoder.c \
+src/core/transport/chttp2/frame_data.c \
+src/core/transport/chttp2/frame_goaway.c \
+src/core/transport/chttp2/frame_ping.c \
+src/core/transport/chttp2/frame_rst_stream.c \
+src/core/transport/chttp2/frame_settings.c \
+src/core/transport/chttp2/frame_window_update.c \
+src/core/transport/chttp2/hpack_parser.c \
+src/core/transport/chttp2/hpack_table.c \
+src/core/transport/chttp2/huffsyms.c \
+src/core/transport/chttp2/incoming_metadata.c \
+src/core/transport/chttp2/parsing.c \
+src/core/transport/chttp2/status_conversion.c \
+src/core/transport/chttp2/stream_encoder.c \
+src/core/transport/chttp2/stream_lists.c \
+src/core/transport/chttp2/stream_map.c \
+src/core/transport/chttp2/timeout_encoding.c \
+src/core/transport/chttp2/varint.c \
+src/core/transport/chttp2/writing.c \
+src/core/transport/chttp2_transport.c \
+src/core/transport/metadata.c \
+src/core/transport/stream_op.c \
+src/core/transport/transport.c \
+src/core/transport/transport_op_string.c \
+src/core/census/context.c \
+src/core/census/initialize.c \
+include/grpc/support/alloc.h \
+include/grpc/support/atm.h \
+include/grpc/support/atm_gcc_atomic.h \
+include/grpc/support/atm_gcc_sync.h \
+include/grpc/support/atm_win32.h \
+include/grpc/support/cancellable_platform.h \
+include/grpc/support/cmdline.h \
+include/grpc/support/cpu.h \
+include/grpc/support/histogram.h \
+include/grpc/support/host_port.h \
+include/grpc/support/log.h \
+include/grpc/support/log_win32.h \
+include/grpc/support/port_platform.h \
+include/grpc/support/slice.h \
+include/grpc/support/slice_buffer.h \
+include/grpc/support/string_util.h \
+include/grpc/support/subprocess.h \
+include/grpc/support/sync.h \
+include/grpc/support/sync_generic.h \
+include/grpc/support/sync_posix.h \
+include/grpc/support/sync_win32.h \
+include/grpc/support/thd.h \
+include/grpc/support/time.h \
+include/grpc/support/tls.h \
+include/grpc/support/tls_gcc.h \
+include/grpc/support/tls_msvc.h \
+include/grpc/support/tls_pthread.h \
+include/grpc/support/useful.h \
+src/core/support/env.h \
+src/core/support/file.h \
+src/core/support/murmur_hash.h \
+src/core/support/string.h \
+src/core/support/string_win32.h \
+src/core/support/thd_internal.h \
+src/core/support/alloc.c \
+src/core/support/cancellable.c \
+src/core/support/cmdline.c \
+src/core/support/cpu_iphone.c \
+src/core/support/cpu_linux.c \
+src/core/support/cpu_posix.c \
+src/core/support/cpu_windows.c \
+src/core/support/env_linux.c \
+src/core/support/env_posix.c \
+src/core/support/env_win32.c \
+src/core/support/file.c \
+src/core/support/file_posix.c \
+src/core/support/file_win32.c \
+src/core/support/histogram.c \
+src/core/support/host_port.c \
+src/core/support/log.c \
+src/core/support/log_android.c \
+src/core/support/log_linux.c \
+src/core/support/log_posix.c \
+src/core/support/log_win32.c \
+src/core/support/murmur_hash.c \
+src/core/support/slice.c \
+src/core/support/slice_buffer.c \
+src/core/support/string.c \
+src/core/support/string_posix.c \
+src/core/support/string_win32.c \
+src/core/support/subprocess_posix.c \
+src/core/support/sync.c \
+src/core/support/sync_posix.c \
+src/core/support/sync_win32.c \
+src/core/support/thd.c \
+src/core/support/thd_posix.c \
+src/core/support/thd_win32.c \
+src/core/support/time.c \
+src/core/support/time_posix.c \
+src/core/support/time_win32.c \
+src/core/support/tls_pthread.c
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/jenkins/docker_run_jenkins.sh b/tools/jenkins/docker_run_jenkins.sh
new file mode 100755
index 0000000000..90107169ba
--- /dev/null
+++ b/tools/jenkins/docker_run_jenkins.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Copyright 2015, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# This script is invoked by run_jekins.sh when piggy-backing into docker.
+set -e
+
+export CONFIG=$config
+export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.5
+export CPPFLAGS=-I/tmp/prebuilt/include
+
+mkdir -p /var/local/git
+git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
+
+cd /var/local/git/grpc
+nvm use 0.12
+rvm use ruby-2.1
+tools/run_tests/prepare_travis.sh
+tools/run_tests/run_tests.py -t -c $config -l $language -x report.xml
diff --git a/tools/jenkins/grpc_jenkins_slave/Dockerfile b/tools/jenkins/grpc_jenkins_slave/Dockerfile
index a9226c63cc..f37c0b9103 100644
--- a/tools/jenkins/grpc_jenkins_slave/Dockerfile
+++ b/tools/jenkins/grpc_jenkins_slave/Dockerfile
@@ -30,7 +30,7 @@
# A work-in-progress Dockerfile that allows running gRPC test suites
# inside a docker container.
-FROM debian:wheezy
+FROM debian:jessie
# Install Git.
RUN apt-get update && apt-get install -y \
@@ -57,7 +57,7 @@ RUN apt-get update && apt-get install -y \
##################
# C++ dependencies
-RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev
+RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang
#################
# C# dependencies
@@ -65,9 +65,12 @@ RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev
# Update to a newer version of mono
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
+RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
+RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
+RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
# Install dependencies
-RUN apt-get update && apt-get install -y \
+RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \
mono-devel \
nunit \
nunit-console \
@@ -133,5 +136,7 @@ RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add -
RUN apt-get update && apt-get install -y \
git php5 php5-dev phpunit unzip
+RUN mkdir /var/local/jenkins
+
# Define the default command.
CMD ["bash"]
diff --git a/tools/jenkins/run_jenkins.sh b/tools/jenkins/run_jenkins.sh
index 534ed306ef..f2091e2423 100755
--- a/tools/jenkins/run_jenkins.sh
+++ b/tools/jenkins/run_jenkins.sh
@@ -41,6 +41,10 @@ if [ "$platform" == "linux" ]
then
echo "building $language on Linux"
+ cd `dirname $0`/../..
+ git_root=`pwd`
+ cd -
+
# Use image name based on Dockerfile checksum
DOCKER_IMAGE_NAME=grpc_jenkins_slave_`sha1sum tools/jenkins/grpc_jenkins_slave/Dockerfile | cut -f1 -d\ `
@@ -57,26 +61,19 @@ then
rm -f docker.cid
# Run tests inside docker
- docker run --cidfile=docker.cid $DOCKER_IMAGE_NAME bash -c -l "git clone --recursive $GIT_URL /var/local/git/grpc \
- && cd /var/local/git/grpc \
- $FETCH_PULL_REQUEST_CMD \
- && git checkout -f $GIT_COMMIT \
- && git submodule update \
- && nvm use 0.12 \
- && rvm use ruby-2.1 \
- && CONFIG=$config tools/run_tests/prepare_travis.sh \
- && CPPFLAGS=-I/tmp/prebuilt/include tools/run_tests/run_tests.py -t -c $config -l $language" || DOCKER_FAILED="true"
+ docker run \
+ -e "config=$config" \
+ -e "language=$language" \
+ -i \
+ -v "$git_root:/var/local/jenkins/grpc" \
+ --cidfile=docker.cid \
+ $DOCKER_IMAGE_NAME \
+ bash -l /var/local/jenkins/grpc/tools/jenkins/docker_run_jenkins.sh || DOCKER_FAILED="true"
DOCKER_CID=`cat docker.cid`
- if [ "$DOCKER_FAILED" == "" ]
- then
- echo "Docker finished successfully, deleting the container $DOCKER_CID"
- docker rm $DOCKER_CID
- else
- echo "Docker exited with failure, keeping container $DOCKER_CID."
- echo "You can SSH to the worker and use 'docker commit CID YOUR_IMAGE_NAME' and 'docker run -i -t YOUR_IMAGE_NAME bash' to debug the problem."
- exit 1
- fi
+ docker kill $DOCKER_CID
+ docker cp $DOCKER_CID:/var/local/git/grpc/report.xml $git_root
+ docker rm $DOCKER_CID
elif [ "$platform" == "windows" ]
then
@@ -89,7 +86,7 @@ then
/cygdrive/c/nuget/nuget.exe restore vsprojects/grpc.sln
/cygdrive/c/nuget/nuget.exe restore src/csharp/Grpc.sln
- python tools/run_tests/run_tests.py -t -l $language
+ python tools/run_tests/run_tests.py -t -l $language -x report.xml
else
echo "Unknown platform $platform"
exit 1
diff --git a/tools/run_tests/check_sources_and_headers.py b/tools/run_tests/check_sources_and_headers.py
new file mode 100755
index 0000000000..605bdedec3
--- /dev/null
+++ b/tools/run_tests/check_sources_and_headers.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python2.7
+
+import json
+import os
+import re
+import sys
+
+root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
+with open(os.path.join(root, 'tools', 'run_tests', 'sources_and_headers.json')) as f:
+ js = json.loads(f.read())
+
+re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"')
+assert re_inc1.match('#include "foo"').group(1) == 'foo'
+re_inc2 = re.compile(r'^#\s*include\s*<((grpc|grpc\+\+)/[^"]*)>')
+assert re_inc2.match('#include <grpc++/foo>').group(1) == 'grpc++/foo'
+
+def get_target(name):
+ for target in js:
+ if target['name'] == name:
+ return target
+ assert False, 'no target %s' % name
+
+def target_has_header(target, name):
+# print target['name'], name
+ if name in target['headers']:
+ return True
+ for dep in target['deps']:
+ if target_has_header(get_target(dep), name):
+ return True
+ if name == 'src/core/profiling/stap_probes.h':
+ return True
+ return False
+
+errors = 0
+for target in js:
+ for fn in target['src']:
+ with open(os.path.join(root, fn)) as f:
+ src = f.read().splitlines()
+ for line in src:
+ m = re_inc1.match(line)
+ if m:
+ if not target_has_header(target, m.group(1)):
+ print (
+ 'target %s (%s) does not name header %s as a dependency' % (
+ target['name'], fn, m.group(1)))
+ errors += 1
+ m = re_inc2.match(line)
+ if m:
+ if not target_has_header(target, 'include/' + m.group(1)):
+ print (
+ 'target %s (%s) does not name header %s as a dependency' % (
+ target['name'], fn, m.group(1)))
+ errors += 1
+
+assert errors == 0 \ No newline at end of file
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 058a30d1ce..8694b8f6bd 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -34,10 +34,12 @@ import multiprocessing
import os
import platform
import signal
+import string
import subprocess
import sys
import tempfile
import time
+import xml.etree.cElementTree as ET
_DEFAULT_MAX_JOBS = 16 * multiprocessing.cpu_count()
@@ -159,7 +161,7 @@ class JobSpec(object):
class Job(object):
"""Manages one job."""
- def __init__(self, spec, bin_hash, newline_on_success, travis):
+ def __init__(self, spec, bin_hash, newline_on_success, travis, xml_report):
self._spec = spec
self._bin_hash = bin_hash
self._tempfile = tempfile.TemporaryFile()
@@ -176,19 +178,27 @@ class Job(object):
self._state = _RUNNING
self._newline_on_success = newline_on_success
self._travis = travis
+ self._xml_test = ET.SubElement(xml_report, 'testcase',
+ name=self._spec.shortname) if xml_report is not None else None
message('START', spec.shortname, do_newline=self._travis)
def state(self, update_cache):
"""Poll current state of the job. Prints messages at completion."""
if self._state == _RUNNING and self._process.poll() is not None:
elapsed = time.time() - self._start
+ self._tempfile.seek(0)
+ stdout = self._tempfile.read()
+ filtered_stdout = filter(lambda x: x in string.printable, stdout.decode(errors='ignore'))
+ if self._xml_test is not None:
+ self._xml_test.set('time', str(elapsed))
+ ET.SubElement(self._xml_test, 'system-out').text = filtered_stdout
if self._process.returncode != 0:
self._state = _FAILURE
- self._tempfile.seek(0)
- stdout = self._tempfile.read()
message('FAILED', '%s [ret=%d, pid=%d]' % (
self._spec.shortname, self._process.returncode, self._process.pid),
stdout, do_newline=True)
+ if self._xml_test is not None:
+ ET.SubElement(self._xml_test, 'failure', message='Failure').text
else:
self._state = _SUCCESS
message('PASSED', '%s [time=%.1fsec]' % (self._spec.shortname, elapsed),
@@ -200,6 +210,9 @@ class Job(object):
stdout = self._tempfile.read()
message('TIMEOUT', self._spec.shortname, stdout, do_newline=True)
self.kill()
+ if self._xml_test is not None:
+ ET.SubElement(self._xml_test, 'system-out').text = stdout
+ ET.SubElement(self._xml_test, 'error', message='Timeout')
return self._state
def kill(self):
@@ -212,7 +225,7 @@ class Jobset(object):
"""Manages one run of jobs."""
def __init__(self, check_cancelled, maxjobs, newline_on_success, travis,
- stop_on_failure, cache):
+ stop_on_failure, cache, xml_report):
self._running = set()
self._check_cancelled = check_cancelled
self._cancelled = False
@@ -224,6 +237,7 @@ class Jobset(object):
self._cache = cache
self._stop_on_failure = stop_on_failure
self._hashes = {}
+ self._xml_report = xml_report
def start(self, spec):
"""Start a job. Return True on success, False on failure."""
@@ -250,7 +264,8 @@ class Jobset(object):
self._running.add(Job(spec,
bin_hash,
self._newline_on_success,
- self._travis))
+ self._travis,
+ self._xml_report))
except:
message('FAILED', spec.shortname)
self._cancelled = True
@@ -324,11 +339,13 @@ def run(cmdlines,
travis=False,
infinite_runs=False,
stop_on_failure=False,
- cache=None):
+ cache=None,
+ xml_report=None):
js = Jobset(check_cancelled,
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS,
newline_on_success, travis, stop_on_failure,
- cache if cache is not None else NoCache())
+ cache if cache is not None else NoCache(),
+ xml_report)
for cmdline in cmdlines:
if not js.start(cmdline):
break
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 2c9ffe72ec..fd90613ad6 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -42,6 +42,7 @@ import re
import subprocess
import sys
import time
+import xml.etree.cElementTree as ET
import jobset
import watch_dirs
@@ -50,6 +51,9 @@ ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
os.chdir(ROOT)
+_FORCE_ENVIRON_FOR_WRAPPERS = {}
+
+
# SimpleConfig: just compile with CONFIG=config, and run the binary to test
class SimpleConfig(object):
@@ -97,7 +101,7 @@ class ValgrindConfig(object):
def job_spec(self, cmdline, hash_targets):
return jobset.JobSpec(cmdline=['valgrind', '--tool=%s' % self.tool] +
self.args + cmdline,
- shortname='valgrind %s' % binary,
+ shortname='valgrind %s' % cmdline[0],
hash_targets=None)
@@ -130,7 +134,7 @@ class CLanguage(object):
return sorted(out)
def make_targets(self):
- return ['buildtests_%s' % self.make_target]
+ return ['buildtests_%s' % self.make_target, 'tools_%s' % self.make_target]
def build_steps(self):
return []
@@ -146,7 +150,7 @@ class NodeLanguage(object):
def test_specs(self, config, travis):
return [config.job_spec(['tools/run_tests/run_node.sh'], None,
- environ={'GRPC_TRACE': 'surface,batch'})]
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def make_targets(self):
return ['static_c', 'shared_c']
@@ -165,7 +169,7 @@ class PhpLanguage(object):
def test_specs(self, config, travis):
return [config.job_spec(['src/php/bin/run_tests.sh'], None,
- environ={'GRPC_TRACE': 'surface,batch'})]
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def make_targets(self):
return ['static_c', 'shared_c']
@@ -190,13 +194,13 @@ class PythonLanguage(object):
modules = [config.job_spec(['tools/run_tests/run_python.sh', '-m',
test['module']],
None,
- environ={'GRPC_TRACE': 'surface,batch'},
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS,
shortname=test['module'])
for test in self._tests if 'module' in test]
files = [config.job_spec(['tools/run_tests/run_python.sh',
test['file']],
None,
- environ={'GRPC_TRACE': 'surface,batch'},
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS,
shortname=test['file'])
for test in self._tests if 'file' in test]
return files + modules
@@ -218,7 +222,7 @@ class RubyLanguage(object):
def test_specs(self, config, travis):
return [config.job_spec(['tools/run_tests/run_ruby.sh'], None,
- environ={'GRPC_TRACE': 'surface,batch'})]
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def make_targets(self):
return ['run_dep_checks']
@@ -251,7 +255,7 @@ class CSharpLanguage(object):
cmd = 'tools/run_tests/run_csharp.sh'
return [config.job_spec([cmd, assembly],
None, shortname=assembly,
- environ={'GRPC_TRACE': 'surface,batch'})
+ environ=_FORCE_ENVIRON_FOR_WRAPPERS)
for assembly in assemblies ]
def make_targets(self):
@@ -275,7 +279,8 @@ class CSharpLanguage(object):
class Sanity(object):
def test_specs(self, config, travis):
- return [config.job_spec('tools/run_tests/run_sanity.sh', None)]
+ return [config.job_spec('tools/run_tests/run_sanity.sh', None),
+ config.job_spec('tools/run_tests/check_sources_and_headers.py', None)]
def make_targets(self):
return ['run_dep_checks']
@@ -385,14 +390,16 @@ argp.add_argument('--newline_on_success',
action='store_const',
const=True)
argp.add_argument('-l', '--language',
- choices=sorted(_LANGUAGES.keys()),
+ choices=['all'] + sorted(_LANGUAGES.keys()),
nargs='+',
- default=sorted(_LANGUAGES.keys()))
+ default=['all'])
argp.add_argument('-S', '--stop_on_failure',
default=False,
action='store_const',
const=True)
argp.add_argument('-a', '--antagonists', default=0, type=int)
+argp.add_argument('-x', '--xml_report', default=None, type=str,
+ help='Generates a JUnit-compatible XML report')
args = argp.parse_args()
# grab config
@@ -402,8 +409,14 @@ run_configs = set(_CONFIGS[cfg]
for x in args.config))
build_configs = set(cfg.build_config for cfg in run_configs)
+if args.travis:
+ _FORCE_ENVIRON_FOR_WRAPPERS = {'GRPC_TRACE': 'surface,batch'}
+
make_targets = []
-languages = set(_LANGUAGES[l] for l in args.language)
+languages = set(_LANGUAGES[l]
+ for l in itertools.chain.from_iterable(
+ _LANGUAGES.iterkeys() if x == 'all' else [x]
+ for x in args.language))
if len(build_configs) > 1:
for language in languages:
@@ -435,8 +448,8 @@ build_steps.extend(set(
one_run = set(
spec
for config in run_configs
- for language in args.language
- for spec in _LANGUAGES[language].test_specs(config, args.travis)
+ for language in languages
+ for spec in language.test_specs(config, args.travis)
if re.search(args.regex, spec.shortname))
runs_per_test = args.runs_per_test
@@ -483,7 +496,7 @@ class TestCache(object):
self.parse(json.loads(f.read()))
-def _build_and_run(check_cancelled, newline_on_success, travis, cache):
+def _build_and_run(check_cancelled, newline_on_success, travis, cache, xml_report=None):
"""Do one pass of building & running tests."""
# build latest sequentially
if not jobset.run(build_steps, maxjobs=1,
@@ -504,19 +517,29 @@ def _build_and_run(check_cancelled, newline_on_success, travis, cache):
# chance to run.
massaged_one_run = list(one_run) # random.shuffle needs an indexable seq.
random.shuffle(massaged_one_run) # which it modifies in-place.
+ if infinite_runs:
+ assert len(massaged_one_run) > 0, 'Must have at least one test for a -n inf run'
runs_sequence = (itertools.repeat(massaged_one_run) if infinite_runs
else itertools.repeat(massaged_one_run, runs_per_test))
all_runs = itertools.chain.from_iterable(runs_sequence)
+
+ root = ET.Element('testsuites') if xml_report else None
+ testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') if xml_report else None
+
if not jobset.run(all_runs, check_cancelled,
newline_on_success=newline_on_success, travis=travis,
infinite_runs=infinite_runs,
maxjobs=args.jobs,
stop_on_failure=args.stop_on_failure,
- cache=cache):
+ cache=cache if not xml_report else None,
+ xml_report=testsuite):
return 2
finally:
for antagonist in antagonists:
antagonist.kill()
+ if xml_report:
+ tree = ET.ElementTree(root)
+ tree.write(xml_report, encoding='UTF-8')
if cache: cache.save()
@@ -548,7 +571,8 @@ else:
result = _build_and_run(check_cancelled=lambda: False,
newline_on_success=args.newline_on_success,
travis=args.travis,
- cache=test_cache)
+ cache=test_cache,
+ xml_report=args.xml_report)
if result == 0:
jobset.message('SUCCESS', 'All tests passed', do_newline=True)
else:
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
new file mode 100644
index 0000000000..1fb239983a
--- /dev/null
+++ b/tools/run_tests/sources_and_headers.json
@@ -0,0 +1,10648 @@
+
+
+[
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "alarm_heap_test",
+ "src": [
+ "test/core/iomgr/alarm_heap_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "alarm_list_test",
+ "src": [
+ "test/core/iomgr/alarm_list_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "alarm_test",
+ "src": [
+ "test/core/iomgr/alarm_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "alpn_test",
+ "src": [
+ "test/core/transport/chttp2/alpn_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "bin_encoder_test",
+ "src": [
+ "test/core/transport/chttp2/bin_encoder_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_status_conversion_test",
+ "src": [
+ "test/core/transport/chttp2/status_conversion_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_stream_encoder_test",
+ "src": [
+ "test/core/transport/chttp2/stream_encoder_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_stream_map_test",
+ "src": [
+ "test/core/transport/chttp2/stream_map_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "dualstack_socket_test",
+ "src": [
+ "test/core/end2end/dualstack_socket_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "fd_conservation_posix_test",
+ "src": [
+ "test/core/iomgr/fd_conservation_posix_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "fd_posix_test",
+ "src": [
+ "test/core/iomgr/fd_posix_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "fling_client",
+ "src": [
+ "test/core/fling/client.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "fling_server",
+ "src": [
+ "test/core/fling/server.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "fling_stream_test",
+ "src": [
+ "test/core/fling/fling_stream_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "fling_test",
+ "src": [
+ "test/core/fling/fling_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gen_hpack_tables",
+ "src": [
+ "tools/codegen/core/gen_hpack_tables.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_cancellable_test",
+ "src": [
+ "test/core/support/cancellable_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_cmdline_test",
+ "src": [
+ "test/core/support/cmdline_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_env_test",
+ "src": [
+ "test/core/support/env_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_file_test",
+ "src": [
+ "test/core/support/file_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_histogram_test",
+ "src": [
+ "test/core/support/histogram_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_host_port_test",
+ "src": [
+ "test/core/support/host_port_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_log_test",
+ "src": [
+ "test/core/support/log_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_slice_buffer_test",
+ "src": [
+ "test/core/support/slice_buffer_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_slice_test",
+ "src": [
+ "test/core/support/slice_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_string_test",
+ "src": [
+ "test/core/support/string_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_sync_test",
+ "src": [
+ "test/core/support/sync_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_thd_test",
+ "src": [
+ "test/core/support/thd_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_time_test",
+ "src": [
+ "test/core/support/time_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_tls_test",
+ "src": [
+ "test/core/support/tls_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "gpr_useful_test",
+ "src": [
+ "test/core/support/useful_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_auth_context_test",
+ "src": [
+ "test/core/security/auth_context_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_base64_test",
+ "src": [
+ "test/core/security/base64_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_byte_buffer_reader_test",
+ "src": [
+ "test/core/surface/byte_buffer_reader_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_channel_stack_test",
+ "src": [
+ "test/core/channel/channel_stack_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_completion_queue_test",
+ "src": [
+ "test/core/surface/completion_queue_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_create_jwt",
+ "src": [
+ "test/core/security/create_jwt.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_credentials_test",
+ "src": [
+ "test/core/security/credentials_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_fetch_oauth2",
+ "src": [
+ "test/core/security/fetch_oauth2.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_json_token_test",
+ "src": [
+ "test/core/security/json_token_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_print_google_default_creds_token",
+ "src": [
+ "test/core/security/print_google_default_creds_token.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_security_connector_test",
+ "src": [
+ "test/core/security/security_connector_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "grpc_stream_op_test",
+ "src": [
+ "test/core/transport/stream_op_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "hpack_parser_test",
+ "src": [
+ "test/core/transport/chttp2/hpack_parser_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "hpack_table_test",
+ "src": [
+ "test/core/transport/chttp2/hpack_table_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "httpcli_format_request_test",
+ "src": [
+ "test/core/httpcli/format_request_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "httpcli_parser_test",
+ "src": [
+ "test/core/httpcli/parser_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "httpcli_test",
+ "src": [
+ "test/core/httpcli/httpcli_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "json_rewrite",
+ "src": [
+ "test/core/json/json_rewrite.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "json_rewrite_test",
+ "src": [
+ "test/core/json/json_rewrite_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "json_test",
+ "src": [
+ "test/core/json/json_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "lame_client_test",
+ "src": [
+ "test/core/surface/lame_client_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "low_level_ping_pong_benchmark",
+ "src": [
+ "test/core/network_benchmarks/low_level_ping_pong.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "message_compress_test",
+ "src": [
+ "test/core/compression/message_compress_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "multi_init_test",
+ "src": [
+ "test/core/surface/multi_init_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "multiple_server_queues_test",
+ "src": [
+ "test/core/end2end/multiple_server_queues_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "murmur_hash_test",
+ "src": [
+ "test/core/support/murmur_hash_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "no_server_test",
+ "src": [
+ "test/core/end2end/no_server_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "poll_kick_posix_test",
+ "src": [
+ "test/core/iomgr/poll_kick_posix_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "resolve_address_test",
+ "src": [
+ "test/core/iomgr/resolve_address_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "secure_endpoint_test",
+ "src": [
+ "test/core/security/secure_endpoint_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "sockaddr_utils_test",
+ "src": [
+ "test/core/iomgr/sockaddr_utils_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "tcp_client_posix_test",
+ "src": [
+ "test/core/iomgr/tcp_client_posix_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "tcp_posix_test",
+ "src": [
+ "test/core/iomgr/tcp_posix_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "tcp_server_posix_test",
+ "src": [
+ "test/core/iomgr/tcp_server_posix_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "time_averaged_stats_test",
+ "src": [
+ "test/core/iomgr/time_averaged_stats_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "time_test",
+ "src": [
+ "test/core/support/time_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "timeout_encoding_test",
+ "src": [
+ "test/core/transport/chttp2/timeout_encoding_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "timers_test",
+ "src": [
+ "test/core/profiling/timers_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "transport_metadata_test",
+ "src": [
+ "test/core/transport/metadata_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "transport_security_test",
+ "src": [
+ "test/core/tsi/transport_security_test.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "async_end2end_test",
+ "src": [
+ "test/cpp/end2end/async_end2end_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "async_streaming_ping_pong_test",
+ "src": [
+ "test/cpp/qps/async_streaming_ping_pong_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "async_unary_ping_pong_test",
+ "src": [
+ "test/cpp/qps/async_unary_ping_pong_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc++"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "channel_arguments_test",
+ "src": [
+ "test/cpp/client/channel_arguments_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "cli_call_test",
+ "src": [
+ "test/cpp/util/cli_call_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "client_crash_test",
+ "src": [
+ "test/cpp/end2end/client_crash_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "client_crash_test_server",
+ "src": [
+ "test/cpp/end2end/client_crash_test_server.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc++"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "credentials_test",
+ "src": [
+ "test/cpp/client/credentials_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "cxx_byte_buffer_test",
+ "src": [
+ "test/cpp/util/byte_buffer_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "cxx_slice_test",
+ "src": [
+ "test/cpp/util/slice_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "cxx_time_test",
+ "src": [
+ "test/cpp/util/time_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "end2end_test",
+ "src": [
+ "test/cpp/end2end/end2end_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "generic_end2end_test",
+ "src": [
+ "test/cpp/end2end/generic_end2end_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "grpc_cli",
+ "src": [
+ "test/cpp/util/grpc_cli.cc"
+ ]
+ },
+ {
+ "deps": [
+ "grpc_plugin_support"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "grpc_cpp_plugin",
+ "src": [
+ "src/compiler/cpp_plugin.cc"
+ ]
+ },
+ {
+ "deps": [
+ "grpc_plugin_support"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "grpc_csharp_plugin",
+ "src": [
+ "src/compiler/csharp_plugin.cc"
+ ]
+ },
+ {
+ "deps": [
+ "grpc_plugin_support"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "grpc_objective_c_plugin",
+ "src": [
+ "src/compiler/objective_c_plugin.cc"
+ ]
+ },
+ {
+ "deps": [
+ "grpc_plugin_support"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "grpc_python_plugin",
+ "src": [
+ "src/compiler/python_plugin.cc"
+ ]
+ },
+ {
+ "deps": [
+ "grpc_plugin_support"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "grpc_ruby_plugin",
+ "src": [
+ "src/compiler/ruby_plugin.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "interop_client_helper",
+ "interop_client_main"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "interop_client",
+ "src": []
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "interop_server_helper",
+ "interop_server_main"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "interop_server",
+ "src": []
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "interop_test",
+ "src": [
+ "test/cpp/interop/interop_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "mock_test",
+ "src": [
+ "test/cpp/end2end/mock_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc_test_util",
+ "pubsub_client_lib"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "pubsub_client",
+ "src": [
+ "examples/pubsub/main.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "pubsub_client_lib"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "pubsub_publisher_test",
+ "src": [
+ "examples/pubsub/publisher_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "pubsub_client_lib"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "pubsub_subscriber_test",
+ "src": [
+ "examples/pubsub/subscriber_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "qps_driver",
+ "src": [
+ "test/cpp/qps/qps_driver.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "qps_interarrival_test",
+ "src": [
+ "test/cpp/qps/qps_interarrival_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "qps_test",
+ "src": [
+ "test/cpp/qps/qps_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "qps_test_openloop",
+ "src": [
+ "test/cpp/qps/qps_test_openloop.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [
+ "test/cpp/qps/client.h",
+ "test/cpp/qps/server.h"
+ ],
+ "language": "c++",
+ "name": "qps_worker",
+ "src": [
+ "test/cpp/qps/client.h",
+ "test/cpp/qps/server.h",
+ "test/cpp/qps/worker.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "server_crash_test",
+ "src": [
+ "test/cpp/end2end/server_crash_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "server_crash_test_client",
+ "src": [
+ "test/cpp/end2end/server_crash_test_client.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "status_test",
+ "src": [
+ "test/cpp/util/status_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "sync_streaming_ping_pong_test",
+ "src": [
+ "test/cpp/qps/sync_streaming_ping_pong_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "qps"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "sync_unary_ping_pong_test",
+ "src": [
+ "test/cpp/qps/sync_unary_ping_pong_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "thread_pool_test",
+ "src": [
+ "test/cpp/server/thread_pool_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c++",
+ "name": "thread_stress_test",
+ "src": [
+ "test/cpp/end2end/thread_stress_test.cc"
+ ]
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fake_security",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fake_security_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_fullstack_with_poll_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_bad_hostname_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_census_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_disappearing_server_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_empty_batch_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_invoke_large_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_max_message_length_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_no_op_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_registered_call_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_payload_and_call_creds",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_with_flags_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_with_payload_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_server_finishes_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_simple_request_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_bad_hostname_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_after_accept_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_after_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_before_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_cancel_in_a_vacuum_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_census_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_disappearing_server_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_empty_batch_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_graceful_server_shutdown_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_invoke_large_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_max_concurrent_streams_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_max_message_length_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_no_op_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_ping_pong_streaming_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_registered_call_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_with_flags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_with_large_metadata_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_request_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_server_finishes_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_simple_delayed_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_bad_hostname_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_after_accept_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_after_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_before_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_cancel_in_a_vacuum_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_census_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_disappearing_server_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_empty_batch_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_max_message_length_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_no_op_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_ping_pong_streaming_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_registered_call_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_with_flags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_request_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_uds_posix",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_bad_hostname_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_after_accept_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_after_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_before_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_cancel_in_a_vacuum_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_census_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_disappearing_server_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_empty_batch_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_graceful_server_shutdown_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_invoke_large_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_max_concurrent_streams_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_max_message_length_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_no_op_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_ping_pong_streaming_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_registered_call_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_with_flags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_with_large_metadata_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_request_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_server_finishes_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_simple_delayed_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_fullstack_with_poll",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_fullstack_with_poll_simple_request_with_high_initial_sequence_number_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_bad_hostname_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_after_accept_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_after_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_before_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_census_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_disappearing_server_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_empty_batch_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_graceful_server_shutdown_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_invoke_large_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_max_concurrent_streams_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_max_message_length_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_no_op_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_ping_pong_streaming_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_registered_call_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_with_flags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_with_large_metadata_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_request_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_server_finishes_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_simple_delayed_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_with_flags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_bad_hostname",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_after_accept",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_after_accept_and_writes_closed",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_after_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_before_invoke",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_cancel_in_a_vacuum",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_census_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_disappearing_server",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_early_server_shutdown_finishes_tags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_empty_batch",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_graceful_server_shutdown",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_invoke_large_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_max_concurrent_streams",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_max_message_length",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_no_op",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_ping_pong_streaming",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_registered_call",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_binary_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_with_flags",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_with_flags_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_with_large_metadata",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_request_with_payload",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_server_finishes_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_simple_delayed_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_simple_request",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "end2end_test_simple_request_with_high_initial_sequence_number",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test",
+ "src": []
+ },
+ {
+ "deps": [
+ "bad_client_test",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "connection_prefix_bad_client_test",
+ "src": [
+ "test/core/bad_client/tests/connection_prefix.c"
+ ]
+ },
+ {
+ "deps": [
+ "bad_client_test",
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "initial_settings_frame_bad_client_test",
+ "src": [
+ "test/core/bad_client/tests/initial_settings_frame.c"
+ ]
+ },
+ {
+ "deps": [],
+ "headers": [
+ "include/grpc/support/alloc.h",
+ "include/grpc/support/atm.h",
+ "include/grpc/support/atm_gcc_atomic.h",
+ "include/grpc/support/atm_gcc_sync.h",
+ "include/grpc/support/atm_win32.h",
+ "include/grpc/support/cancellable_platform.h",
+ "include/grpc/support/cmdline.h",
+ "include/grpc/support/cpu.h",
+ "include/grpc/support/histogram.h",
+ "include/grpc/support/host_port.h",
+ "include/grpc/support/log.h",
+ "include/grpc/support/log_win32.h",
+ "include/grpc/support/port_platform.h",
+ "include/grpc/support/slice.h",
+ "include/grpc/support/slice_buffer.h",
+ "include/grpc/support/string_util.h",
+ "include/grpc/support/subprocess.h",
+ "include/grpc/support/sync.h",
+ "include/grpc/support/sync_generic.h",
+ "include/grpc/support/sync_posix.h",
+ "include/grpc/support/sync_win32.h",
+ "include/grpc/support/thd.h",
+ "include/grpc/support/time.h",
+ "include/grpc/support/tls.h",
+ "include/grpc/support/tls_gcc.h",
+ "include/grpc/support/tls_msvc.h",
+ "include/grpc/support/tls_pthread.h",
+ "include/grpc/support/useful.h",
+ "src/core/support/env.h",
+ "src/core/support/file.h",
+ "src/core/support/murmur_hash.h",
+ "src/core/support/string.h",
+ "src/core/support/string_win32.h",
+ "src/core/support/thd_internal.h"
+ ],
+ "language": "c",
+ "name": "gpr",
+ "src": [
+ "include/grpc/support/alloc.h",
+ "include/grpc/support/atm.h",
+ "include/grpc/support/atm_gcc_atomic.h",
+ "include/grpc/support/atm_gcc_sync.h",
+ "include/grpc/support/atm_win32.h",
+ "include/grpc/support/cancellable_platform.h",
+ "include/grpc/support/cmdline.h",
+ "include/grpc/support/cpu.h",
+ "include/grpc/support/histogram.h",
+ "include/grpc/support/host_port.h",
+ "include/grpc/support/log.h",
+ "include/grpc/support/log_win32.h",
+ "include/grpc/support/port_platform.h",
+ "include/grpc/support/slice.h",
+ "include/grpc/support/slice_buffer.h",
+ "include/grpc/support/string_util.h",
+ "include/grpc/support/subprocess.h",
+ "include/grpc/support/sync.h",
+ "include/grpc/support/sync_generic.h",
+ "include/grpc/support/sync_posix.h",
+ "include/grpc/support/sync_win32.h",
+ "include/grpc/support/thd.h",
+ "include/grpc/support/time.h",
+ "include/grpc/support/tls.h",
+ "include/grpc/support/tls_gcc.h",
+ "include/grpc/support/tls_msvc.h",
+ "include/grpc/support/tls_pthread.h",
+ "include/grpc/support/useful.h",
+ "src/core/support/alloc.c",
+ "src/core/support/cancellable.c",
+ "src/core/support/cmdline.c",
+ "src/core/support/cpu_iphone.c",
+ "src/core/support/cpu_linux.c",
+ "src/core/support/cpu_posix.c",
+ "src/core/support/cpu_windows.c",
+ "src/core/support/env.h",
+ "src/core/support/env_linux.c",
+ "src/core/support/env_posix.c",
+ "src/core/support/env_win32.c",
+ "src/core/support/file.c",
+ "src/core/support/file.h",
+ "src/core/support/file_posix.c",
+ "src/core/support/file_win32.c",
+ "src/core/support/histogram.c",
+ "src/core/support/host_port.c",
+ "src/core/support/log.c",
+ "src/core/support/log_android.c",
+ "src/core/support/log_linux.c",
+ "src/core/support/log_posix.c",
+ "src/core/support/log_win32.c",
+ "src/core/support/murmur_hash.c",
+ "src/core/support/murmur_hash.h",
+ "src/core/support/slice.c",
+ "src/core/support/slice_buffer.c",
+ "src/core/support/string.c",
+ "src/core/support/string.h",
+ "src/core/support/string_posix.c",
+ "src/core/support/string_win32.c",
+ "src/core/support/string_win32.h",
+ "src/core/support/subprocess_posix.c",
+ "src/core/support/sync.c",
+ "src/core/support/sync_posix.c",
+ "src/core/support/sync_win32.c",
+ "src/core/support/thd.c",
+ "src/core/support/thd_internal.h",
+ "src/core/support/thd_posix.c",
+ "src/core/support/thd_win32.c",
+ "src/core/support/time.c",
+ "src/core/support/time_posix.c",
+ "src/core/support/time_win32.c",
+ "src/core/support/tls_pthread.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr"
+ ],
+ "headers": [
+ "test/core/util/test_config.h"
+ ],
+ "language": "c",
+ "name": "gpr_test_util",
+ "src": [
+ "test/core/util/test_config.c",
+ "test/core/util/test_config.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr"
+ ],
+ "headers": [
+ "include/grpc/byte_buffer.h",
+ "include/grpc/byte_buffer_reader.h",
+ "include/grpc/census.h",
+ "include/grpc/compression.h",
+ "include/grpc/grpc.h",
+ "include/grpc/grpc_security.h",
+ "include/grpc/status.h",
+ "src/core/census/context.h",
+ "src/core/census/grpc_context.h",
+ "src/core/channel/census_filter.h",
+ "src/core/channel/channel_args.h",
+ "src/core/channel/channel_stack.h",
+ "src/core/channel/child_channel.h",
+ "src/core/channel/client_channel.h",
+ "src/core/channel/client_setup.h",
+ "src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
+ "src/core/channel/http_client_filter.h",
+ "src/core/channel/http_server_filter.h",
+ "src/core/channel/noop_filter.h",
+ "src/core/compression/message_compress.h",
+ "src/core/debug/trace.h",
+ "src/core/httpcli/format_request.h",
+ "src/core/httpcli/httpcli.h",
+ "src/core/httpcli/httpcli_security_connector.h",
+ "src/core/httpcli/parser.h",
+ "src/core/iomgr/alarm.h",
+ "src/core/iomgr/alarm_heap.h",
+ "src/core/iomgr/alarm_internal.h",
+ "src/core/iomgr/endpoint.h",
+ "src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/fd_posix.h",
+ "src/core/iomgr/iocp_windows.h",
+ "src/core/iomgr/iomgr.h",
+ "src/core/iomgr/iomgr_internal.h",
+ "src/core/iomgr/iomgr_posix.h",
+ "src/core/iomgr/pollset.h",
+ "src/core/iomgr/pollset_kick_posix.h",
+ "src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.h",
+ "src/core/iomgr/pollset_windows.h",
+ "src/core/iomgr/resolve_address.h",
+ "src/core/iomgr/sockaddr.h",
+ "src/core/iomgr/sockaddr_posix.h",
+ "src/core/iomgr/sockaddr_utils.h",
+ "src/core/iomgr/sockaddr_win32.h",
+ "src/core/iomgr/socket_utils_posix.h",
+ "src/core/iomgr/socket_windows.h",
+ "src/core/iomgr/tcp_client.h",
+ "src/core/iomgr/tcp_posix.h",
+ "src/core/iomgr/tcp_server.h",
+ "src/core/iomgr/tcp_windows.h",
+ "src/core/iomgr/time_averaged_stats.h",
+ "src/core/iomgr/wakeup_fd_pipe.h",
+ "src/core/iomgr/wakeup_fd_posix.h",
+ "src/core/json/json.h",
+ "src/core/json/json_common.h",
+ "src/core/json/json_reader.h",
+ "src/core/json/json_writer.h",
+ "src/core/profiling/timers.h",
+ "src/core/profiling/timers_preciseclock.h",
+ "src/core/security/auth_filters.h",
+ "src/core/security/base64.h",
+ "src/core/security/credentials.h",
+ "src/core/security/json_token.h",
+ "src/core/security/secure_endpoint.h",
+ "src/core/security/secure_transport_setup.h",
+ "src/core/security/security_connector.h",
+ "src/core/security/security_context.h",
+ "src/core/surface/byte_buffer_queue.h",
+ "src/core/surface/call.h",
+ "src/core/surface/channel.h",
+ "src/core/surface/client.h",
+ "src/core/surface/completion_queue.h",
+ "src/core/surface/event_string.h",
+ "src/core/surface/init.h",
+ "src/core/surface/server.h",
+ "src/core/surface/surface_trace.h",
+ "src/core/transport/chttp2/alpn.h",
+ "src/core/transport/chttp2/bin_encoder.h",
+ "src/core/transport/chttp2/frame.h",
+ "src/core/transport/chttp2/frame_data.h",
+ "src/core/transport/chttp2/frame_goaway.h",
+ "src/core/transport/chttp2/frame_ping.h",
+ "src/core/transport/chttp2/frame_rst_stream.h",
+ "src/core/transport/chttp2/frame_settings.h",
+ "src/core/transport/chttp2/frame_window_update.h",
+ "src/core/transport/chttp2/hpack_parser.h",
+ "src/core/transport/chttp2/hpack_table.h",
+ "src/core/transport/chttp2/http2_errors.h",
+ "src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
+ "src/core/transport/chttp2/status_conversion.h",
+ "src/core/transport/chttp2/stream_encoder.h",
+ "src/core/transport/chttp2/stream_map.h",
+ "src/core/transport/chttp2/timeout_encoding.h",
+ "src/core/transport/chttp2/varint.h",
+ "src/core/transport/chttp2_transport.h",
+ "src/core/transport/metadata.h",
+ "src/core/transport/stream_op.h",
+ "src/core/transport/transport.h",
+ "src/core/transport/transport_impl.h",
+ "src/core/tsi/fake_transport_security.h",
+ "src/core/tsi/ssl_transport_security.h",
+ "src/core/tsi/transport_security.h",
+ "src/core/tsi/transport_security_interface.h"
+ ],
+ "language": "c",
+ "name": "grpc",
+ "src": [
+ "include/grpc/byte_buffer.h",
+ "include/grpc/byte_buffer_reader.h",
+ "include/grpc/census.h",
+ "include/grpc/compression.h",
+ "include/grpc/grpc.h",
+ "include/grpc/grpc_security.h",
+ "include/grpc/status.h",
+ "src/core/census/context.c",
+ "src/core/census/context.h",
+ "src/core/census/grpc_context.c",
+ "src/core/census/grpc_context.h",
+ "src/core/census/initialize.c",
+ "src/core/channel/census_filter.h",
+ "src/core/channel/channel_args.c",
+ "src/core/channel/channel_args.h",
+ "src/core/channel/channel_stack.c",
+ "src/core/channel/channel_stack.h",
+ "src/core/channel/child_channel.c",
+ "src/core/channel/child_channel.h",
+ "src/core/channel/client_channel.c",
+ "src/core/channel/client_channel.h",
+ "src/core/channel/client_setup.c",
+ "src/core/channel/client_setup.h",
+ "src/core/channel/connected_channel.c",
+ "src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
+ "src/core/channel/http_client_filter.c",
+ "src/core/channel/http_client_filter.h",
+ "src/core/channel/http_server_filter.c",
+ "src/core/channel/http_server_filter.h",
+ "src/core/channel/noop_filter.c",
+ "src/core/channel/noop_filter.h",
+ "src/core/compression/algorithm.c",
+ "src/core/compression/message_compress.c",
+ "src/core/compression/message_compress.h",
+ "src/core/debug/trace.c",
+ "src/core/debug/trace.h",
+ "src/core/httpcli/format_request.c",
+ "src/core/httpcli/format_request.h",
+ "src/core/httpcli/httpcli.c",
+ "src/core/httpcli/httpcli.h",
+ "src/core/httpcli/httpcli_security_connector.c",
+ "src/core/httpcli/httpcli_security_connector.h",
+ "src/core/httpcli/parser.c",
+ "src/core/httpcli/parser.h",
+ "src/core/iomgr/alarm.c",
+ "src/core/iomgr/alarm.h",
+ "src/core/iomgr/alarm_heap.c",
+ "src/core/iomgr/alarm_heap.h",
+ "src/core/iomgr/alarm_internal.h",
+ "src/core/iomgr/endpoint.c",
+ "src/core/iomgr/endpoint.h",
+ "src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/endpoint_pair_posix.c",
+ "src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/fd_posix.c",
+ "src/core/iomgr/fd_posix.h",
+ "src/core/iomgr/iocp_windows.c",
+ "src/core/iomgr/iocp_windows.h",
+ "src/core/iomgr/iomgr.c",
+ "src/core/iomgr/iomgr.h",
+ "src/core/iomgr/iomgr_internal.h",
+ "src/core/iomgr/iomgr_posix.c",
+ "src/core/iomgr/iomgr_posix.h",
+ "src/core/iomgr/iomgr_windows.c",
+ "src/core/iomgr/pollset.h",
+ "src/core/iomgr/pollset_kick_posix.c",
+ "src/core/iomgr/pollset_kick_posix.h",
+ "src/core/iomgr/pollset_multipoller_with_epoll.c",
+ "src/core/iomgr/pollset_multipoller_with_poll_posix.c",
+ "src/core/iomgr/pollset_posix.c",
+ "src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.c",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.c",
+ "src/core/iomgr/pollset_set_windows.h",
+ "src/core/iomgr/pollset_windows.c",
+ "src/core/iomgr/pollset_windows.h",
+ "src/core/iomgr/resolve_address.h",
+ "src/core/iomgr/resolve_address_posix.c",
+ "src/core/iomgr/resolve_address_windows.c",
+ "src/core/iomgr/sockaddr.h",
+ "src/core/iomgr/sockaddr_posix.h",
+ "src/core/iomgr/sockaddr_utils.c",
+ "src/core/iomgr/sockaddr_utils.h",
+ "src/core/iomgr/sockaddr_win32.h",
+ "src/core/iomgr/socket_utils_common_posix.c",
+ "src/core/iomgr/socket_utils_linux.c",
+ "src/core/iomgr/socket_utils_posix.c",
+ "src/core/iomgr/socket_utils_posix.h",
+ "src/core/iomgr/socket_windows.c",
+ "src/core/iomgr/socket_windows.h",
+ "src/core/iomgr/tcp_client.h",
+ "src/core/iomgr/tcp_client_posix.c",
+ "src/core/iomgr/tcp_client_windows.c",
+ "src/core/iomgr/tcp_posix.c",
+ "src/core/iomgr/tcp_posix.h",
+ "src/core/iomgr/tcp_server.h",
+ "src/core/iomgr/tcp_server_posix.c",
+ "src/core/iomgr/tcp_server_windows.c",
+ "src/core/iomgr/tcp_windows.c",
+ "src/core/iomgr/tcp_windows.h",
+ "src/core/iomgr/time_averaged_stats.c",
+ "src/core/iomgr/time_averaged_stats.h",
+ "src/core/iomgr/wakeup_fd_eventfd.c",
+ "src/core/iomgr/wakeup_fd_nospecial.c",
+ "src/core/iomgr/wakeup_fd_pipe.c",
+ "src/core/iomgr/wakeup_fd_pipe.h",
+ "src/core/iomgr/wakeup_fd_posix.c",
+ "src/core/iomgr/wakeup_fd_posix.h",
+ "src/core/json/json.c",
+ "src/core/json/json.h",
+ "src/core/json/json_common.h",
+ "src/core/json/json_reader.c",
+ "src/core/json/json_reader.h",
+ "src/core/json/json_string.c",
+ "src/core/json/json_writer.c",
+ "src/core/json/json_writer.h",
+ "src/core/profiling/basic_timers.c",
+ "src/core/profiling/stap_timers.c",
+ "src/core/profiling/timers.h",
+ "src/core/profiling/timers_preciseclock.h",
+ "src/core/security/auth_filters.h",
+ "src/core/security/base64.c",
+ "src/core/security/base64.h",
+ "src/core/security/client_auth_filter.c",
+ "src/core/security/credentials.c",
+ "src/core/security/credentials.h",
+ "src/core/security/credentials_metadata.c",
+ "src/core/security/credentials_posix.c",
+ "src/core/security/credentials_win32.c",
+ "src/core/security/google_default_credentials.c",
+ "src/core/security/json_token.c",
+ "src/core/security/json_token.h",
+ "src/core/security/secure_endpoint.c",
+ "src/core/security/secure_endpoint.h",
+ "src/core/security/secure_transport_setup.c",
+ "src/core/security/secure_transport_setup.h",
+ "src/core/security/security_connector.c",
+ "src/core/security/security_connector.h",
+ "src/core/security/security_context.c",
+ "src/core/security/security_context.h",
+ "src/core/security/server_auth_filter.c",
+ "src/core/security/server_secure_chttp2.c",
+ "src/core/surface/byte_buffer.c",
+ "src/core/surface/byte_buffer_queue.c",
+ "src/core/surface/byte_buffer_queue.h",
+ "src/core/surface/byte_buffer_reader.c",
+ "src/core/surface/call.c",
+ "src/core/surface/call.h",
+ "src/core/surface/call_details.c",
+ "src/core/surface/call_log_batch.c",
+ "src/core/surface/channel.c",
+ "src/core/surface/channel.h",
+ "src/core/surface/channel_create.c",
+ "src/core/surface/client.c",
+ "src/core/surface/client.h",
+ "src/core/surface/completion_queue.c",
+ "src/core/surface/completion_queue.h",
+ "src/core/surface/event_string.c",
+ "src/core/surface/event_string.h",
+ "src/core/surface/init.c",
+ "src/core/surface/init.h",
+ "src/core/surface/init_secure.c",
+ "src/core/surface/lame_client.c",
+ "src/core/surface/metadata_array.c",
+ "src/core/surface/secure_channel_create.c",
+ "src/core/surface/server.c",
+ "src/core/surface/server.h",
+ "src/core/surface/server_chttp2.c",
+ "src/core/surface/server_create.c",
+ "src/core/surface/surface_trace.c",
+ "src/core/surface/surface_trace.h",
+ "src/core/transport/chttp2/alpn.c",
+ "src/core/transport/chttp2/alpn.h",
+ "src/core/transport/chttp2/bin_encoder.c",
+ "src/core/transport/chttp2/bin_encoder.h",
+ "src/core/transport/chttp2/frame.h",
+ "src/core/transport/chttp2/frame_data.c",
+ "src/core/transport/chttp2/frame_data.h",
+ "src/core/transport/chttp2/frame_goaway.c",
+ "src/core/transport/chttp2/frame_goaway.h",
+ "src/core/transport/chttp2/frame_ping.c",
+ "src/core/transport/chttp2/frame_ping.h",
+ "src/core/transport/chttp2/frame_rst_stream.c",
+ "src/core/transport/chttp2/frame_rst_stream.h",
+ "src/core/transport/chttp2/frame_settings.c",
+ "src/core/transport/chttp2/frame_settings.h",
+ "src/core/transport/chttp2/frame_window_update.c",
+ "src/core/transport/chttp2/frame_window_update.h",
+ "src/core/transport/chttp2/hpack_parser.c",
+ "src/core/transport/chttp2/hpack_parser.h",
+ "src/core/transport/chttp2/hpack_table.c",
+ "src/core/transport/chttp2/hpack_table.h",
+ "src/core/transport/chttp2/http2_errors.h",
+ "src/core/transport/chttp2/huffsyms.c",
+ "src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.c",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
+ "src/core/transport/chttp2/parsing.c",
+ "src/core/transport/chttp2/status_conversion.c",
+ "src/core/transport/chttp2/status_conversion.h",
+ "src/core/transport/chttp2/stream_encoder.c",
+ "src/core/transport/chttp2/stream_encoder.h",
+ "src/core/transport/chttp2/stream_lists.c",
+ "src/core/transport/chttp2/stream_map.c",
+ "src/core/transport/chttp2/stream_map.h",
+ "src/core/transport/chttp2/timeout_encoding.c",
+ "src/core/transport/chttp2/timeout_encoding.h",
+ "src/core/transport/chttp2/varint.c",
+ "src/core/transport/chttp2/varint.h",
+ "src/core/transport/chttp2/writing.c",
+ "src/core/transport/chttp2_transport.c",
+ "src/core/transport/chttp2_transport.h",
+ "src/core/transport/metadata.c",
+ "src/core/transport/metadata.h",
+ "src/core/transport/stream_op.c",
+ "src/core/transport/stream_op.h",
+ "src/core/transport/transport.c",
+ "src/core/transport/transport.h",
+ "src/core/transport/transport_impl.h",
+ "src/core/transport/transport_op_string.c",
+ "src/core/tsi/fake_transport_security.c",
+ "src/core/tsi/fake_transport_security.h",
+ "src/core/tsi/ssl_transport_security.c",
+ "src/core/tsi/ssl_transport_security.h",
+ "src/core/tsi/transport_security.c",
+ "src/core/tsi/transport_security.h",
+ "src/core/tsi/transport_security_interface.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc"
+ ],
+ "headers": [
+ "test/core/end2end/cq_verifier.h",
+ "test/core/end2end/data/ssl_test_data.h",
+ "test/core/iomgr/endpoint_tests.h",
+ "test/core/util/grpc_profiler.h",
+ "test/core/util/parse_hexstring.h",
+ "test/core/util/port.h",
+ "test/core/util/slice_splitter.h"
+ ],
+ "language": "c",
+ "name": "grpc_test_util",
+ "src": [
+ "test/core/end2end/cq_verifier.c",
+ "test/core/end2end/cq_verifier.h",
+ "test/core/end2end/data/server1_cert.c",
+ "test/core/end2end/data/server1_key.c",
+ "test/core/end2end/data/ssl_test_data.h",
+ "test/core/end2end/data/test_root_cert.c",
+ "test/core/iomgr/endpoint_tests.c",
+ "test/core/iomgr/endpoint_tests.h",
+ "test/core/util/grpc_profiler.c",
+ "test/core/util/grpc_profiler.h",
+ "test/core/util/parse_hexstring.c",
+ "test/core/util/parse_hexstring.h",
+ "test/core/util/port.h",
+ "test/core/util/port_posix.c",
+ "test/core/util/port_windows.c",
+ "test/core/util/slice_splitter.c",
+ "test/core/util/slice_splitter.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc"
+ ],
+ "headers": [
+ "test/core/end2end/cq_verifier.h",
+ "test/core/iomgr/endpoint_tests.h",
+ "test/core/util/grpc_profiler.h",
+ "test/core/util/parse_hexstring.h",
+ "test/core/util/port.h",
+ "test/core/util/slice_splitter.h"
+ ],
+ "language": "c",
+ "name": "grpc_test_util_unsecure",
+ "src": [
+ "test/core/end2end/cq_verifier.c",
+ "test/core/end2end/cq_verifier.h",
+ "test/core/iomgr/endpoint_tests.c",
+ "test/core/iomgr/endpoint_tests.h",
+ "test/core/util/grpc_profiler.c",
+ "test/core/util/grpc_profiler.h",
+ "test/core/util/parse_hexstring.c",
+ "test/core/util/parse_hexstring.h",
+ "test/core/util/port.h",
+ "test/core/util/port_posix.c",
+ "test/core/util/port_windows.c",
+ "test/core/util/slice_splitter.c",
+ "test/core/util/slice_splitter.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr"
+ ],
+ "headers": [
+ "include/grpc/byte_buffer.h",
+ "include/grpc/byte_buffer_reader.h",
+ "include/grpc/census.h",
+ "include/grpc/compression.h",
+ "include/grpc/grpc.h",
+ "include/grpc/status.h",
+ "src/core/census/context.h",
+ "src/core/census/grpc_context.h",
+ "src/core/channel/census_filter.h",
+ "src/core/channel/channel_args.h",
+ "src/core/channel/channel_stack.h",
+ "src/core/channel/child_channel.h",
+ "src/core/channel/client_channel.h",
+ "src/core/channel/client_setup.h",
+ "src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
+ "src/core/channel/http_client_filter.h",
+ "src/core/channel/http_server_filter.h",
+ "src/core/channel/noop_filter.h",
+ "src/core/compression/message_compress.h",
+ "src/core/debug/trace.h",
+ "src/core/iomgr/alarm.h",
+ "src/core/iomgr/alarm_heap.h",
+ "src/core/iomgr/alarm_internal.h",
+ "src/core/iomgr/endpoint.h",
+ "src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/fd_posix.h",
+ "src/core/iomgr/iocp_windows.h",
+ "src/core/iomgr/iomgr.h",
+ "src/core/iomgr/iomgr_internal.h",
+ "src/core/iomgr/iomgr_posix.h",
+ "src/core/iomgr/pollset.h",
+ "src/core/iomgr/pollset_kick_posix.h",
+ "src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.h",
+ "src/core/iomgr/pollset_windows.h",
+ "src/core/iomgr/resolve_address.h",
+ "src/core/iomgr/sockaddr.h",
+ "src/core/iomgr/sockaddr_posix.h",
+ "src/core/iomgr/sockaddr_utils.h",
+ "src/core/iomgr/sockaddr_win32.h",
+ "src/core/iomgr/socket_utils_posix.h",
+ "src/core/iomgr/socket_windows.h",
+ "src/core/iomgr/tcp_client.h",
+ "src/core/iomgr/tcp_posix.h",
+ "src/core/iomgr/tcp_server.h",
+ "src/core/iomgr/tcp_windows.h",
+ "src/core/iomgr/time_averaged_stats.h",
+ "src/core/iomgr/wakeup_fd_pipe.h",
+ "src/core/iomgr/wakeup_fd_posix.h",
+ "src/core/json/json.h",
+ "src/core/json/json_common.h",
+ "src/core/json/json_reader.h",
+ "src/core/json/json_writer.h",
+ "src/core/profiling/timers.h",
+ "src/core/profiling/timers_preciseclock.h",
+ "src/core/surface/byte_buffer_queue.h",
+ "src/core/surface/call.h",
+ "src/core/surface/channel.h",
+ "src/core/surface/client.h",
+ "src/core/surface/completion_queue.h",
+ "src/core/surface/event_string.h",
+ "src/core/surface/init.h",
+ "src/core/surface/server.h",
+ "src/core/surface/surface_trace.h",
+ "src/core/transport/chttp2/alpn.h",
+ "src/core/transport/chttp2/bin_encoder.h",
+ "src/core/transport/chttp2/frame.h",
+ "src/core/transport/chttp2/frame_data.h",
+ "src/core/transport/chttp2/frame_goaway.h",
+ "src/core/transport/chttp2/frame_ping.h",
+ "src/core/transport/chttp2/frame_rst_stream.h",
+ "src/core/transport/chttp2/frame_settings.h",
+ "src/core/transport/chttp2/frame_window_update.h",
+ "src/core/transport/chttp2/hpack_parser.h",
+ "src/core/transport/chttp2/hpack_table.h",
+ "src/core/transport/chttp2/http2_errors.h",
+ "src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
+ "src/core/transport/chttp2/status_conversion.h",
+ "src/core/transport/chttp2/stream_encoder.h",
+ "src/core/transport/chttp2/stream_map.h",
+ "src/core/transport/chttp2/timeout_encoding.h",
+ "src/core/transport/chttp2/varint.h",
+ "src/core/transport/chttp2_transport.h",
+ "src/core/transport/metadata.h",
+ "src/core/transport/stream_op.h",
+ "src/core/transport/transport.h",
+ "src/core/transport/transport_impl.h"
+ ],
+ "language": "c",
+ "name": "grpc_unsecure",
+ "src": [
+ "include/grpc/byte_buffer.h",
+ "include/grpc/byte_buffer_reader.h",
+ "include/grpc/census.h",
+ "include/grpc/compression.h",
+ "include/grpc/grpc.h",
+ "include/grpc/status.h",
+ "src/core/census/context.c",
+ "src/core/census/context.h",
+ "src/core/census/grpc_context.c",
+ "src/core/census/grpc_context.h",
+ "src/core/census/initialize.c",
+ "src/core/channel/census_filter.h",
+ "src/core/channel/channel_args.c",
+ "src/core/channel/channel_args.h",
+ "src/core/channel/channel_stack.c",
+ "src/core/channel/channel_stack.h",
+ "src/core/channel/child_channel.c",
+ "src/core/channel/child_channel.h",
+ "src/core/channel/client_channel.c",
+ "src/core/channel/client_channel.h",
+ "src/core/channel/client_setup.c",
+ "src/core/channel/client_setup.h",
+ "src/core/channel/connected_channel.c",
+ "src/core/channel/connected_channel.h",
+ "src/core/channel/context.h",
+ "src/core/channel/http_client_filter.c",
+ "src/core/channel/http_client_filter.h",
+ "src/core/channel/http_server_filter.c",
+ "src/core/channel/http_server_filter.h",
+ "src/core/channel/noop_filter.c",
+ "src/core/channel/noop_filter.h",
+ "src/core/compression/algorithm.c",
+ "src/core/compression/message_compress.c",
+ "src/core/compression/message_compress.h",
+ "src/core/debug/trace.c",
+ "src/core/debug/trace.h",
+ "src/core/iomgr/alarm.c",
+ "src/core/iomgr/alarm.h",
+ "src/core/iomgr/alarm_heap.c",
+ "src/core/iomgr/alarm_heap.h",
+ "src/core/iomgr/alarm_internal.h",
+ "src/core/iomgr/endpoint.c",
+ "src/core/iomgr/endpoint.h",
+ "src/core/iomgr/endpoint_pair.h",
+ "src/core/iomgr/endpoint_pair_posix.c",
+ "src/core/iomgr/endpoint_pair_windows.c",
+ "src/core/iomgr/fd_posix.c",
+ "src/core/iomgr/fd_posix.h",
+ "src/core/iomgr/iocp_windows.c",
+ "src/core/iomgr/iocp_windows.h",
+ "src/core/iomgr/iomgr.c",
+ "src/core/iomgr/iomgr.h",
+ "src/core/iomgr/iomgr_internal.h",
+ "src/core/iomgr/iomgr_posix.c",
+ "src/core/iomgr/iomgr_posix.h",
+ "src/core/iomgr/iomgr_windows.c",
+ "src/core/iomgr/pollset.h",
+ "src/core/iomgr/pollset_kick_posix.c",
+ "src/core/iomgr/pollset_kick_posix.h",
+ "src/core/iomgr/pollset_multipoller_with_epoll.c",
+ "src/core/iomgr/pollset_multipoller_with_poll_posix.c",
+ "src/core/iomgr/pollset_posix.c",
+ "src/core/iomgr/pollset_posix.h",
+ "src/core/iomgr/pollset_set.h",
+ "src/core/iomgr/pollset_set_posix.c",
+ "src/core/iomgr/pollset_set_posix.h",
+ "src/core/iomgr/pollset_set_windows.c",
+ "src/core/iomgr/pollset_set_windows.h",
+ "src/core/iomgr/pollset_windows.c",
+ "src/core/iomgr/pollset_windows.h",
+ "src/core/iomgr/resolve_address.h",
+ "src/core/iomgr/resolve_address_posix.c",
+ "src/core/iomgr/resolve_address_windows.c",
+ "src/core/iomgr/sockaddr.h",
+ "src/core/iomgr/sockaddr_posix.h",
+ "src/core/iomgr/sockaddr_utils.c",
+ "src/core/iomgr/sockaddr_utils.h",
+ "src/core/iomgr/sockaddr_win32.h",
+ "src/core/iomgr/socket_utils_common_posix.c",
+ "src/core/iomgr/socket_utils_linux.c",
+ "src/core/iomgr/socket_utils_posix.c",
+ "src/core/iomgr/socket_utils_posix.h",
+ "src/core/iomgr/socket_windows.c",
+ "src/core/iomgr/socket_windows.h",
+ "src/core/iomgr/tcp_client.h",
+ "src/core/iomgr/tcp_client_posix.c",
+ "src/core/iomgr/tcp_client_windows.c",
+ "src/core/iomgr/tcp_posix.c",
+ "src/core/iomgr/tcp_posix.h",
+ "src/core/iomgr/tcp_server.h",
+ "src/core/iomgr/tcp_server_posix.c",
+ "src/core/iomgr/tcp_server_windows.c",
+ "src/core/iomgr/tcp_windows.c",
+ "src/core/iomgr/tcp_windows.h",
+ "src/core/iomgr/time_averaged_stats.c",
+ "src/core/iomgr/time_averaged_stats.h",
+ "src/core/iomgr/wakeup_fd_eventfd.c",
+ "src/core/iomgr/wakeup_fd_nospecial.c",
+ "src/core/iomgr/wakeup_fd_pipe.c",
+ "src/core/iomgr/wakeup_fd_pipe.h",
+ "src/core/iomgr/wakeup_fd_posix.c",
+ "src/core/iomgr/wakeup_fd_posix.h",
+ "src/core/json/json.c",
+ "src/core/json/json.h",
+ "src/core/json/json_common.h",
+ "src/core/json/json_reader.c",
+ "src/core/json/json_reader.h",
+ "src/core/json/json_string.c",
+ "src/core/json/json_writer.c",
+ "src/core/json/json_writer.h",
+ "src/core/profiling/basic_timers.c",
+ "src/core/profiling/stap_timers.c",
+ "src/core/profiling/timers.h",
+ "src/core/profiling/timers_preciseclock.h",
+ "src/core/surface/byte_buffer.c",
+ "src/core/surface/byte_buffer_queue.c",
+ "src/core/surface/byte_buffer_queue.h",
+ "src/core/surface/byte_buffer_reader.c",
+ "src/core/surface/call.c",
+ "src/core/surface/call.h",
+ "src/core/surface/call_details.c",
+ "src/core/surface/call_log_batch.c",
+ "src/core/surface/channel.c",
+ "src/core/surface/channel.h",
+ "src/core/surface/channel_create.c",
+ "src/core/surface/client.c",
+ "src/core/surface/client.h",
+ "src/core/surface/completion_queue.c",
+ "src/core/surface/completion_queue.h",
+ "src/core/surface/event_string.c",
+ "src/core/surface/event_string.h",
+ "src/core/surface/init.c",
+ "src/core/surface/init.h",
+ "src/core/surface/init_unsecure.c",
+ "src/core/surface/lame_client.c",
+ "src/core/surface/metadata_array.c",
+ "src/core/surface/server.c",
+ "src/core/surface/server.h",
+ "src/core/surface/server_chttp2.c",
+ "src/core/surface/server_create.c",
+ "src/core/surface/surface_trace.c",
+ "src/core/surface/surface_trace.h",
+ "src/core/transport/chttp2/alpn.c",
+ "src/core/transport/chttp2/alpn.h",
+ "src/core/transport/chttp2/bin_encoder.c",
+ "src/core/transport/chttp2/bin_encoder.h",
+ "src/core/transport/chttp2/frame.h",
+ "src/core/transport/chttp2/frame_data.c",
+ "src/core/transport/chttp2/frame_data.h",
+ "src/core/transport/chttp2/frame_goaway.c",
+ "src/core/transport/chttp2/frame_goaway.h",
+ "src/core/transport/chttp2/frame_ping.c",
+ "src/core/transport/chttp2/frame_ping.h",
+ "src/core/transport/chttp2/frame_rst_stream.c",
+ "src/core/transport/chttp2/frame_rst_stream.h",
+ "src/core/transport/chttp2/frame_settings.c",
+ "src/core/transport/chttp2/frame_settings.h",
+ "src/core/transport/chttp2/frame_window_update.c",
+ "src/core/transport/chttp2/frame_window_update.h",
+ "src/core/transport/chttp2/hpack_parser.c",
+ "src/core/transport/chttp2/hpack_parser.h",
+ "src/core/transport/chttp2/hpack_table.c",
+ "src/core/transport/chttp2/hpack_table.h",
+ "src/core/transport/chttp2/http2_errors.h",
+ "src/core/transport/chttp2/huffsyms.c",
+ "src/core/transport/chttp2/huffsyms.h",
+ "src/core/transport/chttp2/incoming_metadata.c",
+ "src/core/transport/chttp2/incoming_metadata.h",
+ "src/core/transport/chttp2/internal.h",
+ "src/core/transport/chttp2/parsing.c",
+ "src/core/transport/chttp2/status_conversion.c",
+ "src/core/transport/chttp2/status_conversion.h",
+ "src/core/transport/chttp2/stream_encoder.c",
+ "src/core/transport/chttp2/stream_encoder.h",
+ "src/core/transport/chttp2/stream_lists.c",
+ "src/core/transport/chttp2/stream_map.c",
+ "src/core/transport/chttp2/stream_map.h",
+ "src/core/transport/chttp2/timeout_encoding.c",
+ "src/core/transport/chttp2/timeout_encoding.h",
+ "src/core/transport/chttp2/varint.c",
+ "src/core/transport/chttp2/varint.h",
+ "src/core/transport/chttp2/writing.c",
+ "src/core/transport/chttp2_transport.c",
+ "src/core/transport/chttp2_transport.h",
+ "src/core/transport/metadata.c",
+ "src/core/transport/metadata.h",
+ "src/core/transport/stream_op.c",
+ "src/core/transport/stream_op.h",
+ "src/core/transport/transport.c",
+ "src/core/transport/transport.h",
+ "src/core/transport/transport_impl.h",
+ "src/core/transport/transport_op_string.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc"
+ ],
+ "headers": [
+ "include/grpc++/async_generic_service.h",
+ "include/grpc++/async_unary_call.h",
+ "include/grpc++/auth_context.h",
+ "include/grpc++/byte_buffer.h",
+ "include/grpc++/channel_arguments.h",
+ "include/grpc++/channel_interface.h",
+ "include/grpc++/client_context.h",
+ "include/grpc++/completion_queue.h",
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
+ "include/grpc++/create_channel.h",
+ "include/grpc++/credentials.h",
+ "include/grpc++/generic_stub.h",
+ "include/grpc++/impl/call.h",
+ "include/grpc++/impl/client_unary_call.h",
+ "include/grpc++/impl/grpc_library.h",
+ "include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
+ "include/grpc++/impl/rpc_method.h",
+ "include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
+ "include/grpc++/impl/service_type.h",
+ "include/grpc++/impl/sync.h",
+ "include/grpc++/impl/sync_cxx11.h",
+ "include/grpc++/impl/sync_no_cxx11.h",
+ "include/grpc++/impl/thd.h",
+ "include/grpc++/impl/thd_cxx11.h",
+ "include/grpc++/impl/thd_no_cxx11.h",
+ "include/grpc++/server.h",
+ "include/grpc++/server_builder.h",
+ "include/grpc++/server_context.h",
+ "include/grpc++/server_credentials.h",
+ "include/grpc++/slice.h",
+ "include/grpc++/status.h",
+ "include/grpc++/status_code_enum.h",
+ "include/grpc++/stream.h",
+ "include/grpc++/thread_pool_interface.h",
+ "include/grpc++/time.h",
+ "src/cpp/client/channel.h",
+ "src/cpp/client/secure_credentials.h",
+ "src/cpp/common/create_auth_context.h",
+ "src/cpp/common/secure_auth_context.h",
+ "src/cpp/server/secure_server_credentials.h",
+ "src/cpp/server/thread_pool.h"
+ ],
+ "language": "c++",
+ "name": "grpc++",
+ "src": [
+ "include/grpc++/async_generic_service.h",
+ "include/grpc++/async_unary_call.h",
+ "include/grpc++/auth_context.h",
+ "include/grpc++/byte_buffer.h",
+ "include/grpc++/channel_arguments.h",
+ "include/grpc++/channel_interface.h",
+ "include/grpc++/client_context.h",
+ "include/grpc++/completion_queue.h",
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
+ "include/grpc++/create_channel.h",
+ "include/grpc++/credentials.h",
+ "include/grpc++/generic_stub.h",
+ "include/grpc++/impl/call.h",
+ "include/grpc++/impl/client_unary_call.h",
+ "include/grpc++/impl/grpc_library.h",
+ "include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
+ "include/grpc++/impl/rpc_method.h",
+ "include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
+ "include/grpc++/impl/service_type.h",
+ "include/grpc++/impl/sync.h",
+ "include/grpc++/impl/sync_cxx11.h",
+ "include/grpc++/impl/sync_no_cxx11.h",
+ "include/grpc++/impl/thd.h",
+ "include/grpc++/impl/thd_cxx11.h",
+ "include/grpc++/impl/thd_no_cxx11.h",
+ "include/grpc++/server.h",
+ "include/grpc++/server_builder.h",
+ "include/grpc++/server_context.h",
+ "include/grpc++/server_credentials.h",
+ "include/grpc++/slice.h",
+ "include/grpc++/status.h",
+ "include/grpc++/status_code_enum.h",
+ "include/grpc++/stream.h",
+ "include/grpc++/thread_pool_interface.h",
+ "include/grpc++/time.h",
+ "src/cpp/client/channel.cc",
+ "src/cpp/client/channel.h",
+ "src/cpp/client/channel_arguments.cc",
+ "src/cpp/client/client_context.cc",
+ "src/cpp/client/create_channel.cc",
+ "src/cpp/client/credentials.cc",
+ "src/cpp/client/generic_stub.cc",
+ "src/cpp/client/insecure_credentials.cc",
+ "src/cpp/client/internal_stub.cc",
+ "src/cpp/client/secure_channel_arguments.cc",
+ "src/cpp/client/secure_credentials.cc",
+ "src/cpp/client/secure_credentials.h",
+ "src/cpp/common/call.cc",
+ "src/cpp/common/completion_queue.cc",
+ "src/cpp/common/create_auth_context.h",
+ "src/cpp/common/rpc_method.cc",
+ "src/cpp/common/secure_auth_context.cc",
+ "src/cpp/common/secure_auth_context.h",
+ "src/cpp/common/secure_create_auth_context.cc",
+ "src/cpp/proto/proto_utils.cc",
+ "src/cpp/server/async_generic_service.cc",
+ "src/cpp/server/create_default_thread_pool.cc",
+ "src/cpp/server/insecure_server_credentials.cc",
+ "src/cpp/server/secure_server_credentials.cc",
+ "src/cpp/server/secure_server_credentials.h",
+ "src/cpp/server/server.cc",
+ "src/cpp/server/server_builder.cc",
+ "src/cpp/server/server_context.cc",
+ "src/cpp/server/server_credentials.cc",
+ "src/cpp/server/thread_pool.cc",
+ "src/cpp/server/thread_pool.h",
+ "src/cpp/util/byte_buffer.cc",
+ "src/cpp/util/slice.cc",
+ "src/cpp/util/status.cc",
+ "src/cpp/util/time.cc"
+ ]
+ },
+ {
+ "deps": [],
+ "headers": [
+ "test/cpp/util/test_config.h"
+ ],
+ "language": "c++",
+ "name": "grpc++_test_config",
+ "src": [
+ "test/cpp/util/test_config.cc",
+ "test/cpp/util/test_config.h"
+ ]
+ },
+ {
+ "deps": [
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/cpp/util/cli_call.h",
+ "test/cpp/util/create_test_channel.h",
+ "test/cpp/util/echo.grpc.pb.h",
+ "test/cpp/util/echo.pb.h",
+ "test/cpp/util/echo_duplicate.grpc.pb.h",
+ "test/cpp/util/echo_duplicate.pb.h",
+ "test/cpp/util/fake_credentials.h",
+ "test/cpp/util/messages.grpc.pb.h",
+ "test/cpp/util/messages.pb.h",
+ "test/cpp/util/subprocess.h"
+ ],
+ "language": "c++",
+ "name": "grpc++_test_util",
+ "src": [
+ "test/cpp/util/cli_call.cc",
+ "test/cpp/util/cli_call.h",
+ "test/cpp/util/create_test_channel.cc",
+ "test/cpp/util/create_test_channel.h",
+ "test/cpp/util/fake_credentials.cc",
+ "test/cpp/util/fake_credentials.h",
+ "test/cpp/util/subprocess.cc",
+ "test/cpp/util/subprocess.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "include/grpc++/async_generic_service.h",
+ "include/grpc++/async_unary_call.h",
+ "include/grpc++/auth_context.h",
+ "include/grpc++/byte_buffer.h",
+ "include/grpc++/channel_arguments.h",
+ "include/grpc++/channel_interface.h",
+ "include/grpc++/client_context.h",
+ "include/grpc++/completion_queue.h",
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
+ "include/grpc++/create_channel.h",
+ "include/grpc++/credentials.h",
+ "include/grpc++/generic_stub.h",
+ "include/grpc++/impl/call.h",
+ "include/grpc++/impl/client_unary_call.h",
+ "include/grpc++/impl/grpc_library.h",
+ "include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
+ "include/grpc++/impl/rpc_method.h",
+ "include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
+ "include/grpc++/impl/service_type.h",
+ "include/grpc++/impl/sync.h",
+ "include/grpc++/impl/sync_cxx11.h",
+ "include/grpc++/impl/sync_no_cxx11.h",
+ "include/grpc++/impl/thd.h",
+ "include/grpc++/impl/thd_cxx11.h",
+ "include/grpc++/impl/thd_no_cxx11.h",
+ "include/grpc++/server.h",
+ "include/grpc++/server_builder.h",
+ "include/grpc++/server_context.h",
+ "include/grpc++/server_credentials.h",
+ "include/grpc++/slice.h",
+ "include/grpc++/status.h",
+ "include/grpc++/status_code_enum.h",
+ "include/grpc++/stream.h",
+ "include/grpc++/thread_pool_interface.h",
+ "include/grpc++/time.h",
+ "src/cpp/client/channel.h",
+ "src/cpp/common/create_auth_context.h",
+ "src/cpp/common/insecure_auth_context.h",
+ "src/cpp/server/thread_pool.h"
+ ],
+ "language": "c++",
+ "name": "grpc++_unsecure",
+ "src": [
+ "include/grpc++/async_generic_service.h",
+ "include/grpc++/async_unary_call.h",
+ "include/grpc++/auth_context.h",
+ "include/grpc++/byte_buffer.h",
+ "include/grpc++/channel_arguments.h",
+ "include/grpc++/channel_interface.h",
+ "include/grpc++/client_context.h",
+ "include/grpc++/completion_queue.h",
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
+ "include/grpc++/create_channel.h",
+ "include/grpc++/credentials.h",
+ "include/grpc++/generic_stub.h",
+ "include/grpc++/impl/call.h",
+ "include/grpc++/impl/client_unary_call.h",
+ "include/grpc++/impl/grpc_library.h",
+ "include/grpc++/impl/internal_stub.h",
+ "include/grpc++/impl/proto_utils.h",
+ "include/grpc++/impl/rpc_method.h",
+ "include/grpc++/impl/rpc_service_method.h",
+ "include/grpc++/impl/serialization_traits.h",
+ "include/grpc++/impl/service_type.h",
+ "include/grpc++/impl/sync.h",
+ "include/grpc++/impl/sync_cxx11.h",
+ "include/grpc++/impl/sync_no_cxx11.h",
+ "include/grpc++/impl/thd.h",
+ "include/grpc++/impl/thd_cxx11.h",
+ "include/grpc++/impl/thd_no_cxx11.h",
+ "include/grpc++/server.h",
+ "include/grpc++/server_builder.h",
+ "include/grpc++/server_context.h",
+ "include/grpc++/server_credentials.h",
+ "include/grpc++/slice.h",
+ "include/grpc++/status.h",
+ "include/grpc++/status_code_enum.h",
+ "include/grpc++/stream.h",
+ "include/grpc++/thread_pool_interface.h",
+ "include/grpc++/time.h",
+ "src/cpp/client/channel.cc",
+ "src/cpp/client/channel.h",
+ "src/cpp/client/channel_arguments.cc",
+ "src/cpp/client/client_context.cc",
+ "src/cpp/client/create_channel.cc",
+ "src/cpp/client/credentials.cc",
+ "src/cpp/client/generic_stub.cc",
+ "src/cpp/client/insecure_credentials.cc",
+ "src/cpp/client/internal_stub.cc",
+ "src/cpp/common/call.cc",
+ "src/cpp/common/completion_queue.cc",
+ "src/cpp/common/create_auth_context.h",
+ "src/cpp/common/insecure_auth_context.h",
+ "src/cpp/common/insecure_create_auth_context.cc",
+ "src/cpp/common/rpc_method.cc",
+ "src/cpp/proto/proto_utils.cc",
+ "src/cpp/server/async_generic_service.cc",
+ "src/cpp/server/create_default_thread_pool.cc",
+ "src/cpp/server/insecure_server_credentials.cc",
+ "src/cpp/server/server.cc",
+ "src/cpp/server/server_builder.cc",
+ "src/cpp/server/server_context.cc",
+ "src/cpp/server/server_credentials.cc",
+ "src/cpp/server/thread_pool.cc",
+ "src/cpp/server/thread_pool.h",
+ "src/cpp/util/byte_buffer.cc",
+ "src/cpp/util/slice.cc",
+ "src/cpp/util/status.cc",
+ "src/cpp/util/time.cc"
+ ]
+ },
+ {
+ "deps": [],
+ "headers": [
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
+ "src/compiler/config.h",
+ "src/compiler/cpp_generator.h",
+ "src/compiler/cpp_generator_helpers.h",
+ "src/compiler/csharp_generator.h",
+ "src/compiler/csharp_generator_helpers.h",
+ "src/compiler/generator_helpers.h",
+ "src/compiler/objective_c_generator.h",
+ "src/compiler/objective_c_generator_helpers.h",
+ "src/compiler/python_generator.h",
+ "src/compiler/ruby_generator.h",
+ "src/compiler/ruby_generator_helpers-inl.h",
+ "src/compiler/ruby_generator_map-inl.h",
+ "src/compiler/ruby_generator_string-inl.h"
+ ],
+ "language": "c++",
+ "name": "grpc_plugin_support",
+ "src": [
+ "include/grpc++/config.h",
+ "include/grpc++/config_protobuf.h",
+ "src/compiler/config.h",
+ "src/compiler/cpp_generator.cc",
+ "src/compiler/cpp_generator.h",
+ "src/compiler/cpp_generator_helpers.h",
+ "src/compiler/csharp_generator.cc",
+ "src/compiler/csharp_generator.h",
+ "src/compiler/csharp_generator_helpers.h",
+ "src/compiler/generator_helpers.h",
+ "src/compiler/objective_c_generator.cc",
+ "src/compiler/objective_c_generator.h",
+ "src/compiler/objective_c_generator_helpers.h",
+ "src/compiler/python_generator.cc",
+ "src/compiler/python_generator.h",
+ "src/compiler/ruby_generator.cc",
+ "src/compiler/ruby_generator.h",
+ "src/compiler/ruby_generator_helpers-inl.h",
+ "src/compiler/ruby_generator_map-inl.h",
+ "src/compiler/ruby_generator_string-inl.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/cpp/interop/client_helper.h"
+ ],
+ "language": "c++",
+ "name": "interop_client_helper",
+ "src": [
+ "test/cpp/interop/client_helper.cc",
+ "test/cpp/interop/client_helper.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "interop_client_helper"
+ ],
+ "headers": [
+ "test/cpp/interop/interop_client.h",
+ "test/proto/empty.grpc.pb.h",
+ "test/proto/empty.pb.h",
+ "test/proto/messages.grpc.pb.h",
+ "test/proto/messages.pb.h",
+ "test/proto/test.grpc.pb.h",
+ "test/proto/test.pb.h"
+ ],
+ "language": "c++",
+ "name": "interop_client_main",
+ "src": [
+ "test/cpp/interop/client.cc",
+ "test/cpp/interop/interop_client.cc",
+ "test/cpp/interop/interop_client.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc++",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/cpp/interop/server_helper.h"
+ ],
+ "language": "c++",
+ "name": "interop_server_helper",
+ "src": [
+ "test/cpp/interop/server_helper.cc",
+ "test/cpp/interop/server_helper.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc++",
+ "grpc++_test_config",
+ "grpc++_test_util",
+ "grpc_test_util",
+ "interop_server_helper"
+ ],
+ "headers": [
+ "test/proto/empty.grpc.pb.h",
+ "test/proto/empty.pb.h",
+ "test/proto/messages.grpc.pb.h",
+ "test/proto/messages.pb.h",
+ "test/proto/test.grpc.pb.h",
+ "test/proto/test.pb.h"
+ ],
+ "language": "c++",
+ "name": "interop_server_main",
+ "src": [
+ "test/cpp/interop/server.cc"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc",
+ "grpc++"
+ ],
+ "headers": [
+ "examples/pubsub/empty.grpc.pb.h",
+ "examples/pubsub/empty.pb.h",
+ "examples/pubsub/label.grpc.pb.h",
+ "examples/pubsub/label.pb.h",
+ "examples/pubsub/publisher.h",
+ "examples/pubsub/pubsub.grpc.pb.h",
+ "examples/pubsub/pubsub.pb.h",
+ "examples/pubsub/subscriber.h"
+ ],
+ "language": "c++",
+ "name": "pubsub_client_lib",
+ "src": [
+ "examples/pubsub/publisher.cc",
+ "examples/pubsub/publisher.h",
+ "examples/pubsub/subscriber.cc",
+ "examples/pubsub/subscriber.h"
+ ]
+ },
+ {
+ "deps": [
+ "grpc++",
+ "grpc++_test_util",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/cpp/qps/client.h",
+ "test/cpp/qps/driver.h",
+ "test/cpp/qps/histogram.h",
+ "test/cpp/qps/interarrival.h",
+ "test/cpp/qps/perf_db.grpc.pb.h",
+ "test/cpp/qps/perf_db.pb.h",
+ "test/cpp/qps/perf_db_client.h",
+ "test/cpp/qps/qps_worker.h",
+ "test/cpp/qps/qpstest.grpc.pb.h",
+ "test/cpp/qps/qpstest.pb.h",
+ "test/cpp/qps/report.h",
+ "test/cpp/qps/server.h",
+ "test/cpp/qps/stats.h",
+ "test/cpp/qps/timer.h",
+ "test/cpp/util/benchmark_config.h"
+ ],
+ "language": "c++",
+ "name": "qps",
+ "src": [
+ "test/cpp/qps/client.h",
+ "test/cpp/qps/client_async.cc",
+ "test/cpp/qps/client_sync.cc",
+ "test/cpp/qps/driver.cc",
+ "test/cpp/qps/driver.h",
+ "test/cpp/qps/histogram.h",
+ "test/cpp/qps/interarrival.h",
+ "test/cpp/qps/perf_db_client.cc",
+ "test/cpp/qps/perf_db_client.h",
+ "test/cpp/qps/qps_worker.cc",
+ "test/cpp/qps/qps_worker.h",
+ "test/cpp/qps/report.cc",
+ "test/cpp/qps/report.h",
+ "test/cpp/qps/server.h",
+ "test/cpp/qps/server_async.cc",
+ "test/cpp/qps/server_sync.cc",
+ "test/cpp/qps/stats.h",
+ "test/cpp/qps/timer.cc",
+ "test/cpp/qps/timer.h",
+ "test/cpp/util/benchmark_config.cc",
+ "test/cpp/util/benchmark_config.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "grpc"
+ ],
+ "headers": [],
+ "language": "csharp",
+ "name": "grpc_csharp_ext",
+ "src": [
+ "src/csharp/ext/grpc_csharp_ext.c"
+ ]
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_fake_security",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_fake_security.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_fullstack",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_fullstack.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_fullstack_uds_posix",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_fullstack_with_poll",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_fullstack_with_poll.c"
+ ]
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_simple_ssl_fullstack",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c"
+ ]
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_simple_ssl_fullstack_with_poll",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_simple_ssl_fullstack_with_poll.c"
+ ]
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_socket_pair",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_socket_pair.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_socket_pair_one_byte_at_a_time",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h"
+ ],
+ "language": "c",
+ "name": "end2end_fixture_chttp2_socket_pair_with_grpc_trace",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_bad_hostname",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/bad_hostname.c",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_cancel_after_accept",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_after_accept.c",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_cancel_after_accept_and_writes_closed",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_after_accept_and_writes_closed.c",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_cancel_after_invoke",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_after_invoke.c",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_cancel_before_invoke",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_before_invoke.c",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_cancel_in_a_vacuum",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_in_a_vacuum.c",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_census_simple_request",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/census_simple_request.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_disappearing_server",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/disappearing_server.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_early_server_shutdown_finishes_inflight_calls",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_early_server_shutdown_finishes_tags",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/early_server_shutdown_finishes_tags.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_empty_batch",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/empty_batch.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_graceful_server_shutdown",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/graceful_server_shutdown.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_invoke_large_request",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/invoke_large_request.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_max_concurrent_streams",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/max_concurrent_streams.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_max_message_length",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/max_message_length.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_no_op",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/no_op.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_ping_pong_streaming",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/ping_pong_streaming.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_registered_call",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/registered_call.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_response_with_binary_metadata_and_payload",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_response_with_metadata_and_payload",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_response_with_metadata_and_payload.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_response_with_payload",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_response_with_payload.c"
+ ]
+ },
+ {
+ "deps": [
+ "end2end_certs",
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_response_with_payload_and_call_creds",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_response_with_payload_and_call_creds.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_response_with_trailing_metadata_and_payload",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_with_flags",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_with_flags.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_with_large_metadata",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_with_large_metadata.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_request_with_payload",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/request_with_payload.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_server_finishes_request",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/server_finishes_request.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_simple_delayed_request",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/simple_delayed_request.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_simple_request",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/simple_request.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h"
+ ],
+ "language": "c",
+ "name": "end2end_test_simple_request_with_high_initial_sequence_number",
+ "src": [
+ "test/core/end2end/end2end_tests.h",
+ "test/core/end2end/tests/cancel_test_helpers.h",
+ "test/core/end2end/tests/simple_request_with_high_initial_sequence_number.c"
+ ]
+ },
+ {
+ "deps": [],
+ "headers": [],
+ "language": "c",
+ "name": "end2end_certs",
+ "src": [
+ "test/core/end2end/data/server1_cert.c",
+ "test/core/end2end/data/server1_key.c",
+ "test/core/end2end/data/test_root_cert.c"
+ ]
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc_test_util_unsecure",
+ "grpc_unsecure"
+ ],
+ "headers": [
+ "test/core/bad_client/bad_client.h"
+ ],
+ "language": "c",
+ "name": "bad_client_test",
+ "src": [
+ "test/core/bad_client/bad_client.c",
+ "test/core/bad_client/bad_client.h"
+ ]
+ }
+]
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index 77b334577f..432b908bd6 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -84,6 +84,14 @@
{
"flaky": false,
"language": "c",
+ "name": "fd_conservation_posix_test",
+ "platforms": [
+ "posix"
+ ]
+ },
+ {
+ "flaky": false,
+ "language": "c",
"name": "fd_posix_test",
"platforms": [
"posix"
@@ -306,6 +314,15 @@
{
"flaky": false,
"language": "c",
+ "name": "grpc_security_connector_test",
+ "platforms": [
+ "windows",
+ "posix"
+ ]
+ },
+ {
+ "flaky": false,
+ "language": "c",
"name": "grpc_stream_op_test",
"platforms": [
"windows",
@@ -404,6 +421,15 @@
{
"flaky": false,
"language": "c",
+ "name": "multiple_server_queues_test",
+ "platforms": [
+ "windows",
+ "posix"
+ ]
+ },
+ {
+ "flaky": false,
+ "language": "c",
"name": "murmur_hash_test",
"platforms": [
"windows",
@@ -598,6 +624,24 @@
{
"flaky": false,
"language": "c++",
+ "name": "cxx_byte_buffer_test",
+ "platforms": [
+ "windows",
+ "posix"
+ ]
+ },
+ {
+ "flaky": false,
+ "language": "c++",
+ "name": "cxx_slice_test",
+ "platforms": [
+ "windows",
+ "posix"
+ ]
+ },
+ {
+ "flaky": false,
+ "language": "c++",
"name": "cxx_time_test",
"platforms": [
"windows",
@@ -722,7 +766,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fake_security_cancel_after_accept_test",
"platforms": [
@@ -821,7 +865,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fake_security_invoke_large_request_test",
"platforms": [
@@ -992,7 +1036,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fullstack_cancel_after_accept_test",
"platforms": [
@@ -1091,7 +1135,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fullstack_invoke_large_request_test",
"platforms": [
@@ -1261,7 +1305,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fullstack_uds_posix_cancel_after_accept_test",
"platforms": [
@@ -1349,7 +1393,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fullstack_uds_posix_invoke_large_request_test",
"platforms": [
@@ -1501,7 +1545,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fullstack_with_poll_cancel_after_accept_test",
"platforms": [
@@ -1589,7 +1633,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_fullstack_with_poll_invoke_large_request_test",
"platforms": [
@@ -1742,7 +1786,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_fullstack_cancel_after_accept_test",
"platforms": [
@@ -1841,7 +1885,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_fullstack_invoke_large_request_test",
"platforms": [
@@ -2011,7 +2055,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test",
"platforms": [
@@ -2099,7 +2143,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test",
"platforms": [
@@ -2252,7 +2296,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test",
"platforms": [
@@ -2351,7 +2395,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test",
"platforms": [
@@ -2522,7 +2566,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_socket_pair_cancel_after_accept_test",
"platforms": [
@@ -2621,7 +2665,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_socket_pair_invoke_large_request_test",
"platforms": [
@@ -2792,7 +2836,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test",
"platforms": [
@@ -2891,7 +2935,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test",
"platforms": [
@@ -3062,7 +3106,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test",
"platforms": [
@@ -3161,7 +3205,7 @@
]
},
{
- "flaky": true,
+ "flaky": false,
"language": "c",
"name": "chttp2_socket_pair_with_grpc_trace_invoke_large_request_test",
"platforms": [
diff --git a/vsprojects/Grpc.mak b/vsprojects/Grpc.mak
index f7c4988762..90238b0cf4 100644
--- a/vsprojects/Grpc.mak
+++ b/vsprojects/Grpc.mak
@@ -57,7 +57,7 @@ $(OUT_DIR):
build_libs: build_gpr build_gpr_test_util build_grpc build_grpc_test_util build_grpc_test_util_unsecure build_grpc_unsecure Debug\end2end_fixture_chttp2_fake_security.lib Debug\end2end_fixture_chttp2_fullstack.lib Debug\end2end_fixture_chttp2_simple_ssl_fullstack.lib Debug\end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack.lib Debug\end2end_fixture_chttp2_socket_pair.lib Debug\end2end_fixture_chttp2_socket_pair_one_byte_at_a_time.lib Debug\end2end_fixture_chttp2_socket_pair_with_grpc_trace.lib Debug\end2end_test_bad_hostname.lib Debug\end2end_test_cancel_after_accept.lib Debug\end2end_test_cancel_after_accept_and_writes_closed.lib Debug\end2end_test_cancel_after_invoke.lib Debug\end2end_test_cancel_before_invoke.lib Debug\end2end_test_cancel_in_a_vacuum.lib Debug\end2end_test_census_simple_request.lib Debug\end2end_test_disappearing_server.lib Debug\end2end_test_early_server_shutdown_finishes_inflight_calls.lib Debug\end2end_test_early_server_shutdown_finishes_tags.lib Debug\end2end_test_empty_batch.lib Debug\end2end_test_graceful_server_shutdown.lib Debug\end2end_test_invoke_large_request.lib Debug\end2end_test_max_concurrent_streams.lib Debug\end2end_test_max_message_length.lib Debug\end2end_test_no_op.lib Debug\end2end_test_ping_pong_streaming.lib Debug\end2end_test_registered_call.lib Debug\end2end_test_request_response_with_binary_metadata_and_payload.lib Debug\end2end_test_request_response_with_metadata_and_payload.lib Debug\end2end_test_request_response_with_payload.lib Debug\end2end_test_request_response_with_payload_and_call_creds.lib Debug\end2end_test_request_response_with_trailing_metadata_and_payload.lib Debug\end2end_test_request_with_flags.lib Debug\end2end_test_request_with_large_metadata.lib Debug\end2end_test_request_with_payload.lib Debug\end2end_test_server_finishes_request.lib Debug\end2end_test_simple_delayed_request.lib Debug\end2end_test_simple_request.lib Debug\end2end_test_simple_request_with_high_initial_sequence_number.lib Debug\end2end_certs.lib Debug\bad_client_test.lib
buildtests: buildtests_c buildtests_cxx
-buildtests_c: alarm_heap_test.exe alarm_list_test.exe alarm_test.exe alpn_test.exe bin_encoder_test.exe chttp2_status_conversion_test.exe chttp2_stream_encoder_test.exe chttp2_stream_map_test.exe fling_client.exe fling_server.exe gpr_cancellable_test.exe gpr_cmdline_test.exe gpr_env_test.exe gpr_file_test.exe gpr_histogram_test.exe gpr_host_port_test.exe gpr_log_test.exe gpr_slice_buffer_test.exe gpr_slice_test.exe gpr_string_test.exe gpr_sync_test.exe gpr_thd_test.exe gpr_time_test.exe gpr_tls_test.exe gpr_useful_test.exe grpc_auth_context_test.exe grpc_base64_test.exe grpc_byte_buffer_reader_test.exe grpc_channel_stack_test.exe grpc_completion_queue_test.exe grpc_credentials_test.exe grpc_json_token_test.exe grpc_stream_op_test.exe hpack_parser_test.exe hpack_table_test.exe httpcli_format_request_test.exe httpcli_parser_test.exe json_rewrite.exe json_rewrite_test.exe json_test.exe lame_client_test.exe message_compress_test.exe multi_init_test.exe murmur_hash_test.exe no_server_test.exe resolve_address_test.exe secure_endpoint_test.exe sockaddr_utils_test.exe time_averaged_stats_test.exe time_test.exe timeout_encoding_test.exe timers_test.exe transport_metadata_test.exe transport_security_test.exe chttp2_fake_security_bad_hostname_test.exe chttp2_fake_security_cancel_after_accept_test.exe chttp2_fake_security_cancel_after_accept_and_writes_closed_test.exe chttp2_fake_security_cancel_after_invoke_test.exe chttp2_fake_security_cancel_before_invoke_test.exe chttp2_fake_security_cancel_in_a_vacuum_test.exe chttp2_fake_security_census_simple_request_test.exe chttp2_fake_security_disappearing_server_test.exe chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_fake_security_early_server_shutdown_finishes_tags_test.exe chttp2_fake_security_empty_batch_test.exe chttp2_fake_security_graceful_server_shutdown_test.exe chttp2_fake_security_invoke_large_request_test.exe chttp2_fake_security_max_concurrent_streams_test.exe chttp2_fake_security_max_message_length_test.exe chttp2_fake_security_no_op_test.exe chttp2_fake_security_ping_pong_streaming_test.exe chttp2_fake_security_registered_call_test.exe chttp2_fake_security_request_response_with_binary_metadata_and_payload_test.exe chttp2_fake_security_request_response_with_metadata_and_payload_test.exe chttp2_fake_security_request_response_with_payload_test.exe chttp2_fake_security_request_response_with_payload_and_call_creds_test.exe chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test.exe chttp2_fake_security_request_with_flags_test.exe chttp2_fake_security_request_with_large_metadata_test.exe chttp2_fake_security_request_with_payload_test.exe chttp2_fake_security_server_finishes_request_test.exe chttp2_fake_security_simple_delayed_request_test.exe chttp2_fake_security_simple_request_test.exe chttp2_fake_security_simple_request_with_high_initial_sequence_number_test.exe chttp2_fullstack_bad_hostname_test.exe chttp2_fullstack_cancel_after_accept_test.exe chttp2_fullstack_cancel_after_accept_and_writes_closed_test.exe chttp2_fullstack_cancel_after_invoke_test.exe chttp2_fullstack_cancel_before_invoke_test.exe chttp2_fullstack_cancel_in_a_vacuum_test.exe chttp2_fullstack_census_simple_request_test.exe chttp2_fullstack_disappearing_server_test.exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_fullstack_early_server_shutdown_finishes_tags_test.exe chttp2_fullstack_empty_batch_test.exe chttp2_fullstack_graceful_server_shutdown_test.exe chttp2_fullstack_invoke_large_request_test.exe chttp2_fullstack_max_concurrent_streams_test.exe chttp2_fullstack_max_message_length_test.exe chttp2_fullstack_no_op_test.exe chttp2_fullstack_ping_pong_streaming_test.exe chttp2_fullstack_registered_call_test.exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_test.exe chttp2_fullstack_request_response_with_metadata_and_payload_test.exe chttp2_fullstack_request_response_with_payload_test.exe chttp2_fullstack_request_response_with_payload_and_call_creds_test.exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test.exe chttp2_fullstack_request_with_flags_test.exe chttp2_fullstack_request_with_large_metadata_test.exe chttp2_fullstack_request_with_payload_test.exe chttp2_fullstack_server_finishes_request_test.exe chttp2_fullstack_simple_delayed_request_test.exe chttp2_fullstack_simple_request_test.exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_test.exe chttp2_simple_ssl_fullstack_bad_hostname_test.exe chttp2_simple_ssl_fullstack_cancel_after_accept_test.exe chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test.exe chttp2_simple_ssl_fullstack_cancel_after_invoke_test.exe chttp2_simple_ssl_fullstack_cancel_before_invoke_test.exe chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test.exe chttp2_simple_ssl_fullstack_census_simple_request_test.exe chttp2_simple_ssl_fullstack_disappearing_server_test.exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test.exe chttp2_simple_ssl_fullstack_empty_batch_test.exe chttp2_simple_ssl_fullstack_graceful_server_shutdown_test.exe chttp2_simple_ssl_fullstack_invoke_large_request_test.exe chttp2_simple_ssl_fullstack_max_concurrent_streams_test.exe chttp2_simple_ssl_fullstack_max_message_length_test.exe chttp2_simple_ssl_fullstack_no_op_test.exe chttp2_simple_ssl_fullstack_ping_pong_streaming_test.exe chttp2_simple_ssl_fullstack_registered_call_test.exe chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test.exe chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test.exe chttp2_simple_ssl_fullstack_request_response_with_payload_test.exe chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test.exe chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test.exe chttp2_simple_ssl_fullstack_request_with_flags_test.exe chttp2_simple_ssl_fullstack_request_with_large_metadata_test.exe chttp2_simple_ssl_fullstack_request_with_payload_test.exe chttp2_simple_ssl_fullstack_server_finishes_request_test.exe chttp2_simple_ssl_fullstack_simple_delayed_request_test.exe chttp2_simple_ssl_fullstack_simple_request_test.exe chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test.exe chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test.exe chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test.exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test.exe chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test.exe chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test.exe chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test.exe chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test.exe chttp2_simple_ssl_with_oauth2_fullstack_no_op_test.exe chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test.exe chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_flags_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test.exe chttp2_socket_pair_bad_hostname_test.exe chttp2_socket_pair_cancel_after_accept_test.exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_test.exe chttp2_socket_pair_cancel_after_invoke_test.exe chttp2_socket_pair_cancel_before_invoke_test.exe chttp2_socket_pair_cancel_in_a_vacuum_test.exe chttp2_socket_pair_census_simple_request_test.exe chttp2_socket_pair_disappearing_server_test.exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_socket_pair_early_server_shutdown_finishes_tags_test.exe chttp2_socket_pair_empty_batch_test.exe chttp2_socket_pair_graceful_server_shutdown_test.exe chttp2_socket_pair_invoke_large_request_test.exe chttp2_socket_pair_max_concurrent_streams_test.exe chttp2_socket_pair_max_message_length_test.exe chttp2_socket_pair_no_op_test.exe chttp2_socket_pair_ping_pong_streaming_test.exe chttp2_socket_pair_registered_call_test.exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test.exe chttp2_socket_pair_request_response_with_metadata_and_payload_test.exe chttp2_socket_pair_request_response_with_payload_test.exe chttp2_socket_pair_request_response_with_payload_and_call_creds_test.exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test.exe chttp2_socket_pair_request_with_flags_test.exe chttp2_socket_pair_request_with_large_metadata_test.exe chttp2_socket_pair_request_with_payload_test.exe chttp2_socket_pair_server_finishes_request_test.exe chttp2_socket_pair_simple_delayed_request_test.exe chttp2_socket_pair_simple_request_test.exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test.exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test.exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test.exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test.exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_test.exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test.exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test.exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test.exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_test.exe chttp2_socket_pair_one_byte_at_a_time_no_op_test.exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test.exe chttp2_socket_pair_one_byte_at_a_time_registered_call_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_flags_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test.exe chttp2_socket_pair_with_grpc_trace_bad_hostname_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test.exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test.exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test.exe chttp2_socket_pair_with_grpc_trace_census_simple_request_test.exe chttp2_socket_pair_with_grpc_trace_disappearing_server_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test.exe chttp2_socket_pair_with_grpc_trace_empty_batch_test.exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test.exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_test.exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test.exe chttp2_socket_pair_with_grpc_trace_max_message_length_test.exe chttp2_socket_pair_with_grpc_trace_no_op_test.exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test.exe chttp2_socket_pair_with_grpc_trace_registered_call_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_with_flags_test.exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test.exe chttp2_socket_pair_with_grpc_trace_request_with_payload_test.exe chttp2_socket_pair_with_grpc_trace_server_finishes_request_test.exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test.exe chttp2_fullstack_bad_hostname_unsecure_test.exe chttp2_fullstack_cancel_after_accept_unsecure_test.exe chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_fullstack_cancel_after_invoke_unsecure_test.exe chttp2_fullstack_cancel_before_invoke_unsecure_test.exe chttp2_fullstack_cancel_in_a_vacuum_unsecure_test.exe chttp2_fullstack_census_simple_request_unsecure_test.exe chttp2_fullstack_disappearing_server_unsecure_test.exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_fullstack_empty_batch_unsecure_test.exe chttp2_fullstack_graceful_server_shutdown_unsecure_test.exe chttp2_fullstack_invoke_large_request_unsecure_test.exe chttp2_fullstack_max_concurrent_streams_unsecure_test.exe chttp2_fullstack_max_message_length_unsecure_test.exe chttp2_fullstack_no_op_unsecure_test.exe chttp2_fullstack_ping_pong_streaming_unsecure_test.exe chttp2_fullstack_registered_call_unsecure_test.exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_fullstack_request_response_with_payload_unsecure_test.exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_fullstack_request_with_flags_unsecure_test.exe chttp2_fullstack_request_with_large_metadata_unsecure_test.exe chttp2_fullstack_request_with_payload_unsecure_test.exe chttp2_fullstack_server_finishes_request_unsecure_test.exe chttp2_fullstack_simple_delayed_request_unsecure_test.exe chttp2_fullstack_simple_request_unsecure_test.exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test.exe chttp2_socket_pair_bad_hostname_unsecure_test.exe chttp2_socket_pair_cancel_after_accept_unsecure_test.exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_socket_pair_cancel_after_invoke_unsecure_test.exe chttp2_socket_pair_cancel_before_invoke_unsecure_test.exe chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test.exe chttp2_socket_pair_census_simple_request_unsecure_test.exe chttp2_socket_pair_disappearing_server_unsecure_test.exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_socket_pair_empty_batch_unsecure_test.exe chttp2_socket_pair_graceful_server_shutdown_unsecure_test.exe chttp2_socket_pair_invoke_large_request_unsecure_test.exe chttp2_socket_pair_max_concurrent_streams_unsecure_test.exe chttp2_socket_pair_max_message_length_unsecure_test.exe chttp2_socket_pair_no_op_unsecure_test.exe chttp2_socket_pair_ping_pong_streaming_unsecure_test.exe chttp2_socket_pair_registered_call_unsecure_test.exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_request_response_with_payload_unsecure_test.exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_request_with_flags_unsecure_test.exe chttp2_socket_pair_request_with_large_metadata_unsecure_test.exe chttp2_socket_pair_request_with_payload_unsecure_test.exe chttp2_socket_pair_server_finishes_request_unsecure_test.exe chttp2_socket_pair_simple_delayed_request_unsecure_test.exe chttp2_socket_pair_simple_request_unsecure_test.exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_flags_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_with_flags_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test.exe connection_prefix_bad_client_test.exe initial_settings_frame_bad_client_test.exe
+buildtests_c: alarm_heap_test.exe alarm_list_test.exe alarm_test.exe alpn_test.exe bin_encoder_test.exe chttp2_status_conversion_test.exe chttp2_stream_encoder_test.exe chttp2_stream_map_test.exe fling_client.exe fling_server.exe gpr_cancellable_test.exe gpr_cmdline_test.exe gpr_env_test.exe gpr_file_test.exe gpr_histogram_test.exe gpr_host_port_test.exe gpr_log_test.exe gpr_slice_buffer_test.exe gpr_slice_test.exe gpr_string_test.exe gpr_sync_test.exe gpr_thd_test.exe gpr_time_test.exe gpr_tls_test.exe gpr_useful_test.exe grpc_auth_context_test.exe grpc_base64_test.exe grpc_byte_buffer_reader_test.exe grpc_channel_stack_test.exe grpc_completion_queue_test.exe grpc_credentials_test.exe grpc_json_token_test.exe grpc_security_connector_test.exe grpc_stream_op_test.exe hpack_parser_test.exe hpack_table_test.exe httpcli_format_request_test.exe httpcli_parser_test.exe json_rewrite.exe json_rewrite_test.exe json_test.exe lame_client_test.exe message_compress_test.exe multi_init_test.exe multiple_server_queues_test.exe murmur_hash_test.exe no_server_test.exe resolve_address_test.exe secure_endpoint_test.exe sockaddr_utils_test.exe time_averaged_stats_test.exe time_test.exe timeout_encoding_test.exe timers_test.exe transport_metadata_test.exe transport_security_test.exe chttp2_fake_security_bad_hostname_test.exe chttp2_fake_security_cancel_after_accept_test.exe chttp2_fake_security_cancel_after_accept_and_writes_closed_test.exe chttp2_fake_security_cancel_after_invoke_test.exe chttp2_fake_security_cancel_before_invoke_test.exe chttp2_fake_security_cancel_in_a_vacuum_test.exe chttp2_fake_security_census_simple_request_test.exe chttp2_fake_security_disappearing_server_test.exe chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_fake_security_early_server_shutdown_finishes_tags_test.exe chttp2_fake_security_empty_batch_test.exe chttp2_fake_security_graceful_server_shutdown_test.exe chttp2_fake_security_invoke_large_request_test.exe chttp2_fake_security_max_concurrent_streams_test.exe chttp2_fake_security_max_message_length_test.exe chttp2_fake_security_no_op_test.exe chttp2_fake_security_ping_pong_streaming_test.exe chttp2_fake_security_registered_call_test.exe chttp2_fake_security_request_response_with_binary_metadata_and_payload_test.exe chttp2_fake_security_request_response_with_metadata_and_payload_test.exe chttp2_fake_security_request_response_with_payload_test.exe chttp2_fake_security_request_response_with_payload_and_call_creds_test.exe chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test.exe chttp2_fake_security_request_with_flags_test.exe chttp2_fake_security_request_with_large_metadata_test.exe chttp2_fake_security_request_with_payload_test.exe chttp2_fake_security_server_finishes_request_test.exe chttp2_fake_security_simple_delayed_request_test.exe chttp2_fake_security_simple_request_test.exe chttp2_fake_security_simple_request_with_high_initial_sequence_number_test.exe chttp2_fullstack_bad_hostname_test.exe chttp2_fullstack_cancel_after_accept_test.exe chttp2_fullstack_cancel_after_accept_and_writes_closed_test.exe chttp2_fullstack_cancel_after_invoke_test.exe chttp2_fullstack_cancel_before_invoke_test.exe chttp2_fullstack_cancel_in_a_vacuum_test.exe chttp2_fullstack_census_simple_request_test.exe chttp2_fullstack_disappearing_server_test.exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_fullstack_early_server_shutdown_finishes_tags_test.exe chttp2_fullstack_empty_batch_test.exe chttp2_fullstack_graceful_server_shutdown_test.exe chttp2_fullstack_invoke_large_request_test.exe chttp2_fullstack_max_concurrent_streams_test.exe chttp2_fullstack_max_message_length_test.exe chttp2_fullstack_no_op_test.exe chttp2_fullstack_ping_pong_streaming_test.exe chttp2_fullstack_registered_call_test.exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_test.exe chttp2_fullstack_request_response_with_metadata_and_payload_test.exe chttp2_fullstack_request_response_with_payload_test.exe chttp2_fullstack_request_response_with_payload_and_call_creds_test.exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test.exe chttp2_fullstack_request_with_flags_test.exe chttp2_fullstack_request_with_large_metadata_test.exe chttp2_fullstack_request_with_payload_test.exe chttp2_fullstack_server_finishes_request_test.exe chttp2_fullstack_simple_delayed_request_test.exe chttp2_fullstack_simple_request_test.exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_test.exe chttp2_simple_ssl_fullstack_bad_hostname_test.exe chttp2_simple_ssl_fullstack_cancel_after_accept_test.exe chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test.exe chttp2_simple_ssl_fullstack_cancel_after_invoke_test.exe chttp2_simple_ssl_fullstack_cancel_before_invoke_test.exe chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test.exe chttp2_simple_ssl_fullstack_census_simple_request_test.exe chttp2_simple_ssl_fullstack_disappearing_server_test.exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test.exe chttp2_simple_ssl_fullstack_empty_batch_test.exe chttp2_simple_ssl_fullstack_graceful_server_shutdown_test.exe chttp2_simple_ssl_fullstack_invoke_large_request_test.exe chttp2_simple_ssl_fullstack_max_concurrent_streams_test.exe chttp2_simple_ssl_fullstack_max_message_length_test.exe chttp2_simple_ssl_fullstack_no_op_test.exe chttp2_simple_ssl_fullstack_ping_pong_streaming_test.exe chttp2_simple_ssl_fullstack_registered_call_test.exe chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test.exe chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test.exe chttp2_simple_ssl_fullstack_request_response_with_payload_test.exe chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test.exe chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test.exe chttp2_simple_ssl_fullstack_request_with_flags_test.exe chttp2_simple_ssl_fullstack_request_with_large_metadata_test.exe chttp2_simple_ssl_fullstack_request_with_payload_test.exe chttp2_simple_ssl_fullstack_server_finishes_request_test.exe chttp2_simple_ssl_fullstack_simple_delayed_request_test.exe chttp2_simple_ssl_fullstack_simple_request_test.exe chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test.exe chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test.exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test.exe chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test.exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test.exe chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test.exe chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test.exe chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test.exe chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test.exe chttp2_simple_ssl_with_oauth2_fullstack_no_op_test.exe chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test.exe chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_flags_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test.exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test.exe chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test.exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test.exe chttp2_socket_pair_bad_hostname_test.exe chttp2_socket_pair_cancel_after_accept_test.exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_test.exe chttp2_socket_pair_cancel_after_invoke_test.exe chttp2_socket_pair_cancel_before_invoke_test.exe chttp2_socket_pair_cancel_in_a_vacuum_test.exe chttp2_socket_pair_census_simple_request_test.exe chttp2_socket_pair_disappearing_server_test.exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_socket_pair_early_server_shutdown_finishes_tags_test.exe chttp2_socket_pair_empty_batch_test.exe chttp2_socket_pair_graceful_server_shutdown_test.exe chttp2_socket_pair_invoke_large_request_test.exe chttp2_socket_pair_max_concurrent_streams_test.exe chttp2_socket_pair_max_message_length_test.exe chttp2_socket_pair_no_op_test.exe chttp2_socket_pair_ping_pong_streaming_test.exe chttp2_socket_pair_registered_call_test.exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test.exe chttp2_socket_pair_request_response_with_metadata_and_payload_test.exe chttp2_socket_pair_request_response_with_payload_test.exe chttp2_socket_pair_request_response_with_payload_and_call_creds_test.exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test.exe chttp2_socket_pair_request_with_flags_test.exe chttp2_socket_pair_request_with_large_metadata_test.exe chttp2_socket_pair_request_with_payload_test.exe chttp2_socket_pair_server_finishes_request_test.exe chttp2_socket_pair_simple_delayed_request_test.exe chttp2_socket_pair_simple_request_test.exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test.exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test.exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test.exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test.exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_test.exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test.exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test.exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test.exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_test.exe chttp2_socket_pair_one_byte_at_a_time_no_op_test.exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test.exe chttp2_socket_pair_one_byte_at_a_time_registered_call_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_flags_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test.exe chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test.exe chttp2_socket_pair_with_grpc_trace_bad_hostname_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test.exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test.exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test.exe chttp2_socket_pair_with_grpc_trace_census_simple_request_test.exe chttp2_socket_pair_with_grpc_trace_disappearing_server_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test.exe chttp2_socket_pair_with_grpc_trace_empty_batch_test.exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test.exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_test.exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test.exe chttp2_socket_pair_with_grpc_trace_max_message_length_test.exe chttp2_socket_pair_with_grpc_trace_no_op_test.exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test.exe chttp2_socket_pair_with_grpc_trace_registered_call_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test.exe chttp2_socket_pair_with_grpc_trace_request_with_flags_test.exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test.exe chttp2_socket_pair_with_grpc_trace_request_with_payload_test.exe chttp2_socket_pair_with_grpc_trace_server_finishes_request_test.exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test.exe chttp2_fullstack_bad_hostname_unsecure_test.exe chttp2_fullstack_cancel_after_accept_unsecure_test.exe chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_fullstack_cancel_after_invoke_unsecure_test.exe chttp2_fullstack_cancel_before_invoke_unsecure_test.exe chttp2_fullstack_cancel_in_a_vacuum_unsecure_test.exe chttp2_fullstack_census_simple_request_unsecure_test.exe chttp2_fullstack_disappearing_server_unsecure_test.exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_fullstack_empty_batch_unsecure_test.exe chttp2_fullstack_graceful_server_shutdown_unsecure_test.exe chttp2_fullstack_invoke_large_request_unsecure_test.exe chttp2_fullstack_max_concurrent_streams_unsecure_test.exe chttp2_fullstack_max_message_length_unsecure_test.exe chttp2_fullstack_no_op_unsecure_test.exe chttp2_fullstack_ping_pong_streaming_unsecure_test.exe chttp2_fullstack_registered_call_unsecure_test.exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_fullstack_request_response_with_payload_unsecure_test.exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_fullstack_request_with_flags_unsecure_test.exe chttp2_fullstack_request_with_large_metadata_unsecure_test.exe chttp2_fullstack_request_with_payload_unsecure_test.exe chttp2_fullstack_server_finishes_request_unsecure_test.exe chttp2_fullstack_simple_delayed_request_unsecure_test.exe chttp2_fullstack_simple_request_unsecure_test.exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test.exe chttp2_socket_pair_bad_hostname_unsecure_test.exe chttp2_socket_pair_cancel_after_accept_unsecure_test.exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_socket_pair_cancel_after_invoke_unsecure_test.exe chttp2_socket_pair_cancel_before_invoke_unsecure_test.exe chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test.exe chttp2_socket_pair_census_simple_request_unsecure_test.exe chttp2_socket_pair_disappearing_server_unsecure_test.exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_socket_pair_empty_batch_unsecure_test.exe chttp2_socket_pair_graceful_server_shutdown_unsecure_test.exe chttp2_socket_pair_invoke_large_request_unsecure_test.exe chttp2_socket_pair_max_concurrent_streams_unsecure_test.exe chttp2_socket_pair_max_message_length_unsecure_test.exe chttp2_socket_pair_no_op_unsecure_test.exe chttp2_socket_pair_ping_pong_streaming_unsecure_test.exe chttp2_socket_pair_registered_call_unsecure_test.exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_request_response_with_payload_unsecure_test.exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_request_with_flags_unsecure_test.exe chttp2_socket_pair_request_with_large_metadata_unsecure_test.exe chttp2_socket_pair_request_with_payload_unsecure_test.exe chttp2_socket_pair_server_finishes_request_unsecure_test.exe chttp2_socket_pair_simple_delayed_request_unsecure_test.exe chttp2_socket_pair_simple_request_unsecure_test.exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_flags_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test.exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_with_flags_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test.exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test.exe connection_prefix_bad_client_test.exe initial_settings_frame_bad_client_test.exe
echo All tests built.
buildtests_cxx: interop_client.exe interop_server.exe
@@ -135,8 +135,8 @@ fling_server: fling_server.exe
$(OUT_DIR)\fling_server.exe
gen_hpack_tables.exe: build_libs $(OUT_DIR)
echo Building gen_hpack_tables
- $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\src\core\transport\chttp2\gen_hpack_tables.c
- $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\gen_hpack_tables.exe" Debug\grpc_test_util.lib Debug\gpr.lib Debug\grpc.lib $(LIBS) $(OUT_DIR)\gen_hpack_tables.obj
+ $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\tools\codegen\core\gen_hpack_tables.c
+ $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\gen_hpack_tables.exe" Debug\gpr.lib Debug\grpc.lib $(LIBS) $(OUT_DIR)\gen_hpack_tables.obj
gen_hpack_tables: gen_hpack_tables.exe
echo Running gen_hpack_tables
$(OUT_DIR)\gen_hpack_tables.exe
@@ -315,6 +315,13 @@ grpc_print_google_default_creds_token.exe: build_libs $(OUT_DIR)
grpc_print_google_default_creds_token: grpc_print_google_default_creds_token.exe
echo Running grpc_print_google_default_creds_token
$(OUT_DIR)\grpc_print_google_default_creds_token.exe
+grpc_security_connector_test.exe: build_libs $(OUT_DIR)
+ echo Building grpc_security_connector_test
+ $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\test\core\security\security_connector_test.c
+ $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\grpc_security_connector_test.exe" Debug\grpc_test_util.lib Debug\grpc.lib Debug\gpr_test_util.lib Debug\gpr.lib $(LIBS) $(OUT_DIR)\security_connector_test.obj
+grpc_security_connector_test: grpc_security_connector_test.exe
+ echo Running grpc_security_connector_test
+ $(OUT_DIR)\grpc_security_connector_test.exe
grpc_stream_op_test.exe: build_libs $(OUT_DIR)
echo Building grpc_stream_op_test
$(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\test\core\transport\stream_op_test.c
@@ -399,6 +406,13 @@ multi_init_test.exe: build_libs $(OUT_DIR)
multi_init_test: multi_init_test.exe
echo Running multi_init_test
$(OUT_DIR)\multi_init_test.exe
+multiple_server_queues_test.exe: build_libs $(OUT_DIR)
+ echo Building multiple_server_queues_test
+ $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\test\core\end2end\multiple_server_queues_test.c
+ $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\multiple_server_queues_test.exe" Debug\grpc_test_util.lib Debug\grpc.lib Debug\gpr_test_util.lib Debug\gpr.lib $(LIBS) $(OUT_DIR)\multiple_server_queues_test.obj
+multiple_server_queues_test: multiple_server_queues_test.exe
+ echo Running multiple_server_queues_test
+ $(OUT_DIR)\multiple_server_queues_test.exe
murmur_hash_test.exe: build_libs $(OUT_DIR)
echo Building murmur_hash_test
$(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ $(REPO_ROOT)\test\core\support\murmur_hash_test.c
diff --git a/vsprojects/grpc++/grpc++.vcxproj b/vsprojects/grpc++/grpc++.vcxproj
index 7e24ab3171..c1a32656cf 100644
--- a/vsprojects/grpc++/grpc++.vcxproj
+++ b/vsprojects/grpc++/grpc++.vcxproj
@@ -155,6 +155,7 @@
<ClInclude Include="..\..\include\grpc++\client_context.h" />
<ClInclude Include="..\..\include\grpc++\completion_queue.h" />
<ClInclude Include="..\..\include\grpc++\config.h" />
+ <ClInclude Include="..\..\include\grpc++\config_protobuf.h" />
<ClInclude Include="..\..\include\grpc++\create_channel.h" />
<ClInclude Include="..\..\include\grpc++\credentials.h" />
<ClInclude Include="..\..\include\grpc++\generic_stub.h" />
@@ -162,8 +163,10 @@
<ClInclude Include="..\..\include\grpc++\impl\client_unary_call.h" />
<ClInclude Include="..\..\include\grpc++\impl\grpc_library.h" />
<ClInclude Include="..\..\include\grpc++\impl\internal_stub.h" />
+ <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h" />
<ClInclude Include="..\..\include\grpc++\impl\rpc_method.h" />
<ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h" />
+ <ClInclude Include="..\..\include\grpc++\impl\serialization_traits.h" />
<ClInclude Include="..\..\include\grpc++\impl\service_type.h" />
<ClInclude Include="..\..\include\grpc++\impl\sync.h" />
<ClInclude Include="..\..\include\grpc++\impl\sync_cxx11.h" />
@@ -188,10 +191,11 @@
<ClInclude Include="..\..\src\cpp\server\secure_server_credentials.h" />
<ClInclude Include="..\..\src\cpp\client\channel.h" />
<ClInclude Include="..\..\src\cpp\common\create_auth_context.h" />
- <ClInclude Include="..\..\src\cpp\proto\proto_utils.h" />
<ClInclude Include="..\..\src\cpp\server\thread_pool.h" />
</ItemGroup>
<ItemGroup>
+ <ClCompile Include="..\..\src\cpp\client\secure_channel_arguments.cc">
+ </ClCompile>
<ClCompile Include="..\..\src\cpp\client\secure_credentials.cc">
</ClCompile>
<ClCompile Include="..\..\src\cpp\common\secure_auth_context.cc">
@@ -206,8 +210,6 @@
</ClCompile>
<ClCompile Include="..\..\src\cpp\client\client_context.cc">
</ClCompile>
- <ClCompile Include="..\..\src\cpp\client\client_unary_call.cc">
- </ClCompile>
<ClCompile Include="..\..\src\cpp\client\create_channel.cc">
</ClCompile>
<ClCompile Include="..\..\src\cpp\client\credentials.cc">
diff --git a/vsprojects/grpc++/grpc++.vcxproj.filters b/vsprojects/grpc++/grpc++.vcxproj.filters
index 74a7177fa9..e63c77a53d 100644
--- a/vsprojects/grpc++/grpc++.vcxproj.filters
+++ b/vsprojects/grpc++/grpc++.vcxproj.filters
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
+ <ClCompile Include="..\..\src\cpp\client\secure_channel_arguments.cc">
+ <Filter>src\cpp\client</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\cpp\client\secure_credentials.cc">
<Filter>src\cpp\client</Filter>
</ClCompile>
@@ -22,9 +25,6 @@
<ClCompile Include="..\..\src\cpp\client\client_context.cc">
<Filter>src\cpp\client</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\cpp\client\client_unary_call.cc">
- <Filter>src\cpp\client</Filter>
- </ClCompile>
<ClCompile Include="..\..\src\cpp\client\create_channel.cc">
<Filter>src\cpp\client</Filter>
</ClCompile>
@@ -117,6 +117,9 @@
<ClInclude Include="..\..\include\grpc++\config.h">
<Filter>include\grpc++</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc++\config_protobuf.h">
+ <Filter>include\grpc++</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc++\create_channel.h">
<Filter>include\grpc++</Filter>
</ClInclude>
@@ -138,12 +141,18 @@
<ClInclude Include="..\..\include\grpc++\impl\internal_stub.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h">
+ <Filter>include\grpc++\impl</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc++\impl\rpc_method.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc++\impl\serialization_traits.h">
+ <Filter>include\grpc++\impl</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc++\impl\service_type.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
@@ -212,9 +221,6 @@
<ClInclude Include="..\..\src\cpp\common\create_auth_context.h">
<Filter>src\cpp\common</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\cpp\proto\proto_utils.h">
- <Filter>src\cpp\proto</Filter>
- </ClInclude>
<ClInclude Include="..\..\src\cpp\server\thread_pool.h">
<Filter>src\cpp\server</Filter>
</ClInclude>
diff --git a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
index 52431b67a2..984fb6884e 100644
--- a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
+++ b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
@@ -155,6 +155,7 @@
<ClInclude Include="..\..\include\grpc++\client_context.h" />
<ClInclude Include="..\..\include\grpc++\completion_queue.h" />
<ClInclude Include="..\..\include\grpc++\config.h" />
+ <ClInclude Include="..\..\include\grpc++\config_protobuf.h" />
<ClInclude Include="..\..\include\grpc++\create_channel.h" />
<ClInclude Include="..\..\include\grpc++\credentials.h" />
<ClInclude Include="..\..\include\grpc++\generic_stub.h" />
@@ -162,8 +163,10 @@
<ClInclude Include="..\..\include\grpc++\impl\client_unary_call.h" />
<ClInclude Include="..\..\include\grpc++\impl\grpc_library.h" />
<ClInclude Include="..\..\include\grpc++\impl\internal_stub.h" />
+ <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h" />
<ClInclude Include="..\..\include\grpc++\impl\rpc_method.h" />
<ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h" />
+ <ClInclude Include="..\..\include\grpc++\impl\serialization_traits.h" />
<ClInclude Include="..\..\include\grpc++\impl\service_type.h" />
<ClInclude Include="..\..\include\grpc++\impl\sync.h" />
<ClInclude Include="..\..\include\grpc++\impl\sync_cxx11.h" />
@@ -186,7 +189,6 @@
<ClInclude Include="..\..\src\cpp\common\insecure_auth_context.h" />
<ClInclude Include="..\..\src\cpp\client\channel.h" />
<ClInclude Include="..\..\src\cpp\common\create_auth_context.h" />
- <ClInclude Include="..\..\src\cpp\proto\proto_utils.h" />
<ClInclude Include="..\..\src\cpp\server\thread_pool.h" />
</ItemGroup>
<ItemGroup>
@@ -198,8 +200,6 @@
</ClCompile>
<ClCompile Include="..\..\src\cpp\client\client_context.cc">
</ClCompile>
- <ClCompile Include="..\..\src\cpp\client\client_unary_call.cc">
- </ClCompile>
<ClCompile Include="..\..\src\cpp\client\create_channel.cc">
</ClCompile>
<ClCompile Include="..\..\src\cpp\client\credentials.cc">
diff --git a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
index 37fc3d0eec..ae348d3fb5 100644
--- a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
+++ b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
@@ -13,9 +13,6 @@
<ClCompile Include="..\..\src\cpp\client\client_context.cc">
<Filter>src\cpp\client</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\cpp\client\client_unary_call.cc">
- <Filter>src\cpp\client</Filter>
- </ClCompile>
<ClCompile Include="..\..\src\cpp\client\create_channel.cc">
<Filter>src\cpp\client</Filter>
</ClCompile>
@@ -108,6 +105,9 @@
<ClInclude Include="..\..\include\grpc++\config.h">
<Filter>include\grpc++</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc++\config_protobuf.h">
+ <Filter>include\grpc++</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc++\create_channel.h">
<Filter>include\grpc++</Filter>
</ClInclude>
@@ -129,12 +129,18 @@
<ClInclude Include="..\..\include\grpc++\impl\internal_stub.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h">
+ <Filter>include\grpc++\impl</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc++\impl\rpc_method.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc++\impl\serialization_traits.h">
+ <Filter>include\grpc++\impl</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc++\impl\service_type.h">
<Filter>include\grpc++\impl</Filter>
</ClInclude>
@@ -197,9 +203,6 @@
<ClInclude Include="..\..\src\cpp\common\create_auth_context.h">
<Filter>src\cpp\common</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\cpp\proto\proto_utils.h">
- <Filter>src\cpp\proto</Filter>
- </ClInclude>
<ClInclude Include="..\..\src\cpp\server\thread_pool.h">
<Filter>src\cpp\server</Filter>
</ClInclude>
diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj
index 053a34536b..af3d9a13e3 100644
--- a/vsprojects/grpc/grpc.vcxproj
+++ b/vsprojects/grpc/grpc.vcxproj
@@ -173,12 +173,14 @@
<ClInclude Include="..\..\src\core\tsi\transport_security.h" />
<ClInclude Include="..\..\src\core\tsi\transport_security_interface.h" />
<ClInclude Include="..\..\src\core\census\grpc_context.h" />
+ <ClInclude Include="..\..\src\core\channel\census_filter.h" />
<ClInclude Include="..\..\src\core\channel\channel_args.h" />
<ClInclude Include="..\..\src\core\channel\channel_stack.h" />
<ClInclude Include="..\..\src\core\channel\child_channel.h" />
<ClInclude Include="..\..\src\core\channel\client_channel.h" />
<ClInclude Include="..\..\src\core\channel\client_setup.h" />
<ClInclude Include="..\..\src\core\channel\connected_channel.h" />
+ <ClInclude Include="..\..\src\core\channel\context.h" />
<ClInclude Include="..\..\src\core\channel\http_client_filter.h" />
<ClInclude Include="..\..\src\core\channel\http_server_filter.h" />
<ClInclude Include="..\..\src\core\channel\noop_filter.h" />
@@ -195,10 +197,11 @@
<ClInclude Include="..\..\src\core\iomgr\iomgr_internal.h" />
<ClInclude Include="..\..\src\core\iomgr\iomgr_posix.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset.h" />
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset_kick_posix.h" />
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick_windows.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset_posix.h" />
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set.h" />
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_posix.h" />
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_windows.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset_windows.h" />
<ClInclude Include="..\..\src\core\iomgr\resolve_address.h" />
<ClInclude Include="..\..\src\core\iomgr\sockaddr.h" />
@@ -242,6 +245,8 @@
<ClInclude Include="..\..\src\core\transport\chttp2\hpack_table.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\http2_errors.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\huffsyms.h" />
+ <ClInclude Include="..\..\src\core\transport\chttp2\incoming_metadata.h" />
+ <ClInclude Include="..\..\src\core\transport\chttp2\internal.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\status_conversion.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\stream_encoder.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\stream_map.h" />
@@ -347,7 +352,7 @@
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\iomgr_windows.c">
</ClCompile>
- <ClCompile Include="..\..\src\core\iomgr\pollset_kick.c">
+ <ClCompile Include="..\..\src\core\iomgr\pollset_kick_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_multipoller_with_epoll.c">
</ClCompile>
@@ -355,6 +360,10 @@
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_posix.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_posix.c">
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_windows.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_windows.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\resolve_address_posix.c">
@@ -463,16 +472,24 @@
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\huffsyms.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\incoming_metadata.c">
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\parsing.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\status_conversion.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_encoder.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\stream_lists.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_map.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\timeout_encoding.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\varint.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\writing.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2_transport.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\metadata.c">
diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters
index 2ff19a9938..f16a27ff05 100644
--- a/vsprojects/grpc/grpc.vcxproj.filters
+++ b/vsprojects/grpc/grpc.vcxproj.filters
@@ -139,7 +139,7 @@
<ClCompile Include="..\..\src\core\iomgr\iomgr_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\core\iomgr\pollset_kick.c">
+ <ClCompile Include="..\..\src\core\iomgr\pollset_kick_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_multipoller_with_epoll.c">
@@ -151,6 +151,12 @@
<ClCompile Include="..\..\src\core\iomgr\pollset_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_posix.c">
+ <Filter>src\core\iomgr</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_windows.c">
+ <Filter>src\core\iomgr</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
@@ -313,12 +319,21 @@
<ClCompile Include="..\..\src\core\transport\chttp2\huffsyms.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\incoming_metadata.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\parsing.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\status_conversion.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_encoder.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\stream_lists.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_map.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
@@ -328,6 +343,9 @@
<ClCompile Include="..\..\src\core\transport\chttp2\varint.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\writing.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2_transport.c">
<Filter>src\core\transport</Filter>
</ClCompile>
@@ -425,6 +443,9 @@
<ClInclude Include="..\..\src\core\census\grpc_context.h">
<Filter>src\core\census</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\channel\census_filter.h">
+ <Filter>src\core\channel</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\core\channel\channel_args.h">
<Filter>src\core\channel</Filter>
</ClInclude>
@@ -443,6 +464,9 @@
<ClInclude Include="..\..\src\core\channel\connected_channel.h">
<Filter>src\core\channel</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\channel\context.h">
+ <Filter>src\core\channel</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\core\channel\http_client_filter.h">
<Filter>src\core\channel</Filter>
</ClInclude>
@@ -491,16 +515,19 @@
<ClInclude Include="..\..\src\core\iomgr\pollset.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_kick_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick_posix.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick_windows.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_posix.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_posix.h">
+ <Filter>src\core\iomgr</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_windows.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\iomgr\pollset_windows.h">
@@ -632,6 +659,12 @@
<ClInclude Include="..\..\src\core\transport\chttp2\huffsyms.h">
<Filter>src\core\transport\chttp2</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\transport\chttp2\incoming_metadata.h">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\core\transport\chttp2\internal.h">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\core\transport\chttp2\status_conversion.h">
<Filter>src\core\transport\chttp2</Filter>
</ClInclude>
diff --git a/vsprojects/grpc_plugin_support/grpc_plugin_support.vcxproj b/vsprojects/grpc_plugin_support/grpc_plugin_support.vcxproj
index c0188e56e7..4f0e4a6e1d 100644
--- a/vsprojects/grpc_plugin_support/grpc_plugin_support.vcxproj
+++ b/vsprojects/grpc_plugin_support/grpc_plugin_support.vcxproj
@@ -146,6 +146,8 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClInclude Include="..\..\include\grpc++\config.h" />
+ <ClInclude Include="..\..\include\grpc++\config_protobuf.h" />
<ClInclude Include="..\..\src\compiler\config.h" />
<ClInclude Include="..\..\src\compiler\cpp_generator.h" />
<ClInclude Include="..\..\src\compiler\cpp_generator_helpers.h" />
diff --git a/vsprojects/grpc_test_util/grpc_test_util.vcxproj b/vsprojects/grpc_test_util/grpc_test_util.vcxproj
index e5288f4d44..f250d0a632 100644
--- a/vsprojects/grpc_test_util/grpc_test_util.vcxproj
+++ b/vsprojects/grpc_test_util/grpc_test_util.vcxproj
@@ -146,6 +146,15 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClInclude Include="..\..\test\core\end2end\data\ssl_test_data.h" />
+ <ClInclude Include="..\..\test\core\end2end\cq_verifier.h" />
+ <ClInclude Include="..\..\test\core\iomgr\endpoint_tests.h" />
+ <ClInclude Include="..\..\test\core\util\grpc_profiler.h" />
+ <ClInclude Include="..\..\test\core\util\parse_hexstring.h" />
+ <ClInclude Include="..\..\test\core\util\port.h" />
+ <ClInclude Include="..\..\test\core\util\slice_splitter.h" />
+ </ItemGroup>
+ <ItemGroup>
<ClCompile Include="..\..\test\core\end2end\data\server1_cert.c">
</ClCompile>
<ClCompile Include="..\..\test\core\end2end\data\server1_key.c">
diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj
index 0f12c257d8..79447b36ed 100644
--- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj
+++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj
@@ -155,12 +155,14 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\core\census\grpc_context.h" />
+ <ClInclude Include="..\..\src\core\channel\census_filter.h" />
<ClInclude Include="..\..\src\core\channel\channel_args.h" />
<ClInclude Include="..\..\src\core\channel\channel_stack.h" />
<ClInclude Include="..\..\src\core\channel\child_channel.h" />
<ClInclude Include="..\..\src\core\channel\client_channel.h" />
<ClInclude Include="..\..\src\core\channel\client_setup.h" />
<ClInclude Include="..\..\src\core\channel\connected_channel.h" />
+ <ClInclude Include="..\..\src\core\channel\context.h" />
<ClInclude Include="..\..\src\core\channel\http_client_filter.h" />
<ClInclude Include="..\..\src\core\channel\http_server_filter.h" />
<ClInclude Include="..\..\src\core\channel\noop_filter.h" />
@@ -177,10 +179,11 @@
<ClInclude Include="..\..\src\core\iomgr\iomgr_internal.h" />
<ClInclude Include="..\..\src\core\iomgr\iomgr_posix.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset.h" />
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset_kick_posix.h" />
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick_windows.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset_posix.h" />
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set.h" />
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_posix.h" />
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_windows.h" />
<ClInclude Include="..\..\src\core\iomgr\pollset_windows.h" />
<ClInclude Include="..\..\src\core\iomgr\resolve_address.h" />
<ClInclude Include="..\..\src\core\iomgr\sockaddr.h" />
@@ -224,6 +227,8 @@
<ClInclude Include="..\..\src\core\transport\chttp2\hpack_table.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\http2_errors.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\huffsyms.h" />
+ <ClInclude Include="..\..\src\core\transport\chttp2\incoming_metadata.h" />
+ <ClInclude Include="..\..\src\core\transport\chttp2\internal.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\status_conversion.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\stream_encoder.h" />
<ClInclude Include="..\..\src\core\transport\chttp2\stream_map.h" />
@@ -285,7 +290,7 @@
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\iomgr_windows.c">
</ClCompile>
- <ClCompile Include="..\..\src\core\iomgr\pollset_kick.c">
+ <ClCompile Include="..\..\src\core\iomgr\pollset_kick_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_multipoller_with_epoll.c">
</ClCompile>
@@ -293,6 +298,10 @@
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_posix.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_posix.c">
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_windows.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_windows.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\resolve_address_posix.c">
@@ -401,16 +410,24 @@
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\huffsyms.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\incoming_metadata.c">
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\parsing.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\status_conversion.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_encoder.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\stream_lists.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_map.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\timeout_encoding.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\varint.c">
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\writing.c">
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2_transport.c">
</ClCompile>
<ClCompile Include="..\..\src\core\transport\metadata.c">
diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters
index 47810a9a01..d9aaa2ef35 100644
--- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters
+++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters
@@ -73,7 +73,7 @@
<ClCompile Include="..\..\src\core\iomgr\iomgr_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\core\iomgr\pollset_kick.c">
+ <ClCompile Include="..\..\src\core\iomgr\pollset_kick_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_multipoller_with_epoll.c">
@@ -85,6 +85,12 @@
<ClCompile Include="..\..\src\core\iomgr\pollset_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_posix.c">
+ <Filter>src\core\iomgr</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\iomgr\pollset_set_windows.c">
+ <Filter>src\core\iomgr</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
@@ -247,12 +253,21 @@
<ClCompile Include="..\..\src\core\transport\chttp2\huffsyms.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\incoming_metadata.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\parsing.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\status_conversion.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_encoder.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\stream_lists.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2\stream_map.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
@@ -262,6 +277,9 @@
<ClCompile Include="..\..\src\core\transport\chttp2\varint.c">
<Filter>src\core\transport\chttp2</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\transport\chttp2\writing.c">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\core\transport\chttp2_transport.c">
<Filter>src\core\transport</Filter>
</ClCompile>
@@ -308,6 +326,9 @@
<ClInclude Include="..\..\src\core\census\grpc_context.h">
<Filter>src\core\census</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\channel\census_filter.h">
+ <Filter>src\core\channel</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\core\channel\channel_args.h">
<Filter>src\core\channel</Filter>
</ClInclude>
@@ -326,6 +347,9 @@
<ClInclude Include="..\..\src\core\channel\connected_channel.h">
<Filter>src\core\channel</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\channel\context.h">
+ <Filter>src\core\channel</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\core\channel\http_client_filter.h">
<Filter>src\core\channel</Filter>
</ClInclude>
@@ -374,16 +398,19 @@
<ClInclude Include="..\..\src\core\iomgr\pollset.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_kick_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick_posix.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_posix.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_kick_windows.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
- <ClInclude Include="..\..\src\core\iomgr\pollset_posix.h">
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_posix.h">
+ <Filter>src\core\iomgr</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\core\iomgr\pollset_set_windows.h">
<Filter>src\core\iomgr</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\iomgr\pollset_windows.h">
@@ -515,6 +542,12 @@
<ClInclude Include="..\..\src\core\transport\chttp2\huffsyms.h">
<Filter>src\core\transport\chttp2</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\transport\chttp2\incoming_metadata.h">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\core\transport\chttp2\internal.h">
+ <Filter>src\core\transport\chttp2</Filter>
+ </ClInclude>
<ClInclude Include="..\..\src\core\transport\chttp2\status_conversion.h">
<Filter>src\core\transport\chttp2</Filter>
</ClInclude>