From e9a253477d06041b6cd137dd0b40c4e2bc658563 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 9 Jan 2015 13:34:53 -0800 Subject: [PATCH 01/24] Fix win32 build error. --- include/grpc/support/port_platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 27a7b5529f7..978b3377243 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -126,7 +126,7 @@ #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64 #endif -#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) != 1 +#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) != 1 #error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX #endif From 93d970a9eff403579e7f5205692f92902ba9f91c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 9 Jan 2015 13:35:04 -0800 Subject: [PATCH 02/24] Fix win32 build error. --- src/core/iomgr/pollset.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/iomgr/pollset.h b/src/core/iomgr/pollset.h index 7374a4ec131..36d80d5c297 100644 --- a/src/core/iomgr/pollset.h +++ b/src/core/iomgr/pollset.h @@ -35,6 +35,7 @@ #define __GRPC_INTERNAL_IOMGR_POLLSET_H_ #include +#include /* A grpc_pollset is a set of file descriptors that a higher level item is interested in. For example: From 5d191a4bf48ae7c02ed6047aa02898901741c326 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 13:38:32 -0800 Subject: [PATCH 03/24] Add build outputs to .gitignore. --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index e69de29bb2d..5202b53ad25 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +bins +deps +libs +objs +*.pyc + From 3b08306c1319c55f2f5724104cb96982d895de9a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 13:51:28 -0800 Subject: [PATCH 04/24] Cleanup and fixes to jobset.py --- tools/run_tests/jobset.py | 47 +++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index d3a46b63e14..7e1ec366f96 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -39,6 +39,36 @@ _RUNNING = object() _KILLED = object() +_COLORS = { + 'red': 31, + 'green': 32, + 'yellow': 33, + } + + +_BEGINNING_OF_LINE = '\x1b[0G' +_CLEAR_LINE = '\x1b[2K' + + +_TAG_COLOR = { + 'FAILED': 'red', + 'PASSED': 'green', + 'START': 'yellow', + 'WAITING': 'yellow', + } + + +def message(tag, message, explanatory_text=None): + sys.stdout.write('%s%s\x1b[%dm%s\x1b[0m: %s%s' % ( + _BEGINNING_OF_LINE, + _CLEAR_LINE, + _COLORS[_TAG_COLOR[tag]], + tag, + message, + '\n%s\n' % explanatory_text if explanatory_text is not None else '')) + sys.stdout.flush() + + class Job(object): """Manages one job.""" @@ -49,9 +79,7 @@ class Job(object): stderr=subprocess.STDOUT, stdout=self._tempfile) self._state = _RUNNING - sys.stdout.write('\x1b[0G\x1b[2K\x1b[33mSTART\x1b[0m: %s' % - self._cmdline) - sys.stdout.flush() + message('START', self._cmdline) def state(self): """Poll current state of the job. Prints messages at completion.""" @@ -60,16 +88,10 @@ class Job(object): self._state = _FAILURE self._tempfile.seek(0) stdout = self._tempfile.read() - sys.stdout.write('\x1b[0G\x1b[2K\x1b[31mFAILED\x1b[0m: %s' - ' [ret=%d]\n' - '%s\n' % ( - self._cmdline, self._process.returncode, stdout)) - sys.stdout.flush() + message('FAILED', '%s [ret=%d]' % (self._cmdline, self._process.returncode), stdout) else: self._state = _SUCCESS - sys.stdout.write('\x1b[0G\x1b[2K\x1b[32mPASSED\x1b[0m: %s' % - self._cmdline) - sys.stdout.flush() + message('PASSED', '%s' % self._cmdline) return self._state def kill(self): @@ -107,7 +129,8 @@ class Jobset(object): dead.add(job) for job in dead: self._running.remove(job) - if not dead: return + if dead: return + message('WAITING', '%d jobs left' % len(self._running)) time.sleep(0.1) def cancelled(self): From b29797b142a016ec9821b65479309329e151f6b4 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 13:51:54 -0800 Subject: [PATCH 05/24] Remove ?san from the default tests. At least until they stabilize some. --- tools/run_tests/run_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 9234682bea7..c9aedc1679e 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -13,13 +13,14 @@ import watch_dirs # flags required for make for each configuration _CONFIGS = ['dbg', 'opt', 'tsan', 'msan', 'asan'] +_DEFAULT = ['dbg', 'opt'] # parse command line argp = argparse.ArgumentParser(description='Run grpc tests.') argp.add_argument('-c', '--config', choices=['all'] + _CONFIGS, nargs='+', - default=['all']) + default=_DEFAULT) argp.add_argument('-t', '--test-filter', nargs='*', default=['*']) argp.add_argument('-n', '--runs_per_test', default=1, type=int) argp.add_argument('-f', '--forever', From 738c334432bfe79104d4d301989fe30823364279 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 14:28:33 -0800 Subject: [PATCH 06/24] Allow running tests under valgrind --- tools/run_tests/jobset.py | 7 ++-- tools/run_tests/run_tests.py | 62 ++++++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index 7e1ec366f96..b7bcb7b02c1 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -8,7 +8,7 @@ import tempfile import time -_MAX_JOBS = 16 * multiprocessing.cpu_count() +_MAX_JOBS = 3 def shuffle_iteratable(it): @@ -108,6 +108,7 @@ class Jobset(object): self._check_cancelled = check_cancelled self._cancelled = False self._failures = 0 + self._completed = 0 def start(self, cmdline): """Start a job. Return True on success, False on failure.""" @@ -128,9 +129,11 @@ class Jobset(object): if st == _FAILURE: self._failures += 1 dead.add(job) for job in dead: + self._completed += 1 self._running.remove(job) if dead: return - message('WAITING', '%d jobs left' % len(self._running)) + message('WAITING', '%d jobs running, %d complete' % ( + len(self._running), self._completed)) time.sleep(0.1) def cancelled(self): diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index c9aedc1679e..2bd2e6d830c 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -11,14 +11,42 @@ import time import jobset import watch_dirs -# flags required for make for each configuration -_CONFIGS = ['dbg', 'opt', 'tsan', 'msan', 'asan'] + +# SimpleConfig: just compile with CONFIG=config, and run the binary to test +class SimpleConfig(object): + def __init__(self, config): + self.build_config = config + + def run_command(self, binary): + return [binary] + + +# ValgrindConfig: compile with some CONFIG=config, but use valgrind to run +class ValgrindConfig(object): + def __init__(self, config): + self.build_config = config + + def run_command(self, binary): + return ['valgrind', binary] + + +# different configurations we can run under +_CONFIGS = { + 'dbg': SimpleConfig('dbg'), + 'opt': SimpleConfig('opt'), + 'tsan': SimpleConfig('tsan'), + 'msan': SimpleConfig('msan'), + 'asan': SimpleConfig('asan'), + 'valgrind': ValgrindConfig('dbg'), + } + + _DEFAULT = ['dbg', 'opt'] # parse command line argp = argparse.ArgumentParser(description='Run grpc tests.') argp.add_argument('-c', '--config', - choices=['all'] + _CONFIGS, + choices=['all'] + sorted(_CONFIGS.keys()), nargs='+', default=_DEFAULT) argp.add_argument('-t', '--test-filter', nargs='*', default=['*']) @@ -30,10 +58,11 @@ argp.add_argument('-f', '--forever', args = argp.parse_args() # grab config -configs = [cfg - for cfg in itertools.chain.from_iterable( - _CONFIGS if x == 'all' else [x] - for x in args.config)] +run_configs = set(_CONFIGS[cfg] + for cfg in itertools.chain.from_iterable( + _CONFIGS.iterkeys() if x == 'all' else [x] + for x in args.config)) +build_configs = set(cfg.build_config for cfg in run_configs) filters = args.test_filter runs_per_test = args.runs_per_test forever = args.forever @@ -44,20 +73,21 @@ def _build_and_run(check_cancelled): # build latest, sharing cpu between the various makes if not jobset.run( (['make', - '-j', '%d' % max(multiprocessing.cpu_count() / len(configs), 1), + '-j', '%d' % (multiprocessing.cpu_count() + 1), 'buildtests_c', 'CONFIG=%s' % cfg] - for cfg in configs), check_cancelled): + for cfg in build_configs), check_cancelled): sys.exit(1) # run all the tests - jobset.run(([x] - for x in itertools.chain.from_iterable( - itertools.chain.from_iterable(itertools.repeat( - glob.glob('bins/%s/%s_test' % (config, filt)), - runs_per_test)) - for config in configs - for filt in filters)), check_cancelled) + jobset.run(( + config.run_command(x) + for config in run_configs + for filt in filters + for x in itertools.chain.from_iterable(itertools.repeat( + glob.glob('bins/%s/%s_test' % ( + config.build_config, filt)), + runs_per_test))), check_cancelled) if forever: From 234ffbfd3969b31598ad8c062992472f18c37034 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 15:09:34 -0800 Subject: [PATCH 07/24] Check return value for error --- src/core/support/log_linux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/support/log_linux.c b/src/core/support/log_linux.c index f3b528bdc4d..36fb4b5051f 100644 --- a/src/core/support/log_linux.c +++ b/src/core/support/log_linux.c @@ -54,7 +54,10 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, char *message = NULL; va_list args; va_start(args, format); - vasprintf(&message, format, args); + if (vasprintf(&message, format, args) == -1) { + va_end(args); + return; + } va_end(args); gpr_log_message(file, line, severity, message); free(message); From d4773f51193570d4898cc05eb385f7008da5b1e3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:38:47 -0800 Subject: [PATCH 08/24] Fix some C++ test dependencies --- Makefile | 324 +++++++++++++++++++++++++++++++++++++++++++++++++++-- build.json | 7 +- 2 files changed, 322 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2183beb0bf7..98739802890 100644 --- a/Makefile +++ b/Makefile @@ -495,7 +495,7 @@ buildtests: buildtests_c buildtests_cxx buildtests_c: bins_dep_c privatelibs_c bins/$(CONFIG)/grpc_byte_buffer_reader_test bins/$(CONFIG)/gpr_cancellable_test bins/$(CONFIG)/gpr_log_test bins/$(CONFIG)/gpr_useful_test bins/$(CONFIG)/gpr_cmdline_test bins/$(CONFIG)/gpr_histogram_test bins/$(CONFIG)/gpr_host_port_test bins/$(CONFIG)/gpr_slice_buffer_test bins/$(CONFIG)/gpr_slice_test bins/$(CONFIG)/gpr_string_test bins/$(CONFIG)/gpr_sync_test bins/$(CONFIG)/gpr_thd_test bins/$(CONFIG)/gpr_time_test bins/$(CONFIG)/murmur_hash_test bins/$(CONFIG)/grpc_stream_op_test bins/$(CONFIG)/alpn_test bins/$(CONFIG)/time_averaged_stats_test bins/$(CONFIG)/chttp2_stream_encoder_test bins/$(CONFIG)/hpack_table_test bins/$(CONFIG)/chttp2_stream_map_test bins/$(CONFIG)/hpack_parser_test bins/$(CONFIG)/transport_metadata_test bins/$(CONFIG)/chttp2_status_conversion_test bins/$(CONFIG)/chttp2_transport_end2end_test bins/$(CONFIG)/tcp_posix_test bins/$(CONFIG)/dualstack_socket_test bins/$(CONFIG)/no_server_test bins/$(CONFIG)/resolve_address_test bins/$(CONFIG)/sockaddr_utils_test bins/$(CONFIG)/tcp_server_posix_test bins/$(CONFIG)/tcp_client_posix_test bins/$(CONFIG)/grpc_channel_stack_test bins/$(CONFIG)/metadata_buffer_test bins/$(CONFIG)/grpc_completion_queue_test bins/$(CONFIG)/census_window_stats_test bins/$(CONFIG)/census_statistics_quick_test bins/$(CONFIG)/census_statistics_small_log_test bins/$(CONFIG)/census_statistics_performance_test bins/$(CONFIG)/census_statistics_multiple_writers_test bins/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test bins/$(CONFIG)/census_stub_test bins/$(CONFIG)/census_hash_table_test bins/$(CONFIG)/fling_server bins/$(CONFIG)/fling_client bins/$(CONFIG)/fling_test bins/$(CONFIG)/echo_server bins/$(CONFIG)/echo_client bins/$(CONFIG)/echo_test bins/$(CONFIG)/message_compress_test bins/$(CONFIG)/bin_encoder_test bins/$(CONFIG)/secure_endpoint_test bins/$(CONFIG)/httpcli_format_request_test bins/$(CONFIG)/httpcli_parser_test bins/$(CONFIG)/httpcli_test bins/$(CONFIG)/grpc_credentials_test bins/$(CONFIG)/grpc_base64_test bins/$(CONFIG)/grpc_json_token_test bins/$(CONFIG)/timeout_encoding_test bins/$(CONFIG)/fd_posix_test bins/$(CONFIG)/fling_stream_test bins/$(CONFIG)/lame_client_test bins/$(CONFIG)/alarm_test bins/$(CONFIG)/alarm_list_test bins/$(CONFIG)/alarm_heap_test bins/$(CONFIG)/time_test bins/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test bins/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test bins/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test bins/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test bins/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test bins/$(CONFIG)/chttp2_fake_security_census_simple_request_test bins/$(CONFIG)/chttp2_fake_security_disappearing_server_test bins/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test bins/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test bins/$(CONFIG)/chttp2_fake_security_invoke_large_request_test bins/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test bins/$(CONFIG)/chttp2_fake_security_no_op_test bins/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test bins/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test bins/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test bins/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test bins/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test bins/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test bins/$(CONFIG)/chttp2_fake_security_simple_request_test bins/$(CONFIG)/chttp2_fake_security_thread_stress_test bins/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_test bins/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test bins/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test bins/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test bins/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test bins/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test bins/$(CONFIG)/chttp2_fullstack_census_simple_request_test bins/$(CONFIG)/chttp2_fullstack_disappearing_server_test bins/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test bins/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test bins/$(CONFIG)/chttp2_fullstack_invoke_large_request_test bins/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test bins/$(CONFIG)/chttp2_fullstack_no_op_test bins/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test bins/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test bins/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test bins/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test bins/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test bins/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test bins/$(CONFIG)/chttp2_fullstack_simple_request_test bins/$(CONFIG)/chttp2_fullstack_thread_stress_test bins/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_test bins/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_test bins/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test bins/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test bins/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test bins/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test bins/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test bins/$(CONFIG)/chttp2_socket_pair_census_simple_request_test bins/$(CONFIG)/chttp2_socket_pair_disappearing_server_test bins/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test bins/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test bins/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test bins/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test bins/$(CONFIG)/chttp2_socket_pair_no_op_test bins/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test bins/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test bins/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test bins/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test bins/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test bins/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test bins/$(CONFIG)/chttp2_socket_pair_simple_request_test bins/$(CONFIG)/chttp2_socket_pair_thread_stress_test bins/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_test bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_test -buildtests_cxx: bins_dep_cxx privatelibs_cxx bins/thread_pool_test bins/status_test bins/sync_client_async_server_test bins/qps_client bins/qps_server bins/interop_server bins/interop_client bins/end2end_test bins/channel_arguments_test bins/credentials_test +buildtests_cxx: bins_dep_cxx privatelibs_cxx bins/$(CONFIG)/thread_pool_test bins/$(CONFIG)/status_test bins/$(CONFIG)/sync_client_async_server_test bins/$(CONFIG)/qps_client bins/$(CONFIG)/qps_server bins/$(CONFIG)/interop_server bins/$(CONFIG)/interop_client bins/$(CONFIG)/end2end_test bins/$(CONFIG)/channel_arguments_test bins/$(CONFIG)/credentials_test test: test_c test_cxx @@ -1339,6 +1339,7 @@ libs/$(CONFIG)/libgrpc.a: $(OPENSSL_DEP) $(LIBGRPC_OBJS) $(E) "[AR] Creating $@" $(Q) mkdir -p `dirname $@` $(Q) $(AR) rcs libs/$(CONFIG)/libgrpc.a $(LIBGRPC_OBJS) + $(Q) rm -rf tmp-merge $(Q) mkdir tmp-merge $(Q) ( cd tmp-merge ; $(AR) x ../libs/$(CONFIG)/libgrpc.a ) $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd tmp-merge ; ar x ../$${l} ) ; done @@ -2655,6 +2656,8 @@ bins/$(CONFIG)/gen_hpack_tables: $(GEN_HPACK_TABLES_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/src/core/transport/chttp2/gen_hpack_tables.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a libs/$(CONFIG)/libgrpc.a + deps_gen_hpack_tables: $(GEN_HPACK_TABLES_DEPS) ifneq ($(NO_SECURE),true) @@ -2682,6 +2685,9 @@ bins/$(CONFIG)/cpp_plugin: $(CPP_PLUGIN_OBJS) $(Q) mkdir -p `dirname $@` $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(CPP_PLUGIN_OBJS) $(HOST_LDLIBSXX) $(HOST_LDLIBS) $(HOST_LDLIBS_PROTOC) -o bins/$(CONFIG)/cpp_plugin +objs/$(CONFIG)/src/compiler/cpp_plugin.o: +objs/$(CONFIG)/src/compiler/cpp_generator.o: + deps_cpp_plugin: $(CPP_PLUGIN_DEPS) ifneq ($(NO_DEPS),true) @@ -2707,6 +2713,9 @@ bins/$(CONFIG)/ruby_plugin: $(RUBY_PLUGIN_OBJS) $(Q) mkdir -p `dirname $@` $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(RUBY_PLUGIN_OBJS) $(HOST_LDLIBSXX) $(HOST_LDLIBS) $(HOST_LDLIBS_PROTOC) -o bins/$(CONFIG)/ruby_plugin +objs/$(CONFIG)/src/compiler/ruby_plugin.o: +objs/$(CONFIG)/src/compiler/ruby_generator.o: + deps_ruby_plugin: $(RUBY_PLUGIN_DEPS) ifneq ($(NO_DEPS),true) @@ -2732,6 +2741,9 @@ bins/$(CONFIG)/go_plugin: $(GO_PLUGIN_OBJS) $(Q) mkdir -p `dirname $@` $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(GO_PLUGIN_OBJS) $(HOST_LDLIBSXX) $(HOST_LDLIBS) $(HOST_LDLIBS_PROTOC) -o bins/$(CONFIG)/go_plugin +objs/$(CONFIG)/src/compiler/go_plugin.o: +objs/$(CONFIG)/src/compiler/go_generator.o: + deps_go_plugin: $(GO_PLUGIN_DEPS) ifneq ($(NO_DEPS),true) @@ -2764,6 +2776,8 @@ bins/$(CONFIG)/grpc_byte_buffer_reader_test: $(GRPC_BYTE_BUFFER_READER_TEST_OBJS endif +objs/$(CONFIG)/test/core/surface/byte_buffer_reader_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_byte_buffer_reader_test: $(GRPC_BYTE_BUFFER_READER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -2798,6 +2812,8 @@ bins/$(CONFIG)/gpr_cancellable_test: $(GPR_CANCELLABLE_TEST_OBJS) libs/$(CONFIG) endif +objs/$(CONFIG)/test/core/support/cancellable_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_cancellable_test: $(GPR_CANCELLABLE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -2832,6 +2848,8 @@ bins/$(CONFIG)/gpr_log_test: $(GPR_LOG_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_ut endif +objs/$(CONFIG)/test/core/support/log_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_log_test: $(GPR_LOG_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -2866,6 +2884,8 @@ bins/$(CONFIG)/gpr_useful_test: $(GPR_USEFUL_TEST_OBJS) libs/$(CONFIG)/libgrpc_t endif +objs/$(CONFIG)/test/core/support/useful_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_useful_test: $(GPR_USEFUL_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -2900,6 +2920,8 @@ bins/$(CONFIG)/gpr_cmdline_test: $(GPR_CMDLINE_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/support/cmdline_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_cmdline_test: $(GPR_CMDLINE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -2934,6 +2956,8 @@ bins/$(CONFIG)/gpr_histogram_test: $(GPR_HISTOGRAM_TEST_OBJS) libs/$(CONFIG)/lib endif +objs/$(CONFIG)/test/core/support/histogram_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_histogram_test: $(GPR_HISTOGRAM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -2968,6 +2992,8 @@ bins/$(CONFIG)/gpr_host_port_test: $(GPR_HOST_PORT_TEST_OBJS) libs/$(CONFIG)/lib endif +objs/$(CONFIG)/test/core/support/host_port_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_host_port_test: $(GPR_HOST_PORT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3002,6 +3028,8 @@ bins/$(CONFIG)/gpr_slice_buffer_test: $(GPR_SLICE_BUFFER_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/support/slice_buffer_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_slice_buffer_test: $(GPR_SLICE_BUFFER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3036,6 +3064,8 @@ bins/$(CONFIG)/gpr_slice_test: $(GPR_SLICE_TEST_OBJS) libs/$(CONFIG)/libgrpc_tes endif +objs/$(CONFIG)/test/core/support/slice_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_slice_test: $(GPR_SLICE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3070,6 +3100,8 @@ bins/$(CONFIG)/gpr_string_test: $(GPR_STRING_TEST_OBJS) libs/$(CONFIG)/libgrpc_t endif +objs/$(CONFIG)/test/core/support/string_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_string_test: $(GPR_STRING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3104,6 +3136,8 @@ bins/$(CONFIG)/gpr_sync_test: $(GPR_SYNC_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_ endif +objs/$(CONFIG)/test/core/support/sync_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_sync_test: $(GPR_SYNC_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3138,6 +3172,8 @@ bins/$(CONFIG)/gpr_thd_test: $(GPR_THD_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_ut endif +objs/$(CONFIG)/test/core/support/thd_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_thd_test: $(GPR_THD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3172,6 +3208,8 @@ bins/$(CONFIG)/gpr_time_test: $(GPR_TIME_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_ endif +objs/$(CONFIG)/test/core/support/time_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgpr.a + deps_gpr_time_test: $(GPR_TIME_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3206,6 +3244,8 @@ bins/$(CONFIG)/murmur_hash_test: $(MURMUR_HASH_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/support/murmur_hash_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_murmur_hash_test: $(MURMUR_HASH_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3240,6 +3280,8 @@ bins/$(CONFIG)/grpc_stream_op_test: $(GRPC_STREAM_OP_TEST_OBJS) libs/$(CONFIG)/l endif +objs/$(CONFIG)/test/core/transport/stream_op_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_stream_op_test: $(GRPC_STREAM_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3274,6 +3316,8 @@ bins/$(CONFIG)/alpn_test: $(ALPN_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util.a l endif +objs/$(CONFIG)/test/core/transport/chttp2/alpn_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_alpn_test: $(ALPN_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3308,6 +3352,8 @@ bins/$(CONFIG)/time_averaged_stats_test: $(TIME_AVERAGED_STATS_TEST_OBJS) libs/$ endif +objs/$(CONFIG)/test/core/iomgr/time_averaged_stats_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_time_averaged_stats_test: $(TIME_AVERAGED_STATS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3342,6 +3388,8 @@ bins/$(CONFIG)/chttp2_stream_encoder_test: $(CHTTP2_STREAM_ENCODER_TEST_OBJS) li endif +objs/$(CONFIG)/test/core/transport/chttp2/stream_encoder_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_chttp2_stream_encoder_test: $(CHTTP2_STREAM_ENCODER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3376,6 +3424,8 @@ bins/$(CONFIG)/hpack_table_test: $(HPACK_TABLE_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/transport/chttp2/hpack_table_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_hpack_table_test: $(HPACK_TABLE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3410,6 +3460,8 @@ bins/$(CONFIG)/chttp2_stream_map_test: $(CHTTP2_STREAM_MAP_TEST_OBJS) libs/$(CON endif +objs/$(CONFIG)/test/core/transport/chttp2/stream_map_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_chttp2_stream_map_test: $(CHTTP2_STREAM_MAP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3444,6 +3496,8 @@ bins/$(CONFIG)/hpack_parser_test: $(HPACK_PARSER_TEST_OBJS) libs/$(CONFIG)/libgr endif +objs/$(CONFIG)/test/core/transport/chttp2/hpack_parser_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_hpack_parser_test: $(HPACK_PARSER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3478,6 +3532,8 @@ bins/$(CONFIG)/transport_metadata_test: $(TRANSPORT_METADATA_TEST_OBJS) libs/$(C endif +objs/$(CONFIG)/test/core/transport/metadata_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_transport_metadata_test: $(TRANSPORT_METADATA_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3512,6 +3568,8 @@ bins/$(CONFIG)/chttp2_status_conversion_test: $(CHTTP2_STATUS_CONVERSION_TEST_OB endif +objs/$(CONFIG)/test/core/transport/chttp2/status_conversion_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_chttp2_status_conversion_test: $(CHTTP2_STATUS_CONVERSION_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3546,6 +3604,8 @@ bins/$(CONFIG)/chttp2_transport_end2end_test: $(CHTTP2_TRANSPORT_END2END_TEST_OB endif +objs/$(CONFIG)/test/core/transport/chttp2_transport_end2end_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_chttp2_transport_end2end_test: $(CHTTP2_TRANSPORT_END2END_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3580,6 +3640,8 @@ bins/$(CONFIG)/tcp_posix_test: $(TCP_POSIX_TEST_OBJS) libs/$(CONFIG)/libgrpc_tes endif +objs/$(CONFIG)/test/core/iomgr/tcp_posix_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_tcp_posix_test: $(TCP_POSIX_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3614,6 +3676,8 @@ bins/$(CONFIG)/dualstack_socket_test: $(DUALSTACK_SOCKET_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/end2end/dualstack_socket_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_dualstack_socket_test: $(DUALSTACK_SOCKET_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3648,6 +3712,8 @@ bins/$(CONFIG)/no_server_test: $(NO_SERVER_TEST_OBJS) libs/$(CONFIG)/libgrpc_tes endif +objs/$(CONFIG)/test/core/end2end/no_server_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_no_server_test: $(NO_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3682,6 +3748,8 @@ bins/$(CONFIG)/resolve_address_test: $(RESOLVE_ADDRESS_TEST_OBJS) libs/$(CONFIG) endif +objs/$(CONFIG)/test/core/iomgr/resolve_address_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_resolve_address_test: $(RESOLVE_ADDRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3716,6 +3784,8 @@ bins/$(CONFIG)/sockaddr_utils_test: $(SOCKADDR_UTILS_TEST_OBJS) libs/$(CONFIG)/l endif +objs/$(CONFIG)/test/core/iomgr/sockaddr_utils_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_sockaddr_utils_test: $(SOCKADDR_UTILS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3750,6 +3820,8 @@ bins/$(CONFIG)/tcp_server_posix_test: $(TCP_SERVER_POSIX_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/iomgr/tcp_server_posix_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_tcp_server_posix_test: $(TCP_SERVER_POSIX_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3784,6 +3856,8 @@ bins/$(CONFIG)/tcp_client_posix_test: $(TCP_CLIENT_POSIX_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/iomgr/tcp_client_posix_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_tcp_client_posix_test: $(TCP_CLIENT_POSIX_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3818,6 +3892,8 @@ bins/$(CONFIG)/grpc_channel_stack_test: $(GRPC_CHANNEL_STACK_TEST_OBJS) libs/$(C endif +objs/$(CONFIG)/test/core/channel/channel_stack_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_channel_stack_test: $(GRPC_CHANNEL_STACK_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3852,6 +3928,8 @@ bins/$(CONFIG)/metadata_buffer_test: $(METADATA_BUFFER_TEST_OBJS) libs/$(CONFIG) endif +objs/$(CONFIG)/test/core/channel/metadata_buffer_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_metadata_buffer_test: $(METADATA_BUFFER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3886,6 +3964,8 @@ bins/$(CONFIG)/grpc_completion_queue_test: $(GRPC_COMPLETION_QUEUE_TEST_OBJS) li endif +objs/$(CONFIG)/test/core/surface/completion_queue_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_completion_queue_test: $(GRPC_COMPLETION_QUEUE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3920,6 +4000,8 @@ bins/$(CONFIG)/grpc_completion_queue_benchmark: $(GRPC_COMPLETION_QUEUE_BENCHMAR endif +objs/$(CONFIG)/test/core/surface/completion_queue_benchmark.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_completion_queue_benchmark: $(GRPC_COMPLETION_QUEUE_BENCHMARK_DEPS) ifneq ($(NO_SECURE),true) @@ -3954,6 +4036,8 @@ bins/$(CONFIG)/census_trace_store_test: $(CENSUS_TRACE_STORE_TEST_OBJS) libs/$(C endif +objs/$(CONFIG)/test/core/statistics/trace_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_trace_store_test: $(CENSUS_TRACE_STORE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -3988,6 +4072,8 @@ bins/$(CONFIG)/census_stats_store_test: $(CENSUS_STATS_STORE_TEST_OBJS) libs/$(C endif +objs/$(CONFIG)/test/core/statistics/rpc_stats_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_stats_store_test: $(CENSUS_STATS_STORE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4022,6 +4108,8 @@ bins/$(CONFIG)/census_window_stats_test: $(CENSUS_WINDOW_STATS_TEST_OBJS) libs/$ endif +objs/$(CONFIG)/test/core/statistics/window_stats_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_window_stats_test: $(CENSUS_WINDOW_STATS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4056,6 +4144,8 @@ bins/$(CONFIG)/census_statistics_quick_test: $(CENSUS_STATISTICS_QUICK_TEST_OBJS endif +objs/$(CONFIG)/test/core/statistics/quick_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_statistics_quick_test: $(CENSUS_STATISTICS_QUICK_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4090,6 +4180,8 @@ bins/$(CONFIG)/census_statistics_small_log_test: $(CENSUS_STATISTICS_SMALL_LOG_T endif +objs/$(CONFIG)/test/core/statistics/small_log_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_statistics_small_log_test: $(CENSUS_STATISTICS_SMALL_LOG_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4124,6 +4216,8 @@ bins/$(CONFIG)/census_statistics_performance_test: $(CENSUS_STATISTICS_PERFORMAN endif +objs/$(CONFIG)/test/core/statistics/performance_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_statistics_performance_test: $(CENSUS_STATISTICS_PERFORMANCE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4158,6 +4252,8 @@ bins/$(CONFIG)/census_statistics_multiple_writers_test: $(CENSUS_STATISTICS_MULT endif +objs/$(CONFIG)/test/core/statistics/multiple_writers_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_statistics_multiple_writers_test: $(CENSUS_STATISTICS_MULTIPLE_WRITERS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4192,6 +4288,8 @@ bins/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test: $(CENSUS endif +objs/$(CONFIG)/test/core/statistics/multiple_writers_circular_buffer_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_statistics_multiple_writers_circular_buffer_test: $(CENSUS_STATISTICS_MULTIPLE_WRITERS_CIRCULAR_BUFFER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4226,6 +4324,8 @@ bins/$(CONFIG)/census_stub_test: $(CENSUS_STUB_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/statistics/census_stub_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_stub_test: $(CENSUS_STUB_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4260,6 +4360,8 @@ bins/$(CONFIG)/census_hash_table_test: $(CENSUS_HASH_TABLE_TEST_OBJS) libs/$(CON endif +objs/$(CONFIG)/test/core/statistics/hash_table_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_census_hash_table_test: $(CENSUS_HASH_TABLE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4294,6 +4396,8 @@ bins/$(CONFIG)/fling_server: $(FLING_SERVER_OBJS) libs/$(CONFIG)/libgrpc_test_ut endif +objs/$(CONFIG)/test/core/fling/server.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_fling_server: $(FLING_SERVER_DEPS) ifneq ($(NO_SECURE),true) @@ -4328,6 +4432,8 @@ bins/$(CONFIG)/fling_client: $(FLING_CLIENT_OBJS) libs/$(CONFIG)/libgrpc_test_ut endif +objs/$(CONFIG)/test/core/fling/client.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_fling_client: $(FLING_CLIENT_DEPS) ifneq ($(NO_SECURE),true) @@ -4362,6 +4468,8 @@ bins/$(CONFIG)/fling_test: $(FLING_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util.a endif +objs/$(CONFIG)/test/core/fling/fling_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_fling_test: $(FLING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4396,6 +4504,8 @@ bins/$(CONFIG)/echo_server: $(ECHO_SERVER_OBJS) libs/$(CONFIG)/libgrpc_test_util endif +objs/$(CONFIG)/test/core/echo/server.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_echo_server: $(ECHO_SERVER_DEPS) ifneq ($(NO_SECURE),true) @@ -4430,6 +4540,8 @@ bins/$(CONFIG)/echo_client: $(ECHO_CLIENT_OBJS) libs/$(CONFIG)/libgrpc_test_util endif +objs/$(CONFIG)/test/core/echo/client.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_echo_client: $(ECHO_CLIENT_DEPS) ifneq ($(NO_SECURE),true) @@ -4464,6 +4576,8 @@ bins/$(CONFIG)/echo_test: $(ECHO_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util.a l endif +objs/$(CONFIG)/test/core/echo/echo_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_echo_test: $(ECHO_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4498,6 +4612,8 @@ bins/$(CONFIG)/low_level_ping_pong_benchmark: $(LOW_LEVEL_PING_PONG_BENCHMARK_OB endif +objs/$(CONFIG)/test/core/network_benchmarks/low_level_ping_pong.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_low_level_ping_pong_benchmark: $(LOW_LEVEL_PING_PONG_BENCHMARK_DEPS) ifneq ($(NO_SECURE),true) @@ -4532,6 +4648,8 @@ bins/$(CONFIG)/message_compress_test: $(MESSAGE_COMPRESS_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/compression/message_compress_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_message_compress_test: $(MESSAGE_COMPRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4566,6 +4684,8 @@ bins/$(CONFIG)/bin_encoder_test: $(BIN_ENCODER_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/transport/chttp2/bin_encoder_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_bin_encoder_test: $(BIN_ENCODER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4600,6 +4720,8 @@ bins/$(CONFIG)/secure_endpoint_test: $(SECURE_ENDPOINT_TEST_OBJS) libs/$(CONFIG) endif +objs/$(CONFIG)/test/core/security/secure_endpoint_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_secure_endpoint_test: $(SECURE_ENDPOINT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4634,6 +4756,8 @@ bins/$(CONFIG)/httpcli_format_request_test: $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS) endif +objs/$(CONFIG)/test/core/httpcli/format_request_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_httpcli_format_request_test: $(HTTPCLI_FORMAT_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4668,6 +4792,8 @@ bins/$(CONFIG)/httpcli_parser_test: $(HTTPCLI_PARSER_TEST_OBJS) libs/$(CONFIG)/l endif +objs/$(CONFIG)/test/core/httpcli/parser_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_httpcli_parser_test: $(HTTPCLI_PARSER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4702,6 +4828,8 @@ bins/$(CONFIG)/httpcli_test: $(HTTPCLI_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_ut endif +objs/$(CONFIG)/test/core/httpcli/httpcli_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_httpcli_test: $(HTTPCLI_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4736,6 +4864,8 @@ bins/$(CONFIG)/grpc_credentials_test: $(GRPC_CREDENTIALS_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/security/credentials_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_credentials_test: $(GRPC_CREDENTIALS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4770,6 +4900,8 @@ bins/$(CONFIG)/grpc_fetch_oauth2: $(GRPC_FETCH_OAUTH2_OBJS) libs/$(CONFIG)/libgr endif +objs/$(CONFIG)/test/core/security/fetch_oauth2.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_fetch_oauth2: $(GRPC_FETCH_OAUTH2_DEPS) ifneq ($(NO_SECURE),true) @@ -4804,6 +4936,8 @@ bins/$(CONFIG)/grpc_base64_test: $(GRPC_BASE64_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/security/base64_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_base64_test: $(GRPC_BASE64_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4838,6 +4972,8 @@ bins/$(CONFIG)/grpc_json_token_test: $(GRPC_JSON_TOKEN_TEST_OBJS) libs/$(CONFIG) endif +objs/$(CONFIG)/test/core/security/json_token_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_grpc_json_token_test: $(GRPC_JSON_TOKEN_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4872,6 +5008,8 @@ bins/$(CONFIG)/timeout_encoding_test: $(TIMEOUT_ENCODING_TEST_OBJS) libs/$(CONFI endif +objs/$(CONFIG)/test/core/transport/chttp2/timeout_encoding_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_timeout_encoding_test: $(TIMEOUT_ENCODING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4906,6 +5044,8 @@ bins/$(CONFIG)/fd_posix_test: $(FD_POSIX_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_ endif +objs/$(CONFIG)/test/core/iomgr/fd_posix_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_fd_posix_test: $(FD_POSIX_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4940,6 +5080,8 @@ bins/$(CONFIG)/fling_stream_test: $(FLING_STREAM_TEST_OBJS) libs/$(CONFIG)/libgr endif +objs/$(CONFIG)/test/core/fling/fling_stream_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_fling_stream_test: $(FLING_STREAM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -4974,6 +5116,8 @@ bins/$(CONFIG)/lame_client_test: $(LAME_CLIENT_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/core/surface/lame_client_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_lame_client_test: $(LAME_CLIENT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5008,6 +5152,8 @@ bins/$(CONFIG)/thread_pool_test: $(THREAD_POOL_TEST_OBJS) libs/$(CONFIG)/libgrpc endif +objs/$(CONFIG)/test/cpp/server/thread_pool_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_thread_pool_test: $(THREAD_POOL_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5042,6 +5188,8 @@ bins/$(CONFIG)/status_test: $(STATUS_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util endif +objs/$(CONFIG)/test/cpp/util/status_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_status_test: $(STATUS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5069,13 +5217,15 @@ bins/$(CONFIG)/sync_client_async_server_test: openssl_dep_error else -bins/$(CONFIG)/sync_client_async_server_test: $(SYNC_CLIENT_ASYNC_SERVER_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +bins/$(CONFIG)/sync_client_async_server_test: $(SYNC_CLIENT_ASYNC_SERVER_TEST_OBJS) libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(SYNC_CLIENT_ASYNC_SERVER_TEST_OBJS) $(GTEST_LIB) libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS) $(LDLIBS_SECURE) -o bins/$(CONFIG)/sync_client_async_server_test + $(Q) $(LDXX) $(LDFLAGS) $(SYNC_CLIENT_ASYNC_SERVER_TEST_OBJS) $(GTEST_LIB) libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS) $(LDLIBS_SECURE) -o bins/$(CONFIG)/sync_client_async_server_test endif +objs/$(CONFIG)/test/cpp/end2end/sync_client_async_server_test.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_sync_client_async_server_test: $(SYNC_CLIENT_ASYNC_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5113,6 +5263,11 @@ bins/$(CONFIG)/qps_client: $(QPS_CLIENT_OBJS) libs/$(CONFIG)/libgrpc++_test_util endif +objs/$(CONFIG)/test/cpp/interop/empty.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/messages.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/test.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/qps/client.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_qps_client: $(QPS_CLIENT_DEPS) ifneq ($(NO_SECURE),true) @@ -5150,6 +5305,11 @@ bins/$(CONFIG)/qps_server: $(QPS_SERVER_OBJS) libs/$(CONFIG)/libgrpc++_test_util endif +objs/$(CONFIG)/test/cpp/interop/empty.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/messages.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/test.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/qps/server.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_qps_server: $(QPS_SERVER_DEPS) ifneq ($(NO_SECURE),true) @@ -5187,6 +5347,11 @@ bins/$(CONFIG)/interop_server: $(INTEROP_SERVER_OBJS) libs/$(CONFIG)/libgrpc++_t endif +objs/$(CONFIG)/test/cpp/interop/empty.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/messages.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/test.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/server.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_interop_server: $(INTEROP_SERVER_DEPS) ifneq ($(NO_SECURE),true) @@ -5224,6 +5389,11 @@ bins/$(CONFIG)/interop_client: $(INTEROP_CLIENT_OBJS) libs/$(CONFIG)/libgrpc++_t endif +objs/$(CONFIG)/test/cpp/interop/empty.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/messages.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/test.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a +objs/$(CONFIG)/test/cpp/interop/client.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_interop_client: $(INTEROP_CLIENT_DEPS) ifneq ($(NO_SECURE),true) @@ -5258,6 +5428,8 @@ bins/$(CONFIG)/end2end_test: $(END2END_TEST_OBJS) libs/$(CONFIG)/libgrpc++_test_ endif +objs/$(CONFIG)/test/cpp/end2end/end2end_test.o: libs/$(CONFIG)/libgrpc++_test_util.a libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_end2end_test: $(END2END_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5285,13 +5457,15 @@ bins/$(CONFIG)/channel_arguments_test: openssl_dep_error else -bins/$(CONFIG)/channel_arguments_test: $(CHANNEL_ARGUMENTS_TEST_OBJS) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a +bins/$(CONFIG)/channel_arguments_test: $(CHANNEL_ARGUMENTS_TEST_OBJS) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(CHANNEL_ARGUMENTS_TEST_OBJS) $(GTEST_LIB) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS) $(LDLIBS_SECURE) -o bins/$(CONFIG)/channel_arguments_test + $(Q) $(LDXX) $(LDFLAGS) $(CHANNEL_ARGUMENTS_TEST_OBJS) $(GTEST_LIB) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS) $(LDLIBS_SECURE) -o bins/$(CONFIG)/channel_arguments_test endif +objs/$(CONFIG)/test/cpp/client/channel_arguments_test.o: libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_channel_arguments_test: $(CHANNEL_ARGUMENTS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5319,13 +5493,15 @@ bins/$(CONFIG)/credentials_test: openssl_dep_error else -bins/$(CONFIG)/credentials_test: $(CREDENTIALS_TEST_OBJS) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a +bins/$(CONFIG)/credentials_test: $(CREDENTIALS_TEST_OBJS) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(E) "[LD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(LDXX) $(LDFLAGS) $(CREDENTIALS_TEST_OBJS) $(GTEST_LIB) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a $(LDLIBSXX) $(LDLIBS) $(LDLIBS_SECURE) -o bins/$(CONFIG)/credentials_test + $(Q) $(LDXX) $(LDFLAGS) $(CREDENTIALS_TEST_OBJS) $(GTEST_LIB) libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS) $(LDLIBS_SECURE) -o bins/$(CONFIG)/credentials_test endif +objs/$(CONFIG)/test/cpp/client/credentials_test.o: libs/$(CONFIG)/libgrpc++.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_credentials_test: $(CREDENTIALS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5360,6 +5536,8 @@ bins/$(CONFIG)/alarm_test: $(ALARM_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util.a endif +objs/$(CONFIG)/test/core/iomgr/alarm_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_alarm_test: $(ALARM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5394,6 +5572,8 @@ bins/$(CONFIG)/alarm_list_test: $(ALARM_LIST_TEST_OBJS) libs/$(CONFIG)/libgrpc_t endif +objs/$(CONFIG)/test/core/iomgr/alarm_list_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_alarm_list_test: $(ALARM_LIST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5428,6 +5608,8 @@ bins/$(CONFIG)/alarm_heap_test: $(ALARM_HEAP_TEST_OBJS) libs/$(CONFIG)/libgrpc_t endif +objs/$(CONFIG)/test/core/iomgr/alarm_heap_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_alarm_heap_test: $(ALARM_HEAP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5462,6 +5644,8 @@ bins/$(CONFIG)/time_test: $(TIME_TEST_OBJS) libs/$(CONFIG)/libgrpc_test_util.a l endif +objs/$(CONFIG)/test/core/support/time_test.o: libs/$(CONFIG)/libgrpc_test_util.a libs/$(CONFIG)/libgrpc.a libs/$(CONFIG)/libgpr.a + deps_time_test: $(TIME_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5495,6 +5679,7 @@ bins/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test: $(CHTTP2_FAKE_SECU endif + deps_chttp2_fake_security_cancel_after_accept_test: $(CHTTP2_FAKE_SECURITY_CANCEL_AFTER_ACCEPT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5528,6 +5713,7 @@ bins/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test: endif + deps_chttp2_fake_security_cancel_after_accept_and_writes_closed_test: $(CHTTP2_FAKE_SECURITY_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5561,6 +5747,7 @@ bins/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test: $(CHTTP2_FAKE_SECU endif + deps_chttp2_fake_security_cancel_after_invoke_test: $(CHTTP2_FAKE_SECURITY_CANCEL_AFTER_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5594,6 +5781,7 @@ bins/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test: $(CHTTP2_FAKE_SEC endif + deps_chttp2_fake_security_cancel_before_invoke_test: $(CHTTP2_FAKE_SECURITY_CANCEL_BEFORE_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5627,6 +5815,7 @@ bins/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test: $(CHTTP2_FAKE_SECUR endif + deps_chttp2_fake_security_cancel_in_a_vacuum_test: $(CHTTP2_FAKE_SECURITY_CANCEL_IN_A_VACUUM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5660,6 +5849,7 @@ bins/$(CONFIG)/chttp2_fake_security_census_simple_request_test: $(CHTTP2_FAKE_SE endif + deps_chttp2_fake_security_census_simple_request_test: $(CHTTP2_FAKE_SECURITY_CENSUS_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5693,6 +5883,7 @@ bins/$(CONFIG)/chttp2_fake_security_disappearing_server_test: $(CHTTP2_FAKE_SECU endif + deps_chttp2_fake_security_disappearing_server_test: $(CHTTP2_FAKE_SECURITY_DISAPPEARING_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5726,6 +5917,7 @@ bins/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_call endif + deps_chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test: $(CHTTP2_FAKE_SECURITY_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5759,6 +5951,7 @@ bins/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test: $( endif + deps_chttp2_fake_security_early_server_shutdown_finishes_tags_test: $(CHTTP2_FAKE_SECURITY_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5792,6 +5985,7 @@ bins/$(CONFIG)/chttp2_fake_security_invoke_large_request_test: $(CHTTP2_FAKE_SEC endif + deps_chttp2_fake_security_invoke_large_request_test: $(CHTTP2_FAKE_SECURITY_INVOKE_LARGE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5825,6 +6019,7 @@ bins/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test: $(CHTTP2_FAKE_S endif + deps_chttp2_fake_security_max_concurrent_streams_test: $(CHTTP2_FAKE_SECURITY_MAX_CONCURRENT_STREAMS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5858,6 +6053,7 @@ bins/$(CONFIG)/chttp2_fake_security_no_op_test: $(CHTTP2_FAKE_SECURITY_NO_OP_TES endif + deps_chttp2_fake_security_no_op_test: $(CHTTP2_FAKE_SECURITY_NO_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5891,6 +6087,7 @@ bins/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test: $(CHTTP2_FAKE_SECU endif + deps_chttp2_fake_security_ping_pong_streaming_test: $(CHTTP2_FAKE_SECURITY_PING_PONG_STREAMING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5924,6 +6121,7 @@ bins/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_pa endif + deps_chttp2_fake_security_request_response_with_binary_metadata_and_payload_test: $(CHTTP2_FAKE_SECURITY_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5957,6 +6155,7 @@ bins/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_t endif + deps_chttp2_fake_security_request_response_with_metadata_and_payload_test: $(CHTTP2_FAKE_SECURITY_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -5990,6 +6189,7 @@ bins/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test: $(CHTTP2 endif + deps_chttp2_fake_security_request_response_with_payload_test: $(CHTTP2_FAKE_SECURITY_REQUEST_RESPONSE_WITH_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6023,6 +6223,7 @@ bins/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_ endif + deps_chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test: $(CHTTP2_FAKE_SECURITY_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6056,6 +6257,7 @@ bins/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test: $(CHTTP2_FAKE_S endif + deps_chttp2_fake_security_simple_delayed_request_test: $(CHTTP2_FAKE_SECURITY_SIMPLE_DELAYED_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6089,6 +6291,7 @@ bins/$(CONFIG)/chttp2_fake_security_simple_request_test: $(CHTTP2_FAKE_SECURITY_ endif + deps_chttp2_fake_security_simple_request_test: $(CHTTP2_FAKE_SECURITY_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6122,6 +6325,7 @@ bins/$(CONFIG)/chttp2_fake_security_thread_stress_test: $(CHTTP2_FAKE_SECURITY_T endif + deps_chttp2_fake_security_thread_stress_test: $(CHTTP2_FAKE_SECURITY_THREAD_STRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6155,6 +6359,7 @@ bins/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_test: $( endif + deps_chttp2_fake_security_writes_done_hangs_with_pending_read_test: $(CHTTP2_FAKE_SECURITY_WRITES_DONE_HANGS_WITH_PENDING_READ_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6188,6 +6393,7 @@ bins/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test: $(CHTTP2_FULLSTACK_CAN endif + deps_chttp2_fullstack_cancel_after_accept_test: $(CHTTP2_FULLSTACK_CANCEL_AFTER_ACCEPT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6221,6 +6427,7 @@ bins/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test: $(CH endif + deps_chttp2_fullstack_cancel_after_accept_and_writes_closed_test: $(CHTTP2_FULLSTACK_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6254,6 +6461,7 @@ bins/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test: $(CHTTP2_FULLSTACK_CAN endif + deps_chttp2_fullstack_cancel_after_invoke_test: $(CHTTP2_FULLSTACK_CANCEL_AFTER_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6287,6 +6495,7 @@ bins/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test: $(CHTTP2_FULLSTACK_CA endif + deps_chttp2_fullstack_cancel_before_invoke_test: $(CHTTP2_FULLSTACK_CANCEL_BEFORE_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6320,6 +6529,7 @@ bins/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test: $(CHTTP2_FULLSTACK_CANC endif + deps_chttp2_fullstack_cancel_in_a_vacuum_test: $(CHTTP2_FULLSTACK_CANCEL_IN_A_VACUUM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6353,6 +6563,7 @@ bins/$(CONFIG)/chttp2_fullstack_census_simple_request_test: $(CHTTP2_FULLSTACK_C endif + deps_chttp2_fullstack_census_simple_request_test: $(CHTTP2_FULLSTACK_CENSUS_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6386,6 +6597,7 @@ bins/$(CONFIG)/chttp2_fullstack_disappearing_server_test: $(CHTTP2_FULLSTACK_DIS endif + deps_chttp2_fullstack_disappearing_server_test: $(CHTTP2_FULLSTACK_DISAPPEARING_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6419,6 +6631,7 @@ bins/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_te endif + deps_chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test: $(CHTTP2_FULLSTACK_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6452,6 +6665,7 @@ bins/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test: $(CHTT endif + deps_chttp2_fullstack_early_server_shutdown_finishes_tags_test: $(CHTTP2_FULLSTACK_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6485,6 +6699,7 @@ bins/$(CONFIG)/chttp2_fullstack_invoke_large_request_test: $(CHTTP2_FULLSTACK_IN endif + deps_chttp2_fullstack_invoke_large_request_test: $(CHTTP2_FULLSTACK_INVOKE_LARGE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6518,6 +6733,7 @@ bins/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test: $(CHTTP2_FULLSTACK_ endif + deps_chttp2_fullstack_max_concurrent_streams_test: $(CHTTP2_FULLSTACK_MAX_CONCURRENT_STREAMS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6551,6 +6767,7 @@ bins/$(CONFIG)/chttp2_fullstack_no_op_test: $(CHTTP2_FULLSTACK_NO_OP_TEST_OBJS) endif + deps_chttp2_fullstack_no_op_test: $(CHTTP2_FULLSTACK_NO_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6584,6 +6801,7 @@ bins/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test: $(CHTTP2_FULLSTACK_PIN endif + deps_chttp2_fullstack_ping_pong_streaming_test: $(CHTTP2_FULLSTACK_PING_PONG_STREAMING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6617,6 +6835,7 @@ bins/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payloa endif + deps_chttp2_fullstack_request_response_with_binary_metadata_and_payload_test: $(CHTTP2_FULLSTACK_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6650,6 +6869,7 @@ bins/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test: endif + deps_chttp2_fullstack_request_response_with_metadata_and_payload_test: $(CHTTP2_FULLSTACK_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6683,6 +6903,7 @@ bins/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test: $(CHTTP2_FUL endif + deps_chttp2_fullstack_request_response_with_payload_test: $(CHTTP2_FULLSTACK_REQUEST_RESPONSE_WITH_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6716,6 +6937,7 @@ bins/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payl endif + deps_chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test: $(CHTTP2_FULLSTACK_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6749,6 +6971,7 @@ bins/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test: $(CHTTP2_FULLSTACK_ endif + deps_chttp2_fullstack_simple_delayed_request_test: $(CHTTP2_FULLSTACK_SIMPLE_DELAYED_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6782,6 +7005,7 @@ bins/$(CONFIG)/chttp2_fullstack_simple_request_test: $(CHTTP2_FULLSTACK_SIMPLE_R endif + deps_chttp2_fullstack_simple_request_test: $(CHTTP2_FULLSTACK_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6815,6 +7039,7 @@ bins/$(CONFIG)/chttp2_fullstack_thread_stress_test: $(CHTTP2_FULLSTACK_THREAD_ST endif + deps_chttp2_fullstack_thread_stress_test: $(CHTTP2_FULLSTACK_THREAD_STRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6848,6 +7073,7 @@ bins/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_test: $(CHTT endif + deps_chttp2_fullstack_writes_done_hangs_with_pending_read_test: $(CHTTP2_FULLSTACK_WRITES_DONE_HANGS_WITH_PENDING_READ_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6881,6 +7107,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test: $(CHTTP2_SI endif + deps_chttp2_simple_ssl_fullstack_cancel_after_accept_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_CANCEL_AFTER_ACCEPT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6914,6 +7141,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed endif + deps_chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6947,6 +7175,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test: $(CHTTP2_SI endif + deps_chttp2_simple_ssl_fullstack_cancel_after_invoke_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_CANCEL_AFTER_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -6980,6 +7209,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test: $(CHTTP2_S endif + deps_chttp2_simple_ssl_fullstack_cancel_before_invoke_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_CANCEL_BEFORE_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7013,6 +7243,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test: $(CHTTP2_SIM endif + deps_chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_CANCEL_IN_A_VACUUM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7046,6 +7277,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test: $(CHTTP2_ endif + deps_chttp2_simple_ssl_fullstack_census_simple_request_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_CENSUS_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7079,6 +7311,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test: $(CHTTP2_SI endif + deps_chttp2_simple_ssl_fullstack_disappearing_server_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_DISAPPEARING_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7112,6 +7345,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflig endif + deps_chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7145,6 +7379,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_t endif + deps_chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7178,6 +7413,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test: $(CHTTP2_S endif + deps_chttp2_simple_ssl_fullstack_invoke_large_request_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_INVOKE_LARGE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7211,6 +7447,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test: $(CHTTP2 endif + deps_chttp2_simple_ssl_fullstack_max_concurrent_streams_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_MAX_CONCURRENT_STREAMS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7244,6 +7481,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test: $(CHTTP2_SIMPLE_SSL_FULLS endif + deps_chttp2_simple_ssl_fullstack_no_op_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_NO_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7277,6 +7515,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test: $(CHTTP2_SI endif + deps_chttp2_simple_ssl_fullstack_ping_pong_streaming_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_PING_PONG_STREAMING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7310,6 +7549,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata endif + deps_chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7343,6 +7583,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_pa endif + deps_chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7376,6 +7617,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test: $ endif + deps_chttp2_simple_ssl_fullstack_request_response_with_payload_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_REQUEST_RESPONSE_WITH_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7409,6 +7651,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metada endif + deps_chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7442,6 +7685,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test: $(CHTTP2 endif + deps_chttp2_simple_ssl_fullstack_simple_delayed_request_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_SIMPLE_DELAYED_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7475,6 +7719,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test: $(CHTTP2_SIMPLE_ endif + deps_chttp2_simple_ssl_fullstack_simple_request_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7508,6 +7753,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_test: $(CHTTP2_SIMPLE_S endif + deps_chttp2_simple_ssl_fullstack_thread_stress_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_THREAD_STRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7541,6 +7787,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_t endif + deps_chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_test: $(CHTTP2_SIMPLE_SSL_FULLSTACK_WRITES_DONE_HANGS_WITH_PENDING_READ_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7574,6 +7821,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test: endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_CANCEL_AFTER_ACCEPT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7607,6 +7855,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_w endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7640,6 +7889,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test: endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_CANCEL_AFTER_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7673,6 +7923,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_CANCEL_BEFORE_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7706,6 +7957,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test: endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_CANCEL_IN_A_VACUUM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7739,6 +7991,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_tes endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_CENSUS_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7772,6 +8025,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test: endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_DISAPPEARING_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7805,6 +8059,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_fin endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7838,6 +8093,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_fin endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7871,6 +8127,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_INVOKE_LARGE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7904,6 +8161,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_te endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_MAX_CONCURRENT_STREAMS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7937,6 +8195,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test: $(CHTTP2_SIMP endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_no_op_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_NO_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -7970,6 +8229,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test: endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_PING_PONG_STREAMING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8003,6 +8263,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_bin endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8036,6 +8297,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_met endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8069,6 +8331,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_pay endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_REQUEST_RESPONSE_WITH_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8102,6 +8365,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_tra endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8135,6 +8399,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_te endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_SIMPLE_DELAYED_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8168,6 +8433,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test: $(CH endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8201,6 +8467,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test: $(CHT endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_THREAD_STRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8234,6 +8501,7 @@ bins/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pe endif + deps_chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_test: $(CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_WRITES_DONE_HANGS_WITH_PENDING_READ_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8267,6 +8535,7 @@ bins/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test: $(CHTTP2_SOCKET_PAIR endif + deps_chttp2_socket_pair_cancel_after_accept_test: $(CHTTP2_SOCKET_PAIR_CANCEL_AFTER_ACCEPT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8300,6 +8569,7 @@ bins/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test: $( endif + deps_chttp2_socket_pair_cancel_after_accept_and_writes_closed_test: $(CHTTP2_SOCKET_PAIR_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8333,6 +8603,7 @@ bins/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test: $(CHTTP2_SOCKET_PAIR endif + deps_chttp2_socket_pair_cancel_after_invoke_test: $(CHTTP2_SOCKET_PAIR_CANCEL_AFTER_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8366,6 +8637,7 @@ bins/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test: $(CHTTP2_SOCKET_PAI endif + deps_chttp2_socket_pair_cancel_before_invoke_test: $(CHTTP2_SOCKET_PAIR_CANCEL_BEFORE_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8399,6 +8671,7 @@ bins/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test: $(CHTTP2_SOCKET_PAIR_ endif + deps_chttp2_socket_pair_cancel_in_a_vacuum_test: $(CHTTP2_SOCKET_PAIR_CANCEL_IN_A_VACUUM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8432,6 +8705,7 @@ bins/$(CONFIG)/chttp2_socket_pair_census_simple_request_test: $(CHTTP2_SOCKET_PA endif + deps_chttp2_socket_pair_census_simple_request_test: $(CHTTP2_SOCKET_PAIR_CENSUS_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8465,6 +8739,7 @@ bins/$(CONFIG)/chttp2_socket_pair_disappearing_server_test: $(CHTTP2_SOCKET_PAIR endif + deps_chttp2_socket_pair_disappearing_server_test: $(CHTTP2_SOCKET_PAIR_DISAPPEARING_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8498,6 +8773,7 @@ bins/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_ endif + deps_chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test: $(CHTTP2_SOCKET_PAIR_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8531,6 +8807,7 @@ bins/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test: $(CH endif + deps_chttp2_socket_pair_early_server_shutdown_finishes_tags_test: $(CHTTP2_SOCKET_PAIR_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8564,6 +8841,7 @@ bins/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test: $(CHTTP2_SOCKET_PAI endif + deps_chttp2_socket_pair_invoke_large_request_test: $(CHTTP2_SOCKET_PAIR_INVOKE_LARGE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8597,6 +8875,7 @@ bins/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test: $(CHTTP2_SOCKET_P endif + deps_chttp2_socket_pair_max_concurrent_streams_test: $(CHTTP2_SOCKET_PAIR_MAX_CONCURRENT_STREAMS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8630,6 +8909,7 @@ bins/$(CONFIG)/chttp2_socket_pair_no_op_test: $(CHTTP2_SOCKET_PAIR_NO_OP_TEST_OB endif + deps_chttp2_socket_pair_no_op_test: $(CHTTP2_SOCKET_PAIR_NO_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8663,6 +8943,7 @@ bins/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test: $(CHTTP2_SOCKET_PAIR endif + deps_chttp2_socket_pair_ping_pong_streaming_test: $(CHTTP2_SOCKET_PAIR_PING_PONG_STREAMING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8696,6 +8977,7 @@ bins/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payl endif + deps_chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test: $(CHTTP2_SOCKET_PAIR_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8729,6 +9011,7 @@ bins/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_tes endif + deps_chttp2_socket_pair_request_response_with_metadata_and_payload_test: $(CHTTP2_SOCKET_PAIR_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8762,6 +9045,7 @@ bins/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test: $(CHTTP2_S endif + deps_chttp2_socket_pair_request_response_with_payload_test: $(CHTTP2_SOCKET_PAIR_REQUEST_RESPONSE_WITH_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8795,6 +9079,7 @@ bins/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_pa endif + deps_chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test: $(CHTTP2_SOCKET_PAIR_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8828,6 +9113,7 @@ bins/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test: $(CHTTP2_SOCKET_P endif + deps_chttp2_socket_pair_simple_delayed_request_test: $(CHTTP2_SOCKET_PAIR_SIMPLE_DELAYED_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8861,6 +9147,7 @@ bins/$(CONFIG)/chttp2_socket_pair_simple_request_test: $(CHTTP2_SOCKET_PAIR_SIMP endif + deps_chttp2_socket_pair_simple_request_test: $(CHTTP2_SOCKET_PAIR_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8894,6 +9181,7 @@ bins/$(CONFIG)/chttp2_socket_pair_thread_stress_test: $(CHTTP2_SOCKET_PAIR_THREA endif + deps_chttp2_socket_pair_thread_stress_test: $(CHTTP2_SOCKET_PAIR_THREAD_STRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8927,6 +9215,7 @@ bins/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_test: $(CH endif + deps_chttp2_socket_pair_writes_done_hangs_with_pending_read_test: $(CHTTP2_SOCKET_PAIR_WRITES_DONE_HANGS_WITH_PENDING_READ_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8960,6 +9249,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test: $ endif + deps_chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_CANCEL_AFTER_ACCEPT_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -8993,6 +9283,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_wri endif + deps_chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9026,6 +9317,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test: $ endif + deps_chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_CANCEL_AFTER_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9059,6 +9351,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test: endif + deps_chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_CANCEL_BEFORE_INVOKE_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9092,6 +9385,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test: $( endif + deps_chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_CANCEL_IN_A_VACUUM_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9125,6 +9419,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test: endif + deps_chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_CENSUS_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9158,6 +9453,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test: $ endif + deps_chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_DISAPPEARING_SERVER_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9191,6 +9487,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finis endif + deps_chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9224,6 +9521,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finis endif + deps_chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9257,6 +9555,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test: endif + deps_chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_INVOKE_LARGE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9290,6 +9589,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test endif + deps_chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_MAX_CONCURRENT_STREAMS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9323,6 +9623,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test: $(CHTTP2_SOCKET endif + deps_chttp2_socket_pair_one_byte_at_a_time_no_op_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_NO_OP_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9356,6 +9657,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test: $ endif + deps_chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_PING_PONG_STREAMING_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9389,6 +9691,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binar endif + deps_chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9422,6 +9725,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metad endif + deps_chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9455,6 +9759,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_paylo endif + deps_chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_REQUEST_RESPONSE_WITH_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9488,6 +9793,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trail endif + deps_chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9521,6 +9827,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test endif + deps_chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_SIMPLE_DELAYED_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9554,6 +9861,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test: $(CHTT endif + deps_chttp2_socket_pair_one_byte_at_a_time_simple_request_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_SIMPLE_REQUEST_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9587,6 +9895,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_test: $(CHTTP endif + deps_chttp2_socket_pair_one_byte_at_a_time_thread_stress_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_THREAD_STRESS_TEST_DEPS) ifneq ($(NO_SECURE),true) @@ -9620,6 +9929,7 @@ bins/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pend endif + deps_chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_test: $(CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_WRITES_DONE_HANGS_WITH_PENDING_READ_TEST_DEPS) ifneq ($(NO_SECURE),true) diff --git a/build.json b/build.json index 219ff23fe13..f488e8b0fcc 100644 --- a/build.json +++ b/build.json @@ -1280,6 +1280,7 @@ "test/cpp/end2end/sync_client_async_server_test.cc" ], "deps": [ + "grpc++_test_util", "grpc_test_util", "grpc++", "grpc", @@ -1384,7 +1385,8 @@ ], "deps": [ "grpc++", - "grpc" + "grpc", + "gpr" ] }, { @@ -1396,7 +1398,8 @@ ], "deps": [ "grpc++", - "grpc" + "grpc", + "gpr" ] }, { From f5371efe65a68738a904090a95b0725397a24a1e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:40:18 -0800 Subject: [PATCH 09/24] Fix some C++ test dependencies --- templates/Makefile.template | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/templates/Makefile.template b/templates/Makefile.template index 44144c8f7e5..32c2f18b07b 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -2,6 +2,7 @@ # This currently builds C and C++ code. <%! import re + import os proto_re = re.compile('(.*)\\.proto') @@ -355,7 +356,7 @@ buildtests_c: bins_dep_c privatelibs_c\ buildtests_cxx: bins_dep_cxx privatelibs_cxx\ % for tgt in targets: % if tgt.build == 'test' and tgt.get('c++', False): - bins/${tgt.name}\ + bins/$(CONFIG)/${tgt.name}\ % endif % endfor @@ -687,6 +688,7 @@ libs/$(CONFIG)/lib${lib.name}.a: $(LIB${lib.name.upper()}_OBJS) $(Q) $(AR) rcs libs/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS) % if lib.get('baselib', False): % if lib.get('secure', True): + $(Q) rm -rf tmp-merge $(Q) mkdir tmp-merge $(Q) ( cd tmp-merge ; $(AR) x ../libs/$(CONFIG)/lib${lib.name}.a ) $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd tmp-merge ; <%text>ar x ../$${l} ) ; done @@ -836,6 +838,14 @@ bins/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\ endif % endif +% for src in tgt.src: +objs/$(CONFIG)/${os.path.splitext(src)[0]}.o: \ +% for dep in tgt.deps: + libs/$(CONFIG)/lib${dep}.a\ +% endfor + +% endfor + deps_${tgt.name}: $(${tgt.name.upper()}_DEPS) % if tgt.get('secure', True): From edd10d2596259e32d74ffd53ad62b9f0fe450b5e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:40:51 -0800 Subject: [PATCH 10/24] Make this file usable from C++ --- test/core/util/port.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/core/util/port.h b/test/core/util/port.h index d06f04731e2..0ba895af433 100644 --- a/test/core/util/port.h +++ b/test/core/util/port.h @@ -34,6 +34,10 @@ #ifndef __GRPC_TEST_UTIL_PORT_H__ #define __GRPC_TEST_UTIL_PORT_H__ +#ifdef __cplusplus +extern "C" { +#endif + /* pick a port number that is currently unused by either tcp or udp. return 0 on failure. */ int grpc_pick_unused_port(); @@ -41,4 +45,8 @@ int grpc_pick_unused_port(); on failure. */ int grpc_pick_unused_port_or_die(); +#ifdef __cplusplus +} +#endif + #endif /* __GRPC_TEST_UTIL_PORT_H__ */ From 35e3971e899313870c5006ba9a99f2740ce216f6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:41:24 -0800 Subject: [PATCH 11/24] Make this file compile --- test/cpp/end2end/end2end_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 73b7025cb36..16be518a3fc 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -34,7 +34,7 @@ #include #include -#include "net/grpc/cpp/echo_duplicate_proto_cc.pb.h" +#include "test/cpp/util/echo_duplicate.pb.h" #include "test/cpp/util/echo.pb.h" #include "src/cpp/util/time.h" #include @@ -47,7 +47,7 @@ #include #include #include -#include "net/util/netutil.h" +#include "test/core/util/port.h" #include #include @@ -141,7 +141,7 @@ class TestServiceImplDupPkg class End2endTest : public ::testing::Test { protected: void SetUp() override { - int port = PickUnusedPortOrDie(); + int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; @@ -189,7 +189,7 @@ TEST_F(End2endTest, SimpleRpc) { TEST_F(End2endTest, MultipleRpcs) { ResetStub(); - vector threads; + std::vector threads; for (int i = 0; i < 10; ++i) { threads.push_back(new std::thread(SendRpc, stub_.get(), 10)); } From 9608f0f212f847c02f5aa768079ce5dcb04caa04 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:41:41 -0800 Subject: [PATCH 12/24] Make this file compile --- test/cpp/client/channel_arguments_test.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/cpp/client/channel_arguments_test.cc b/test/cpp/client/channel_arguments_test.cc index b94d4788f7c..9dc0ab3d612 100644 --- a/test/cpp/client/channel_arguments_test.cc +++ b/test/cpp/client/channel_arguments_test.cc @@ -69,15 +69,12 @@ TEST_F(ChannelArgumentsTest, SetInt) { key = ""; SetChannelArgs(channel_args, &args); EXPECT_EQ(2, args.num_args); - bool found[2] = {false, false}; // We do not enforce order on the arguments. - for (int i = 0; i < args.num_args; i++) { + for (size_t i = 0; i < args.num_args; i++) { EXPECT_EQ(GRPC_ARG_INTEGER, args.args[i].type); if (grpc::string(args.args[i].key) == "key0") { - found[0] = true; EXPECT_EQ(0, args.args[i].value.integer); } else if (grpc::string(args.args[i].key) == "key1") { - found[1] = true; EXPECT_EQ(1, args.args[i].value.integer); } } @@ -107,15 +104,12 @@ TEST_F(ChannelArgumentsTest, SetString) { channel_args.SetString(key, val); SetChannelArgs(channel_args, &args); EXPECT_EQ(2, args.num_args); - bool found[2] = {false, false}; // We do not enforce order on the arguments. - for (int i = 0; i < args.num_args; i++) { + for (size_t i = 0; i < args.num_args; i++) { EXPECT_EQ(GRPC_ARG_STRING, args.args[i].type); if (grpc::string(args.args[i].key) == "key0") { - found[0] = true; EXPECT_STREQ("val0", args.args[i].value.string); } else if (grpc::string(args.args[i].key) == "key1") { - found[1] = true; EXPECT_STREQ("val1", args.args[i].value.string); } } From b2a42f3271a72ed693b36def6c7d5d08beda2dc3 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:41:56 -0800 Subject: [PATCH 13/24] Make this file compile --- test/cpp/end2end/sync_client_async_server_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/end2end/sync_client_async_server_test.cc b/test/cpp/end2end/sync_client_async_server_test.cc index f4dad60e223..54e7648cb6b 100644 --- a/test/cpp/end2end/sync_client_async_server_test.cc +++ b/test/cpp/end2end/sync_client_async_server_test.cc @@ -49,7 +49,7 @@ #include #include #include "test/cpp/end2end/async_test_server.h" -#include "net/util/netutil.h" +#include "test/core/util/port.h" #include using grpc::cpp::test::util::EchoRequest; @@ -73,7 +73,7 @@ void ServerLoop(void* s) { class End2endTest : public ::testing::Test { protected: void SetUp() override { - int port = PickUnusedPortOrDie(); + int port = grpc_pick_unused_port_or_die(); // TODO(yangg) protobuf has a StringPrintf, maybe use that std::ostringstream oss; oss << "[::]:" << port; From 27715caf6e1f22323d218f0bc2c042c7e17a167f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:55:59 -0800 Subject: [PATCH 14/24] Allow C++ tests to be built in parallel --- Makefile | 299 ++++++++++++++++++++++++++++++++++++ templates/Makefile.template | 12 ++ 2 files changed, 311 insertions(+) diff --git a/Makefile b/Makefile index 98739802890..5b2ca353451 100644 --- a/Makefile +++ b/Makefile @@ -1212,6 +1212,33 @@ ifneq ($(NO_DEPS),true) -include $(LIBGPR_DEPS) endif +objs/$(CONFIG)/src/core/support/alloc.o: +objs/$(CONFIG)/src/core/support/cancellable.o: +objs/$(CONFIG)/src/core/support/cmdline.o: +objs/$(CONFIG)/src/core/support/cpu_linux.o: +objs/$(CONFIG)/src/core/support/cpu_posix.o: +objs/$(CONFIG)/src/core/support/histogram.o: +objs/$(CONFIG)/src/core/support/host_port.o: +objs/$(CONFIG)/src/core/support/log_android.o: +objs/$(CONFIG)/src/core/support/log.o: +objs/$(CONFIG)/src/core/support/log_linux.o: +objs/$(CONFIG)/src/core/support/log_posix.o: +objs/$(CONFIG)/src/core/support/log_win32.o: +objs/$(CONFIG)/src/core/support/murmur_hash.o: +objs/$(CONFIG)/src/core/support/slice_buffer.o: +objs/$(CONFIG)/src/core/support/slice.o: +objs/$(CONFIG)/src/core/support/string.o: +objs/$(CONFIG)/src/core/support/string_posix.o: +objs/$(CONFIG)/src/core/support/string_win32.o: +objs/$(CONFIG)/src/core/support/sync.o: +objs/$(CONFIG)/src/core/support/sync_posix.o: +objs/$(CONFIG)/src/core/support/sync_win32.o: +objs/$(CONFIG)/src/core/support/thd_posix.o: +objs/$(CONFIG)/src/core/support/thd_win32.o: +objs/$(CONFIG)/src/core/support/time.o: +objs/$(CONFIG)/src/core/support/time_posix.o: +objs/$(CONFIG)/src/core/support/time_win32.o: + clean_libgpr: $(E) "[CLEAN] Cleaning libgpr files" $(Q) $(RM) $(LIBGPR_OBJS) @@ -1377,6 +1404,98 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/src/core/security/auth.o: +objs/$(CONFIG)/src/core/security/base64.o: +objs/$(CONFIG)/src/core/security/credentials.o: +objs/$(CONFIG)/src/core/security/google_root_certs.o: +objs/$(CONFIG)/src/core/security/json_token.o: +objs/$(CONFIG)/src/core/security/secure_endpoint.o: +objs/$(CONFIG)/src/core/security/secure_transport_setup.o: +objs/$(CONFIG)/src/core/security/security_context.o: +objs/$(CONFIG)/src/core/security/server_secure_chttp2.o: +objs/$(CONFIG)/src/core/tsi/fake_transport_security.o: +objs/$(CONFIG)/src/core/tsi/ssl_transport_security.o: +objs/$(CONFIG)/src/core/tsi/transport_security.o: +objs/$(CONFIG)/src/core/channel/call_op_string.o: +objs/$(CONFIG)/src/core/channel/census_filter.o: +objs/$(CONFIG)/src/core/channel/channel_args.o: +objs/$(CONFIG)/src/core/channel/channel_stack.o: +objs/$(CONFIG)/src/core/channel/child_channel.o: +objs/$(CONFIG)/src/core/channel/client_channel.o: +objs/$(CONFIG)/src/core/channel/client_setup.o: +objs/$(CONFIG)/src/core/channel/connected_channel.o: +objs/$(CONFIG)/src/core/channel/http_client_filter.o: +objs/$(CONFIG)/src/core/channel/http_filter.o: +objs/$(CONFIG)/src/core/channel/http_server_filter.o: +objs/$(CONFIG)/src/core/channel/metadata_buffer.o: +objs/$(CONFIG)/src/core/channel/noop_filter.o: +objs/$(CONFIG)/src/core/compression/algorithm.o: +objs/$(CONFIG)/src/core/compression/message_compress.o: +objs/$(CONFIG)/src/core/httpcli/format_request.o: +objs/$(CONFIG)/src/core/httpcli/httpcli.o: +objs/$(CONFIG)/src/core/httpcli/httpcli_security_context.o: +objs/$(CONFIG)/src/core/httpcli/parser.o: +objs/$(CONFIG)/src/core/iomgr/alarm.o: +objs/$(CONFIG)/src/core/iomgr/alarm_heap.o: +objs/$(CONFIG)/src/core/iomgr/endpoint.o: +objs/$(CONFIG)/src/core/iomgr/endpoint_pair_posix.o: +objs/$(CONFIG)/src/core/iomgr/fd_posix.o: +objs/$(CONFIG)/src/core/iomgr/iomgr.o: +objs/$(CONFIG)/src/core/iomgr/iomgr_posix.o: +objs/$(CONFIG)/src/core/iomgr/pollset_multipoller_with_poll_posix.o: +objs/$(CONFIG)/src/core/iomgr/pollset_posix.o: +objs/$(CONFIG)/src/core/iomgr/resolve_address_posix.o: +objs/$(CONFIG)/src/core/iomgr/sockaddr_utils.o: +objs/$(CONFIG)/src/core/iomgr/socket_utils_common_posix.o: +objs/$(CONFIG)/src/core/iomgr/socket_utils_linux.o: +objs/$(CONFIG)/src/core/iomgr/socket_utils_posix.o: +objs/$(CONFIG)/src/core/iomgr/tcp_client_posix.o: +objs/$(CONFIG)/src/core/iomgr/tcp_posix.o: +objs/$(CONFIG)/src/core/iomgr/tcp_server_posix.o: +objs/$(CONFIG)/src/core/iomgr/time_averaged_stats.o: +objs/$(CONFIG)/src/core/statistics/census_init.o: +objs/$(CONFIG)/src/core/statistics/census_log.o: +objs/$(CONFIG)/src/core/statistics/census_rpc_stats.o: +objs/$(CONFIG)/src/core/statistics/census_tracing.o: +objs/$(CONFIG)/src/core/statistics/hash_table.o: +objs/$(CONFIG)/src/core/statistics/window_stats.o: +objs/$(CONFIG)/src/core/surface/byte_buffer.o: +objs/$(CONFIG)/src/core/surface/byte_buffer_reader.o: +objs/$(CONFIG)/src/core/surface/call.o: +objs/$(CONFIG)/src/core/surface/channel.o: +objs/$(CONFIG)/src/core/surface/channel_create.o: +objs/$(CONFIG)/src/core/surface/client.o: +objs/$(CONFIG)/src/core/surface/completion_queue.o: +objs/$(CONFIG)/src/core/surface/event_string.o: +objs/$(CONFIG)/src/core/surface/init.o: +objs/$(CONFIG)/src/core/surface/lame_client.o: +objs/$(CONFIG)/src/core/surface/secure_channel_create.o: +objs/$(CONFIG)/src/core/surface/secure_server_create.o: +objs/$(CONFIG)/src/core/surface/server.o: +objs/$(CONFIG)/src/core/surface/server_chttp2.o: +objs/$(CONFIG)/src/core/surface/server_create.o: +objs/$(CONFIG)/src/core/transport/chttp2/alpn.o: +objs/$(CONFIG)/src/core/transport/chttp2/bin_encoder.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_data.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_goaway.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_ping.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_rst_stream.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_settings.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_window_update.o: +objs/$(CONFIG)/src/core/transport/chttp2/hpack_parser.o: +objs/$(CONFIG)/src/core/transport/chttp2/hpack_table.o: +objs/$(CONFIG)/src/core/transport/chttp2/huffsyms.o: +objs/$(CONFIG)/src/core/transport/chttp2/status_conversion.o: +objs/$(CONFIG)/src/core/transport/chttp2/stream_encoder.o: +objs/$(CONFIG)/src/core/transport/chttp2/stream_map.o: +objs/$(CONFIG)/src/core/transport/chttp2/timeout_encoding.o: +objs/$(CONFIG)/src/core/transport/chttp2/varint.o: +objs/$(CONFIG)/src/core/transport/chttp2_transport.o: +objs/$(CONFIG)/src/core/transport/metadata.o: +objs/$(CONFIG)/src/core/transport/stream_op.o: +objs/$(CONFIG)/src/core/transport/transport.o: +objs/$(CONFIG)/third_party/cJSON/cJSON.o: + clean_libgrpc: $(E) "[CLEAN] Cleaning libgrpc files" $(Q) $(RM) $(LIBGRPC_OBJS) @@ -1506,6 +1625,86 @@ ifneq ($(NO_DEPS),true) -include $(LIBGRPC_UNSECURE_DEPS) endif +objs/$(CONFIG)/src/core/channel/call_op_string.o: +objs/$(CONFIG)/src/core/channel/census_filter.o: +objs/$(CONFIG)/src/core/channel/channel_args.o: +objs/$(CONFIG)/src/core/channel/channel_stack.o: +objs/$(CONFIG)/src/core/channel/child_channel.o: +objs/$(CONFIG)/src/core/channel/client_channel.o: +objs/$(CONFIG)/src/core/channel/client_setup.o: +objs/$(CONFIG)/src/core/channel/connected_channel.o: +objs/$(CONFIG)/src/core/channel/http_client_filter.o: +objs/$(CONFIG)/src/core/channel/http_filter.o: +objs/$(CONFIG)/src/core/channel/http_server_filter.o: +objs/$(CONFIG)/src/core/channel/metadata_buffer.o: +objs/$(CONFIG)/src/core/channel/noop_filter.o: +objs/$(CONFIG)/src/core/compression/algorithm.o: +objs/$(CONFIG)/src/core/compression/message_compress.o: +objs/$(CONFIG)/src/core/httpcli/format_request.o: +objs/$(CONFIG)/src/core/httpcli/httpcli.o: +objs/$(CONFIG)/src/core/httpcli/httpcli_security_context.o: +objs/$(CONFIG)/src/core/httpcli/parser.o: +objs/$(CONFIG)/src/core/iomgr/alarm.o: +objs/$(CONFIG)/src/core/iomgr/alarm_heap.o: +objs/$(CONFIG)/src/core/iomgr/endpoint.o: +objs/$(CONFIG)/src/core/iomgr/endpoint_pair_posix.o: +objs/$(CONFIG)/src/core/iomgr/fd_posix.o: +objs/$(CONFIG)/src/core/iomgr/iomgr.o: +objs/$(CONFIG)/src/core/iomgr/iomgr_posix.o: +objs/$(CONFIG)/src/core/iomgr/pollset_multipoller_with_poll_posix.o: +objs/$(CONFIG)/src/core/iomgr/pollset_posix.o: +objs/$(CONFIG)/src/core/iomgr/resolve_address_posix.o: +objs/$(CONFIG)/src/core/iomgr/sockaddr_utils.o: +objs/$(CONFIG)/src/core/iomgr/socket_utils_common_posix.o: +objs/$(CONFIG)/src/core/iomgr/socket_utils_linux.o: +objs/$(CONFIG)/src/core/iomgr/socket_utils_posix.o: +objs/$(CONFIG)/src/core/iomgr/tcp_client_posix.o: +objs/$(CONFIG)/src/core/iomgr/tcp_posix.o: +objs/$(CONFIG)/src/core/iomgr/tcp_server_posix.o: +objs/$(CONFIG)/src/core/iomgr/time_averaged_stats.o: +objs/$(CONFIG)/src/core/statistics/census_init.o: +objs/$(CONFIG)/src/core/statistics/census_log.o: +objs/$(CONFIG)/src/core/statistics/census_rpc_stats.o: +objs/$(CONFIG)/src/core/statistics/census_tracing.o: +objs/$(CONFIG)/src/core/statistics/hash_table.o: +objs/$(CONFIG)/src/core/statistics/window_stats.o: +objs/$(CONFIG)/src/core/surface/byte_buffer.o: +objs/$(CONFIG)/src/core/surface/byte_buffer_reader.o: +objs/$(CONFIG)/src/core/surface/call.o: +objs/$(CONFIG)/src/core/surface/channel.o: +objs/$(CONFIG)/src/core/surface/channel_create.o: +objs/$(CONFIG)/src/core/surface/client.o: +objs/$(CONFIG)/src/core/surface/completion_queue.o: +objs/$(CONFIG)/src/core/surface/event_string.o: +objs/$(CONFIG)/src/core/surface/init.o: +objs/$(CONFIG)/src/core/surface/lame_client.o: +objs/$(CONFIG)/src/core/surface/secure_channel_create.o: +objs/$(CONFIG)/src/core/surface/secure_server_create.o: +objs/$(CONFIG)/src/core/surface/server.o: +objs/$(CONFIG)/src/core/surface/server_chttp2.o: +objs/$(CONFIG)/src/core/surface/server_create.o: +objs/$(CONFIG)/src/core/transport/chttp2/alpn.o: +objs/$(CONFIG)/src/core/transport/chttp2/bin_encoder.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_data.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_goaway.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_ping.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_rst_stream.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_settings.o: +objs/$(CONFIG)/src/core/transport/chttp2/frame_window_update.o: +objs/$(CONFIG)/src/core/transport/chttp2/hpack_parser.o: +objs/$(CONFIG)/src/core/transport/chttp2/hpack_table.o: +objs/$(CONFIG)/src/core/transport/chttp2/huffsyms.o: +objs/$(CONFIG)/src/core/transport/chttp2/status_conversion.o: +objs/$(CONFIG)/src/core/transport/chttp2/stream_encoder.o: +objs/$(CONFIG)/src/core/transport/chttp2/stream_map.o: +objs/$(CONFIG)/src/core/transport/chttp2/timeout_encoding.o: +objs/$(CONFIG)/src/core/transport/chttp2/varint.o: +objs/$(CONFIG)/src/core/transport/chttp2_transport.o: +objs/$(CONFIG)/src/core/transport/metadata.o: +objs/$(CONFIG)/src/core/transport/stream_op.o: +objs/$(CONFIG)/src/core/transport/transport.o: +objs/$(CONFIG)/third_party/cJSON/cJSON.o: + clean_libgrpc_unsecure: $(E) "[CLEAN] Cleaning libgrpc_unsecure files" $(Q) $(RM) $(LIBGRPC_UNSECURE_OBJS) @@ -1559,6 +1758,20 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/cq_verifier.o: +objs/$(CONFIG)/test/core/end2end/data/test_root_cert.o: +objs/$(CONFIG)/test/core/end2end/data/prod_roots_certs.o: +objs/$(CONFIG)/test/core/end2end/data/server1_cert.o: +objs/$(CONFIG)/test/core/end2end/data/server1_key.o: +objs/$(CONFIG)/test/core/iomgr/endpoint_tests.o: +objs/$(CONFIG)/test/core/statistics/census_log_tests.o: +objs/$(CONFIG)/test/core/transport/transport_end2end_tests.o: +objs/$(CONFIG)/test/core/util/grpc_profiler.o: +objs/$(CONFIG)/test/core/util/parse_hexstring.o: +objs/$(CONFIG)/test/core/util/port_posix.o: +objs/$(CONFIG)/test/core/util/slice_splitter.o: +objs/$(CONFIG)/test/core/util/test_config.o: + clean_libgrpc_test_util: $(E) "[CLEAN] Cleaning libgrpc_test_util files" $(Q) $(RM) $(LIBGRPC_TEST_UTIL_OBJS) @@ -1660,6 +1873,27 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/src/cpp/client/channel.o: +objs/$(CONFIG)/src/cpp/client/channel_arguments.o: +objs/$(CONFIG)/src/cpp/client/client_context.o: +objs/$(CONFIG)/src/cpp/client/create_channel.o: +objs/$(CONFIG)/src/cpp/client/credentials.o: +objs/$(CONFIG)/src/cpp/client/internal_stub.o: +objs/$(CONFIG)/src/cpp/proto/proto_utils.o: +objs/$(CONFIG)/src/cpp/common/rpc_method.o: +objs/$(CONFIG)/src/cpp/server/async_server.o: +objs/$(CONFIG)/src/cpp/server/async_server_context.o: +objs/$(CONFIG)/src/cpp/server/completion_queue.o: +objs/$(CONFIG)/src/cpp/server/server_builder.o: +objs/$(CONFIG)/src/cpp/server/server_context_impl.o: +objs/$(CONFIG)/src/cpp/server/server.o: +objs/$(CONFIG)/src/cpp/server/server_rpc_handler.o: +objs/$(CONFIG)/src/cpp/server/server_credentials.o: +objs/$(CONFIG)/src/cpp/server/thread_pool.o: +objs/$(CONFIG)/src/cpp/stream/stream_context.o: +objs/$(CONFIG)/src/cpp/util/status.o: +objs/$(CONFIG)/src/cpp/util/time.o: + clean_libgrpc++: $(E) "[CLEAN] Cleaning libgrpc++ files" $(Q) $(RM) $(LIBGRPC++_OBJS) @@ -1705,6 +1939,12 @@ ifneq ($(NO_DEPS),true) endif endif + + + +objs/$(CONFIG)/test/cpp/util/create_test_channel.o: gens/test/cpp/util/messages.pb.cc gens/test/cpp/util/echo.pb.cc gens/test/cpp/util/echo_duplicate.pb.cc +objs/$(CONFIG)/test/cpp/end2end/async_test_server.o: gens/test/cpp/util/messages.pb.cc gens/test/cpp/util/echo.pb.cc gens/test/cpp/util/echo_duplicate.pb.cc + clean_libgrpc++_test_util: $(E) "[CLEAN] Cleaning libgrpc++_test_util files" $(Q) $(RM) $(LIBGRPC++_TEST_UTIL_OBJS) @@ -1746,6 +1986,8 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/fixtures/chttp2_fake_security.o: + clean_libend2end_fixture_chttp2_fake_security: $(E) "[CLEAN] Cleaning libend2end_fixture_chttp2_fake_security files" $(Q) $(RM) $(LIBEND2END_FIXTURE_CHTTP2_FAKE_SECURITY_OBJS) @@ -1787,6 +2029,8 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/fixtures/chttp2_fullstack.o: + clean_libend2end_fixture_chttp2_fullstack: $(E) "[CLEAN] Cleaning libend2end_fixture_chttp2_fullstack files" $(Q) $(RM) $(LIBEND2END_FIXTURE_CHTTP2_FULLSTACK_OBJS) @@ -1828,6 +2072,8 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.o: + clean_libend2end_fixture_chttp2_simple_ssl_fullstack: $(E) "[CLEAN] Cleaning libend2end_fixture_chttp2_simple_ssl_fullstack files" $(Q) $(RM) $(LIBEND2END_FIXTURE_CHTTP2_SIMPLE_SSL_FULLSTACK_OBJS) @@ -1869,6 +2115,8 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.o: + clean_libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack: $(E) "[CLEAN] Cleaning libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack files" $(Q) $(RM) $(LIBEND2END_FIXTURE_CHTTP2_SIMPLE_SSL_WITH_OAUTH2_FULLSTACK_OBJS) @@ -1910,6 +2158,8 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/fixtures/chttp2_socket_pair.o: + clean_libend2end_fixture_chttp2_socket_pair: $(E) "[CLEAN] Cleaning libend2end_fixture_chttp2_socket_pair files" $(Q) $(RM) $(LIBEND2END_FIXTURE_CHTTP2_SOCKET_PAIR_OBJS) @@ -1951,6 +2201,8 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/fixtures/chttp2_socket_pair_one_byte_at_a_time.o: + clean_libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time: $(E) "[CLEAN] Cleaning libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time files" $(Q) $(RM) $(LIBEND2END_FIXTURE_CHTTP2_SOCKET_PAIR_ONE_BYTE_AT_A_TIME_OBJS) @@ -1981,6 +2233,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/cancel_after_accept.o: + clean_libend2end_test_cancel_after_accept: $(E) "[CLEAN] Cleaning libend2end_test_cancel_after_accept files" $(Q) $(RM) $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_OBJS) @@ -2011,6 +2265,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/cancel_after_accept_and_writes_closed.o: + clean_libend2end_test_cancel_after_accept_and_writes_closed: $(E) "[CLEAN] Cleaning libend2end_test_cancel_after_accept_and_writes_closed files" $(Q) $(RM) $(LIBEND2END_TEST_CANCEL_AFTER_ACCEPT_AND_WRITES_CLOSED_OBJS) @@ -2041,6 +2297,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_CANCEL_AFTER_INVOKE_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/cancel_after_invoke.o: + clean_libend2end_test_cancel_after_invoke: $(E) "[CLEAN] Cleaning libend2end_test_cancel_after_invoke files" $(Q) $(RM) $(LIBEND2END_TEST_CANCEL_AFTER_INVOKE_OBJS) @@ -2071,6 +2329,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_CANCEL_BEFORE_INVOKE_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/cancel_before_invoke.o: + clean_libend2end_test_cancel_before_invoke: $(E) "[CLEAN] Cleaning libend2end_test_cancel_before_invoke files" $(Q) $(RM) $(LIBEND2END_TEST_CANCEL_BEFORE_INVOKE_OBJS) @@ -2101,6 +2361,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_CANCEL_IN_A_VACUUM_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/cancel_in_a_vacuum.o: + clean_libend2end_test_cancel_in_a_vacuum: $(E) "[CLEAN] Cleaning libend2end_test_cancel_in_a_vacuum files" $(Q) $(RM) $(LIBEND2END_TEST_CANCEL_IN_A_VACUUM_OBJS) @@ -2131,6 +2393,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_CENSUS_SIMPLE_REQUEST_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/census_simple_request.o: + clean_libend2end_test_census_simple_request: $(E) "[CLEAN] Cleaning libend2end_test_census_simple_request files" $(Q) $(RM) $(LIBEND2END_TEST_CENSUS_SIMPLE_REQUEST_OBJS) @@ -2161,6 +2425,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_DISAPPEARING_SERVER_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/disappearing_server.o: + clean_libend2end_test_disappearing_server: $(E) "[CLEAN] Cleaning libend2end_test_disappearing_server files" $(Q) $(RM) $(LIBEND2END_TEST_DISAPPEARING_SERVER_OBJS) @@ -2191,6 +2457,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.o: + clean_libend2end_test_early_server_shutdown_finishes_inflight_calls: $(E) "[CLEAN] Cleaning libend2end_test_early_server_shutdown_finishes_inflight_calls files" $(Q) $(RM) $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_INFLIGHT_CALLS_OBJS) @@ -2221,6 +2489,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/early_server_shutdown_finishes_tags.o: + clean_libend2end_test_early_server_shutdown_finishes_tags: $(E) "[CLEAN] Cleaning libend2end_test_early_server_shutdown_finishes_tags files" $(Q) $(RM) $(LIBEND2END_TEST_EARLY_SERVER_SHUTDOWN_FINISHES_TAGS_OBJS) @@ -2251,6 +2521,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_INVOKE_LARGE_REQUEST_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/invoke_large_request.o: + clean_libend2end_test_invoke_large_request: $(E) "[CLEAN] Cleaning libend2end_test_invoke_large_request files" $(Q) $(RM) $(LIBEND2END_TEST_INVOKE_LARGE_REQUEST_OBJS) @@ -2281,6 +2553,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_MAX_CONCURRENT_STREAMS_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/max_concurrent_streams.o: + clean_libend2end_test_max_concurrent_streams: $(E) "[CLEAN] Cleaning libend2end_test_max_concurrent_streams files" $(Q) $(RM) $(LIBEND2END_TEST_MAX_CONCURRENT_STREAMS_OBJS) @@ -2311,6 +2585,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_NO_OP_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/no_op.o: + clean_libend2end_test_no_op: $(E) "[CLEAN] Cleaning libend2end_test_no_op files" $(Q) $(RM) $(LIBEND2END_TEST_NO_OP_OBJS) @@ -2341,6 +2617,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_PING_PONG_STREAMING_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/ping_pong_streaming.o: + clean_libend2end_test_ping_pong_streaming: $(E) "[CLEAN] Cleaning libend2end_test_ping_pong_streaming files" $(Q) $(RM) $(LIBEND2END_TEST_PING_PONG_STREAMING_OBJS) @@ -2371,6 +2649,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/request_response_with_binary_metadata_and_payload.o: + clean_libend2end_test_request_response_with_binary_metadata_and_payload: $(E) "[CLEAN] Cleaning libend2end_test_request_response_with_binary_metadata_and_payload files" $(Q) $(RM) $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_BINARY_METADATA_AND_PAYLOAD_OBJS) @@ -2401,6 +2681,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/request_response_with_metadata_and_payload.o: + clean_libend2end_test_request_response_with_metadata_and_payload: $(E) "[CLEAN] Cleaning libend2end_test_request_response_with_metadata_and_payload files" $(Q) $(RM) $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_METADATA_AND_PAYLOAD_OBJS) @@ -2431,6 +2713,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_PAYLOAD_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/request_response_with_payload.o: + clean_libend2end_test_request_response_with_payload: $(E) "[CLEAN] Cleaning libend2end_test_request_response_with_payload files" $(Q) $(RM) $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_PAYLOAD_OBJS) @@ -2461,6 +2745,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.o: + clean_libend2end_test_request_response_with_trailing_metadata_and_payload: $(E) "[CLEAN] Cleaning libend2end_test_request_response_with_trailing_metadata_and_payload files" $(Q) $(RM) $(LIBEND2END_TEST_REQUEST_RESPONSE_WITH_TRAILING_METADATA_AND_PAYLOAD_OBJS) @@ -2491,6 +2777,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_SIMPLE_DELAYED_REQUEST_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/simple_delayed_request.o: + clean_libend2end_test_simple_delayed_request: $(E) "[CLEAN] Cleaning libend2end_test_simple_delayed_request files" $(Q) $(RM) $(LIBEND2END_TEST_SIMPLE_DELAYED_REQUEST_OBJS) @@ -2521,6 +2809,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_SIMPLE_REQUEST_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/simple_request.o: + clean_libend2end_test_simple_request: $(E) "[CLEAN] Cleaning libend2end_test_simple_request files" $(Q) $(RM) $(LIBEND2END_TEST_SIMPLE_REQUEST_OBJS) @@ -2551,6 +2841,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_THREAD_STRESS_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/thread_stress.o: + clean_libend2end_test_thread_stress: $(E) "[CLEAN] Cleaning libend2end_test_thread_stress files" $(Q) $(RM) $(LIBEND2END_TEST_THREAD_STRESS_OBJS) @@ -2581,6 +2873,8 @@ ifneq ($(NO_DEPS),true) -include $(LIBEND2END_TEST_WRITES_DONE_HANGS_WITH_PENDING_READ_DEPS) endif +objs/$(CONFIG)/test/core/end2end/tests/writes_done_hangs_with_pending_read.o: + clean_libend2end_test_writes_done_hangs_with_pending_read: $(E) "[CLEAN] Cleaning libend2end_test_writes_done_hangs_with_pending_read files" $(Q) $(RM) $(LIBEND2END_TEST_WRITES_DONE_HANGS_WITH_PENDING_READ_OBJS) @@ -2625,6 +2919,11 @@ ifneq ($(NO_DEPS),true) endif endif +objs/$(CONFIG)/test/core/end2end/data/test_root_cert.o: +objs/$(CONFIG)/test/core/end2end/data/prod_roots_certs.o: +objs/$(CONFIG)/test/core/end2end/data/server1_cert.o: +objs/$(CONFIG)/test/core/end2end/data/server1_key.o: + clean_libend2end_certs: $(E) "[CLEAN] Cleaning libend2end_certs files" $(Q) $(RM) $(LIBEND2END_CERTS_OBJS) diff --git a/templates/Makefile.template b/templates/Makefile.template index 32c2f18b07b..d0ebb102408 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -762,6 +762,18 @@ endif endif % endif +% for src in lib.src: +% if not proto_re.match(src): +objs/$(CONFIG)/${os.path.splitext(src)[0]}.o: \ +% for src2 in lib.src: +% if proto_re.match(src2): + ${proto_to_cc(src2)}\ +% endif +% endfor +% endif + +% endfor + clean_lib${lib.name}: $(E) "[CLEAN] Cleaning lib${lib.name} files" $(Q) $(RM) $(LIB${lib.name.upper()}_OBJS) From 9b62482e15b9360163ff0d6a8d03cc6e18e97485 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 16:59:48 -0800 Subject: [PATCH 15/24] Make the go code generator compile --- src/compiler/go_generator.cc | 4 ++-- src/compiler/go_generator.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/go_generator.cc b/src/compiler/go_generator.cc index 8beae8dcccf..cf5bb11a19b 100644 --- a/src/compiler/go_generator.cc +++ b/src/compiler/go_generator.cc @@ -31,8 +31,6 @@ * */ -using namespace std; - #include "src/compiler/go_generator.h" #include @@ -42,6 +40,8 @@ using namespace std; #include #include +using namespace std; + namespace grpc_go_generator { bool NoStreaming(const google::protobuf::MethodDescriptor* method) { diff --git a/src/compiler/go_generator.h b/src/compiler/go_generator.h index fd5a05e5374..5744345b563 100644 --- a/src/compiler/go_generator.h +++ b/src/compiler/go_generator.h @@ -44,7 +44,7 @@ class FileDescriptor; namespace grpc_go_generator { -string GetServices(const google::protobuf::FileDescriptor* file); +std::string GetServices(const google::protobuf::FileDescriptor* file); } // namespace grpc_go_generator From de990f915526dacea6896f86fb325274da565e78 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 17:07:23 -0800 Subject: [PATCH 16/24] Initialize gtest correctly --- test/cpp/client/channel_arguments_test.cc | 2 +- test/cpp/client/credentials_test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/client/channel_arguments_test.cc b/test/cpp/client/channel_arguments_test.cc index 9dc0ab3d612..3cd6add167b 100644 --- a/test/cpp/client/channel_arguments_test.cc +++ b/test/cpp/client/channel_arguments_test.cc @@ -119,6 +119,6 @@ TEST_F(ChannelArgumentsTest, SetString) { } // namespace grpc int main(int argc, char** argv) { - + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 1bc95f9ff8a..ea088b87bd5 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -65,7 +65,7 @@ TEST_F(CredentialsTest, InvalidServiceAccountCreds) { } // namespace grpc int main(int argc, char **argv) { - + ::testing::InitGoogleTest(&argc, argv); grpc_init(); int ret = RUN_ALL_TESTS(); grpc_shutdown(); From 7c1d7f7a9a11ff1032bee4e145344a3fc8fe2719 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 17:08:33 -0800 Subject: [PATCH 17/24] Run C++ tests and C tests --- tools/run_tests/run_tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index d678721274f..00831d2d746 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -13,6 +13,7 @@ import watch_dirs # flags required for make for each configuration _CONFIGS = ['dbg', 'opt', 'tsan', 'msan', 'asan'] +_MAKE_TEST_TARGETS = ['buildtests_c', 'buildtests_cxx'] # parse command line argp = argparse.ArgumentParser(description='Run grpc tests.') @@ -44,9 +45,11 @@ def _build_and_run(check_cancelled): if not jobset.run( (['make', '-j', '%d' % (multiprocessing.cpu_count() + 1), - 'buildtests_c', + target, 'CONFIG=%s' % cfg] - for cfg in configs), check_cancelled, maxjobs=1): + for cfg in configs + for target in _MAKE_TEST_TARGETS), + check_cancelled, maxjobs=1): sys.exit(1) # run all the tests From 472f60edac466843148fa46e7b18a972c85d5b64 Mon Sep 17 00:00:00 2001 From: nnoble Date: Mon, 12 Jan 2015 18:40:46 -0800 Subject: [PATCH 18/24] Fixing opensource build. Change on 2015/01/12 by nnoble ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=83810001 --- build.json | 3 +-- src/cpp/client/credentials.cc | 2 +- src/cpp/server/server_credentials.cc | 2 +- vsprojects/vs2013/grpc.vcxproj | 1 - vsprojects/vs2013/grpc_unsecure.vcxproj | 1 - 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/build.json b/build.json index 659b24d0768..385e2c9675e 100644 --- a/build.json +++ b/build.json @@ -282,8 +282,7 @@ "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/tsi/transport_security_test_lib.h" + "src/core/tsi/transport_security_interface.h" ], "deps": [ "gpr" diff --git a/src/cpp/client/credentials.cc b/src/cpp/client/credentials.cc index 430582b263b..cac1d3d106c 100644 --- a/src/cpp/client/credentials.cc +++ b/src/cpp/client/credentials.cc @@ -34,7 +34,7 @@ #include -#include +#include #include #include diff --git a/src/cpp/server/server_credentials.cc b/src/cpp/server/server_credentials.cc index fe6c8f9a986..f9ca1622bac 100644 --- a/src/cpp/server/server_credentials.cc +++ b/src/cpp/server/server_credentials.cc @@ -32,7 +32,7 @@ */ -#include +#include #include diff --git a/vsprojects/vs2013/grpc.vcxproj b/vsprojects/vs2013/grpc.vcxproj index 9a8c0e2edda..9f3ec8c597c 100644 --- a/vsprojects/vs2013/grpc.vcxproj +++ b/vsprojects/vs2013/grpc.vcxproj @@ -91,7 +91,6 @@ - diff --git a/vsprojects/vs2013/grpc_unsecure.vcxproj b/vsprojects/vs2013/grpc_unsecure.vcxproj index 9a8c0e2edda..9f3ec8c597c 100644 --- a/vsprojects/vs2013/grpc_unsecure.vcxproj +++ b/vsprojects/vs2013/grpc_unsecure.vcxproj @@ -91,7 +91,6 @@ - From e1586a7a11d9e6453ac80b264bfd8ef74d451a64 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 12 Jan 2015 22:05:30 -0800 Subject: [PATCH 19/24] Fix alignment --- build.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.json b/build.json index 27c84dbf876..5402a88de94 100644 --- a/build.json +++ b/build.json @@ -1454,7 +1454,7 @@ "deps": [ "grpc++", "grpc", - "gpr" + "gpr" ] }, { @@ -1467,7 +1467,7 @@ "deps": [ "grpc++", "grpc", - "gpr" + "gpr" ] }, { From 3acf05afd8402366e53cc5bd282ee2e8b6f3d329 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Tue, 13 Jan 2015 07:55:34 -0800 Subject: [PATCH 20/24] Fixes the shebang line - fixes the shebang line by moving it above the copyright notice in executables. - also fixes the execution bit on all the binaries --- src/ruby/bin/interop/interop_client.rb | 3 ++- src/ruby/bin/interop/interop_server.rb | 4 ++-- src/ruby/bin/math_client.rb | 5 +++-- src/ruby/bin/math_server.rb | 4 ++-- src/ruby/bin/noproto_client.rb | 3 ++- src/ruby/bin/noproto_server.rb | 3 ++- 6 files changed, 13 insertions(+), 9 deletions(-) mode change 100644 => 100755 src/ruby/bin/interop/interop_client.rb mode change 100644 => 100755 src/ruby/bin/interop/interop_server.rb mode change 100644 => 100755 src/ruby/bin/math_client.rb mode change 100644 => 100755 src/ruby/bin/math_server.rb mode change 100644 => 100755 src/ruby/bin/noproto_client.rb mode change 100644 => 100755 src/ruby/bin/noproto_server.rb diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb old mode 100644 new mode 100755 index d0478bb4d1c..718b0fdb83e --- a/src/ruby/bin/interop/interop_client.rb +++ b/src/ruby/bin/interop/interop_client.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + # Copyright 2014, Google Inc. # All rights reserved. # @@ -27,7 +29,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/usr/bin/env ruby # interop_client is a testing tool that accesses a gRPC interop testing # server and runs a test on it. # diff --git a/src/ruby/bin/interop/interop_server.rb b/src/ruby/bin/interop/interop_server.rb old mode 100644 new mode 100755 index 53e271e80d5..63071f3ec2e --- a/src/ruby/bin/interop/interop_server.rb +++ b/src/ruby/bin/interop/interop_server.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + # Copyright 2014, Google Inc. # All rights reserved. # @@ -27,8 +29,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/usr/bin/env ruby -# # interop_server is a Testing app that runs a gRPC interop testing server. # # It helps validate interoperation b/w gRPC in different environments diff --git a/src/ruby/bin/math_client.rb b/src/ruby/bin/math_client.rb old mode 100644 new mode 100755 index 5cba9317f4f..4df333d085d --- a/src/ruby/bin/math_client.rb +++ b/src/ruby/bin/math_client.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + # Copyright 2014, Google Inc. # All rights reserved. # @@ -27,8 +29,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. -#!/usr/bin/env ruby -# + # Sample app that accesses a Calc service running on a Ruby gRPC server and # helps validate RpcServer as a gRPC server using proto2 serialization. # diff --git a/src/ruby/bin/math_server.rb b/src/ruby/bin/math_server.rb old mode 100644 new mode 100755 index a0f301c3e79..0e47f71e668 --- a/src/ruby/bin/math_server.rb +++ b/src/ruby/bin/math_server.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + # Copyright 2014, Google Inc. # All rights reserved. # @@ -27,8 +29,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/usr/bin/env ruby -# # Sample gRPC Ruby server that implements the Math::Calc service and helps # validate GRPC::RpcServer as GRPC implementation using proto2 serialization. # diff --git a/src/ruby/bin/noproto_client.rb b/src/ruby/bin/noproto_client.rb old mode 100644 new mode 100755 index 50ae9fb68f8..34bdf545ee9 --- a/src/ruby/bin/noproto_client.rb +++ b/src/ruby/bin/noproto_client.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + # Copyright 2014, Google Inc. # All rights reserved. # @@ -27,7 +29,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/usr/bin/env ruby # Sample app that helps validate RpcServer without protobuf serialization. # # Usage: $ ruby -S path/to/noproto_client.rb diff --git a/src/ruby/bin/noproto_server.rb b/src/ruby/bin/noproto_server.rb old mode 100644 new mode 100755 index d410827b22d..1bdc192f023 --- a/src/ruby/bin/noproto_server.rb +++ b/src/ruby/bin/noproto_server.rb @@ -1,3 +1,5 @@ +#!/usr/bin/env ruby + # Copyright 2014, Google Inc. # All rights reserved. # @@ -27,7 +29,6 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#!/usr/bin/env ruby # Sample app that helps validate RpcServer without protobuf serialization. # # Usage: $ path/to/noproto_server.rb From b5dcec5a2e917aebd0d59772ee4aa6737064494e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 13 Jan 2015 11:13:42 -0800 Subject: [PATCH 21/24] clang-format codebase --- .clang-format | 65 + include/grpc++/async_server_context.h | 2 +- include/grpc++/channel_interface.h | 8 +- include/grpc++/config.h | 1 - include/grpc++/credentials.h | 1 - include/grpc++/impl/rpc_service_method.h | 16 +- include/grpc++/status_code_enum.h | 1 - include/grpc/byte_buffer.h | 2 +- include/grpc/byte_buffer_reader.h | 2 +- include/grpc/grpc.h | 2 +- include/grpc/status.h | 3 +- include/grpc/support/alloc.h | 2 +- include/grpc/support/atm.h | 2 +- include/grpc/support/atm_gcc_atomic.h | 2 +- include/grpc/support/atm_gcc_sync.h | 2 +- include/grpc/support/atm_win32.h | 4 +- include/grpc/support/cancellable_platform.h | 2 +- include/grpc/support/cmdline.h | 2 +- include/grpc/support/histogram.h | 2 +- include/grpc/support/log.h | 2 +- include/grpc/support/slice.h | 2 +- include/grpc/support/slice_buffer.h | 2 +- include/grpc/support/string.h | 2 +- include/grpc/support/sync.h | 2 +- include/grpc/support/sync_generic.h | 2 +- include/grpc/support/sync_posix.h | 2 +- include/grpc/support/sync_win32.h | 2 +- include/grpc/support/thd.h | 2 +- include/grpc/support/thd_posix.h | 2 +- include/grpc/support/thd_win32.h | 2 +- include/grpc/support/time.h | 2 +- include/grpc/support/time_posix.h | 2 +- include/grpc/support/time_win32.h | 2 +- include/grpc/support/useful.h | 2 +- src/compiler/cpp_generator.cc | 57 +- src/compiler/cpp_generator_helpers.h | 3 +- src/compiler/cpp_plugin.cc | 7 +- src/compiler/go_generator.cc | 214 +- src/compiler/go_plugin.cc | 4 +- src/compiler/ruby_generator.cc | 13 +- src/compiler/ruby_generator_helpers-inl.h | 8 +- src/compiler/ruby_generator_map-inl.h | 6 +- src/compiler/ruby_generator_string-inl.h | 6 +- src/core/channel/channel_args.h | 2 +- src/core/channel/channel_stack.c | 11 +- src/core/channel/channel_stack.h | 2 +- src/core/channel/client_channel.h | 2 +- src/core/channel/client_setup.h | 2 +- src/core/channel/connected_channel.c | 6 +- src/core/channel/connected_channel.h | 2 +- src/core/channel/metadata_buffer.c | 2 +- src/core/channel/metadata_buffer.h | 2 +- src/core/channel/noop_filter.c | 4 +- src/core/channel/noop_filter.h | 2 +- src/core/compression/algorithm.h | 2 +- src/core/compression/message_compress.h | 2 +- src/core/httpcli/format_request.h | 2 +- src/core/httpcli/httpcli.h | 2 +- src/core/httpcli/httpcli_security_context.h | 2 +- src/core/httpcli/parser.h | 2 +- src/core/security/auth.c | 5 +- src/core/security/auth.h | 2 +- src/core/security/credentials.h | 2 +- src/core/security/google_root_certs.h | 2 +- src/core/security/secure_endpoint.h | 2 +- src/core/security/secure_transport_setup.h | 2 +- src/core/security/security_context.c | 13 +- src/core/security/security_context.h | 2 +- src/core/security/server_secure_chttp2.c | 3 +- src/core/statistics/census_interface.h | 2 +- src/core/statistics/census_rpc_stats.h | 2 +- src/core/support/alloc.c | 4 +- src/core/support/cpu.h | 2 +- src/core/support/murmur_hash.h | 2 +- src/core/support/thd_internal.h | 2 +- src/core/surface/call.c | 2 +- src/core/surface/call.h | 2 +- src/core/surface/channel.c | 2 +- src/core/surface/channel.h | 2 +- src/core/surface/client.c | 7 +- src/core/surface/client.h | 2 +- src/core/surface/completion_queue.h | 2 +- src/core/surface/event_string.h | 2 +- src/core/surface/server.c | 4 +- src/core/surface/server.h | 2 +- src/core/surface/surface_trace.h | 2 +- src/core/transport/chttp2/frame.h | 2 +- src/core/transport/chttp2/frame_data.c | 1 - src/core/transport/chttp2/frame_data.h | 2 +- src/core/transport/chttp2/frame_ping.h | 2 +- src/core/transport/chttp2/frame_rst_stream.h | 2 +- src/core/transport/chttp2/frame_settings.h | 2 +- .../transport/chttp2/frame_window_update.h | 2 +- src/core/transport/chttp2/hpack_parser.h | 2 +- src/core/transport/chttp2/hpack_table.c | 124 +- src/core/transport/chttp2/hpack_table.h | 2 +- src/core/transport/chttp2/http2_errors.h | 2 +- src/core/transport/chttp2/status_conversion.h | 2 +- src/core/transport/chttp2/stream_encoder.h | 2 +- src/core/transport/chttp2/stream_map.h | 2 +- src/core/transport/chttp2/varint.h | 2 +- src/core/transport/chttp2_transport.h | 2 +- src/core/transport/metadata.h | 2 +- src/core/transport/stream_op.h | 2 +- src/core/transport/transport.h | 2 +- src/core/transport/transport_impl.h | 2 +- src/core/tsi/fake_transport_security.c | 24 +- src/core/tsi/fake_transport_security.h | 3 +- src/core/tsi/ssl_transport_security.c | 78 +- src/core/tsi/ssl_transport_security.h | 3 +- src/core/tsi/transport_security.c | 35 +- src/core/tsi/transport_security.h | 4 +- src/core/tsi/transport_security_interface.h | 31 +- src/cpp/client/channel.cc | 8 +- src/cpp/client/channel.h | 8 +- src/cpp/client/credentials.cc | 2 - src/cpp/proto/proto_utils.cc | 6 +- src/cpp/proto/proto_utils.h | 3 +- src/cpp/server/async_server_context.cc | 3 +- src/cpp/server/server_context_impl.cc | 4 +- src/cpp/server/server_credentials.cc | 1 - src/cpp/server/server_rpc_handler.cc | 12 +- src/cpp/stream/stream_context.cc | 3 +- src/cpp/stream/stream_context.h | 13 +- src/cpp/util/status.cc | 1 - src/php/ext/grpc/byte_buffer.c | 9 +- src/php/ext/grpc/byte_buffer.h | 3 +- src/php/ext/grpc/call.c | 293 +- src/php/ext/grpc/call.h | 17 +- src/php/ext/grpc/channel.c | 89 +- src/php/ext/grpc/completion_queue.c | 76 +- src/php/ext/grpc/credentials.c | 86 +- src/php/ext/grpc/event.c | 63 +- src/php/ext/grpc/php_grpc.c | 266 +- src/php/ext/grpc/php_grpc.h | 23 +- src/php/ext/grpc/server.c | 107 +- src/php/ext/grpc/server_credentials.c | 56 +- src/php/ext/grpc/timeval.c | 151 +- src/ruby/ext/grpc/rb_byte_buffer.c | 10 +- src/ruby/ext/grpc/rb_byte_buffer.h | 2 +- src/ruby/ext/grpc/rb_call.c | 38 +- src/ruby/ext/grpc/rb_call.h | 2 +- src/ruby/ext/grpc/rb_channel.c | 4 +- src/ruby/ext/grpc/rb_channel.h | 2 +- src/ruby/ext/grpc/rb_channel_args.c | 11 +- src/ruby/ext/grpc/rb_channel_args.h | 3 +- src/ruby/ext/grpc/rb_completion_queue.c | 43 +- src/ruby/ext/grpc/rb_completion_queue.h | 2 +- src/ruby/ext/grpc/rb_credentials.c | 22 +- src/ruby/ext/grpc/rb_credentials.h | 2 +- src/ruby/ext/grpc/rb_event.c | 67 +- src/ruby/ext/grpc/rb_event.h | 2 +- src/ruby/ext/grpc/rb_grpc.c | 43 +- src/ruby/ext/grpc/rb_grpc.h | 2 +- src/ruby/ext/grpc/rb_metadata.c | 9 +- src/ruby/ext/grpc/rb_metadata.h | 4 +- src/ruby/ext/grpc/rb_server.c | 8 +- src/ruby/ext/grpc/rb_server.h | 2 +- src/ruby/ext/grpc/rb_server_credentials.c | 15 +- src/ruby/ext/grpc/rb_server_credentials.h | 2 +- test/core/channel/channel_stack_test.c | 4 +- test/core/channel/metadata_buffer_test.c | 4 +- test/core/end2end/cq_verifier.h | 2 +- test/core/end2end/data/prod_roots_certs.c | 22479 ++++++++-------- test/core/end2end/data/ssl_test_data.h | 2 +- test/core/end2end/dualstack_socket_test.c | 1 - test/core/end2end/end2end_tests.h | 2 +- .../chttp2_socket_pair_one_byte_at_a_time.c | 6 +- test/core/end2end/tests/cancel_after_accept.c | 1 - test/core/end2end/tests/no_op.c | 5 +- ...quest_response_with_metadata_and_payload.c | 1 - test/core/httpcli/format_request_test.c | 1 - .../core/surface/completion_queue_benchmark.c | 14 +- test/core/surface/completion_queue_test.c | 20 +- test/core/transport/transport_end2end_tests.h | 2 +- test/core/util/grpc_profiler.h | 2 +- test/core/util/port.h | 2 +- test/core/util/port_posix.c | 2 +- test/core/util/slice_splitter.h | 2 +- test/core/util/test_config.h | 2 +- test/cpp/client/channel_arguments_test.cc | 5 +- test/cpp/client/credentials_test.cc | 1 - test/cpp/end2end/end2end_test.cc | 4 +- .../end2end/sync_client_async_server_test.cc | 5 +- test/cpp/interop/client.cc | 1 - test/cpp/qps/client.cc | 12 +- test/cpp/util/status_test.cc | 1 - test/cpp/util/time_test.cc | 1 - tools/clang-format/clang-format-all.sh | 8 + 189 files changed, 12456 insertions(+), 12667 deletions(-) create mode 100644 .clang-format mode change 100755 => 100644 src/php/ext/grpc/byte_buffer.c mode change 100755 => 100644 src/php/ext/grpc/byte_buffer.h mode change 100755 => 100644 src/php/ext/grpc/call.c mode change 100755 => 100644 src/php/ext/grpc/call.h mode change 100755 => 100644 src/php/ext/grpc/channel.c mode change 100755 => 100644 src/php/ext/grpc/completion_queue.c mode change 100755 => 100644 src/php/ext/grpc/credentials.c mode change 100755 => 100644 src/php/ext/grpc/event.c mode change 100755 => 100644 src/php/ext/grpc/php_grpc.c mode change 100755 => 100644 src/php/ext/grpc/php_grpc.h mode change 100755 => 100644 src/php/ext/grpc/server.c mode change 100755 => 100644 src/php/ext/grpc/server_credentials.c mode change 100755 => 100644 src/php/ext/grpc/timeval.c create mode 100755 tools/clang-format/clang-format-all.sh diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000000..38804f78c4e --- /dev/null +++ b/.clang-format @@ -0,0 +1,65 @@ +--- +Language: Cpp +# BasedOnStyle: Google +AccessModifierOffset: -1 +AlignAfterOpenBracket: true +AlignEscapedNewlinesLeft: true +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: true +AllowShortLoopsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakTemplateDeclarations: true +AlwaysBreakBeforeMultilineStrings: true +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BinPackParameters: true +BinPackArguments: true +ColumnLimit: 80 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +DerivePointerAlignment: true +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: true +IndentWrappedFunctionNames: false +IndentFunctionDeclarationAfterType: false +MaxEmptyLinesToKeep: 1 +KeepEmptyLinesAtTheStartOfBlocks: false +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +SpacesBeforeTrailingComments: 2 +Cpp11BracedListStyle: true +Standard: Auto +IndentWidth: 2 +TabWidth: 8 +UseTab: Never +BreakBeforeBraces: Attach +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterCStyleCast: false +SpacesInContainerLiterals: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +CommentPragmas: '^ IWYU pragma:' +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +SpaceBeforeParens: ControlStatements +DisableFormat: false +... + diff --git a/include/grpc++/async_server_context.h b/include/grpc++/async_server_context.h index 237a6856a49..c038286ac13 100644 --- a/include/grpc++/async_server_context.h +++ b/include/grpc++/async_server_context.h @@ -87,7 +87,7 @@ class AsyncServerContext { system_clock::time_point absolute_deadline_; google::protobuf::Message* request_; // not owned - grpc_call* call_; // owned + grpc_call* call_; // owned }; } // namespace grpc diff --git a/include/grpc++/channel_interface.h b/include/grpc++/channel_interface.h index 4b9d76e0d10..9ed35422b85 100644 --- a/include/grpc++/channel_interface.h +++ b/include/grpc++/channel_interface.h @@ -57,10 +57,10 @@ class ChannelInterface { const google::protobuf::Message& request, google::protobuf::Message* result) = 0; - virtual StreamContextInterface* CreateStream(const RpcMethod& method, - ClientContext* context, - const google::protobuf::Message* request, - google::protobuf::Message* result) = 0; + virtual StreamContextInterface* CreateStream( + const RpcMethod& method, ClientContext* context, + const google::protobuf::Message* request, + google::protobuf::Message* result) = 0; }; } // namespace grpc diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 153b288f0c0..52913fbf0f9 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -39,7 +39,6 @@ namespace grpc { typedef std::string string; - } #endif // __GRPCPP_CONFIG_H__ diff --git a/include/grpc++/credentials.h b/include/grpc++/credentials.h index a8debbf7cf2..987d890b4f8 100644 --- a/include/grpc++/credentials.h +++ b/include/grpc++/credentials.h @@ -112,7 +112,6 @@ class CredentialsFactory { const grpc::string& authorization_token, const grpc::string& authority_selector); - // Combines two credentials objects into a composite credentials static std::unique_ptr ComposeCredentials( const std::unique_ptr& creds1, diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h index 15ff9cab1a4..620de5e67fb 100644 --- a/include/grpc++/impl/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -55,14 +55,17 @@ class MethodHandler { public: virtual ~MethodHandler() {} struct HandlerParameter { - HandlerParameter(ServerContext* context, const google::protobuf::Message* req, + HandlerParameter(ServerContext* context, + const google::protobuf::Message* req, google::protobuf::Message* resp) : server_context(context), request(req), response(resp), stream_context(nullptr) {} - HandlerParameter(ServerContext* context, const google::protobuf::Message* req, - google::protobuf::Message* resp, StreamContextInterface* stream) + HandlerParameter(ServerContext* context, + const google::protobuf::Message* req, + google::protobuf::Message* resp, + StreamContextInterface* stream) : server_context(context), request(req), response(resp), @@ -171,7 +174,8 @@ class RpcServiceMethod : public RpcMethod { public: // Takes ownership of the handler and two prototype objects. RpcServiceMethod(const char* name, RpcMethod::RpcType type, - MethodHandler* handler, google::protobuf::Message* request_prototype, + MethodHandler* handler, + google::protobuf::Message* request_prototype, google::protobuf::Message* response_prototype) : RpcMethod(name, type), handler_(handler), @@ -180,7 +184,9 @@ class RpcServiceMethod : public RpcMethod { MethodHandler* handler() { return handler_.get(); } - google::protobuf::Message* AllocateRequestProto() { return request_prototype_->New(); } + google::protobuf::Message* AllocateRequestProto() { + return request_prototype_->New(); + } google::protobuf::Message* AllocateResponseProto() { return response_prototype_->New(); } diff --git a/include/grpc++/status_code_enum.h b/include/grpc++/status_code_enum.h index 964420dcc4a..4e0fda13db6 100644 --- a/include/grpc++/status_code_enum.h +++ b/include/grpc++/status_code_enum.h @@ -34,7 +34,6 @@ #ifndef __GRPCPP_STATUS_CODE_ENUM_H__ #define __GRPCPP_STATUS_CODE_ENUM_H__ - namespace grpc { enum StatusCode { diff --git a/include/grpc/byte_buffer.h b/include/grpc/byte_buffer.h index 27ca63e6fac..094d3016e1e 100644 --- a/include/grpc/byte_buffer.h +++ b/include/grpc/byte_buffer.h @@ -47,4 +47,4 @@ struct grpc_byte_buffer { } data; }; -#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 5f1c160e158..6386db65929 100644 --- a/include/grpc/byte_buffer_reader.h +++ b/include/grpc/byte_buffer_reader.h @@ -46,4 +46,4 @@ struct grpc_byte_buffer_reader { } current; }; -#endif /* __GRPC_BYTE_BUFFER_READER_H__ */ +#endif /* __GRPC_BYTE_BUFFER_READER_H__ */ diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 085393084d2..d8fd03b8999 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -453,4 +453,4 @@ void grpc_server_destroy(grpc_server *server); } #endif -#endif /* __GRPC_GRPC_H__ */ +#endif /* __GRPC_GRPC_H__ */ diff --git a/include/grpc/status.h b/include/grpc/status.h index a4ce312bf26..630b7769fd5 100644 --- a/include/grpc/status.h +++ b/include/grpc/status.h @@ -34,7 +34,6 @@ #ifndef __GRPC_STATUS_H__ #define __GRPC_STATUS_H__ - #ifdef __cplusplus extern "C" { #endif @@ -200,4 +199,4 @@ typedef enum { } #endif -#endif /* __GRPC_STATUS_H__ */ +#endif /* __GRPC_STATUS_H__ */ diff --git a/include/grpc/support/alloc.h b/include/grpc/support/alloc.h index d613d856831..fa9cc4bf7c7 100644 --- a/include/grpc/support/alloc.h +++ b/include/grpc/support/alloc.h @@ -55,4 +55,4 @@ void gpr_free_aligned(void *ptr); } #endif -#endif /* __GRPC_SUPPORT_ALLOC_H__ */ +#endif /* __GRPC_SUPPORT_ALLOC_H__ */ diff --git a/include/grpc/support/atm.h b/include/grpc/support/atm.h index d9fd3832096..5e613f1ba98 100644 --- a/include/grpc/support/atm.h +++ b/include/grpc/support/atm.h @@ -89,4 +89,4 @@ #error could not determine platform for atm #endif -#endif /* __GRPC_SUPPORT_ATM_H__ */ +#endif /* __GRPC_SUPPORT_ATM_H__ */ diff --git a/include/grpc/support/atm_gcc_atomic.h b/include/grpc/support/atm_gcc_atomic.h index 4e0a7ab1c6b..896dd842ec2 100644 --- a/include/grpc/support/atm_gcc_atomic.h +++ b/include/grpc/support/atm_gcc_atomic.h @@ -66,4 +66,4 @@ static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { __ATOMIC_RELAXED); } -#endif /* __GRPC_SUPPORT_ATM_GCC_ATOMIC_H__ */ +#endif /* __GRPC_SUPPORT_ATM_GCC_ATOMIC_H__ */ diff --git a/include/grpc/support/atm_gcc_sync.h b/include/grpc/support/atm_gcc_sync.h index 976f2977bb5..1a3a10c911b 100644 --- a/include/grpc/support/atm_gcc_sync.h +++ b/include/grpc/support/atm_gcc_sync.h @@ -70,4 +70,4 @@ static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) { #define gpr_atm_acq_cas(p, o, n) (__sync_bool_compare_and_swap((p), (o), (n))) #define gpr_atm_rel_cas(p, o, n) gpr_atm_acq_cas((p), (o), (n)) -#endif /* __GRPC_SUPPORT_ATM_GCC_SYNC_H__ */ +#endif /* __GRPC_SUPPORT_ATM_GCC_SYNC_H__ */ diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h index d32ffd46a29..19881e83ad8 100644 --- a/include/grpc/support/atm_win32.h +++ b/include/grpc/support/atm_win32.h @@ -55,8 +55,8 @@ static __inline void gpr_atm_rel_store(gpr_atm *p, gpr_atm value) { } static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { - /* InterlockedCompareExchangePointerNoFence() not available on vista or - windows7 */ +/* InterlockedCompareExchangePointerNoFence() not available on vista or + windows7 */ #ifdef GPR_ARCH_64 return o == (gpr_atm)InterlockedCompareExchangeAcquire64(p, n, o); #else diff --git a/include/grpc/support/cancellable_platform.h b/include/grpc/support/cancellable_platform.h index d67302dd904..db099b83818 100644 --- a/include/grpc/support/cancellable_platform.h +++ b/include/grpc/support/cancellable_platform.h @@ -53,4 +53,4 @@ typedef struct { struct gpr_cancellable_list_ waiters; } gpr_cancellable; -#endif /* __GRPC_SUPPORT_CANCELLABLE_PLATFORM_H__ */ +#endif /* __GRPC_SUPPORT_CANCELLABLE_PLATFORM_H__ */ diff --git a/include/grpc/support/cmdline.h b/include/grpc/support/cmdline.h index 60e8035c754..ba3ffe42cc0 100644 --- a/include/grpc/support/cmdline.h +++ b/include/grpc/support/cmdline.h @@ -92,4 +92,4 @@ void gpr_cmdline_destroy(gpr_cmdline *cl); } #endif -#endif /* __GRPC_SUPPORT_CMDLINE_H__ */ +#endif /* __GRPC_SUPPORT_CMDLINE_H__ */ diff --git a/include/grpc/support/histogram.h b/include/grpc/support/histogram.h index 13dce3bdcde..e67323d5d3d 100644 --- a/include/grpc/support/histogram.h +++ b/include/grpc/support/histogram.h @@ -63,4 +63,4 @@ double gpr_histogram_sum_of_squares(gpr_histogram *histogram); } #endif -#endif /* __GRPC_SUPPORT_HISTOGRAM_H__ */ +#endif /* __GRPC_SUPPORT_HISTOGRAM_H__ */ diff --git a/include/grpc/support/log.h b/include/grpc/support/log.h index f92114a8e3e..1c2857dad38 100644 --- a/include/grpc/support/log.h +++ b/include/grpc/support/log.h @@ -105,4 +105,4 @@ void gpr_set_log_function(gpr_log_func func); } #endif -#endif /* __GRPC_SUPPORT_LOG_H__ */ +#endif /* __GRPC_SUPPORT_LOG_H__ */ diff --git a/include/grpc/support/slice.h b/include/grpc/support/slice.h index a89073c56a1..597b5688fce 100644 --- a/include/grpc/support/slice.h +++ b/include/grpc/support/slice.h @@ -173,4 +173,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 e4d204b8274..0ad735a47a3 100644 --- a/include/grpc/support/slice_buffer.h +++ b/include/grpc/support/slice_buffer.h @@ -81,4 +81,4 @@ void gpr_slice_buffer_reset_and_unref(gpr_slice_buffer *sb); } #endif -#endif /* __GRPC_SUPPORT_SLICE_BUFFER_H__ */ +#endif /* __GRPC_SUPPORT_SLICE_BUFFER_H__ */ diff --git a/include/grpc/support/string.h b/include/grpc/support/string.h index a7acfdab882..68e7452a7fa 100644 --- a/include/grpc/support/string.h +++ b/include/grpc/support/string.h @@ -74,4 +74,4 @@ int gpr_asprintf(char **strp, const char *format, ...); } #endif -#endif /* __GRPC_SUPPORT_STRING_H__ */ +#endif /* __GRPC_SUPPORT_STRING_H__ */ diff --git a/include/grpc/support/sync.h b/include/grpc/support/sync.h index 3e435a6e4c8..6f0f684ae7a 100644 --- a/include/grpc/support/sync.h +++ b/include/grpc/support/sync.h @@ -345,4 +345,4 @@ gpr_intptr gpr_stats_read(const gpr_stats_counter *c); } #endif -#endif /* __GRPC_SUPPORT_SYNC_H__ */ +#endif /* __GRPC_SUPPORT_SYNC_H__ */ diff --git a/include/grpc/support/sync_generic.h b/include/grpc/support/sync_generic.h index 0c8a9924395..1a595e7ffc0 100644 --- a/include/grpc/support/sync_generic.h +++ b/include/grpc/support/sync_generic.h @@ -52,4 +52,4 @@ typedef struct { gpr_atm value; } gpr_stats_counter; #define GPR_STATS_INIT \ { 0 } -#endif /* __GRPC_SUPPORT_SYNC_GENERIC_H__ */ +#endif /* __GRPC_SUPPORT_SYNC_GENERIC_H__ */ diff --git a/include/grpc/support/sync_posix.h b/include/grpc/support/sync_posix.h index 6787695cfb2..d51c268dc98 100644 --- a/include/grpc/support/sync_posix.h +++ b/include/grpc/support/sync_posix.h @@ -45,4 +45,4 @@ typedef pthread_once_t gpr_once; #define GPR_ONCE_INIT PTHREAD_ONCE_INIT -#endif /* __GRPC_SUPPORT_SYNC_POSIX_H__ */ +#endif /* __GRPC_SUPPORT_SYNC_POSIX_H__ */ diff --git a/include/grpc/support/sync_win32.h b/include/grpc/support/sync_win32.h index b3230dcc0df..6e256663501 100644 --- a/include/grpc/support/sync_win32.h +++ b/include/grpc/support/sync_win32.h @@ -49,4 +49,4 @@ typedef CONDITION_VARIABLE gpr_cv; typedef INIT_ONCE gpr_once; #define GPR_ONCE_INIT INIT_ONCE_STATIC_INIT -#endif /* __GRPC_SUPPORT_SYNC_WIN32_H__ */ +#endif /* __GRPC_SUPPORT_SYNC_WIN32_H__ */ diff --git a/include/grpc/support/thd.h b/include/grpc/support/thd.h index 18a1e80d06c..91e0c9f16f5 100644 --- a/include/grpc/support/thd.h +++ b/include/grpc/support/thd.h @@ -76,4 +76,4 @@ gpr_thd_options gpr_thd_options_default(void); } #endif -#endif /* __GRPC_SUPPORT_THD_H__ */ +#endif /* __GRPC_SUPPORT_THD_H__ */ diff --git a/include/grpc/support/thd_posix.h b/include/grpc/support/thd_posix.h index 3cfa5124027..b688e45bc54 100644 --- a/include/grpc/support/thd_posix.h +++ b/include/grpc/support/thd_posix.h @@ -39,4 +39,4 @@ typedef pthread_t gpr_thd_id; -#endif /* __GRPC_SUPPORT_THD_POSIX_H__ */ +#endif /* __GRPC_SUPPORT_THD_POSIX_H__ */ diff --git a/include/grpc/support/thd_win32.h b/include/grpc/support/thd_win32.h index 6fa576e4a4f..b4ab3c7271f 100644 --- a/include/grpc/support/thd_win32.h +++ b/include/grpc/support/thd_win32.h @@ -41,4 +41,4 @@ typedef int gpr_thd_id; -#endif /* __GRPC_SUPPORT_THD_WIN32_H__ */ +#endif /* __GRPC_SUPPORT_THD_WIN32_H__ */ diff --git a/include/grpc/support/time.h b/include/grpc/support/time.h index d5ab9f53052..6327a2cffb6 100644 --- a/include/grpc/support/time.h +++ b/include/grpc/support/time.h @@ -113,4 +113,4 @@ double gpr_timespec_to_micros(gpr_timespec t); } #endif -#endif /* __GRPC_SUPPORT_TIME_H__ */ +#endif /* __GRPC_SUPPORT_TIME_H__ */ diff --git a/include/grpc/support/time_posix.h b/include/grpc/support/time_posix.h index 72ebf5f3fd1..9ff6f7f4933 100644 --- a/include/grpc/support/time_posix.h +++ b/include/grpc/support/time_posix.h @@ -40,4 +40,4 @@ typedef struct timespec gpr_timespec; -#endif /* __GRPC_SUPPORT_TIME_POSIX_H__ */ +#endif /* __GRPC_SUPPORT_TIME_POSIX_H__ */ diff --git a/include/grpc/support/time_win32.h b/include/grpc/support/time_win32.h index 2450550bd6a..e62ad64b8f5 100644 --- a/include/grpc/support/time_win32.h +++ b/include/grpc/support/time_win32.h @@ -43,4 +43,4 @@ typedef struct gpr_timespec { long tv_nsec; } gpr_timespec; -#endif /* __GRPC_SUPPORT_TIME_WIN32_H__ */ +#endif /* __GRPC_SUPPORT_TIME_WIN32_H__ */ diff --git a/include/grpc/support/useful.h b/include/grpc/support/useful.h index c44d8e05a16..c451e9cc83d 100644 --- a/include/grpc/support/useful.h +++ b/include/grpc/support/useful.h @@ -45,4 +45,4 @@ #define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) -#endif /* __GRPC_SUPPORT_USEFUL_H__ */ +#endif /* __GRPC_SUPPORT_USEFUL_H__ */ diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 43a04be931d..11160498068 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -43,13 +43,11 @@ namespace grpc_cpp_generator { namespace { bool NoStreaming(const google::protobuf::MethodDescriptor* method) { - return !method->client_streaming() && - !method->server_streaming(); + return !method->client_streaming() && !method->server_streaming(); } bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) { - return method->client_streaming() && - !method->server_streaming(); + return method->client_streaming() && !method->server_streaming(); } bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) { @@ -57,8 +55,7 @@ bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) { } bool BidiStreaming(const google::protobuf::MethodDescriptor* method) { - return method->client_streaming() && - method->server_streaming(); + return method->client_streaming() && method->server_streaming(); } bool HasClientOnlyStreaming(const google::protobuf::FileDescriptor* file) { @@ -132,8 +129,8 @@ string GetSourceIncludes() { } void PrintHeaderClientMethod(google::protobuf::io::Printer* printer, - const google::protobuf::MethodDescriptor* method, - map* vars) { + const google::protobuf::MethodDescriptor* method, + map* vars) { (*vars)["Method"] = method->name(); (*vars)["Request"] = grpc_cpp_generator::ClassName(method->input_type(), true); @@ -204,8 +201,9 @@ void PrintHeaderService(google::protobuf::io::Printer* printer, printer->Indent(); // Client side - printer->Print("class Stub : public ::grpc::InternalStub {\n" - " public:\n"); + printer->Print( + "class Stub : public ::grpc::InternalStub {\n" + " public:\n"); printer->Indent(); for (int i = 0; i < service->method_count(); ++i) { PrintHeaderClientMethod(printer, service->method(i), vars); @@ -219,8 +217,9 @@ void PrintHeaderService(google::protobuf::io::Printer* printer, printer->Print("\n"); // Server side - printer->Print("class Service {\n" - " public:\n"); + printer->Print( + "class Service {\n" + " public:\n"); printer->Indent(); printer->Print("Service() : service_(nullptr) {}\n"); printer->Print("virtual ~Service();\n"); @@ -229,8 +228,9 @@ void PrintHeaderService(google::protobuf::io::Printer* printer, } printer->Print("::grpc::RpcService* service();\n"); printer->Outdent(); - printer->Print(" private:\n" - " ::grpc::RpcService* service_;\n"); + printer->Print( + " private:\n" + " ::grpc::RpcService* service_;\n"); printer->Print("};\n"); printer->Outdent(); @@ -251,8 +251,8 @@ string GetHeaderServices(const google::protobuf::FileDescriptor* file) { } void PrintSourceClientMethod(google::protobuf::io::Printer* printer, - const google::protobuf::MethodDescriptor* method, - map* vars) { + const google::protobuf::MethodDescriptor* method, + map* vars) { (*vars)["Method"] = method->name(); (*vars)["Request"] = grpc_cpp_generator::ClassName(method->input_type(), true); @@ -308,8 +308,8 @@ void PrintSourceClientMethod(google::protobuf::io::Printer* printer, } void PrintSourceServerMethod(google::protobuf::io::Printer* printer, - const google::protobuf::MethodDescriptor* method, - map* vars) { + const google::protobuf::MethodDescriptor* method, + map* vars) { (*vars)["Method"] = method->name(); (*vars)["Request"] = grpc_cpp_generator::ClassName(method->input_type(), true); @@ -362,12 +362,12 @@ void PrintSourceService(google::protobuf::io::Printer* printer, map* vars) { (*vars)["Service"] = service->name(); printer->Print(*vars, - "$Service$::Stub* $Service$::NewStub(" - "const std::shared_ptr<::grpc::ChannelInterface>& channel) {\n" - " $Service$::Stub* stub = new $Service$::Stub();\n" - " stub->set_channel(channel);\n" - " return stub;\n" - "};\n\n"); + "$Service$::Stub* $Service$::NewStub(" + "const std::shared_ptr<::grpc::ChannelInterface>& channel) {\n" + " $Service$::Stub* stub = new $Service$::Stub();\n" + " stub->set_channel(channel);\n" + " return stub;\n" + "};\n\n"); for (int i = 0; i < service->method_count(); ++i) { PrintSourceClientMethod(printer, service->method(i), vars); } @@ -380,11 +380,12 @@ void PrintSourceService(google::protobuf::io::Printer* printer, PrintSourceServerMethod(printer, service->method(i), vars); } printer->Print(*vars, - "::grpc::RpcService* $Service$::Service::service() {\n"); + "::grpc::RpcService* $Service$::Service::service() {\n"); printer->Indent(); - printer->Print("if (service_ != nullptr) {\n" - " return service_;\n" - "}\n"); + printer->Print( + "if (service_ != nullptr) {\n" + " return service_;\n" + "}\n"); printer->Print("service_ = new ::grpc::RpcService();\n"); for (int i = 0; i < service->method_count(); ++i) { const google::protobuf::MethodDescriptor* method = service->method(i); diff --git a/src/compiler/cpp_generator_helpers.h b/src/compiler/cpp_generator_helpers.h index 8d8b03ea432..ba251faf29a 100644 --- a/src/compiler/cpp_generator_helpers.h +++ b/src/compiler/cpp_generator_helpers.h @@ -85,7 +85,8 @@ inline string DotsToUnderscores(const string& name) { return StringReplace(name, ".", "_"); } -inline string ClassName(const google::protobuf::Descriptor* descriptor, bool qualified) { +inline string ClassName(const google::protobuf::Descriptor* descriptor, + bool qualified) { // Find "outer", the descriptor of the top-level message in which // "descriptor" is embedded. const google::protobuf::Descriptor* outer = descriptor; diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc index 7aa745a4f17..17836b16125 100644 --- a/src/compiler/cpp_plugin.cc +++ b/src/compiler/cpp_plugin.cc @@ -54,9 +54,10 @@ class CppGrpcGenerator : public google::protobuf::compiler::CodeGenerator { google::protobuf::compiler::GeneratorContext* context, string* error) const { if (file->options().cc_generic_services()) { - *error = "cpp grpc proto compiler plugin does not work with generic " - "services. To generate cpp grpc APIs, please set \"" - "cc_generic_service = false\"."; + *error = + "cpp grpc proto compiler plugin does not work with generic " + "services. To generate cpp grpc APIs, please set \"" + "cc_generic_service = false\"."; return false; } diff --git a/src/compiler/go_generator.cc b/src/compiler/go_generator.cc index 8beae8dcccf..3873eae3bb6 100644 --- a/src/compiler/go_generator.cc +++ b/src/compiler/go_generator.cc @@ -45,23 +45,19 @@ using namespace std; namespace grpc_go_generator { bool NoStreaming(const google::protobuf::MethodDescriptor* method) { - return !method->client_streaming() && - !method->server_streaming(); + return !method->client_streaming() && !method->server_streaming(); } bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) { - return method->client_streaming() && - !method->server_streaming(); + return method->client_streaming() && !method->server_streaming(); } bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) { - return !method->client_streaming() && - method->server_streaming(); + return !method->client_streaming() && method->server_streaming(); } bool BidiStreaming(const google::protobuf::MethodDescriptor* method) { - return method->client_streaming() && - method->server_streaming(); + return method->client_streaming() && method->server_streaming(); } bool HasClientOnlyStreaming(const google::protobuf::FileDescriptor* file) { @@ -91,20 +87,22 @@ void PrintClientMethodDef(google::protobuf::io::Printer* printer, (*vars)["Response"] = method->output_type()->name(); if (NoStreaming(method)) { printer->Print(*vars, - "\t$Method$(ctx context.Context, in *$Request$, opts ...rpc.CallOption) " - "(*$Response$, error)\n"); + "\t$Method$(ctx context.Context, in *$Request$, opts " + "...rpc.CallOption) " + "(*$Response$, error)\n"); } else if (BidiStreaming(method)) { printer->Print(*vars, - "\t$Method$(ctx context.Context, opts ...rpc.CallOption) " - "($Service$_$Method$Client, error)\n"); + "\t$Method$(ctx context.Context, opts ...rpc.CallOption) " + "($Service$_$Method$Client, error)\n"); } else if (ServerOnlyStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "\t$Method$(ctx context.Context, m *$Request$, opts ...rpc.CallOption) " "($Service$_$Method$Client, error)\n"); } else if (ClientOnlyStreaming(method)) { printer->Print(*vars, - "\t$Method$(ctx context.Context, opts ...rpc.CallOption) " - "($Service$_$Method$Client, error)\n"); + "\t$Method$(ctx context.Context, opts ...rpc.CallOption) " + "($Service$_$Method$Client, error)\n"); } } @@ -116,11 +114,11 @@ void PrintClientMethodImpl(google::protobuf::io::Printer* printer, (*vars)["Response"] = method->output_type()->name(); if (NoStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "func (c *$ServiceStruct$Client) $Method$(ctx context.Context, " "in *$Request$, opts ...rpc.CallOption) (*$Response$, error) {\n"); - printer->Print(*vars, - "\tout := new($Response$)\n"); + printer->Print(*vars, "\tout := new($Response$)\n"); printer->Print(*vars, "\terr := rpc.Invoke(ctx, \"/$Package$$Service$/$Method$\", " "in, out, c.cc, opts...)\n"); @@ -142,20 +140,22 @@ void PrintClientMethodImpl(google::protobuf::io::Printer* printer, "\treturn &$ServiceStruct$$Method$Client{stream}, nil\n" "}\n\n"); printer->Print(*vars, - "type $Service$_$Method$Client interface {\n" - "\tSend(*$Request$) error\n" - "\tRecv() (*$Response$, error)\n" - "\trpc.ClientStream\n" - "}\n\n"); - printer->Print(*vars, - "type $ServiceStruct$$Method$Client struct {\n" - "\trpc.ClientStream\n" - "}\n\n"); + "type $Service$_$Method$Client interface {\n" + "\tSend(*$Request$) error\n" + "\tRecv() (*$Response$, error)\n" + "\trpc.ClientStream\n" + "}\n\n"); printer->Print(*vars, + "type $ServiceStruct$$Method$Client struct {\n" + "\trpc.ClientStream\n" + "}\n\n"); + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Client) Send(m *$Request$) error {\n" "\treturn x.ClientStream.SendProto(m)\n" "}\n\n"); - printer->Print(*vars, + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Client) Recv() (*$Response$, error) " "{\n" "\tm := new($Response$)\n" @@ -185,15 +185,16 @@ void PrintClientMethodImpl(google::protobuf::io::Printer* printer, "\treturn x, nil\n" "}\n\n"); printer->Print(*vars, - "type $Service$_$Method$Client interface {\n" - "\tRecv() (*$Response$, error)\n" - "\trpc.ClientStream\n" - "}\n\n"); - printer->Print(*vars, - "type $ServiceStruct$$Method$Client struct {\n" - "\trpc.ClientStream\n" - "}\n\n"); + "type $Service$_$Method$Client interface {\n" + "\tRecv() (*$Response$, error)\n" + "\trpc.ClientStream\n" + "}\n\n"); printer->Print(*vars, + "type $ServiceStruct$$Method$Client struct {\n" + "\trpc.ClientStream\n" + "}\n\n"); + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Client) Recv() (*$Response$, error) " "{\n" "\tm := new($Response$)\n" @@ -215,20 +216,22 @@ void PrintClientMethodImpl(google::protobuf::io::Printer* printer, "\treturn &$ServiceStruct$$Method$Client{stream}, nil\n" "}\n\n"); printer->Print(*vars, - "type $Service$_$Method$Client interface {\n" - "\tSend(*$Request$) error\n" - "\tCloseAndRecv() (*$Response$, error)\n" - "\trpc.ClientStream\n" - "}\n\n"); - printer->Print(*vars, - "type $ServiceStruct$$Method$Client struct {\n" - "\trpc.ClientStream\n" - "}\n\n"); + "type $Service$_$Method$Client interface {\n" + "\tSend(*$Request$) error\n" + "\tCloseAndRecv() (*$Response$, error)\n" + "\trpc.ClientStream\n" + "}\n\n"); printer->Print(*vars, + "type $ServiceStruct$$Method$Client struct {\n" + "\trpc.ClientStream\n" + "}\n\n"); + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Client) Send(m *$Request$) error {\n" "\treturn x.ClientStream.SendProto(m)\n" "}\n\n"); - printer->Print(*vars, + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Client) CloseAndRecv() (*$Response$, " "error) {\n" "\tif err := x.ClientStream.CloseSend(); err != nil {\n" @@ -264,7 +267,8 @@ void PrintClient(google::protobuf::io::Printer* printer, "type $ServiceStruct$Client struct {\n" "\tcc *rpc.ClientConn\n" "}\n\n"); - printer->Print(*vars, + printer->Print( + *vars, "func New$Service$Client(cc *rpc.ClientConn) $Service$Client {\n" "\treturn &$ServiceStruct$Client{cc}\n" "}\n\n"); @@ -280,17 +284,16 @@ void PrintServerMethodDef(google::protobuf::io::Printer* printer, (*vars)["Request"] = method->input_type()->name(); (*vars)["Response"] = method->output_type()->name(); if (NoStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "\t$Method$(context.Context, *$Request$) (*$Response$, error)\n"); } else if (BidiStreaming(method)) { - printer->Print(*vars, - "\t$Method$($Service$_$Method$Server) error\n"); + printer->Print(*vars, "\t$Method$($Service$_$Method$Server) error\n"); } else if (ServerOnlyStreaming(method)) { printer->Print(*vars, - "\t$Method$(*$Request$, $Service$_$Method$Server) error\n"); + "\t$Method$(*$Request$, $Service$_$Method$Server) error\n"); } else if (ClientOnlyStreaming(method)) { - printer->Print(*vars, - "\t$Method$($Service$_$Method$Server) error\n"); + printer->Print(*vars, "\t$Method$($Service$_$Method$Server) error\n"); } } @@ -301,11 +304,11 @@ void PrintServerHandler(google::protobuf::io::Printer* printer, (*vars)["Request"] = method->input_type()->name(); (*vars)["Response"] = method->output_type()->name(); if (NoStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "func _$Service$_$Method$_Handler(srv interface{}, ctx context.Context," " buf []byte) (proto.Message, error) {\n"); - printer->Print(*vars, - "\tin := new($Request$)\n"); + printer->Print(*vars, "\tin := new($Request$)\n"); printer->Print("\tif err := proto.Unmarshal(buf, in); err != nil {\n"); printer->Print("\t\treturn nil, err\n"); printer->Print("\t}\n"); @@ -317,27 +320,30 @@ void PrintServerHandler(google::protobuf::io::Printer* printer, printer->Print("\treturn out, nil\n"); printer->Print("}\n\n"); } else if (BidiStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "func _$Service$_$Method$_Handler(srv interface{}, stream rpc.Stream) " "error {\n" "\treturn srv.($Service$Server).$Method$(&$ServiceStruct$$Method$Server" "{stream})\n" "}\n\n"); printer->Print(*vars, - "type $Service$_$Method$Server interface {\n" - "\tSend(*$Response$) error\n" - "\tRecv() (*$Request$, error)\n" - "\trpc.Stream\n" - "}\n\n"); - printer->Print(*vars, - "type $ServiceStruct$$Method$Server struct {\n" - "\trpc.Stream\n" - "}\n\n"); + "type $Service$_$Method$Server interface {\n" + "\tSend(*$Response$) error\n" + "\tRecv() (*$Request$, error)\n" + "\trpc.Stream\n" + "}\n\n"); printer->Print(*vars, + "type $ServiceStruct$$Method$Server struct {\n" + "\trpc.Stream\n" + "}\n\n"); + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Server) Send(m *$Response$) error {\n" "\treturn x.Stream.SendProto(m)\n" "}\n\n"); - printer->Print(*vars, + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Server) Recv() (*$Request$, error) " "{\n" "\tm := new($Request$)\n" @@ -347,7 +353,8 @@ void PrintServerHandler(google::protobuf::io::Printer* printer, "\treturn m, nil\n" "}\n\n"); } else if (ServerOnlyStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "func _$Service$_$Method$_Handler(srv interface{}, stream rpc.Stream) " "error {\n" "\tm := new($Request$)\n" @@ -358,36 +365,39 @@ void PrintServerHandler(google::protobuf::io::Printer* printer, "&$ServiceStruct$$Method$Server{stream})\n" "}\n\n"); printer->Print(*vars, - "type $Service$_$Method$Server interface {\n" - "\tSend(*$Response$) error\n" - "\trpc.Stream\n" - "}\n\n"); - printer->Print(*vars, - "type $ServiceStruct$$Method$Server struct {\n" - "\trpc.Stream\n" - "}\n\n"); + "type $Service$_$Method$Server interface {\n" + "\tSend(*$Response$) error\n" + "\trpc.Stream\n" + "}\n\n"); printer->Print(*vars, + "type $ServiceStruct$$Method$Server struct {\n" + "\trpc.Stream\n" + "}\n\n"); + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Server) Send(m *$Response$) error {\n" "\treturn x.Stream.SendProto(m)\n" "}\n\n"); } else if (ClientOnlyStreaming(method)) { - printer->Print(*vars, + printer->Print( + *vars, "func _$Service$_$Method$_Handler(srv interface{}, stream rpc.Stream) " "error {\n" "\treturn srv.($Service$Server).$Method$(&$ServiceStruct$$Method$Server" "{stream})\n" "}\n\n"); printer->Print(*vars, - "type $Service$_$Method$Server interface {\n" - "\tSendAndClose(*$Response$) error\n" - "\tRecv() (*$Request$, error)\n" - "\trpc.Stream\n" - "}\n\n"); - printer->Print(*vars, - "type $ServiceStruct$$Method$Server struct {\n" - "\trpc.Stream\n" - "}\n\n"); + "type $Service$_$Method$Server interface {\n" + "\tSendAndClose(*$Response$) error\n" + "\tRecv() (*$Request$, error)\n" + "\trpc.Stream\n" + "}\n\n"); printer->Print(*vars, + "type $ServiceStruct$$Method$Server struct {\n" + "\trpc.Stream\n" + "}\n\n"); + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Server) SendAndClose(m *$Response$) " "error {\n" "\tif err := x.Stream.SendProto(m); err != nil {\n" @@ -395,7 +405,8 @@ void PrintServerHandler(google::protobuf::io::Printer* printer, "\t}\n" "\treturn nil\n" "}\n\n"); - printer->Print(*vars, + printer->Print( + *vars, "func (x *$ServiceStruct$$Method$Server) Recv() (*$Request$, error) {\n" "\tm := new($Request$)\n" "\tif err := x.Stream.RecvProto(m); err != nil {\n" @@ -411,22 +422,19 @@ void PrintServerMethodDesc(google::protobuf::io::Printer* printer, map* vars) { (*vars)["Method"] = method->name(); printer->Print("\t\t{\n"); - printer->Print(*vars, - "\t\t\tMethodName:\t\"$Method$\",\n"); - printer->Print(*vars, - "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n"); + printer->Print(*vars, "\t\t\tMethodName:\t\"$Method$\",\n"); + printer->Print(*vars, "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n"); printer->Print("\t\t},\n"); } -void PrintServerStreamingMethodDesc(google::protobuf::io::Printer* printer, - const google::protobuf::MethodDescriptor* method, - map* vars) { +void PrintServerStreamingMethodDesc( + google::protobuf::io::Printer* printer, + const google::protobuf::MethodDescriptor* method, + map* vars) { (*vars)["Method"] = method->name(); printer->Print("\t\t{\n"); - printer->Print(*vars, - "\t\t\tStreamName:\t\"$Method$\",\n"); - printer->Print(*vars, - "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n"); + printer->Print(*vars, "\t\t\tStreamName:\t\"$Method$\",\n"); + printer->Print(*vars, "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n"); printer->Print("\t\t},\n"); } @@ -467,8 +475,9 @@ void PrintServer(google::protobuf::io::Printer* printer, PrintServerStreamingMethodDesc(printer, service->method(i), vars); } } - printer->Print("\t},\n" - "}\n\n"); + printer->Print( + "\t},\n" + "}\n\n"); } std::string BadToUnderscore(std::string str) { @@ -493,8 +502,9 @@ string GetServices(const google::protobuf::FileDescriptor* file) { printer.Print(vars, "package $PackageName$\n\n"); printer.Print("import (\n"); if (HasClientOnlyStreaming(file)) { - printer.Print("\t\"fmt\"\n" - "\t\"io\"\n"); + printer.Print( + "\t\"fmt\"\n" + "\t\"io\"\n"); } printer.Print( "\t\"google/net/grpc/go/rpc\"\n" diff --git a/src/compiler/go_plugin.cc b/src/compiler/go_plugin.cc index f941840815e..c81612c0ab5 100644 --- a/src/compiler/go_plugin.cc +++ b/src/compiler/go_plugin.cc @@ -61,8 +61,8 @@ class GoGrpcGenerator : public google::protobuf::compiler::CodeGenerator { string file_name; if (file->name().size() > 6 && file->name().find_last_of(".proto") == file->name().size() - 1) { - file_name = file->name().substr(0, file->name().size() - 6) + - "_grpc.pb.go"; + file_name = + file->name().substr(0, file->name().size() - 6) + "_grpc.pb.go"; } else { *error = "Invalid proto file name. Proto file must end with .proto"; return false; diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc index 20485b47a5f..fae8858ff72 100644 --- a/src/compiler/ruby_generator.cc +++ b/src/compiler/ruby_generator.cc @@ -67,9 +67,8 @@ void PrintMethod(const MethodDescriptor* method, const string& package, output_type = "stream(" + output_type + ")"; } map method_vars = ListToDict({ - "mth.name", method->name(), - "input.type", input_type, - "output.type", output_type, + "mth.name", method->name(), "input.type", input_type, "output.type", + output_type, }); out->Print(method_vars, "rpc :$mth.name$, $input.type$, $output.type$\n"); } @@ -105,8 +104,7 @@ void PrintService(const ServiceDescriptor* service, const string& package, out->Print("self.marshal_class_method = :encode\n"); out->Print("self.unmarshal_class_method = :decode\n"); map pkg_vars = ListToDict({ - "service.name", service->name(), - "pkg.name", package, + "service.name", service->name(), "pkg.name", package, }); out->Print(pkg_vars, "self.service_name = '$pkg.name$.$service.name$'\n"); out->Print("\n"); @@ -139,9 +137,8 @@ string GetServices(const FileDescriptor* file) { // Write out a file header. map header_comment_vars = ListToDict({ - "file.name", file->name(), - "file.package", file->package(), - }); + "file.name", file->name(), "file.package", file->package(), + }); out.Print("# Generated by the protocol buffer compiler. DO NOT EDIT!\n"); out.Print(header_comment_vars, "# Source: $file.name$ for package '$file.package$'\n"); diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h index 67a5eedd09b..8263e353b24 100644 --- a/src/compiler/ruby_generator_helpers-inl.h +++ b/src/compiler/ruby_generator_helpers-inl.h @@ -47,8 +47,9 @@ inline bool ServicesFilename(const google::protobuf::FileDescriptor* file, static const unsigned proto_suffix_length = 6; // length of ".proto" if (file->name().size() > proto_suffix_length && file->name().find_last_of(".proto") == file->name().size() - 1) { - *file_name_or_error = file->name().substr( - 0, file->name().size() - proto_suffix_length) + "_services.rb"; + *file_name_or_error = + file->name().substr(0, file->name().size() - proto_suffix_length) + + "_services.rb"; return true; } else { *file_name_or_error = "Invalid proto file name: must end with .proto"; @@ -56,7 +57,8 @@ inline bool ServicesFilename(const google::protobuf::FileDescriptor* file, } } -inline string MessagesRequireName(const google::protobuf::FileDescriptor* file) { +inline string MessagesRequireName( + const google::protobuf::FileDescriptor* file) { return Replace(file->name(), ".proto", ""); } diff --git a/src/compiler/ruby_generator_map-inl.h b/src/compiler/ruby_generator_map-inl.h index ea5050652b6..fa86fbb9569 100644 --- a/src/compiler/ruby_generator_map-inl.h +++ b/src/compiler/ruby_generator_map-inl.h @@ -40,7 +40,6 @@ #include #include - using std::initializer_list; using std::map; using std::vector; @@ -51,11 +50,12 @@ namespace grpc_ruby_generator { // into a map of key* to value*. Is merely a readability helper for later code. inline map ListToDict(const initializer_list& values) { if (values.size() % 2 != 0) { - // MOE: insert std::cerr << "Not every 'key' has a value in `values`." << std::endl; + // MOE: insert std::cerr << "Not every 'key' has a value in `values`." + // << std::endl; } map value_map; auto value_iter = values.begin(); - for (unsigned i = 0; i < values.size()/2; ++i) { + for (unsigned i = 0; i < values.size() / 2; ++i) { string key = *value_iter; ++value_iter; string value = *value_iter; diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h index 85a76fa4215..44e17a202a7 100644 --- a/src/compiler/ruby_generator_string-inl.h +++ b/src/compiler/ruby_generator_string-inl.h @@ -45,7 +45,7 @@ using std::transform; namespace grpc_ruby_generator { // Split splits a string using char into elems. -inline vector &Split(const string &s, char delim, +inline vector& Split(const string& s, char delim, vector* elems) { stringstream ss(s); string item; @@ -56,7 +56,7 @@ inline vector &Split(const string &s, char delim, } // Split splits a string using char, returning the result in a vector. -inline vector Split(const string &s, char delim) { +inline vector Split(const string& s, char delim) { vector elems; Split(s, delim, &elems); return elems; @@ -106,7 +106,7 @@ inline string CapitalizeFirst(string s) { inline string RubyTypeOf(const string& a_type, const string& package) { string res(a_type); ReplacePrefix(&res, package, ""); // remove the leading package if present - ReplacePrefix(&res, ".", ""); // remove the leading . (no package) + ReplacePrefix(&res, ".", ""); // remove the leading . (no package) if (res.find('.') == string::npos) { return res; } else { diff --git a/src/core/channel/channel_args.h b/src/core/channel/channel_args.h index cf38d5d01fa..92280450a14 100644 --- a/src/core/channel/channel_args.h +++ b/src/core/channel/channel_args.h @@ -51,4 +51,4 @@ void grpc_channel_args_destroy(grpc_channel_args *a); is specified in channel args, otherwise returns 0. */ int grpc_channel_args_is_census_enabled(const grpc_channel_args *a); -#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_ARGS_H__ */ diff --git a/src/core/channel/channel_stack.c b/src/core/channel/channel_stack.c index 5ee412bf7d0..14fc8007785 100644 --- a/src/core/channel/channel_stack.c +++ b/src/core/channel/channel_stack.c @@ -54,7 +54,7 @@ /* Given a size, round up to the next multiple of sizeof(void*) */ #define ROUND_UP_TO_ALIGNMENT_SIZE(x) \ - (((x)+GPR_MAX_ALIGNMENT - 1) & ~(GPR_MAX_ALIGNMENT - 1)) + (((x) + GPR_MAX_ALIGNMENT - 1) & ~(GPR_MAX_ALIGNMENT - 1)) size_t grpc_channel_stack_size(const grpc_channel_filter **filters, size_t filter_count) { @@ -190,14 +190,13 @@ void grpc_channel_next_op(grpc_channel_element *elem, grpc_channel_op *op) { grpc_channel_stack *grpc_channel_stack_from_top_element( grpc_channel_element *elem) { - return (grpc_channel_stack *)((char *)(elem) - - ROUND_UP_TO_ALIGNMENT_SIZE( - sizeof(grpc_channel_stack))); + return (grpc_channel_stack *)((char *)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE( + sizeof(grpc_channel_stack))); } grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem) { - return (grpc_call_stack *)((char *)(elem) - ROUND_UP_TO_ALIGNMENT_SIZE( - sizeof(grpc_call_stack))); + return (grpc_call_stack *)((char *)(elem)-ROUND_UP_TO_ALIGNMENT_SIZE( + sizeof(grpc_call_stack))); } static void do_nothing(void *user_data, grpc_op_error error) {} diff --git a/src/core/channel/channel_stack.h b/src/core/channel/channel_stack.h index 14e972f5393..eb68102b435 100644 --- a/src/core/channel/channel_stack.h +++ b/src/core/channel/channel_stack.h @@ -302,4 +302,4 @@ void grpc_call_element_send_cancel(grpc_call_element *cur_elem); } while (0) #endif -#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_CHANNEL_STACK_H__ */ diff --git a/src/core/channel/client_channel.h b/src/core/channel/client_channel.h index 576af64ec75..6b8a7d95a8a 100644 --- a/src/core/channel/client_channel.h +++ b/src/core/channel/client_channel.h @@ -59,4 +59,4 @@ grpc_transport_setup_result grpc_client_channel_transport_setup_complete( grpc_channel_filter const **channel_filters, size_t num_channel_filters, grpc_mdctx *mdctx); -#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_CHANNEL_H__ */ diff --git a/src/core/channel/client_setup.h b/src/core/channel/client_setup.h index a508785e60b..155a9a5b1a7 100644 --- a/src/core/channel/client_setup.h +++ b/src/core/channel/client_setup.h @@ -64,4 +64,4 @@ gpr_timespec grpc_client_setup_request_deadline(grpc_client_setup_request *r); grpc_mdctx *grpc_client_setup_get_mdctx(grpc_client_setup_request *r); -#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_CLIENT_SETUP_H__ */ diff --git a/src/core/channel/connected_channel.c b/src/core/channel/connected_channel.c index e01cb81a890..30de10905ce 100644 --- a/src/core/channel/connected_channel.c +++ b/src/core/channel/connected_channel.c @@ -69,7 +69,7 @@ typedef struct { /* We perform a small hack to locate transport data alongside the connected channel data in call allocations, to allow everything to be pulled in minimal cache line requests */ -#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld)+1)) +#define TRANSPORT_STREAM_FROM_CALL_DATA(calld) ((grpc_stream *)((calld) + 1)) #define CALL_DATA_FROM_TRANSPORT_STREAM(transport_stream) \ (((call_data *)(transport_stream)) - 1) @@ -257,9 +257,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) { } const grpc_channel_filter grpc_connected_channel_filter = { - call_op, channel_op, + call_op, channel_op, - sizeof(call_data), init_call_elem, destroy_call_elem, + sizeof(call_data), init_call_elem, destroy_call_elem, sizeof(channel_data), init_channel_elem, destroy_channel_elem, diff --git a/src/core/channel/connected_channel.h b/src/core/channel/connected_channel.h index 660ea7ad89d..9d143fc1359 100644 --- a/src/core/channel/connected_channel.h +++ b/src/core/channel/connected_channel.h @@ -46,4 +46,4 @@ extern const grpc_channel_filter grpc_connected_channel_filter; grpc_transport_setup_result grpc_connected_channel_bind_transport( grpc_channel_stack *channel_stack, grpc_transport *transport); -#endif /* __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_CONNECTED_CHANNEL_H__ */ diff --git a/src/core/channel/metadata_buffer.c b/src/core/channel/metadata_buffer.c index 75fd90b707d..d4de4ba576c 100644 --- a/src/core/channel/metadata_buffer.c +++ b/src/core/channel/metadata_buffer.c @@ -61,7 +61,7 @@ struct grpc_metadata_buffer_impl { size_t elem_cap; }; -#define ELEMS(buffer) ((qelem *)((buffer)+1)) +#define ELEMS(buffer) ((qelem *)((buffer) + 1)) void grpc_metadata_buffer_init(grpc_metadata_buffer *buffer) { /* start buffer as NULL, indicating no elements */ diff --git a/src/core/channel/metadata_buffer.h b/src/core/channel/metadata_buffer.h index 818b290ce20..011dabed1b1 100644 --- a/src/core/channel/metadata_buffer.h +++ b/src/core/channel/metadata_buffer.h @@ -67,4 +67,4 @@ grpc_metadata *grpc_metadata_buffer_extract_elements( grpc_metadata_buffer *buffer); void grpc_metadata_buffer_cleanup_elements(void *elements, grpc_op_error error); -#endif /* __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_METADATA_BUFFER_H__ */ diff --git a/src/core/channel/noop_filter.c b/src/core/channel/noop_filter.c index b6b3f661f7b..6f854a2b871 100644 --- a/src/core/channel/noop_filter.c +++ b/src/core/channel/noop_filter.c @@ -131,9 +131,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) { } const grpc_channel_filter grpc_no_op_filter = { - call_op, channel_op, + call_op, channel_op, - sizeof(call_data), init_call_elem, destroy_call_elem, + sizeof(call_data), init_call_elem, destroy_call_elem, sizeof(channel_data), init_channel_elem, destroy_channel_elem, diff --git a/src/core/channel/noop_filter.h b/src/core/channel/noop_filter.h index 4057ff7ac9b..269214f893f 100644 --- a/src/core/channel/noop_filter.h +++ b/src/core/channel/noop_filter.h @@ -41,4 +41,4 @@ customize for their own filters */ extern const grpc_channel_filter grpc_no_op_filter; -#endif /* __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ */ +#endif /* __GRPC_INTERNAL_CHANNEL_NOOP_FILTER_H__ */ diff --git a/src/core/compression/algorithm.h b/src/core/compression/algorithm.h index 05895a889e2..c5ec6d21b68 100644 --- a/src/core/compression/algorithm.h +++ b/src/core/compression/algorithm.h @@ -46,4 +46,4 @@ typedef enum { const char *grpc_compression_algorithm_name( grpc_compression_algorithm algorithm); -#endif /* __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ */ +#endif /* __GRPC_INTERNAL_COMPRESSION_ALGORITHM_H__ */ diff --git a/src/core/compression/message_compress.h b/src/core/compression/message_compress.h index af8a0a5d754..564ca69a877 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_COMPRESSION_MESSAGE_COMPRESS_H__ */ +#endif /* __GRPC_INTERNAL_COMPRESSION_MESSAGE_COMPRESS_H__ */ diff --git a/src/core/httpcli/format_request.h b/src/core/httpcli/format_request.h index 988f872563d..a82130cb93a 100644 --- a/src/core/httpcli/format_request.h +++ b/src/core/httpcli/format_request.h @@ -42,4 +42,4 @@ gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request, const char *body_bytes, size_t body_size); -#endif /* __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ */ +#endif /* __GRPC_INTERNAL_HTTPCLI_FORMAT_REQUEST_H__ */ diff --git a/src/core/httpcli/httpcli.h b/src/core/httpcli/httpcli.h index ef8031354c1..90f89a93664 100644 --- a/src/core/httpcli/httpcli.h +++ b/src/core/httpcli/httpcli.h @@ -115,4 +115,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_HTTPCLI_HTTPCLI_H__ */ +#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_H__ */ diff --git a/src/core/httpcli/httpcli_security_context.h b/src/core/httpcli/httpcli_security_context.h index c267622e601..a73ecca0b37 100644 --- a/src/core/httpcli/httpcli_security_context.h +++ b/src/core/httpcli/httpcli_security_context.h @@ -40,4 +40,4 @@ grpc_security_status grpc_httpcli_ssl_channel_security_context_create( const unsigned char *pem_root_certs, size_t pem_root_certs_size, const char *secure_peer_name, grpc_channel_security_context **ctx); -#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ */ +#endif /* __GRPC_INTERNAL_HTTPCLI_HTTPCLI_SECURITY_CONTEXT_H__ */ diff --git a/src/core/httpcli/parser.h b/src/core/httpcli/parser.h index e2c24a9993d..520b16fd020 100644 --- a/src/core/httpcli/parser.h +++ b/src/core/httpcli/parser.h @@ -61,4 +61,4 @@ void grpc_httpcli_parser_destroy(grpc_httpcli_parser *parser); int grpc_httpcli_parser_parse(grpc_httpcli_parser *parser, gpr_slice slice); int grpc_httpcli_parser_eof(grpc_httpcli_parser *parser); -#endif /* __GRPC_INTERNAL_HTTPCLI_PARSER_H__ */ +#endif /* __GRPC_INTERNAL_HTTPCLI_PARSER_H__ */ diff --git a/src/core/security/auth.c b/src/core/security/auth.c index f743b258382..e36bf2382f7 100644 --- a/src/core/security/auth.c +++ b/src/core/security/auth.c @@ -157,6 +157,5 @@ static void destroy_channel_elem(grpc_channel_element *elem) { } const grpc_channel_filter grpc_client_auth_filter = { - call_op, channel_op, sizeof(call_data), - init_call_elem, destroy_call_elem, sizeof(channel_data), - init_channel_elem, destroy_channel_elem, "auth"}; + call_op, channel_op, sizeof(call_data), init_call_elem, destroy_call_elem, + sizeof(channel_data), init_channel_elem, destroy_channel_elem, "auth"}; diff --git a/src/core/security/auth.h b/src/core/security/auth.h index 0b279f87409..94fa2aba7db 100644 --- a/src/core/security/auth.h +++ b/src/core/security/auth.h @@ -38,4 +38,4 @@ extern const grpc_channel_filter grpc_client_auth_filter; -#endif /* __GRPC_INTERNAL_SECURITY_AUTH_H__ */ +#endif /* __GRPC_INTERNAL_SECURITY_AUTH_H__ */ diff --git a/src/core/security/credentials.h b/src/core/security/credentials.h index 8559f239d51..4a2532d7c41 100644 --- a/src/core/security/credentials.h +++ b/src/core/security/credentials.h @@ -143,4 +143,4 @@ struct grpc_server_credentials { const grpc_ssl_config *grpc_ssl_server_credentials_get_config( const grpc_server_credentials *ssl_creds); -#endif /* __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ */ +#endif /* __GRPC_INTERNAL_SECURITY_CREDENTIALS_H__ */ diff --git a/src/core/security/google_root_certs.h b/src/core/security/google_root_certs.h index 4bcfaddcdb3..30ed16c03bc 100644 --- a/src/core/security/google_root_certs.h +++ b/src/core/security/google_root_certs.h @@ -37,4 +37,4 @@ extern unsigned char grpc_google_root_certs[]; extern unsigned int grpc_google_root_certs_size; -#endif /* __GRPC_INTERNAL_SECURITY_GOOGLE_ROOT_CERTS_H__ */ +#endif /* __GRPC_INTERNAL_SECURITY_GOOGLE_ROOT_CERTS_H__ */ diff --git a/src/core/security/secure_endpoint.h b/src/core/security/secure_endpoint.h index d0f0fa7d5bc..20143150e07 100644 --- a/src/core/security/secure_endpoint.h +++ b/src/core/security/secure_endpoint.h @@ -44,4 +44,4 @@ grpc_endpoint *grpc_secure_endpoint_create( struct tsi_frame_protector *protector, grpc_endpoint *to_wrap, gpr_slice *leftover_slices, size_t leftover_nslices); -#endif /* __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ */ +#endif /* __GRPC_INTERNAL_ENDPOINT_SECURE_ENDPOINT_H__ */ diff --git a/src/core/security/secure_transport_setup.h b/src/core/security/secure_transport_setup.h index 50f2b08529b..b13d065fbff 100644 --- a/src/core/security/secure_transport_setup.h +++ b/src/core/security/secure_transport_setup.h @@ -50,4 +50,4 @@ void grpc_setup_secure_transport(grpc_security_context *ctx, grpc_secure_transport_setup_done_cb cb, void *user_data); -#endif /* __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ */ +#endif /* __GRPC_INTERNAL_SECURITY_SECURE_TRANSPORT_SETUP_H__ */ diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c index a0c72e2d699..d519ecab87a 100644 --- a/src/core/security/security_context.c +++ b/src/core/security/security_context.c @@ -100,8 +100,7 @@ grpc_arg grpc_security_context_to_arg(grpc_security_context *ctx) { return result; } -grpc_security_context *grpc_security_context_from_arg( - const grpc_arg *arg) { +grpc_security_context *grpc_security_context_from_arg(const grpc_arg *arg) { if (strcmp(arg->key, GRPC_SECURITY_CONTEXT_ARG)) return NULL; if (arg->type != GRPC_ARG_POINTER) { gpr_log(GPR_ERROR, "Invalid type %d for arg %s", arg->type, @@ -140,9 +139,7 @@ static void fake_channel_destroy(grpc_security_context *ctx) { gpr_free(ctx); } -static void fake_server_destroy(grpc_security_context *ctx) { - gpr_free(ctx); -} +static void fake_server_destroy(grpc_security_context *ctx) { gpr_free(ctx); } static grpc_security_status fake_channel_create_handshaker( grpc_security_context *ctx, tsi_handshaker **handshaker) { @@ -234,8 +231,7 @@ static void ssl_channel_destroy(grpc_security_context *ctx) { } static void ssl_server_destroy(grpc_security_context *ctx) { - grpc_ssl_server_security_context *c = - (grpc_ssl_server_security_context *)ctx; + grpc_ssl_server_security_context *c = (grpc_ssl_server_security_context *)ctx; if (c->handshaker_factory != NULL) { tsi_ssl_handshaker_factory_destroy(c->handshaker_factory); } @@ -267,8 +263,7 @@ static grpc_security_status ssl_channel_create_handshaker( static grpc_security_status ssl_server_create_handshaker( grpc_security_context *ctx, tsi_handshaker **handshaker) { - grpc_ssl_server_security_context *c = - (grpc_ssl_server_security_context *)ctx; + grpc_ssl_server_security_context *c = (grpc_ssl_server_security_context *)ctx; return ssl_create_handshaker(c->handshaker_factory, 0, NULL, handshaker); } diff --git a/src/core/security/security_context.h b/src/core/security/security_context.h index 65073abf0cb..9ace7f1ccb9 100644 --- a/src/core/security/security_context.h +++ b/src/core/security/security_context.h @@ -118,7 +118,7 @@ grpc_security_context *grpc_find_security_context_in_args( typedef struct grpc_channel_security_context grpc_channel_security_context; struct grpc_channel_security_context { - grpc_security_context base; /* requires is_client_side to be non 0. */ + grpc_security_context base; /* requires is_client_side to be non 0. */ grpc_credentials *request_metadata_creds; }; diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index 9d7c0e5e5a8..931fa95651b 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -70,8 +70,7 @@ static void on_accept(void *server, grpc_endpoint *tcp) { const grpc_channel_args *args = grpc_server_get_channel_args(server); grpc_security_context *ctx = grpc_find_security_context_in_args(args); GPR_ASSERT(ctx); - grpc_setup_secure_transport(ctx, tcp, on_secure_transport_setup_done, - server); + grpc_setup_secure_transport(ctx, tcp, on_secure_transport_setup_done, server); } /* Note: the following code is the same with server_chttp2.c */ diff --git a/src/core/statistics/census_interface.h b/src/core/statistics/census_interface.h index 7618387ee2f..af9c70c4fb7 100644 --- a/src/core/statistics/census_interface.h +++ b/src/core/statistics/census_interface.h @@ -73,4 +73,4 @@ census_op_id census_tracing_start_op(); /* Ends tracing. Calling this function will invalidate the input op_id. */ void census_tracing_end_op(census_op_id op_id); -#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ */ +#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_INTERFACE_H__ */ diff --git a/src/core/statistics/census_rpc_stats.h b/src/core/statistics/census_rpc_stats.h index e1ff3ac31b7..a9c999aa5ce 100644 --- a/src/core/statistics/census_rpc_stats.h +++ b/src/core/statistics/census_rpc_stats.h @@ -98,4 +98,4 @@ void census_stats_store_shutdown(); } #endif -#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ */ +#endif /* __GRPC_INTERNAL_STATISTICS_CENSUS_RPC_STATS_H__ */ diff --git a/src/core/support/alloc.c b/src/core/support/alloc.c index 658408f3341..ddf67897732 100644 --- a/src/core/support/alloc.c +++ b/src/core/support/alloc.c @@ -62,6 +62,4 @@ void *gpr_malloc_aligned(size_t size, size_t alignment) { return (void *)ret; } -void gpr_free_aligned(void *ptr) { - free(((void **)ptr)[-1]); -} +void gpr_free_aligned(void *ptr) { free(((void **)ptr)[-1]); } diff --git a/src/core/support/cpu.h b/src/core/support/cpu.h index 6ac0db35e5e..2435ec03530 100644 --- a/src/core/support/cpu.h +++ b/src/core/support/cpu.h @@ -46,4 +46,4 @@ int gpr_cpu_num_cores(); [0, gpr_cpu_num_cores() - 1] */ int gpr_cpu_current_cpu(); -#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */ +#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */ diff --git a/src/core/support/murmur_hash.h b/src/core/support/murmur_hash.h index 5643717cd22..2ebf3e57b1f 100644 --- a/src/core/support/murmur_hash.h +++ b/src/core/support/murmur_hash.h @@ -41,4 +41,4 @@ /* compute the hash of key (length len) */ gpr_uint32 gpr_murmur_hash3(const void *key, size_t len, gpr_uint32 seed); -#endif /* __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ */ +#endif /* __GRPC_INTERNAL_SUPPORT_MURMUR_HASH_H__ */ diff --git a/src/core/support/thd_internal.h b/src/core/support/thd_internal.h index 519177a5551..190d4e36681 100644 --- a/src/core/support/thd_internal.h +++ b/src/core/support/thd_internal.h @@ -36,4 +36,4 @@ /* Internal interfaces between modules within the gpr support library. */ -#endif /* __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ */ +#endif /* __GRPC_INTERNAL_SUPPORT_THD_INTERNAL_H__ */ diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 9c5f5064eba..4ea8378d969 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -197,7 +197,7 @@ struct grpc_call { gpr_refcount internal_refcount; }; -#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call)+1)) +#define CALL_STACK_FROM_CALL(call) ((grpc_call_stack *)((call) + 1)) #define CALL_FROM_CALL_STACK(call_stack) (((grpc_call *)(call_stack)) - 1) #define CALL_ELEM_FROM_CALL(call, idx) \ grpc_call_stack_element(CALL_STACK_FROM_CALL(call), idx) diff --git a/src/core/surface/call.h b/src/core/surface/call.h index 5c2ef3be187..01605bb38a7 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -73,4 +73,4 @@ grpc_metadata_buffer *grpc_call_get_metadata_buffer(grpc_call *call); void grpc_call_add_mdelem(grpc_call *call, grpc_mdelem *mdelem, gpr_uint32 flags); -#endif /* __GRPC_INTERNAL_SURFACE_CALL_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_CALL_H__ */ diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index 8ef13675fe3..a1bcea58ddb 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -51,7 +51,7 @@ struct grpc_channel { grpc_mdstr *authority_string; }; -#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c)+1)) +#define CHANNEL_STACK_FROM_CHANNEL(c) ((grpc_channel_stack *)((c) + 1)) grpc_channel *grpc_channel_create_from_filters( const grpc_channel_filter **filters, size_t num_filters, diff --git a/src/core/surface/channel.h b/src/core/surface/channel.h index 11d4939916a..b3ea2ede403 100644 --- a/src/core/surface/channel.h +++ b/src/core/surface/channel.h @@ -48,4 +48,4 @@ grpc_mdstr *grpc_channel_get_message_string(grpc_channel *channel); void grpc_channel_internal_ref(grpc_channel *channel); void grpc_channel_internal_unref(grpc_channel *channel); -#endif /* __GRPC_INTERNAL_SURFACE_CHANNEL_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_CHANNEL_H__ */ diff --git a/src/core/surface/client.c b/src/core/surface/client.c index 98cb460d630..524b0718a94 100644 --- a/src/core/surface/client.c +++ b/src/core/surface/client.c @@ -106,13 +106,12 @@ static void init_channel_elem(grpc_channel_element *elem, GPR_ASSERT(!is_last); } -static void destroy_channel_elem(grpc_channel_element *elem) { -} +static void destroy_channel_elem(grpc_channel_element *elem) {} const grpc_channel_filter grpc_client_surface_filter = { - call_op, channel_op, + call_op, channel_op, - sizeof(call_data), init_call_elem, destroy_call_elem, + sizeof(call_data), init_call_elem, destroy_call_elem, sizeof(channel_data), init_channel_elem, destroy_channel_elem, diff --git a/src/core/surface/client.h b/src/core/surface/client.h index eb567276e2a..cff3d401d92 100644 --- a/src/core/surface/client.h +++ b/src/core/surface/client.h @@ -38,4 +38,4 @@ extern const grpc_channel_filter grpc_client_surface_filter; -#endif /* __GRPC_INTERNAL_SURFACE_CLIENT_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_CLIENT_H__ */ diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h index 2e752a3fe00..5e457493966 100644 --- a/src/core/surface/completion_queue.h +++ b/src/core/surface/completion_queue.h @@ -104,4 +104,4 @@ void grpc_cq_dump_pending_ops(grpc_completion_queue *cc); grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc); -#endif /* __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_COMPLETION_QUEUE_H__ */ diff --git a/src/core/surface/event_string.h b/src/core/surface/event_string.h index 30b693e95cd..b34e2d152b5 100644 --- a/src/core/surface/event_string.h +++ b/src/core/surface/event_string.h @@ -39,4 +39,4 @@ /* Returns a string describing an event. Must be later freed with gpr_free() */ char *grpc_event_string(grpc_event *ev); -#endif /* __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_EVENT_STRING_H__ */ diff --git a/src/core/surface/server.c b/src/core/surface/server.c index aa544a97f28..167bfe97d12 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -405,9 +405,9 @@ static void destroy_channel_elem(grpc_channel_element *elem) { } static const grpc_channel_filter server_surface_filter = { - call_op, channel_op, + call_op, channel_op, - sizeof(call_data), init_call_elem, destroy_call_elem, + sizeof(call_data), init_call_elem, destroy_call_elem, sizeof(channel_data), init_channel_elem, destroy_channel_elem, diff --git a/src/core/surface/server.h b/src/core/surface/server.h index 61292ebe4e6..50574d66a40 100644 --- a/src/core/surface/server.h +++ b/src/core/surface/server.h @@ -60,4 +60,4 @@ grpc_transport_setup_result grpc_server_setup_transport( const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server); -#endif /* __GRPC_INTERNAL_SURFACE_SERVER_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_SERVER_H__ */ diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h index f6f9acfd9cf..df1aea9669e 100644 --- a/src/core/surface/surface_trace.h +++ b/src/core/surface/surface_trace.h @@ -51,4 +51,4 @@ } while (0) #endif -#endif /* __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ */ +#endif /* __GRPC_INTERNAL_SURFACE_SURFACE_TRACE_H__ */ diff --git a/src/core/transport/chttp2/frame.h b/src/core/transport/chttp2/frame.h index a04e442ed6e..6d286383091 100644 --- a/src/core/transport/chttp2/frame.h +++ b/src/core/transport/chttp2/frame.h @@ -77,4 +77,4 @@ typedef struct { #define GRPC_CHTTP2_DATA_FLAG_PADDED 8 #define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20 -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_H__ */ diff --git a/src/core/transport/chttp2/frame_data.c b/src/core/transport/chttp2/frame_data.c index fbd3b6cabfe..c22a2237370 100644 --- a/src/core/transport/chttp2/frame_data.c +++ b/src/core/transport/chttp2/frame_data.c @@ -161,4 +161,3 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse( abort(); return GRPC_CHTTP2_CONNECTION_ERROR; } - diff --git a/src/core/transport/chttp2/frame_data.h b/src/core/transport/chttp2/frame_data.h index abe26dab766..c260059e8b9 100644 --- a/src/core/transport/chttp2/frame_data.h +++ b/src/core/transport/chttp2/frame_data.h @@ -77,4 +77,4 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse( /* 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_TRANSPORT_CHTTP2_FRAME_DATA_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_DATA_H__ */ diff --git a/src/core/transport/chttp2/frame_ping.h b/src/core/transport/chttp2/frame_ping.h index a64d53644b7..fa778c51b2f 100644 --- a/src/core/transport/chttp2/frame_ping.h +++ b/src/core/transport/chttp2/frame_ping.h @@ -50,4 +50,4 @@ 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); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_PING_H__ */ diff --git a/src/core/transport/chttp2/frame_rst_stream.h b/src/core/transport/chttp2/frame_rst_stream.h index 78aea0f26aa..dbb262971b3 100644 --- a/src/core/transport/chttp2/frame_rst_stream.h +++ b/src/core/transport/chttp2/frame_rst_stream.h @@ -38,4 +38,4 @@ gpr_slice grpc_chttp2_rst_stream_create(gpr_uint32 stream_id, gpr_uint32 code); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H__ */ diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h index dcb8b00ca19..855f9636bba 100644 --- a/src/core/transport/chttp2/frame_settings.h +++ b/src/core/transport/chttp2/frame_settings.h @@ -96,4 +96,4 @@ grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame( grpc_chttp2_parse_error grpc_chttp2_settings_parser_parse( void *parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_SETTINGS_H__ */ diff --git a/src/core/transport/chttp2/frame_window_update.h b/src/core/transport/chttp2/frame_window_update.h index 4b789fcc4ab..2d9e6c4dcb7 100644 --- a/src/core/transport/chttp2/frame_window_update.h +++ b/src/core/transport/chttp2/frame_window_update.h @@ -52,4 +52,4 @@ 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); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_FRAME_WINDOW_UPDATE_H__ */ diff --git a/src/core/transport/chttp2/hpack_parser.h b/src/core/transport/chttp2/hpack_parser.h index 799513e7fff..b0a0d76713c 100644 --- a/src/core/transport/chttp2/hpack_parser.h +++ b/src/core/transport/chttp2/hpack_parser.h @@ -108,4 +108,4 @@ grpc_chttp2_parse_error grpc_chttp2_header_parser_parse( void *hpack_parser, grpc_chttp2_parse_state *state, gpr_slice slice, int is_last); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_PARSER_H__ */ diff --git a/src/core/transport/chttp2/hpack_table.c b/src/core/transport/chttp2/hpack_table.c index 8f2ebecfeb1..ae8bfa8009b 100644 --- a/src/core/transport/chttp2/hpack_table.c +++ b/src/core/transport/chttp2/hpack_table.c @@ -43,68 +43,68 @@ 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) { diff --git a/src/core/transport/chttp2/hpack_table.h b/src/core/transport/chttp2/hpack_table.h index a3a07ad014d..84a8e2d1e08 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_TRANSPORT_CHTTP2_HPACK_TABLE_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HPACK_TABLE_H__ */ diff --git a/src/core/transport/chttp2/http2_errors.h b/src/core/transport/chttp2/http2_errors.h index d065422c6f0..7791da6d5ad 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_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_HTTP2_ERRORS_H__ */ diff --git a/src/core/transport/chttp2/status_conversion.h b/src/core/transport/chttp2/status_conversion.h index ae9e7f2ca3e..f78d81e0aab 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_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STATUS_CONVERSION_H__ */ diff --git a/src/core/transport/chttp2/stream_encoder.h b/src/core/transport/chttp2/stream_encoder.h index 4b093e84959..147b1d31ffe 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_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_ENCODER_H__ */ diff --git a/src/core/transport/chttp2/stream_map.h b/src/core/transport/chttp2/stream_map.h index caaee30676b..03bf719f376 100644 --- a/src/core/transport/chttp2/stream_map.h +++ b/src/core/transport/chttp2/stream_map.h @@ -78,4 +78,4 @@ void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map, void *value), void *user_data); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_STREAM_MAP_H__ */ diff --git a/src/core/transport/chttp2/varint.h b/src/core/transport/chttp2/varint.h index 780390238fa..940df00a993 100644 --- a/src/core/transport/chttp2/varint.h +++ b/src/core/transport/chttp2/varint.h @@ -70,4 +70,4 @@ void grpc_chttp2_hpack_write_varint_tail(gpr_uint32 tail_value, } \ } while (0) -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_VARINT_H__ */ diff --git a/src/core/transport/chttp2_transport.h b/src/core/transport/chttp2_transport.h index dd4419b98dc..e12357ff5ef 100644 --- a/src/core/transport/chttp2_transport.h +++ b/src/core/transport/chttp2_transport.h @@ -44,4 +44,4 @@ void grpc_create_chttp2_transport(grpc_transport_setup_callback setup, size_t nslices, grpc_mdctx *metadata_context, int is_client); -#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_CHTTP2_TRANSPORT_H__ */ diff --git a/src/core/transport/metadata.h b/src/core/transport/metadata.h index 6c6dee5efd6..943e65a981e 100644 --- a/src/core/transport/metadata.h +++ b/src/core/transport/metadata.h @@ -136,4 +136,4 @@ const char *grpc_mdstr_as_c_string(grpc_mdstr *s); #define GRPC_MDSTR_KV_HASH(k_hash, v_hash) (GPR_ROTL((k_hash), 2) ^ (v_hash)) -#endif /* __GRPC_INTERNAL_TRANSPORT_METADATA_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_METADATA_H__ */ diff --git a/src/core/transport/stream_op.h b/src/core/transport/stream_op.h index be60bc2da65..20d609133f8 100644 --- a/src/core/transport/stream_op.h +++ b/src/core/transport/stream_op.h @@ -125,4 +125,4 @@ void grpc_sopb_add_flow_ctl_cb(grpc_stream_op_buffer *sopb, void grpc_sopb_append(grpc_stream_op_buffer *sopb, grpc_stream_op *ops, size_t nops); -#endif /* __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_STREAM_OP_H__ */ diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h index 00dacbf5b9c..af12f4e700d 100644 --- a/src/core/transport/transport.h +++ b/src/core/transport/transport.h @@ -254,4 +254,4 @@ void grpc_transport_setup_initiate(grpc_transport_setup *setup); used as a destruction call by setup). */ void grpc_transport_setup_cancel(grpc_transport_setup *setup); -#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_H__ */ diff --git a/src/core/transport/transport_impl.h b/src/core/transport/transport_impl.h index 9f497b9cbaf..31e80d36edd 100644 --- a/src/core/transport/transport_impl.h +++ b/src/core/transport/transport_impl.h @@ -84,4 +84,4 @@ struct grpc_transport { const grpc_transport_vtable *vtable; }; -#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ */ +#endif /* __GRPC_INTERNAL_TRANSPORT_TRANSPORT_IMPL_H__ */ diff --git a/src/core/tsi/fake_transport_security.c b/src/core/tsi/fake_transport_security.c index 7807e719495..63d0e1f7881 100644 --- a/src/core/tsi/fake_transport_security.c +++ b/src/core/tsi/fake_transport_security.c @@ -83,7 +83,6 @@ typedef struct { uint32_t max_frame_size; } tsi_fake_frame_protector; - /* --- Utils. ---*/ static const char* tsi_fake_handshake_message_strings[] = { @@ -120,7 +119,7 @@ static void store32_little_endian(uint32_t value, unsigned char* buf) { buf[3] = (unsigned char)(value >> 24) & 0xFF; buf[2] = (unsigned char)(value >> 16) & 0xFF; buf[1] = (unsigned char)(value >> 8) & 0xFF; - buf[0] = (unsigned char)(value) & 0xFF; + buf[0] = (unsigned char)(value)&0xFF; } static void tsi_fake_frame_reset(tsi_fake_frame* frame, int needs_draining) { @@ -246,8 +245,8 @@ static tsi_result fake_protector_protect( /* Try to drain first. */ if (frame->needs_draining) { drained_size = saved_output_size - *num_bytes_written; - result = drain_frame_to_bytes(protected_output_frames, - &drained_size, frame); + result = + drain_frame_to_bytes(protected_output_frames, &drained_size, frame); *num_bytes_written += drained_size; protected_output_frames += drained_size; if (result != TSI_OK) { @@ -273,8 +272,8 @@ static tsi_result fake_protector_protect( return result; } } - result = fill_frame_from_bytes(unprotected_bytes, unprotected_bytes_size, - frame); + result = + fill_frame_from_bytes(unprotected_bytes, unprotected_bytes_size, frame); if (result != TSI_OK) { if (result == TSI_INCOMPLETE_DATA) result = TSI_OK; return result; @@ -301,7 +300,7 @@ static tsi_result fake_protector_protect_flush( frame->size = frame->offset; frame->offset = 0; frame->needs_draining = 1; - store32_little_endian(frame->size, frame->data); /* Overwrite header. */ + store32_little_endian(frame->size, frame->data); /* Overwrite header. */ } result = drain_frame_to_bytes(protected_output_frames, protected_output_frames_size, frame); @@ -327,8 +326,7 @@ static tsi_result fake_protector_unprotect( /* Go past the header if needed. */ if (frame->offset == 0) frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; drained_size = saved_output_size - *num_bytes_written; - result = drain_frame_to_bytes(unprotected_bytes, &drained_size, - frame); + result = drain_frame_to_bytes(unprotected_bytes, &drained_size, frame); unprotected_bytes += drained_size; *num_bytes_written += drained_size; if (result != TSI_OK) { @@ -352,7 +350,7 @@ static tsi_result fake_protector_unprotect( /* Try to drain again. */ if (!frame->needs_draining) return TSI_INTERNAL_ERROR; if (frame->offset != 0) return TSI_INTERNAL_ERROR; - frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; /* Go past the header. */ + frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; /* Go past the header. */ drained_size = saved_output_size - *num_bytes_written; result = drain_frame_to_bytes(unprotected_bytes, &drained_size, frame); *num_bytes_written += drained_size; @@ -481,10 +479,8 @@ static void fake_handshaker_destroy(tsi_handshaker* self) { static const tsi_handshaker_vtable handshaker_vtable = { fake_handshaker_get_bytes_to_send_to_peer, - fake_handshaker_process_bytes_from_peer, - fake_handshaker_get_result, - fake_handshaker_extract_peer, - fake_handshaker_create_frame_protector, + fake_handshaker_process_bytes_from_peer, fake_handshaker_get_result, + fake_handshaker_extract_peer, fake_handshaker_create_frame_protector, fake_handshaker_destroy, }; diff --git a/src/core/tsi/fake_transport_security.h b/src/core/tsi/fake_transport_security.h index 075d51871b3..a62fe81c095 100644 --- a/src/core/tsi/fake_transport_security.h +++ b/src/core/tsi/fake_transport_security.h @@ -50,7 +50,6 @@ extern "C" { cleartext data for the protector. */ tsi_handshaker* tsi_create_fake_handshaker(int is_client); - /* Creates a protector directly without going through the handshake phase. */ tsi_frame_protector* tsi_create_fake_protector( uint32_t* max_protected_frame_size); @@ -59,4 +58,4 @@ tsi_frame_protector* tsi_create_fake_protector( } #endif -#endif /* __FAKE_TRANSPORT_SECURITY_H_ */ +#endif /* __FAKE_TRANSPORT_SECURITY_H_ */ diff --git a/src/core/tsi/ssl_transport_security.c b/src/core/tsi/ssl_transport_security.c index b9e48e73737..c98071a9376 100644 --- a/src/core/tsi/ssl_transport_security.c +++ b/src/core/tsi/ssl_transport_security.c @@ -54,7 +54,6 @@ * SSL structure. This is what we would ultimately want though... */ #define TSI_SSL_MAX_PROTECTION_OVERHEAD 100 - /* --- Structure definitions. ---*/ struct tsi_ssl_handshaker_factory { @@ -100,7 +99,6 @@ typedef struct { uint32_t buffer_offset; } tsi_ssl_frame_protector; - /* --- Library Initialization. ---*/ static gpr_once init_openssl_once = GPR_ONCE_INIT; @@ -269,7 +267,7 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type, tsi_peer* peer) { /* TODO(jboeuf): Maybe add more properties. */ uint32_t property_count = include_certificate_type ? 3 : 2; - tsi_result result = tsi_construct_peer(property_count, peer); + tsi_result result = tsi_construct_peer(property_count, peer); if (result != TSI_OK) return result; do { result = peer_property_from_x509_common_name(cert, &peer->properties[0]); @@ -299,12 +297,10 @@ static void log_ssl_error_stack(void) { } } - /* Performs an SSL_read and handle errors. */ static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes, uint32_t* unprotected_bytes_size) { - int read_from_ssl = SSL_read(ssl, unprotected_bytes, - *unprotected_bytes_size); + int read_from_ssl = SSL_read(ssl, unprotected_bytes, *unprotected_bytes_size); if (read_from_ssl == 0) { gpr_log(GPR_ERROR, "SSL_read returned 0 unexpectedly."); return TSI_INTERNAL_ERROR; @@ -378,7 +374,7 @@ static tsi_result ssl_ctx_use_certificate_chain( X509* certificate_authority = PEM_read_bio_X509(pem, NULL, NULL, ""); if (certificate_authority == NULL) { ERR_clear_error(); - break; /* Done reading. */ + break; /* Done reading. */ } if (!SSL_CTX_add_extra_chain_cert(context, certificate_authority)) { X509_free(certificate_authority); @@ -423,8 +419,8 @@ static tsi_result ssl_ctx_use_private_key(SSL_CTX* context, /* Loads in-memory PEM verification certs into the SSL context and optionally returns the verification cert names (root_names can be NULL). */ static tsi_result ssl_ctx_load_verification_certs( - SSL_CTX* context, const unsigned char* pem_roots, - uint32_t pem_roots_size, STACK_OF(X509_NAME)** root_names) { + SSL_CTX* context, const unsigned char* pem_roots, uint32_t pem_roots_size, + STACK_OF(X509_NAME) * *root_names) { tsi_result result = TSI_OK; uint32_t num_roots = 0; X509* root = NULL; @@ -442,7 +438,7 @@ static tsi_result ssl_ctx_load_verification_certs( root = PEM_read_bio_X509_AUX(pem, NULL, NULL, ""); if (root == NULL) { ERR_clear_error(); - break; /* We're at the end of stream. */ + break; /* We're at the end of stream. */ } if (root_names != NULL) { root_name = X509_get_subject_name(root); @@ -485,13 +481,11 @@ static tsi_result ssl_ctx_load_verification_certs( return result; } - /* Populates the SSL context with a private key and a cert chain, and sets the cipher list and the ephemeral ECDH key. */ static tsi_result populate_ssl_context( SSL_CTX* context, const unsigned char* pem_private_key, - uint32_t pem_private_key_size, - const unsigned char* pem_certificate_chain, + uint32_t pem_private_key_size, const unsigned char* pem_certificate_chain, uint32_t pem_certificate_chain_size, const char* cipher_list) { tsi_result result = TSI_OK; if (pem_certificate_chain != NULL) { @@ -532,12 +526,12 @@ static tsi_result extract_x509_subject_names_from_pem_cert( tsi_result result = TSI_OK; X509* cert = NULL; BIO* pem = BIO_new_mem_buf((void*)pem_cert, pem_cert_size); - if (pem == NULL) return TSI_OUT_OF_RESOURCES; + if (pem == NULL) return TSI_OUT_OF_RESOURCES; cert = PEM_read_bio_X509(pem, NULL, NULL, ""); if (cert == NULL) { - gpr_log(GPR_ERROR, "Invalid certificate"); - result = TSI_INVALID_ARGUMENT; + gpr_log(GPR_ERROR, "Invalid certificate"); + result = TSI_INVALID_ARGUMENT; } else { result = peer_from_x509(cert, 0, peer); } @@ -581,8 +575,7 @@ static tsi_result build_alpn_protocol_name_list( static tsi_result ssl_protector_protect( tsi_frame_protector* self, const unsigned char* unprotected_bytes, - uint32_t* unprotected_bytes_size, - unsigned char* protected_output_frames, + uint32_t* unprotected_bytes_size, unsigned char* protected_output_frames, uint32_t* protected_output_frames_size) { tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self; int read_from_ssl; @@ -634,8 +627,7 @@ static tsi_result ssl_protector_protect( static tsi_result ssl_protector_protect_flush( tsi_frame_protector* self, unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size, - uint32_t* still_pending_size) { + uint32_t* protected_output_frames_size, uint32_t* still_pending_size) { tsi_result result = TSI_OK; tsi_ssl_frame_protector* impl = (tsi_ssl_frame_protector*)self; int read_from_ssl = 0; @@ -662,8 +654,7 @@ static tsi_result ssl_protector_protect_flush( static tsi_result ssl_protector_unprotect( tsi_frame_protector* self, const unsigned char* protected_frames_bytes, - uint32_t* protected_frames_bytes_size, - unsigned char* unprotected_bytes, + uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes, uint32_t* unprotected_bytes_size) { tsi_result result = TSI_OK; int written_into_ssl = 0; @@ -673,7 +664,7 @@ static tsi_result ssl_protector_unprotect( /* First, try to read remaining data from ssl. */ result = do_ssl_read(impl->ssl, unprotected_bytes, unprotected_bytes_size); - if (result != TSI_OK) return result; + if (result != TSI_OK) return result; if (*unprotected_bytes_size == output_bytes_size) { /* We have read everything we could and cannot process any more input. */ *protected_frames_bytes_size = 0; @@ -684,8 +675,8 @@ static tsi_result ssl_protector_unprotect( *unprotected_bytes_size = output_bytes_size - output_bytes_offset; /* Then, try to write some data to ssl. */ - written_into_ssl = BIO_write( - impl->into_ssl, protected_frames_bytes, *protected_frames_bytes_size); + written_into_ssl = BIO_write(impl->into_ssl, protected_frames_bytes, + *protected_frames_bytes_size); if (written_into_ssl < 0) { gpr_log(GPR_ERROR, "Sending protected frame to ssl failed with %d", written_into_ssl); @@ -710,13 +701,10 @@ static void ssl_protector_destroy(tsi_frame_protector* self) { } static const tsi_frame_protector_vtable frame_protector_vtable = { - ssl_protector_protect, - ssl_protector_protect_flush, - ssl_protector_unprotect, + ssl_protector_protect, ssl_protector_protect_flush, ssl_protector_unprotect, ssl_protector_destroy, }; - /* --- tsi_handshaker methods implementation. ---*/ static tsi_result ssl_handshaker_get_bytes_to_send_to_peer( @@ -751,8 +739,7 @@ static tsi_result ssl_handshaker_get_result(tsi_handshaker* self) { } static tsi_result ssl_handshaker_process_bytes_from_peer( - tsi_handshaker* self, const unsigned char* bytes, - uint32_t* bytes_size) { + tsi_handshaker* self, const unsigned char* bytes, uint32_t* bytes_size) { tsi_ssl_handshaker* impl = (tsi_ssl_handshaker*)self; int bytes_written_into_ssl_size = 0; if (bytes == NULL || bytes_size == 0 || *bytes_size > INT_MAX) { @@ -884,14 +871,11 @@ static void ssl_handshaker_destroy(tsi_handshaker* self) { static const tsi_handshaker_vtable handshaker_vtable = { ssl_handshaker_get_bytes_to_send_to_peer, - ssl_handshaker_process_bytes_from_peer, - ssl_handshaker_get_result, - ssl_handshaker_extract_peer, - ssl_handshaker_create_frame_protector, + ssl_handshaker_process_bytes_from_peer, ssl_handshaker_get_result, + ssl_handshaker_extract_peer, ssl_handshaker_create_frame_protector, ssl_handshaker_destroy, }; - /* --- tsi_ssl_handshaker_factory common methods. --- */ tsi_result tsi_ssl_handshaker_factory_create_handshaker( @@ -971,7 +955,6 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client, return TSI_OK; } - /* --- tsi_ssl__client_handshaker_factory methods implementation. --- */ static tsi_result ssl_client_handshaker_factory_create_handshaker( @@ -991,7 +974,6 @@ static void ssl_client_handshaker_factory_destroy( free(impl); } - /* --- tsi_ssl_server_handshaker_factory methods implementation. --- */ static tsi_result ssl_server_handshaker_factory_create_handshaker( @@ -1031,19 +1013,19 @@ static int does_entry_match_name(const char* entry, uint32_t entry_length, const char* name_subdomain = NULL; if (entry_length == 0) return 0; if (!strncmp(name, entry, entry_length) && (strlen(name) == entry_length)) { - return 1; /* Perfect match. */ + return 1; /* Perfect match. */ } if (entry[0] != '*') return 0; /* Wildchar subdomain matching. */ - if (entry_length < 3 || entry[1] != '.') { /* At least *.x */ + if (entry_length < 3 || entry[1] != '.') { /* At least *.x */ gpr_log(GPR_ERROR, "Invalid wildchar entry."); return 0; } name_subdomain = strchr(name, '.'); if (name_subdomain == NULL || strlen(name_subdomain) < 2) return 0; - name_subdomain++; /* Starts after the dot. */ - entry += 2; /* Remove *. */ + name_subdomain++; /* Starts after the dot. */ + entry += 2; /* Remove *. */ entry_length -= 2; return (!strncmp(entry, name_subdomain, entry_length) && (strlen(name_subdomain) == entry_length)); @@ -1095,7 +1077,6 @@ static int server_handshaker_factory_alpn_callback( return SSL_TLSEXT_ERR_NOACK; } - /* --- tsi_ssl_handshaker_factory constructors. --- */ tsi_result tsi_create_ssl_client_handshaker_factory( @@ -1277,10 +1258,8 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) { uint32_t i = 0; const tsi_peer_property* property = tsi_peer_get_property_by_name( peer, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY); - if (property == NULL || - property->type != TSI_PEER_PROPERTY_TYPE_STRING) { - gpr_log(GPR_ERROR, - "Invalid x509 subject common name property."); + if (property == NULL || property->type != TSI_PEER_PROPERTY_TYPE_STRING) { + gpr_log(GPR_ERROR, "Invalid x509 subject common name property."); return 0; } if (does_entry_match_name(property->value.string.data, @@ -1291,8 +1270,7 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) { property = tsi_peer_get_property_by_name( peer, TSI_X509_SUBJECT_ALTERNATIVE_NAMES_PEER_PROPERTY); if (property == NULL || property->type != TSI_PEER_PROPERTY_TYPE_LIST) { - gpr_log(GPR_ERROR, - "Invalid x509 subject alternative names property."); + gpr_log(GPR_ERROR, "Invalid x509 subject alternative names property."); return 0; } @@ -1308,5 +1286,5 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name) { return 1; } } - return 0; /* Not found. */ + return 0; /* Not found. */ } diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h index 56f50a5ddec..de2b1df7bf6 100644 --- a/src/core/tsi/ssl_transport_security.h +++ b/src/core/tsi/ssl_transport_security.h @@ -162,9 +162,8 @@ void tsi_ssl_handshaker_factory_destroy(tsi_ssl_handshaker_factory* self); /* Util that checks that an ssl peer matches a specific name. */ int tsi_ssl_peer_matches_name(const tsi_peer* peer, const char* name); - #ifdef __cplusplus } #endif -#endif /* __SSL_TRANSPORT_SECURITY_H_ */ +#endif /* __SSL_TRANSPORT_SECURITY_H_ */ diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c index 94252e36d0e..5a42f03f5f8 100644 --- a/src/core/tsi/transport_security.c +++ b/src/core/tsi/transport_security.c @@ -44,7 +44,7 @@ char* tsi_strdup(const char* src) { if (!src) return NULL; len = strlen(src) + 1; dst = malloc(len); - if (!dst) return NULL; + if (!dst) return NULL; memcpy(dst, src, len); return dst; } @@ -84,17 +84,15 @@ const char* tsi_result_to_string(tsi_result result) { } } - /* --- tsi_frame_protector common implementation. --- Calls specific implementation after state/input validation. */ -tsi_result tsi_frame_protector_protect( - tsi_frame_protector* self, - const unsigned char* unprotected_bytes, - uint32_t* unprotected_bytes_size, - unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size) { +tsi_result tsi_frame_protector_protect(tsi_frame_protector* self, + const unsigned char* unprotected_bytes, + uint32_t* unprotected_bytes_size, + unsigned char* protected_output_frames, + uint32_t* protected_output_frames_size) { if (self == NULL || unprotected_bytes == NULL || unprotected_bytes_size == NULL || protected_output_frames == NULL || protected_output_frames_size == NULL) { @@ -106,10 +104,8 @@ tsi_result tsi_frame_protector_protect( } tsi_result tsi_frame_protector_protect_flush( - tsi_frame_protector* self, - unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size, - uint32_t* still_pending_size) { + tsi_frame_protector* self, unsigned char* protected_output_frames, + uint32_t* protected_output_frames_size, uint32_t* still_pending_size) { if (self == NULL || protected_output_frames == NULL || protected_output_frames == NULL || still_pending_size == NULL) { return TSI_INVALID_ARGUMENT; @@ -120,10 +116,8 @@ tsi_result tsi_frame_protector_protect_flush( } tsi_result tsi_frame_protector_unprotect( - tsi_frame_protector* self, - const unsigned char* protected_frames_bytes, - uint32_t* protected_frames_bytes_size, - unsigned char* unprotected_bytes, + tsi_frame_protector* self, const unsigned char* protected_frames_bytes, + uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes, uint32_t* unprotected_bytes_size) { if (self == NULL || protected_frames_bytes == NULL || protected_frames_bytes_size == NULL || unprotected_bytes == NULL || @@ -140,7 +134,6 @@ void tsi_frame_protector_destroy(tsi_frame_protector* self) { self->vtable->destroy(self); } - /* --- tsi_handshaker common implementation. --- Calls specific implementation after state/input validation. */ @@ -153,7 +146,6 @@ tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self, return self->vtable->get_bytes_to_send_to_peer(self, bytes, bytes_size); } - tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker* self, const unsigned char* bytes, uint32_t* bytes_size) { @@ -179,8 +171,7 @@ tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer) { } tsi_result tsi_handshaker_create_frame_protector( - tsi_handshaker* self, - uint32_t* max_protected_frame_size, + tsi_handshaker* self, uint32_t* max_protected_frame_size, tsi_frame_protector** protector) { tsi_result result; if (self == NULL || protector == NULL) return TSI_INVALID_ARGUMENT; @@ -201,7 +192,6 @@ void tsi_handshaker_destroy(tsi_handshaker* self) { self->vtable->destroy(self); } - /* --- tsi_peer implementation. --- */ const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* self, @@ -227,7 +217,6 @@ tsi_peer_property tsi_init_peer_property(void) { return property; } - static void tsi_peer_destroy_list_property(tsi_peer_property* children, uint32_t child_count) { uint32_t i; @@ -254,7 +243,7 @@ void tsi_peer_property_destruct(tsi_peer_property* property) { /* Nothing to free. */ break; } - *property = tsi_init_peer_property(); /* Reset everything to 0. */ + *property = tsi_init_peer_property(); /* Reset everything to 0. */ } void tsi_peer_destruct(tsi_peer* self) { diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index cf9a2b01954..9a20fa83a5f 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -109,10 +109,10 @@ tsi_result tsi_construct_list_peer_property(const char* name, tsi_peer_property* property); /* Utils. */ -char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */ +char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */ #ifdef __cplusplus } #endif -#endif /* __TRANSPORT_SECURITY_H_ */ +#endif /* __TRANSPORT_SECURITY_H_ */ diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 18545b42532..76746a4b207 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -60,7 +60,6 @@ typedef enum { const char* tsi_result_to_string(tsi_result result); - /* --- tsi_frame_protector object --- This object protects and unprotects buffers once the handshake is done. @@ -121,12 +120,11 @@ typedef struct tsi_frame_protector tsi_frame_protector; if (result != TSI_OK) HandleError(result); ------------------------------------------------------------------------ */ -tsi_result tsi_frame_protector_protect( - tsi_frame_protector* self, - const unsigned char* unprotected_bytes, - uint32_t* unprotected_bytes_size, - unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size); +tsi_result tsi_frame_protector_protect(tsi_frame_protector* self, + const unsigned char* unprotected_bytes, + uint32_t* unprotected_bytes_size, + unsigned char* protected_output_frames, + uint32_t* protected_output_frames_size); /* Indicates that we need to flush the bytes buffered in the protector and get the resulting frame. @@ -137,10 +135,8 @@ tsi_result tsi_frame_protector_protect( - still_pending_bytes is an output parameter indicating the number of bytes that still need to be flushed from the protector.*/ tsi_result tsi_frame_protector_protect_flush( - tsi_frame_protector* self, - unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size, - uint32_t* still_pending_size); + tsi_frame_protector* self, unsigned char* protected_output_frames, + uint32_t* protected_output_frames_size, uint32_t* still_pending_size); /* Outputs unprotected bytes. - protected_frames_bytes is an input only parameter and points to the @@ -163,16 +159,13 @@ tsi_result tsi_frame_protector_protect_flush( needs to be read before new protected data can be processed in which case protected_frames_size will be set to 0. */ tsi_result tsi_frame_protector_unprotect( - tsi_frame_protector* self, - const unsigned char* protected_frames_bytes, - uint32_t* protected_frames_bytes_size, - unsigned char* unprotected_bytes, + tsi_frame_protector* self, const unsigned char* protected_frames_bytes, + uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes, uint32_t* unprotected_bytes_size); /* Destroys the tsi_frame_protector object. */ void tsi_frame_protector_destroy(tsi_frame_protector* self); - /* --- tsi_peer objects --- tsi_peer objects are a set of properties. The peer owns the properties. */ @@ -333,7 +326,6 @@ tsi_result tsi_handshaker_get_result(tsi_handshaker* self); #define tsi_handshaker_is_in_progress(h) \ (tsi_handshaker_get_result((h)) == TSI_HANDSHAKE_IN_PROGRESS) - /* This method may return TSI_FAILED_PRECONDITION if tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise assuming the handshaker is not in a fatal error state. @@ -357,8 +349,7 @@ tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer); the handshaker is not in a fatal error state. The caller is responsible for destroying the protector. */ tsi_result tsi_handshaker_create_frame_protector( - tsi_handshaker* self, - uint32_t* max_output_protected_frame_size, + tsi_handshaker* self, uint32_t* max_output_protected_frame_size, tsi_frame_protector** protector); /* This method releases the tsi_handshaker object. After this method is called, @@ -369,4 +360,4 @@ void tsi_handshaker_destroy(tsi_handshaker* self); } #endif -#endif /* __TRANSPORT_SECURITY_INTERFACE_H_ */ +#endif /* __TRANSPORT_SECURITY_INTERFACE_H_ */ diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc index bcda4ed40cc..ddda8c22d6d 100644 --- a/src/cpp/client/channel.cc +++ b/src/cpp/client/channel.cc @@ -172,10 +172,10 @@ Status Channel::StartBlockingRpc(const RpcMethod& method, return status; } -StreamContextInterface* Channel::CreateStream(const RpcMethod& method, - ClientContext* context, - const google::protobuf::Message* request, - google::protobuf::Message* result) { +StreamContextInterface* Channel::CreateStream( + const RpcMethod& method, ClientContext* context, + const google::protobuf::Message* request, + google::protobuf::Message* result) { grpc_call* call = grpc_channel_create_call( c_channel_, method.name(), target_.c_str(), context->RawDeadline()); context->set_call(call); diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h index 621e58539bf..8de1180ac29 100644 --- a/src/cpp/client/channel.h +++ b/src/cpp/client/channel.h @@ -58,10 +58,10 @@ class Channel : public ChannelInterface { const google::protobuf::Message& request, google::protobuf::Message* result) override; - StreamContextInterface* CreateStream(const RpcMethod& method, - ClientContext* context, - const google::protobuf::Message* request, - google::protobuf::Message* result) override; + StreamContextInterface* CreateStream( + const RpcMethod& method, ClientContext* context, + const google::protobuf::Message* request, + google::protobuf::Message* result) override; private: const grpc::string target_; diff --git a/src/cpp/client/credentials.cc b/src/cpp/client/credentials.cc index cac1d3d106c..d81cf9f4d07 100644 --- a/src/cpp/client/credentials.cc +++ b/src/cpp/client/credentials.cc @@ -31,7 +31,6 @@ * */ - #include #include @@ -112,7 +111,6 @@ std::unique_ptr CredentialsFactory::IAMCredentials( return cpp_creds; } - // Combines two credentials objects into a composite credentials. std::unique_ptr CredentialsFactory::ComposeCredentials( const std::unique_ptr& creds1, diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 255d1461a9a..3b94dc3c07f 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -40,7 +40,8 @@ namespace grpc { -bool SerializeProto(const google::protobuf::Message& msg, grpc_byte_buffer** bp) { +bool SerializeProto(const google::protobuf::Message& msg, + grpc_byte_buffer** bp) { grpc::string msg_str; bool success = msg.SerializeToString(&msg_str); if (success) { @@ -52,7 +53,8 @@ bool SerializeProto(const google::protobuf::Message& msg, grpc_byte_buffer** bp) return success; } -bool DeserializeProto(grpc_byte_buffer* buffer, google::protobuf::Message* msg) { +bool DeserializeProto(grpc_byte_buffer* buffer, + google::protobuf::Message* msg) { grpc::string msg_string; grpc_byte_buffer_reader* reader = grpc_byte_buffer_reader_create(buffer); gpr_slice slice; diff --git a/src/cpp/proto/proto_utils.h b/src/cpp/proto/proto_utils.h index 11471f1acb6..ea472f9c518 100644 --- a/src/cpp/proto/proto_utils.h +++ b/src/cpp/proto/proto_utils.h @@ -46,7 +46,8 @@ 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 google::protobuf::Message& msg, grpc_byte_buffer** buffer); +bool SerializeProto(const google::protobuf::Message& msg, + grpc_byte_buffer** buffer); // The caller keeps ownership of buffer and msg. bool DeserializeProto(grpc_byte_buffer* buffer, google::protobuf::Message* msg); diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index f44678b5699..298936dec9c 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -48,8 +48,7 @@ AsyncServerContext::AsyncServerContext( host_(host), absolute_deadline_(absolute_deadline), request_(nullptr), - call_(call) { -} + call_(call) {} AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } diff --git a/src/cpp/server/server_context_impl.cc b/src/cpp/server/server_context_impl.cc index 13f2a3ae1ac..467cc80e055 100644 --- a/src/cpp/server/server_context_impl.cc +++ b/src/cpp/server/server_context_impl.cc @@ -33,6 +33,4 @@ #include "src/cpp/server/server_context_impl.h" -namespace grpc { - -} // namespace grpc +namespace grpc {} // namespace grpc diff --git a/src/cpp/server/server_credentials.cc b/src/cpp/server/server_credentials.cc index f9ca1622bac..5d899b1cd94 100644 --- a/src/cpp/server/server_credentials.cc +++ b/src/cpp/server/server_credentials.cc @@ -31,7 +31,6 @@ * */ - #include #include diff --git a/src/cpp/server/server_rpc_handler.cc b/src/cpp/server/server_rpc_handler.cc index b7b29c24066..42f8b755b66 100644 --- a/src/cpp/server/server_rpc_handler.cc +++ b/src/cpp/server/server_rpc_handler.cc @@ -60,8 +60,10 @@ void ServerRpcHandler::StartRpc() { async_server_context_->Accept(cq_.cq()); // Allocate request and response. - std::unique_ptr request(method_->AllocateRequestProto()); - std::unique_ptr response(method_->AllocateResponseProto()); + std::unique_ptr request( + method_->AllocateRequestProto()); + std::unique_ptr response( + method_->AllocateResponseProto()); // Read request async_server_context_->StartRead(request.get()); @@ -86,8 +88,10 @@ void ServerRpcHandler::StartRpc() { } else { // Allocate request and response. // TODO(yangg) maybe not allocate both when not needed? - std::unique_ptr request(method_->AllocateRequestProto()); - std::unique_ptr response(method_->AllocateResponseProto()); + std::unique_ptr request( + method_->AllocateRequestProto()); + std::unique_ptr response( + method_->AllocateResponseProto()); StreamContext stream_context(*method_, async_server_context_->call(), cq_.cq(), request.get(), response.get()); diff --git a/src/cpp/stream/stream_context.cc b/src/cpp/stream/stream_context.cc index 6c424b937ed..7936a30dfd7 100644 --- a/src/cpp/stream/stream_context.cc +++ b/src/cpp/stream/stream_context.cc @@ -61,7 +61,8 @@ StreamContext::StreamContext(const RpcMethod& method, ClientContext* context, // Server only ctor StreamContext::StreamContext(const RpcMethod& method, grpc_call* call, grpc_completion_queue* cq, - google::protobuf::Message* request, google::protobuf::Message* result) + google::protobuf::Message* request, + google::protobuf::Message* result) : is_client_(false), method_(&method), call_(call), diff --git a/src/cpp/stream/stream_context.h b/src/cpp/stream/stream_context.h index 6c31095042a..f70fe6daa34 100644 --- a/src/cpp/stream/stream_context.h +++ b/src/cpp/stream/stream_context.h @@ -51,7 +51,8 @@ class RpcMethod; class StreamContext : public StreamContextInterface { public: StreamContext(const RpcMethod& method, ClientContext* context, - const google::protobuf::Message* request, google::protobuf::Message* result); + const google::protobuf::Message* request, + google::protobuf::Message* result); StreamContext(const RpcMethod& method, grpc_call* call, grpc_completion_queue* cq, google::protobuf::Message* request, google::protobuf::Message* result); @@ -81,11 +82,11 @@ class StreamContext : public StreamContextInterface { grpc_completion_queue* cq() { return cq_; } bool is_client_; - const RpcMethod* method_; // not owned - grpc_call* call_; // not owned - grpc_completion_queue* cq_; // not owned - google::protobuf::Message* request_; // first request, not owned - google::protobuf::Message* result_; // last response, not owned + const RpcMethod* method_; // not owned + grpc_call* call_; // not owned + grpc_completion_queue* cq_; // not owned + google::protobuf::Message* request_; // first request, not owned + google::protobuf::Message* result_; // last response, not owned bool peer_halfclosed_; bool self_halfclosed_; diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index 66be26da074..e7ca41b7523 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -31,7 +31,6 @@ * */ - #include namespace grpc { diff --git a/src/php/ext/grpc/byte_buffer.c b/src/php/ext/grpc/byte_buffer.c old mode 100755 new mode 100644 index db018313a76..e2f63e3413b --- a/src/php/ext/grpc/byte_buffer.c +++ b/src/php/ext/grpc/byte_buffer.c @@ -21,16 +21,15 @@ grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length) { return grpc_byte_buffer_create(&slice, 1); } -void byte_buffer_to_string(grpc_byte_buffer *buffer, - char **out_string, +void byte_buffer_to_string(grpc_byte_buffer *buffer, char **out_string, size_t *out_length) { size_t length = grpc_byte_buffer_length(buffer); - char *string = ecalloc(length+1, sizeof(char)); + char *string = ecalloc(length + 1, sizeof(char)); size_t offset = 0; grpc_byte_buffer_reader *reader = grpc_byte_buffer_reader_create(buffer); gpr_slice next; - while(grpc_byte_buffer_reader_next(reader, &next) != 0) { - memcpy(string+offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next)); + while (grpc_byte_buffer_reader_next(reader, &next) != 0) { + memcpy(string + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next)); offset += GPR_SLICE_LENGTH(next); } *out_string = string; diff --git a/src/php/ext/grpc/byte_buffer.h b/src/php/ext/grpc/byte_buffer.h old mode 100755 new mode 100644 index 1dd4769de24..b83f734caf3 --- a/src/php/ext/grpc/byte_buffer.h +++ b/src/php/ext/grpc/byte_buffer.h @@ -5,8 +5,7 @@ grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length); -void byte_buffer_to_string(grpc_byte_buffer *buffer, - char **out_string, +void byte_buffer_to_string(grpc_byte_buffer *buffer, char **out_string, size_t *out_length); #endif /* NET_GRPC_PHP_GRPC_BYTE_BUFFER_H_ */ diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c old mode 100755 new mode 100644 index 7f4f221caa0..c01af34e958 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -24,9 +24,9 @@ #include "byte_buffer.h" /* Frees and destroys an instance of wrapped_grpc_call */ -void free_wrapped_grpc_call(void *object TSRMLS_DC){ - wrapped_grpc_call *call = (wrapped_grpc_call*)object; - if(call->owned && call->wrapped != NULL){ +void free_wrapped_grpc_call(void *object TSRMLS_DC) { + wrapped_grpc_call *call = (wrapped_grpc_call *)object; + if (call->owned && call->wrapped != NULL) { grpc_call_destroy(call->wrapped); } efree(call); @@ -34,38 +34,36 @@ void free_wrapped_grpc_call(void *object TSRMLS_DC){ /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ -zend_object_value create_wrapped_grpc_call( - zend_class_entry *class_type TSRMLS_DC){ +zend_object_value create_wrapped_grpc_call(zend_class_entry *class_type + TSRMLS_DC) { zend_object_value retval; wrapped_grpc_call *intern; - intern = (wrapped_grpc_call*)emalloc(sizeof(wrapped_grpc_call)); + intern = (wrapped_grpc_call *)emalloc(sizeof(wrapped_grpc_call)); memset(intern, 0, sizeof(wrapped_grpc_call)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t) zend_objects_destroy_object, - free_wrapped_grpc_call, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_call, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } /* Wraps a grpc_call struct in a PHP object. Owned indicates whether the struct should be destroyed at the end of the object's lifecycle */ -zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned){ +zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned) { zval *call_object; MAKE_STD_ZVAL(call_object); object_init_ex(call_object, grpc_ce_call); - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - call_object TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(call_object TSRMLS_CC); call->wrapped = wrapped; return call_object; } -zval *grpc_call_create_metadata_array(int count, grpc_metadata *elements){ +zval *grpc_call_create_metadata_array(int count, grpc_metadata *elements) { int i; zval *array; zval **data = NULL; @@ -78,18 +76,16 @@ zval *grpc_call_create_metadata_array(int count, grpc_metadata *elements){ array_init(array); array_hash = Z_ARRVAL_P(array); grpc_metadata *elem; - for(i=0; ikey); - str_key = ecalloc(key_len+1, sizeof(char)); + str_key = ecalloc(key_len + 1, sizeof(char)); memcpy(str_key, elem->key, key_len); - str_val = ecalloc(elem->value_length+1, sizeof(char)); + str_val = ecalloc(elem->value_length + 1, sizeof(char)); memcpy(str_val, elem->value, elem->value_length); - if(zend_hash_find(array_hash, - str_key, - key_len, - (void**)data) == SUCCESS){ - switch(Z_TYPE_P(*data)){ + if (zend_hash_find(array_hash, str_key, key_len, (void **)data) == + SUCCESS) { + switch (Z_TYPE_P(*data)) { case IS_STRING: MAKE_STD_ZVAL(inner_array); array_init(inner_array); @@ -107,44 +103,36 @@ zval *grpc_call_create_metadata_array(int count, grpc_metadata *elements){ efree(str_val); return NULL; } - add_next_index_stringl(inner_array, - str_val, - elem->value_length, - false); + add_next_index_stringl(inner_array, str_val, elem->value_length, false); } else { - add_assoc_stringl(array, - str_key, - str_val, - elem->value_length, - false); + add_assoc_stringl(array, str_key, str_val, elem->value_length, false); } } return array; } -int php_grpc_call_add_metadata_array_walk(void *elem TSRMLS_DC, - int num_args, +int php_grpc_call_add_metadata_array_walk(void *elem TSRMLS_DC, int num_args, va_list args, - zend_hash_key *hash_key){ + zend_hash_key *hash_key) { grpc_call_error error_code; - zval **data = (zval**)elem; + zval **data = (zval **)elem; grpc_metadata metadata; - grpc_call *call = va_arg(args, grpc_call*); + grpc_call *call = va_arg(args, grpc_call *); gpr_uint32 flags = va_arg(args, gpr_uint32); const char *key; HashTable *inner_hash; /* We assume that either two args were passed, and we are in the recursive case (and the second argument is the key), or one arg was passed and hash_key is the string key. */ - if(num_args > 2){ - key = va_arg(args, const char*); + if (num_args > 2) { + key = va_arg(args, const char *); } else { /* TODO(mlumish): If possible, check that hash_key is a string */ key = hash_key->arKey; } - switch(Z_TYPE_P(*data)){ + switch (Z_TYPE_P(*data)) { case IS_STRING: - metadata.key = (char*)key; + metadata.key = (char *)key; metadata.value = Z_STRVAL_P(*data); metadata.value_length = Z_STRLEN_P(*data); error_code = grpc_call_add_metadata(call, &metadata, 0u); @@ -153,11 +141,8 @@ int php_grpc_call_add_metadata_array_walk(void *elem TSRMLS_DC, case IS_ARRAY: inner_hash = Z_ARRVAL_P(*data); zend_hash_apply_with_arguments(inner_hash TSRMLS_CC, - php_grpc_call_add_metadata_array_walk, - 3, - call, - flags, - key); + php_grpc_call_add_metadata_array_walk, 3, + call, flags, key); break; default: zend_throw_exception(zend_exception_get_default(), @@ -174,27 +159,26 @@ int php_grpc_call_add_metadata_array_walk(void *elem TSRMLS_DC, * @param string $method The method to call * @param Timeval $absolute_deadline The deadline for completing the call */ -PHP_METHOD(Call, __construct){ - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); +PHP_METHOD(Call, __construct) { + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); zval *channel_obj; char *method; int method_len; zval *deadline_obj; /* "OsO" == 1 Object, 1 string, 1 Object */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "OsO", - &channel_obj, grpc_ce_channel, - &method, &method_len, - &deadline_obj, grpc_ce_timeval) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OsO", &channel_obj, + grpc_ce_channel, &method, &method_len, + &deadline_obj, grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "Call expects a Channel, a String, and a Timeval", 1 TSRMLS_CC); return; } wrapped_grpc_channel *channel = - (wrapped_grpc_channel*)zend_object_store_get_object(channel_obj TSRMLS_CC); - if(channel->wrapped == NULL) { + (wrapped_grpc_channel *)zend_object_store_get_object( + channel_obj TSRMLS_CC); + if (channel->wrapped == NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, "Call cannot be constructed from a closed Channel", 1 TSRMLS_CC); @@ -202,11 +186,10 @@ PHP_METHOD(Call, __construct){ } add_property_zval(getThis(), "channel", channel_obj); wrapped_grpc_timeval *deadline = - (wrapped_grpc_timeval*)zend_object_store_get_object(deadline_obj TSRMLS_CC); - call->wrapped = grpc_channel_create_call(channel->wrapped, - method, - channel->target, - deadline->wrapped); + (wrapped_grpc_timeval *)zend_object_store_get_object( + deadline_obj TSRMLS_CC); + call->wrapped = grpc_channel_create_call(channel->wrapped, method, + channel->target, deadline->wrapped); } /** @@ -218,17 +201,15 @@ PHP_METHOD(Call, __construct){ * (optional) * @return Void */ -PHP_METHOD(Call, add_metadata){ - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); +PHP_METHOD(Call, add_metadata) { + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); zval *array; HashTable *array_hash; long flags = 0; /* "a|l" == 1 array, 1 optional long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "a|l", - &array, - &flags) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|l", &array, &flags) == + FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "add_metadata expects an array and an optional long", 1 TSRMLS_CC); @@ -236,10 +217,8 @@ PHP_METHOD(Call, add_metadata){ } array_hash = Z_ARRVAL_P(array); zend_hash_apply_with_arguments(array_hash TSRMLS_CC, - php_grpc_call_add_metadata_array_walk, - 2, - call->wrapped, - (gpr_uint32)flags); + php_grpc_call_add_metadata_array_walk, 2, + call->wrapped, (gpr_uint32)flags); } /** @@ -252,7 +231,7 @@ PHP_METHOD(Call, add_metadata){ * (optional) * @return Void */ -PHP_METHOD(Call, start_invoke){ +PHP_METHOD(Call, start_invoke) { grpc_call_error error_code; long tag1; long tag2; @@ -260,31 +239,24 @@ PHP_METHOD(Call, start_invoke){ zval *queue_obj; long flags = 0; /* "Olll|l" == 1 Object, 3 mandatory longs, 1 optional long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Olll|l", - &queue_obj, grpc_ce_completion_queue, - &tag1, - &tag2, - &tag3, - &flags) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Olll|l", &queue_obj, + grpc_ce_completion_queue, &tag1, &tag2, &tag3, + &flags) == FAILURE) { zend_throw_exception( spl_ce_InvalidArgumentException, "start_invoke needs a CompletionQueue, 3 longs, and an optional long", - 1 TSRMLS_CC); + 1 TSRMLS_CC); return; } add_property_zval(getThis(), "completion_queue", queue_obj); - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); wrapped_grpc_completion_queue *queue = - (wrapped_grpc_completion_queue*)zend_object_store_get_object( - queue_obj TSRMLS_CC); - error_code = grpc_call_start_invoke(call->wrapped, - queue->wrapped, - (void*)tag1, - (void*)tag2, - (void*)tag3, - (gpr_uint32)flags); + (wrapped_grpc_completion_queue *)zend_object_store_get_object( + queue_obj TSRMLS_CC); + error_code = + grpc_call_start_invoke(call->wrapped, queue->wrapped, (void *)tag1, + (void *)tag2, (void *)tag3, (gpr_uint32)flags); MAYBE_THROW_CALL_ERROR(start_invoke, error_code); } @@ -298,15 +270,13 @@ PHP_METHOD(Call, start_invoke){ * (optional) * @return Void */ -PHP_METHOD(Call, server_accept){ +PHP_METHOD(Call, server_accept) { long tag; zval *queue_obj; grpc_call_error error_code; /* "Ol|l" == 1 Object, 1 long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "Ol", - &queue_obj, grpc_ce_completion_queue, - &tag) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Ol", &queue_obj, + grpc_ce_completion_queue, &tag) == FAILURE) { zend_throw_exception( spl_ce_InvalidArgumentException, "server_accept expects a CompletionQueue, a long, and an optional long", @@ -314,14 +284,13 @@ PHP_METHOD(Call, server_accept){ return; } add_property_zval(getThis(), "completion_queue", queue_obj); - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); wrapped_grpc_completion_queue *queue = - (wrapped_grpc_completion_queue*)zend_object_store_get_object( - queue_obj TSRMLS_CC); - error_code = grpc_call_server_accept(call->wrapped, - queue->wrapped, - (void*)tag); + (wrapped_grpc_completion_queue *)zend_object_store_get_object( + queue_obj TSRMLS_CC); + error_code = + grpc_call_server_accept(call->wrapped, queue->wrapped, (void *)tag); MAYBE_THROW_CALL_ERROR(server_accept, error_code); } @@ -329,16 +298,14 @@ PHP_METHOD(Call, server_end_initial_metadata) { grpc_call_error error_code; long flags = 0; /* "|l" == 1 optional long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "|l", - &flags) == FAILURE) { - zend_throw_exception( - spl_ce_InvalidArgumentException, - "server_end_initial_metadata expects an optional long", - 1 TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == + FAILURE) { + zend_throw_exception(spl_ce_InvalidArgumentException, + "server_end_initial_metadata expects an optional long", + 1 TSRMLS_CC); } - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); error_code = grpc_call_server_end_initial_metadata(call->wrapped, flags); MAYBE_THROW_CALL_ERROR(server_end_initial_metadata, error_code); } @@ -347,9 +314,9 @@ PHP_METHOD(Call, server_end_initial_metadata) { * Called by clients to cancel an RPC on the server. * @return Void */ -PHP_METHOD(Call, cancel){ - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); +PHP_METHOD(Call, cancel) { + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); grpc_call_error error_code = grpc_call_cancel(call->wrapped); MAYBE_THROW_CALL_ERROR(cancel, error_code); } @@ -362,30 +329,25 @@ PHP_METHOD(Call, cancel){ * (optional) * @return Void */ -PHP_METHOD(Call, start_write){ +PHP_METHOD(Call, start_write) { grpc_call_error error_code; - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); char *buffer; int buffer_len; long tag; long flags = 0; /* "Ol|l" == 1 Object, 1 mandatory long, 1 optional long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "sl|l", - &buffer, &buffer_len, - &tag, - &flags) == FAILURE){ - zend_throw_exception( - spl_ce_InvalidArgumentException, - "start_write expects a string and an optional long", - 1 TSRMLS_CC); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &buffer, + &buffer_len, &tag, &flags) == FAILURE) { + zend_throw_exception(spl_ce_InvalidArgumentException, + "start_write expects a string and an optional long", + 1 TSRMLS_CC); return; } error_code = grpc_call_start_write(call->wrapped, string_to_byte_buffer(buffer, buffer_len), - (void*)tag, - (gpr_uint32)flags); + (void *)tag, (gpr_uint32)flags); MAYBE_THROW_CALL_ERROR(start_write, error_code); } @@ -396,30 +358,26 @@ PHP_METHOD(Call, start_write){ * @param long $tag The tag to associate with this status * @return Void */ -PHP_METHOD(Call, start_write_status){ +PHP_METHOD(Call, start_write_status) { grpc_call_error error_code; - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); long status_code; int status_details_length; long tag; char *status_details; /* "lsl" == 1 long, 1 string, 1 long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "lsl", - &status_code, - &status_details, &status_details_length, - &tag) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsl", &status_code, + &status_details, &status_details_length, + &tag) == FAILURE) { zend_throw_exception( spl_ce_InvalidArgumentException, - "start_write_status expects a long, a string, and a long", - 1 TSRMLS_CC); + "start_write_status expects a long, a string, and a long", 1 TSRMLS_CC); return; } - error_code = grpc_call_start_write_status(call->wrapped, - (grpc_status_code)status_code, - status_details, - (void*)tag); + error_code = + grpc_call_start_write_status(call->wrapped, (grpc_status_code)status_code, + status_details, (void *)tag); MAYBE_THROW_CALL_ERROR(start_write_status, error_code); } @@ -427,19 +385,18 @@ PHP_METHOD(Call, start_write_status){ * Indicate that there are no more messages to send * @return Void */ -PHP_METHOD(Call, writes_done){ +PHP_METHOD(Call, writes_done) { grpc_call_error error_code; - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); long tag; /* "l" == 1 long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "writes_done expects a long", - 1 TSRMLS_CC); + "writes_done expects a long", 1 TSRMLS_CC); return; } - error_code = grpc_call_writes_done(call->wrapped, (void*)tag); + error_code = grpc_call_writes_done(call->wrapped, (void *)tag); MAYBE_THROW_CALL_ERROR(writes_done, error_code); } @@ -449,37 +406,35 @@ PHP_METHOD(Call, writes_done){ * @param long $tag The tag to associate with this read * @return Void */ -PHP_METHOD(Call, start_read){ +PHP_METHOD(Call, start_read) { grpc_call_error error_code; - wrapped_grpc_call *call = (wrapped_grpc_call*)zend_object_store_get_object( - getThis() TSRMLS_CC); + wrapped_grpc_call *call = + (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); long tag; /* "l" == 1 long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "start_read expects a long", - 1 TSRMLS_CC); + "start_read expects a long", 1 TSRMLS_CC); return; } - error_code = grpc_call_start_read(call->wrapped, (void*)tag); + error_code = grpc_call_start_read(call->wrapped, (void *)tag); MAYBE_THROW_CALL_ERROR(start_read, error_code); } static zend_function_entry call_methods[] = { - PHP_ME(Call, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Call, server_accept, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, server_end_initial_metadata, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, add_metadata, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, cancel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, start_invoke, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, start_read, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, start_write, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, start_write_status, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Call, writes_done, NULL, ZEND_ACC_PUBLIC) - PHP_FE_END -}; + PHP_ME(Call, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Call, server_accept, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Call, server_end_initial_metadata, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Call, add_metadata, NULL, ZEND_ACC_PUBLIC) PHP_ME( + Call, cancel, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Call, start_invoke, NULL, ZEND_ACC_PUBLIC) PHP_ME( + Call, start_read, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Call, start_write, NULL, ZEND_ACC_PUBLIC) PHP_ME( + Call, start_write_status, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Call, writes_done, NULL, ZEND_ACC_PUBLIC) + PHP_FE_END}; -void grpc_init_call(TSRMLS_D){ +void grpc_init_call(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\Call", call_methods); ce.create_object = create_wrapped_grpc_call; diff --git a/src/php/ext/grpc/call.h b/src/php/ext/grpc/call.h old mode 100755 new mode 100644 index c3b18d66cb6..232c5d7cf29 --- a/src/php/ext/grpc/call.h +++ b/src/php/ext/grpc/call.h @@ -13,15 +13,14 @@ #include "grpc/grpc.h" // Throw an exception if error_code is not OK -#define MAYBE_THROW_CALL_ERROR(func_name, error_code) \ - do{ \ - if(error_code != GRPC_CALL_OK) { \ - zend_throw_exception(spl_ce_LogicException, \ - #func_name " was called incorrectly", \ - (long)error_code TSRMLS_CC); \ - } \ - } while(0) - +#define MAYBE_THROW_CALL_ERROR(func_name, error_code) \ + do { \ + if (error_code != GRPC_CALL_OK) { \ + zend_throw_exception(spl_ce_LogicException, \ + #func_name " was called incorrectly", \ + (long)error_code TSRMLS_CC); \ + } \ + } while (0) /* Class entry for the Call PHP class */ zend_class_entry *grpc_ce_call; diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c old mode 100755 new mode 100644 index c2847b99f1c..f0e4153b22a --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -23,9 +23,9 @@ #include "credentials.h" /* Frees and destroys an instance of wrapped_grpc_channel */ -void free_wrapped_grpc_channel(void *object TSRMLS_DC){ - wrapped_grpc_channel *channel = (wrapped_grpc_channel*)object; - if(channel->wrapped != NULL){ +void free_wrapped_grpc_channel(void *object TSRMLS_DC) { + wrapped_grpc_channel *channel = (wrapped_grpc_channel *)object; + if (channel->wrapped != NULL) { grpc_channel_destroy(channel->wrapped); } efree(channel); @@ -33,24 +33,22 @@ void free_wrapped_grpc_channel(void *object TSRMLS_DC){ /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_channel( - zend_class_entry *class_type TSRMLS_DC){ +zend_object_value create_wrapped_grpc_channel(zend_class_entry *class_type + TSRMLS_DC) { zend_object_value retval; wrapped_grpc_channel *intern; - intern = (wrapped_grpc_channel*)emalloc(sizeof(wrapped_grpc_channel)); + intern = (wrapped_grpc_channel *)emalloc(sizeof(wrapped_grpc_channel)); memset(intern, 0, sizeof(wrapped_grpc_channel)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_channel, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_channel, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } -void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args){ +void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args) { HashTable *array_hash; HashPosition array_pointer; int args_index; @@ -62,24 +60,18 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args){ args->num_args = zend_hash_num_elements(array_hash); args->args = ecalloc(args->num_args, sizeof(grpc_arg)); args_index = 0; - for(zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, - (void**)&data, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)){ - if(zend_hash_get_current_key_ex(array_hash, - &key, - &key_len, - &index, - 0, - &array_pointer) != HASH_KEY_IS_STRING){ + for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); + zend_hash_get_current_data_ex(array_hash, (void **)&data, + &array_pointer) == SUCCESS; + zend_hash_move_forward_ex(array_hash, &array_pointer)) { + if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, + &array_pointer) != HASH_KEY_IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, - "args keys must be strings", - 1 TSRMLS_CC); + "args keys must be strings", 1 TSRMLS_CC); return; } args->args[args_index].key = key; - switch(Z_TYPE_P(*data)){ + switch (Z_TYPE_P(*data)) { case IS_LONG: args->args[args_index].value.integer = (int)Z_LVAL_P(*data); break; @@ -88,8 +80,7 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args){ break; default: zend_throw_exception(spl_ce_InvalidArgumentException, - "args values must be int or string", - 1 TSRMLS_CC); + "args values must be int or string", 1 TSRMLS_CC); return; } args_index++; @@ -103,9 +94,9 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args){ * @param string $target The hostname to associate with this channel * @param array $args The arguments to pass to the Channel (optional) */ -PHP_METHOD(Channel, __construct){ +PHP_METHOD(Channel, __construct) { wrapped_grpc_channel *channel = - (wrapped_grpc_channel*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_channel *)zend_object_store_get_object(getThis() TSRMLS_CC); char *target; int target_length; zval *args_array = NULL; @@ -114,30 +105,25 @@ PHP_METHOD(Channel, __construct){ zval **creds_obj = NULL; wrapped_grpc_credentials *creds = NULL; /* "s|a" == 1 string, 1 optional array */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "s|a", - &target, &target_length, - &args_array) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &target, + &target_length, &args_array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "Channel expects a string and an array", - 1 TSRMLS_CC); + "Channel expects a string and an array", 1 TSRMLS_CC); return; } if (args_array == NULL) { channel->wrapped = grpc_channel_create(target, NULL); } else { array_hash = Z_ARRVAL_P(args_array); - if(zend_hash_find(array_hash, - "credentials", - sizeof("credentials"), - (void**)&creds_obj) == SUCCESS) { - if(zend_get_class_entry(*creds_obj TSRMLS_CC) != grpc_ce_credentials) { + if (zend_hash_find(array_hash, "credentials", sizeof("credentials"), + (void **)&creds_obj) == SUCCESS) { + if (zend_get_class_entry(*creds_obj TSRMLS_CC) != grpc_ce_credentials) { zend_throw_exception(spl_ce_InvalidArgumentException, "credentials must be a Credentials object", 1 TSRMLS_CC); return; } - creds = (wrapped_grpc_credentials*)zend_object_store_get_object( + creds = (wrapped_grpc_credentials *)zend_object_store_get_object( *creds_obj TSRMLS_CC); zend_hash_del(array_hash, "credentials", 12); } @@ -146,35 +132,32 @@ PHP_METHOD(Channel, __construct){ channel->wrapped = grpc_channel_create(target, &args); } else { gpr_log(GPR_DEBUG, "Initialized secure channel"); - channel->wrapped = grpc_secure_channel_create(creds->wrapped, - target, - &args); + channel->wrapped = + grpc_secure_channel_create(creds->wrapped, target, &args); } efree(args.args); } - channel->target = ecalloc(target_length+1, sizeof(char)); + channel->target = ecalloc(target_length + 1, sizeof(char)); memcpy(channel->target, target, target_length); } /** * Close the channel */ -PHP_METHOD(Channel, close){ +PHP_METHOD(Channel, close) { wrapped_grpc_channel *channel = - (wrapped_grpc_channel*)zend_object_store_get_object(getThis() TSRMLS_CC); - if(channel->wrapped != NULL) { + (wrapped_grpc_channel *)zend_object_store_get_object(getThis() TSRMLS_CC); + if (channel->wrapped != NULL) { grpc_channel_destroy(channel->wrapped); channel->wrapped = NULL; } } static zend_function_entry channel_methods[] = { - PHP_ME(Channel, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Channel, close, NULL, ZEND_ACC_PUBLIC) - PHP_FE_END -}; + PHP_ME(Channel, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Channel, close, NULL, ZEND_ACC_PUBLIC) PHP_FE_END}; -void grpc_init_channel(TSRMLS_D){ +void grpc_init_channel(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\Channel", channel_methods); ce.create_object = create_wrapped_grpc_channel; diff --git a/src/php/ext/grpc/completion_queue.c b/src/php/ext/grpc/completion_queue.c old mode 100755 new mode 100644 index 0570bd50295..9785eab8cc1 --- a/src/php/ext/grpc/completion_queue.c +++ b/src/php/ext/grpc/completion_queue.c @@ -20,15 +20,15 @@ #include "timeval.h" /* Frees and destroys a wrapped instance of grpc_completion_queue */ -void free_wrapped_grpc_completion_queue(void *object TSRMLS_DC){ +void free_wrapped_grpc_completion_queue(void *object TSRMLS_DC) { wrapped_grpc_completion_queue *queue = NULL; grpc_event *event; - queue = (wrapped_grpc_completion_queue*)object; - if(queue->wrapped != NULL){ + queue = (wrapped_grpc_completion_queue *)object; + if (queue->wrapped != NULL) { grpc_completion_queue_shutdown(queue->wrapped); event = grpc_completion_queue_next(queue->wrapped, gpr_inf_future); - while(event != NULL){ - if(event->type == GRPC_QUEUE_SHUTDOWN){ + while (event != NULL) { + if (event->type == GRPC_QUEUE_SHUTDOWN) { break; } event = grpc_completion_queue_next(queue->wrapped, gpr_inf_future); @@ -41,21 +41,19 @@ void free_wrapped_grpc_completion_queue(void *object TSRMLS_DC){ /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ zend_object_value create_wrapped_grpc_completion_queue( - zend_class_entry *class_type TSRMLS_DC){ + zend_class_entry *class_type TSRMLS_DC) { zend_object_value retval; wrapped_grpc_completion_queue *intern; - intern = (wrapped_grpc_completion_queue*)emalloc( + intern = (wrapped_grpc_completion_queue *)emalloc( sizeof(wrapped_grpc_completion_queue)); memset(intern, 0, sizeof(wrapped_grpc_completion_queue)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t) zend_objects_destroy_object, - free_wrapped_grpc_completion_queue, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_completion_queue, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } @@ -63,10 +61,10 @@ zend_object_value create_wrapped_grpc_completion_queue( /** * Construct an instance of CompletionQueue */ -PHP_METHOD(CompletionQueue, __construct){ +PHP_METHOD(CompletionQueue, __construct) { wrapped_grpc_completion_queue *queue = - (wrapped_grpc_completion_queue*)zend_object_store_get_object( - getThis() TSRMLS_CC); + (wrapped_grpc_completion_queue *)zend_object_store_get_object( + getThis() TSRMLS_CC); queue->wrapped = grpc_completion_queue_create(); } @@ -78,52 +76,46 @@ PHP_METHOD(CompletionQueue, __construct){ * @param Timeval $timeout The timeout for the event * @return Event The event that occurred */ -PHP_METHOD(CompletionQueue, next){ +PHP_METHOD(CompletionQueue, next) { zval *timeout; /* "O" == 1 Object */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", - &timeout, grpc_ce_timeval)==FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &timeout, + grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "next needs a Timeval", - 1 TSRMLS_CC); + "next needs a Timeval", 1 TSRMLS_CC); return; } wrapped_grpc_completion_queue *completion_queue = - (wrapped_grpc_completion_queue*)zend_object_store_get_object( - getThis() TSRMLS_CC); + (wrapped_grpc_completion_queue *)zend_object_store_get_object( + getThis() TSRMLS_CC); wrapped_grpc_timeval *wrapped_timeout = - (wrapped_grpc_timeval*)zend_object_store_get_object(timeout TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(timeout TSRMLS_CC); grpc_event *event = grpc_completion_queue_next(completion_queue->wrapped, wrapped_timeout->wrapped); - if(event == NULL){ + if (event == NULL) { RETURN_NULL(); } zval *wrapped_event = grpc_php_convert_event(event); RETURN_DESTROY_ZVAL(wrapped_event); } -PHP_METHOD(CompletionQueue, pluck){ +PHP_METHOD(CompletionQueue, pluck) { long tag; zval *timeout; /* "lO" == 1 long, 1 Object */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "lO", - &tag, - &timeout, grpc_ce_timeval)==FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lO", &tag, &timeout, + grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "pluck needs a long and a Timeval", - 1 TSRMLS_CC); + "pluck needs a long and a Timeval", 1 TSRMLS_CC); } wrapped_grpc_completion_queue *completion_queue = - (wrapped_grpc_completion_queue*)zend_object_store_get_object( + (wrapped_grpc_completion_queue *)zend_object_store_get_object( getThis() TSRMLS_CC); wrapped_grpc_timeval *wrapped_timeout = - (wrapped_grpc_timeval*)zend_object_store_get_object(timeout TSRMLS_CC); - grpc_event *event = grpc_completion_queue_pluck(completion_queue->wrapped, - (void*)tag, - wrapped_timeout->wrapped); - if(event == NULL){ + (wrapped_grpc_timeval *)zend_object_store_get_object(timeout TSRMLS_CC); + grpc_event *event = grpc_completion_queue_pluck( + completion_queue->wrapped, (void *)tag, wrapped_timeout->wrapped); + if (event == NULL) { RETURN_NULL(); } zval *wrapped_event = grpc_php_convert_event(event); @@ -131,13 +123,11 @@ PHP_METHOD(CompletionQueue, pluck){ } static zend_function_entry completion_queue_methods[] = { - PHP_ME(CompletionQueue, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(CompletionQueue, next, NULL, ZEND_ACC_PUBLIC) - PHP_ME(CompletionQueue, pluck, NULL, ZEND_ACC_PUBLIC) - PHP_FE_END -}; + PHP_ME(CompletionQueue, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(CompletionQueue, next, NULL, ZEND_ACC_PUBLIC) + PHP_ME(CompletionQueue, pluck, NULL, ZEND_ACC_PUBLIC) PHP_FE_END}; -void grpc_init_completion_queue(TSRMLS_D){ +void grpc_init_completion_queue(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\CompletionQueue", completion_queue_methods); ce.create_object = create_wrapped_grpc_completion_queue; diff --git a/src/php/ext/grpc/credentials.c b/src/php/ext/grpc/credentials.c old mode 100755 new mode 100644 index ffafddae5f2..f486272531d --- a/src/php/ext/grpc/credentials.c +++ b/src/php/ext/grpc/credentials.c @@ -17,9 +17,9 @@ #include "grpc/grpc_security.h" /* Frees and destroys an instance of wrapped_grpc_credentials */ -void free_wrapped_grpc_credentials(void *object TSRMLS_DC){ - wrapped_grpc_credentials *creds = (wrapped_grpc_credentials*)object; - if(creds->wrapped != NULL) { +void free_wrapped_grpc_credentials(void *object TSRMLS_DC) { + wrapped_grpc_credentials *creds = (wrapped_grpc_credentials *)object; + if (creds->wrapped != NULL) { grpc_credentials_release(creds->wrapped); } efree(creds); @@ -27,32 +27,31 @@ void free_wrapped_grpc_credentials(void *object TSRMLS_DC){ /* Initializes an instance of wrapped_grpc_credentials to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_credentials( - zend_class_entry *class_type TSRMLS_DC){ +zend_object_value create_wrapped_grpc_credentials(zend_class_entry *class_type + TSRMLS_DC) { zend_object_value retval; wrapped_grpc_credentials *intern; - intern = (wrapped_grpc_credentials*)emalloc(sizeof(wrapped_grpc_credentials)); + intern = + (wrapped_grpc_credentials *)emalloc(sizeof(wrapped_grpc_credentials)); memset(intern, 0, sizeof(wrapped_grpc_credentials)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t) zend_objects_destroy_object, - free_wrapped_grpc_credentials, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } -zval *grpc_php_wrap_credentials(grpc_credentials *wrapped){ +zval *grpc_php_wrap_credentials(grpc_credentials *wrapped) { zval *credentials_object; MAKE_STD_ZVAL(credentials_object); object_init_ex(credentials_object, grpc_ce_credentials); wrapped_grpc_credentials *credentials = - (wrapped_grpc_credentials*)zend_object_store_get_object( - credentials_object TSRMLS_CC); + (wrapped_grpc_credentials *)zend_object_store_get_object( + credentials_object TSRMLS_CC); credentials->wrapped = wrapped; return credentials_object; } @@ -61,7 +60,7 @@ zval *grpc_php_wrap_credentials(grpc_credentials *wrapped){ * Create a default credentials object. * @return Credentials The new default credentials object */ -PHP_METHOD(Credentials, createDefault){ +PHP_METHOD(Credentials, createDefault) { grpc_credentials *creds = grpc_default_credentials_create(); zval *creds_object = grpc_php_wrap_credentials(creds); RETURN_DESTROY_ZVAL(creds_object); @@ -76,7 +75,7 @@ PHP_METHOD(Credentials, createDefault){ * (optional) * @return Credentials The new SSL credentials object */ -PHP_METHOD(Credentials, createSsl){ +PHP_METHOD(Credentials, createSsl) { char *pem_root_certs; char *pem_private_key = NULL; char *pem_cert_chain = NULL; @@ -84,20 +83,18 @@ PHP_METHOD(Credentials, createSsl){ int root_certs_length, private_key_length = 0, cert_chain_length = 0; /* "s|s!s! == 1 string, 2 optional nullable strings */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "s|s!s!", - &pem_root_certs, &root_certs_length, - &pem_private_key, &private_key_length, - &pem_cert_chain, &cert_chain_length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!s!", + &pem_root_certs, &root_certs_length, + &pem_private_key, &private_key_length, + &pem_cert_chain, &cert_chain_length) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "createSsl expects 1 to 3 strings", - 1 TSRMLS_CC); + "createSsl expects 1 to 3 strings", 1 TSRMLS_CC); return; } grpc_credentials *creds = grpc_ssl_credentials_create( - (unsigned char*)pem_root_certs, (size_t)root_certs_length, - (unsigned char*)pem_private_key, (size_t)private_key_length, - (unsigned char*)pem_cert_chain, (size_t)cert_chain_length); + (unsigned char *)pem_root_certs, (size_t)root_certs_length, + (unsigned char *)pem_private_key, (size_t)private_key_length, + (unsigned char *)pem_cert_chain, (size_t)cert_chain_length); zval *creds_object = grpc_php_wrap_credentials(creds); RETURN_DESTROY_ZVAL(creds_object); } @@ -108,28 +105,26 @@ PHP_METHOD(Credentials, createSsl){ * @param Credentials cred2 The second credential * @return Credentials The new composite credentials object */ -PHP_METHOD(Credentials, createComposite){ +PHP_METHOD(Credentials, createComposite) { zval *cred1_obj; zval *cred2_obj; /* "OO" == 3 Objects */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "OO", - &cred1_obj, grpc_ce_credentials, - &cred2_obj, grpc_ce_credentials) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &cred1_obj, + grpc_ce_credentials, &cred2_obj, + grpc_ce_credentials) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "createComposite expects 2 Credentials", - 1 TSRMLS_CC); + "createComposite expects 2 Credentials", 1 TSRMLS_CC); return; } wrapped_grpc_credentials *cred1 = - (wrapped_grpc_credentials*)zend_object_store_get_object( + (wrapped_grpc_credentials *)zend_object_store_get_object( cred1_obj TSRMLS_CC); wrapped_grpc_credentials *cred2 = - (wrapped_grpc_credentials*)zend_object_store_get_object( + (wrapped_grpc_credentials *)zend_object_store_get_object( cred2_obj TSRMLS_CC); - grpc_credentials *creds = grpc_composite_credentials_create(cred1->wrapped, - cred2->wrapped); + grpc_credentials *creds = + grpc_composite_credentials_create(cred1->wrapped, cred2->wrapped); zval *creds_object = grpc_php_wrap_credentials(creds); RETURN_DESTROY_ZVAL(creds_object); } @@ -155,15 +150,16 @@ PHP_METHOD(Credentials, createFake) { } static zend_function_entry credentials_methods[] = { - PHP_ME(Credentials, createDefault, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Credentials, createSsl, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Credentials, createComposite, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Credentials, createGce, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Credentials, createFake, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_FE_END -}; - -void grpc_init_credentials(TSRMLS_D){ + PHP_ME(Credentials, createDefault, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Credentials, createSsl, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Credentials, createComposite, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Credentials, createGce, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Credentials, createFake, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END}; + +void grpc_init_credentials(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\Credentials", credentials_methods); ce.create_object = create_wrapped_grpc_credentials; diff --git a/src/php/ext/grpc/event.c b/src/php/ext/grpc/event.c old mode 100755 new mode 100644 index c15f479448d..b4069f72f00 --- a/src/php/ext/grpc/event.c +++ b/src/php/ext/grpc/event.c @@ -32,24 +32,25 @@ zval *grpc_php_convert_event(grpc_event *event) { zval *event_object; - if(event == NULL) { + if (event == NULL) { return NULL; } MAKE_STD_ZVAL(event_object); object_init(event_object); - add_property_zval(event_object, - "call", - grpc_php_wrap_call(event->call, - event->type==GRPC_SERVER_RPC_NEW)); + add_property_zval( + event_object, "call", + grpc_php_wrap_call(event->call, event->type == GRPC_SERVER_RPC_NEW)); add_property_long(event_object, "type", event->type); add_property_long(event_object, "tag", (long)event->tag); - switch(event->type){ - case GRPC_QUEUE_SHUTDOWN: add_property_null(event_object, "data"); break; + switch (event->type) { + case GRPC_QUEUE_SHUTDOWN: + add_property_null(event_object, "data"); + break; case GRPC_READ: - if(event->data.read == NULL){ + if (event->data.read == NULL) { add_property_null(event_object, "data"); } else { byte_buffer_to_string(event->data.read, &read_string, &read_len); @@ -57,16 +58,14 @@ zval *grpc_php_convert_event(grpc_event *event) { } break; case GRPC_INVOKE_ACCEPTED: - add_property_long(event_object, - "data", + add_property_long(event_object, "data", (long)event->data.invoke_accepted); break; case GRPC_WRITE_ACCEPTED: add_property_long(event_object, "data", (long)event->data.write_accepted); break; case GRPC_FINISH_ACCEPTED: - add_property_long(event_object, - "data", + add_property_long(event_object, "data", (long)event->data.finish_accepted); break; case GRPC_CLIENT_METADATA_READ: @@ -79,19 +78,15 @@ zval *grpc_php_convert_event(grpc_event *event) { MAKE_STD_ZVAL(data_object); object_init(data_object); add_property_long(data_object, "code", event->data.finished.status); - if(event->data.finished.details == NULL){ + if (event->data.finished.details == NULL) { add_property_null(data_object, "details"); } else { detail_len = strlen(event->data.finished.details); - detail_string = ecalloc(detail_len+1, sizeof(char)); + detail_string = ecalloc(detail_len + 1, sizeof(char)); memcpy(detail_string, event->data.finished.details, detail_len); - add_property_string(data_object, - "details", - detail_string, - true); + add_property_string(data_object, "details", detail_string, true); } - add_property_zval(data_object, - "metadata", + add_property_zval(data_object, "metadata", grpc_call_create_metadata_array( event->data.finished.metadata_count, event->data.finished.metadata_elements)); @@ -101,31 +96,25 @@ zval *grpc_php_convert_event(grpc_event *event) { MAKE_STD_ZVAL(data_object); object_init(data_object); method_len = strlen(event->data.server_rpc_new.method); - method_string = ecalloc(method_len+1, sizeof(char)); + method_string = ecalloc(method_len + 1, sizeof(char)); memcpy(method_string, event->data.server_rpc_new.method, method_len); - add_property_string(data_object, - "method", - method_string, - false); + add_property_string(data_object, "method", method_string, false); host_len = strlen(event->data.server_rpc_new.host); - host_string = ecalloc(host_len+1, sizeof(char)); + host_string = ecalloc(host_len + 1, sizeof(char)); memcpy(host_string, event->data.server_rpc_new.host, host_len); - add_property_string(data_object, - "host", - host_string, - false); - add_property_zval(data_object, - "absolute_timeout", - grpc_php_wrap_timeval( - event->data.server_rpc_new.deadline)); - add_property_zval(data_object, - "metadata", + add_property_string(data_object, "host", host_string, false); + add_property_zval( + data_object, "absolute_timeout", + grpc_php_wrap_timeval(event->data.server_rpc_new.deadline)); + add_property_zval(data_object, "metadata", grpc_call_create_metadata_array( event->data.server_rpc_new.metadata_count, event->data.server_rpc_new.metadata_elements)); add_property_zval(event_object, "data", data_object); break; - default: add_property_null(event_object, "data"); break; + default: + add_property_null(event_object, "data"); + break; } grpc_event_finish(event); return event_object; diff --git a/src/php/ext/grpc/php_grpc.c b/src/php/ext/grpc/php_grpc.c old mode 100755 new mode 100644 index 71449bfd06d..c1042293aa4 --- a/src/php/ext/grpc/php_grpc.c +++ b/src/php/ext/grpc/php_grpc.c @@ -16,14 +16,14 @@ #include "ext/standard/info.h" #include "php_grpc.h" -//ZEND_DECLARE_MODULE_GLOBALS(grpc) +// ZEND_DECLARE_MODULE_GLOBALS(grpc) /* {{{ grpc_functions[] * * Every user visible function must have an entry in grpc_functions[]. */ const zend_function_entry grpc_functions[] = { - PHP_FE_END /* Must be the last line in grpc_functions[] */ + PHP_FE_END /* Must be the last line in grpc_functions[] */ }; /* }}} */ @@ -33,18 +33,12 @@ zend_module_entry grpc_module_entry = { #if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, #endif - "grpc", - grpc_functions, - PHP_MINIT(grpc), - PHP_MSHUTDOWN(grpc), - NULL, - NULL, + "grpc", grpc_functions, PHP_MINIT(grpc), PHP_MSHUTDOWN(grpc), NULL, NULL, PHP_MINFO(grpc), #if ZEND_MODULE_API_NO >= 20010901 PHP_GRPC_VERSION, #endif - STANDARD_MODULE_PROPERTIES -}; + STANDARD_MODULE_PROPERTIES}; /* }}} */ #ifdef COMPILE_DL_GRPC @@ -55,8 +49,10 @@ ZEND_GET_MODULE(grpc) */ /* Remove comments and fill if you need to have entries in php.ini PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("grpc.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_grpc_globals, grpc_globals) - STD_PHP_INI_ENTRY("grpc.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_grpc_globals, grpc_globals) + STD_PHP_INI_ENTRY("grpc.global_value", "42", PHP_INI_ALL, OnUpdateLong, +global_value, zend_grpc_globals, grpc_globals) + STD_PHP_INI_ENTRY("grpc.global_string", "foobar", PHP_INI_ALL, +OnUpdateString, global_string, zend_grpc_globals, grpc_globals) PHP_INI_END() */ /* }}} */ @@ -74,159 +70,118 @@ static void php_grpc_init_globals(zend_grpc_globals *grpc_globals) /* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(grpc) -{ - /* If you have INI entries, uncomment these lines - REGISTER_INI_ENTRIES(); - */ - /* Register call error constants */ - grpc_init(); - REGISTER_LONG_CONSTANT("Grpc\\CALL_OK", GRPC_CALL_OK, CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR", GRPC_CALL_ERROR, CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_ON_SERVER", - GRPC_CALL_ERROR_NOT_ON_SERVER, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_ON_CLIENT", - GRPC_CALL_ERROR_NOT_ON_CLIENT, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_ALREADY_INVOKED", - GRPC_CALL_ERROR_ALREADY_INVOKED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_INVOKED", - GRPC_CALL_ERROR_NOT_INVOKED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_ALREADY_FINISHED", - GRPC_CALL_ERROR_ALREADY_FINISHED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_TOO_MANY_OPERATIONS", - GRPC_CALL_ERROR_TOO_MANY_OPERATIONS, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_INVALID_FLAGS", - GRPC_CALL_ERROR_INVALID_FLAGS, - CONST_CS); - - /* Register op error constants */ - REGISTER_LONG_CONSTANT("Grpc\\OP_OK", GRPC_OP_OK, CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\OP_ERROR", GRPC_OP_ERROR, CONST_CS); - - /* Register flag constants */ - REGISTER_LONG_CONSTANT("Grpc\\WRITE_BUFFER_HINT", - GRPC_WRITE_BUFFER_HINT, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\WRITE_NO_COMPRESS", - GRPC_WRITE_NO_COMPRESS, - CONST_CS); - - /* Register completion type constants */ - REGISTER_LONG_CONSTANT("Grpc\\QUEUE_SHUTDOWN", - GRPC_QUEUE_SHUTDOWN, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\READ", GRPC_READ, CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\INVOKE_ACCEPTED", - GRPC_INVOKE_ACCEPTED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\WRITE_ACCEPTED", - GRPC_WRITE_ACCEPTED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\FINISH_ACCEPTED", - GRPC_FINISH_ACCEPTED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\CLIENT_METADATA_READ", - GRPC_CLIENT_METADATA_READ, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\FINISHED", GRPC_FINISHED, CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\SERVER_RPC_NEW", - GRPC_SERVER_RPC_NEW, - CONST_CS); - - /* Register status constants */ - REGISTER_LONG_CONSTANT("Grpc\\STATUS_OK", - GRPC_STATUS_OK, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_CANCELLED", - GRPC_STATUS_CANCELLED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNKNOWN", - GRPC_STATUS_UNKNOWN, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_INVALID_ARGUMENT", - GRPC_STATUS_INVALID_ARGUMENT, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_DEADLINE_EXCEEDED", - GRPC_STATUS_DEADLINE_EXCEEDED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_NOT_FOUND", - GRPC_STATUS_NOT_FOUND, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_ALREADY_EXISTS", - GRPC_STATUS_ALREADY_EXISTS, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_PERMISSION_DENIED", - GRPC_STATUS_PERMISSION_DENIED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNAUTHENTICATED", - GRPC_STATUS_UNAUTHENTICATED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_RESOURCE_EXHAUSTED", - GRPC_STATUS_RESOURCE_EXHAUSTED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_FAILED_PRECONDITION", - GRPC_STATUS_FAILED_PRECONDITION, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_ABORTED", - GRPC_STATUS_ABORTED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_OUT_OF_RANGE", - GRPC_STATUS_OUT_OF_RANGE, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNIMPLEMENTED", - GRPC_STATUS_UNIMPLEMENTED, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_INTERNAL", - GRPC_STATUS_INTERNAL, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNAVAILABLE", - GRPC_STATUS_UNAVAILABLE, - CONST_CS); - REGISTER_LONG_CONSTANT("Grpc\\STATUS_DATA_LOSS", - GRPC_STATUS_DATA_LOSS, - CONST_CS); - - grpc_init_call(TSRMLS_C); - grpc_init_channel(TSRMLS_C); - grpc_init_server(TSRMLS_C); - grpc_init_completion_queue(TSRMLS_C); - grpc_init_timeval(TSRMLS_C); - grpc_init_credentials(TSRMLS_C); - grpc_init_server_credentials(TSRMLS_C); - return SUCCESS; +PHP_MINIT_FUNCTION(grpc) { + /* If you have INI entries, uncomment these lines + REGISTER_INI_ENTRIES(); + */ + /* Register call error constants */ + grpc_init(); + REGISTER_LONG_CONSTANT("Grpc\\CALL_OK", GRPC_CALL_OK, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR", GRPC_CALL_ERROR, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_ON_SERVER", + GRPC_CALL_ERROR_NOT_ON_SERVER, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_ON_CLIENT", + GRPC_CALL_ERROR_NOT_ON_CLIENT, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_ALREADY_INVOKED", + GRPC_CALL_ERROR_ALREADY_INVOKED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_NOT_INVOKED", + GRPC_CALL_ERROR_NOT_INVOKED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_ALREADY_FINISHED", + GRPC_CALL_ERROR_ALREADY_FINISHED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_TOO_MANY_OPERATIONS", + GRPC_CALL_ERROR_TOO_MANY_OPERATIONS, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CALL_ERROR_INVALID_FLAGS", + GRPC_CALL_ERROR_INVALID_FLAGS, CONST_CS); + + /* Register op error constants */ + REGISTER_LONG_CONSTANT("Grpc\\OP_OK", GRPC_OP_OK, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\OP_ERROR", GRPC_OP_ERROR, CONST_CS); + + /* Register flag constants */ + REGISTER_LONG_CONSTANT("Grpc\\WRITE_BUFFER_HINT", GRPC_WRITE_BUFFER_HINT, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\WRITE_NO_COMPRESS", GRPC_WRITE_NO_COMPRESS, + CONST_CS); + + /* Register completion type constants */ + REGISTER_LONG_CONSTANT("Grpc\\QUEUE_SHUTDOWN", GRPC_QUEUE_SHUTDOWN, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\READ", GRPC_READ, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\INVOKE_ACCEPTED", GRPC_INVOKE_ACCEPTED, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\WRITE_ACCEPTED", GRPC_WRITE_ACCEPTED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\FINISH_ACCEPTED", GRPC_FINISH_ACCEPTED, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\CLIENT_METADATA_READ", + GRPC_CLIENT_METADATA_READ, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\FINISHED", GRPC_FINISHED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\SERVER_RPC_NEW", GRPC_SERVER_RPC_NEW, CONST_CS); + + /* Register status constants */ + REGISTER_LONG_CONSTANT("Grpc\\STATUS_OK", GRPC_STATUS_OK, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_CANCELLED", GRPC_STATUS_CANCELLED, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNKNOWN", GRPC_STATUS_UNKNOWN, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_INVALID_ARGUMENT", + GRPC_STATUS_INVALID_ARGUMENT, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_DEADLINE_EXCEEDED", + GRPC_STATUS_DEADLINE_EXCEEDED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_NOT_FOUND", GRPC_STATUS_NOT_FOUND, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_ALREADY_EXISTS", + GRPC_STATUS_ALREADY_EXISTS, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_PERMISSION_DENIED", + GRPC_STATUS_PERMISSION_DENIED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNAUTHENTICATED", + GRPC_STATUS_UNAUTHENTICATED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_RESOURCE_EXHAUSTED", + GRPC_STATUS_RESOURCE_EXHAUSTED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_FAILED_PRECONDITION", + GRPC_STATUS_FAILED_PRECONDITION, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_ABORTED", GRPC_STATUS_ABORTED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_OUT_OF_RANGE", GRPC_STATUS_OUT_OF_RANGE, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNIMPLEMENTED", + GRPC_STATUS_UNIMPLEMENTED, CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_INTERNAL", GRPC_STATUS_INTERNAL, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_UNAVAILABLE", GRPC_STATUS_UNAVAILABLE, + CONST_CS); + REGISTER_LONG_CONSTANT("Grpc\\STATUS_DATA_LOSS", GRPC_STATUS_DATA_LOSS, + CONST_CS); + + grpc_init_call(TSRMLS_C); + grpc_init_channel(TSRMLS_C); + grpc_init_server(TSRMLS_C); + grpc_init_completion_queue(TSRMLS_C); + grpc_init_timeval(TSRMLS_C); + grpc_init_credentials(TSRMLS_C); + grpc_init_server_credentials(TSRMLS_C); + return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(grpc) -{ - /* uncomment this line if you have INI entries - UNREGISTER_INI_ENTRIES(); - */ - grpc_shutdown_timeval(TSRMLS_C); - grpc_shutdown(); - return SUCCESS; +PHP_MSHUTDOWN_FUNCTION(grpc) { + /* uncomment this line if you have INI entries + UNREGISTER_INI_ENTRIES(); + */ + grpc_shutdown_timeval(TSRMLS_C); + grpc_shutdown(); + return SUCCESS; } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(grpc) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "grpc support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ +PHP_MINFO_FUNCTION(grpc) { + php_info_print_table_start(); + php_info_print_table_header(2, "grpc support", "enabled"); + php_info_print_table_end(); + + /* Remove comments if you have entries in php.ini + DISPLAY_INI_ENTRIES(); + */ } /* }}} */ /* The previous line is meant for vim and emacs, so it can correctly fold and @@ -235,7 +190,6 @@ PHP_MINFO_FUNCTION(grpc) follow this convention for the convenience of others editing your code. */ - /* * Local variables: * tab-width: 4 diff --git a/src/php/ext/grpc/php_grpc.h b/src/php/ext/grpc/php_grpc.h old mode 100755 new mode 100644 index 777e0c43687..53cc5dcf6e3 --- a/src/php/ext/grpc/php_grpc.h +++ b/src/php/ext/grpc/php_grpc.h @@ -7,14 +7,15 @@ extern zend_module_entry grpc_module_entry; #define phpext_grpc_ptr &grpc_module_entry -#define PHP_GRPC_VERSION "0.1.0" /* Replace with version number for your extension */ +#define PHP_GRPC_VERSION \ + "0.1.0" /* Replace with version number for your extension */ #ifdef PHP_WIN32 -# define PHP_GRPC_API __declspec(dllexport) +#define PHP_GRPC_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 -# define PHP_GRPC_API __attribute__ ((visibility("default"))) +#define PHP_GRPC_API __attribute__((visibility("default"))) #else -# define PHP_GRPC_API +#define PHP_GRPC_API #endif #ifdef ZTS @@ -25,11 +26,9 @@ extern zend_module_entry grpc_module_entry; #include "grpc/grpc.h" -#define RETURN_DESTROY_ZVAL(val) \ - RETURN_ZVAL( \ - val, \ - false /* Don't execute copy constructor */, \ - true /* Dealloc original before returning */) +#define RETURN_DESTROY_ZVAL(val) \ + RETURN_ZVAL(val, false /* Don't execute copy constructor */, \ + true /* Dealloc original before returning */) /* These are all function declarations */ /* Code that runs at module initialization */ @@ -40,8 +39,8 @@ PHP_MSHUTDOWN_FUNCTION(grpc); PHP_MINFO_FUNCTION(grpc); /* - Declare any global variables you may need between the BEGIN - and END macros here: + Declare any global variables you may need between the BEGIN + and END macros here: ZEND_BEGIN_MODULE_GLOBALS(grpc) ZEND_END_MODULE_GLOBALS(grpc) @@ -63,4 +62,4 @@ ZEND_END_MODULE_GLOBALS(grpc) #define GRPC_G(v) (grpc_globals.v) #endif -#endif /* PHP_GRPC_H */ +#endif /* PHP_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c old mode 100755 new mode 100644 index 5af42f76ee0..f4843757120 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -24,9 +24,9 @@ #include "server_credentials.h" /* Frees and destroys an instance of wrapped_grpc_server */ -void free_wrapped_grpc_server(void *object TSRMLS_DC){ - wrapped_grpc_server *server = (wrapped_grpc_server*)object; - if(server->wrapped != NULL){ +void free_wrapped_grpc_server(void *object TSRMLS_DC) { + wrapped_grpc_server *server = (wrapped_grpc_server *)object; + if (server->wrapped != NULL) { grpc_server_shutdown(server->wrapped); grpc_server_destroy(server->wrapped); } @@ -35,21 +35,19 @@ void free_wrapped_grpc_server(void *object TSRMLS_DC){ /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ -zend_object_value create_wrapped_grpc_server( - zend_class_entry *class_type TSRMLS_DC){ +zend_object_value create_wrapped_grpc_server(zend_class_entry *class_type + TSRMLS_DC) { zend_object_value retval; wrapped_grpc_server *intern; - intern = (wrapped_grpc_server*)emalloc(sizeof(wrapped_grpc_server)); + intern = (wrapped_grpc_server *)emalloc(sizeof(wrapped_grpc_server)); memset(intern, 0, sizeof(wrapped_grpc_server)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t) zend_objects_destroy_object, - free_wrapped_grpc_server, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_server, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } @@ -59,9 +57,9 @@ zend_object_value create_wrapped_grpc_server( * @param CompletionQueue $queue The completion queue to use with the server * @param array $args The arguments to pass to the server (optional) */ -PHP_METHOD(Server, __construct){ +PHP_METHOD(Server, __construct) { wrapped_grpc_server *server = - (wrapped_grpc_server*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); zval *queue_obj; zval *args_array = NULL; grpc_channel_args args; @@ -69,10 +67,8 @@ PHP_METHOD(Server, __construct){ zval **creds_obj = NULL; wrapped_grpc_server_credentials *creds = NULL; /* "O|a" == 1 Object, 1 optional array */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O|a", - &queue_obj, grpc_ce_completion_queue, - &args_array) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|a", &queue_obj, + grpc_ce_completion_queue, &args_array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "Server expects a CompletionQueue and an array", 1 TSRMLS_CC); @@ -80,24 +76,22 @@ PHP_METHOD(Server, __construct){ } add_property_zval(getThis(), "completion_queue", queue_obj); wrapped_grpc_completion_queue *queue = - (wrapped_grpc_completion_queue*)zend_object_store_get_object( - queue_obj TSRMLS_CC); + (wrapped_grpc_completion_queue *)zend_object_store_get_object( + queue_obj TSRMLS_CC); if (args_array == NULL) { server->wrapped = grpc_server_create(queue->wrapped, NULL); } else { array_hash = Z_ARRVAL_P(args_array); - if(zend_hash_find(array_hash, - "credentials", - sizeof("credentials"), - (void**)&creds_obj) == SUCCESS) { - if(zend_get_class_entry(*creds_obj TSRMLS_CC) != - grpc_ce_server_credentials) { + if (zend_hash_find(array_hash, "credentials", sizeof("credentials"), + (void **)&creds_obj) == SUCCESS) { + if (zend_get_class_entry(*creds_obj TSRMLS_CC) != + grpc_ce_server_credentials) { zend_throw_exception(spl_ce_InvalidArgumentException, "credentials must be a ServerCredentials object", 1 TSRMLS_CC); return; } - creds = (wrapped_grpc_server_credentials*)zend_object_store_get_object( + creds = (wrapped_grpc_server_credentials *)zend_object_store_get_object( *creds_obj TSRMLS_CC); zend_hash_del(array_hash, "credentials", sizeof("credentials")); } @@ -106,9 +100,8 @@ PHP_METHOD(Server, __construct){ server->wrapped = grpc_server_create(queue->wrapped, &args); } else { gpr_log(GPR_DEBUG, "Initialized secure server"); - server->wrapped = grpc_secure_server_create(creds->wrapped, - queue->wrapped, - &args); + server->wrapped = + grpc_secure_server_create(creds->wrapped, queue->wrapped, &args); } efree(args.args); } @@ -120,21 +113,19 @@ PHP_METHOD(Server, __construct){ * @param long $tag_cancel The tag to use if the call is cancelled * @return Void */ -PHP_METHOD(Server, request_call){ +PHP_METHOD(Server, request_call) { grpc_call_error error_code; wrapped_grpc_server *server = - (wrapped_grpc_server*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); long tag_new; /* "l" == 1 long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "l", - &tag_new) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &tag_new) == + FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "request_call expects a long", - 1 TSRMLS_CC); + "request_call expects a long", 1 TSRMLS_CC); return; } - error_code = grpc_server_request_call(server->wrapped, (void*)tag_new); + error_code = grpc_server_request_call(server->wrapped, (void *)tag_new); MAYBE_THROW_CALL_ERROR(request_call, error_code); } @@ -143,35 +134,31 @@ PHP_METHOD(Server, request_call){ * @param string $addr The address to add * @return true on success, false on failure */ -PHP_METHOD(Server, add_http2_port){ +PHP_METHOD(Server, add_http2_port) { wrapped_grpc_server *server = - (wrapped_grpc_server*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); const char *addr; int addr_len; /* "s" == 1 string */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "s", - &addr, &addr_len) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == + FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "add_http2_port expects a string", - 1 TSRMLS_CC); + "add_http2_port expects a string", 1 TSRMLS_CC); return; } RETURN_BOOL(grpc_server_add_http2_port(server->wrapped, addr)); } -PHP_METHOD(Server, add_secure_http2_port){ +PHP_METHOD(Server, add_secure_http2_port) { wrapped_grpc_server *server = - (wrapped_grpc_server*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); const char *addr; int addr_len; /* "s" == 1 string */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "s", - &addr, &addr_len) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == + FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "add_http2_port expects a string", - 1 TSRMLS_CC); + "add_http2_port expects a string", 1 TSRMLS_CC); return; } RETURN_BOOL(grpc_server_add_secure_http2_port(server->wrapped, addr)); @@ -181,22 +168,20 @@ PHP_METHOD(Server, add_secure_http2_port){ * Start a server - tells all listeners to start listening * @return Void */ -PHP_METHOD(Server, start){ +PHP_METHOD(Server, start) { wrapped_grpc_server *server = - (wrapped_grpc_server*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); grpc_server_start(server->wrapped); } static zend_function_entry server_methods[] = { - PHP_ME(Server, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Server, request_call, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Server, add_http2_port, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Server, add_secure_http2_port, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Server, start, NULL, ZEND_ACC_PUBLIC) - PHP_FE_END -}; - -void grpc_init_server(TSRMLS_D){ + PHP_ME(Server, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Server, request_call, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Server, add_http2_port, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Server, add_secure_http2_port, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Server, start, NULL, ZEND_ACC_PUBLIC) PHP_FE_END}; + +void grpc_init_server(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\Server", server_methods); ce.create_object = create_wrapped_grpc_server; diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c old mode 100755 new mode 100644 index b07790b4be9..5b9ab3390d7 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -17,10 +17,10 @@ #include "grpc/grpc_security.h" /* Frees and destroys an instace of wrapped_grpc_server_credentials */ -void free_wrapped_grpc_server_credentials(void *object TSRMLS_DC){ +void free_wrapped_grpc_server_credentials(void *object TSRMLS_DC) { wrapped_grpc_server_credentials *creds = - (wrapped_grpc_server_credentials*)object; - if(creds->wrapped != NULL) { + (wrapped_grpc_server_credentials *)object; + if (creds->wrapped != NULL) { grpc_server_credentials_release(creds->wrapped); } efree(creds); @@ -29,32 +29,30 @@ void free_wrapped_grpc_server_credentials(void *object TSRMLS_DC){ /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ zend_object_value create_wrapped_grpc_server_credentials( - zend_class_entry *class_type TSRMLS_DC){ + zend_class_entry *class_type TSRMLS_DC) { zend_object_value retval; wrapped_grpc_server_credentials *intern; - intern = (wrapped_grpc_server_credentials*)emalloc(sizeof( - wrapped_grpc_server_credentials)); + intern = (wrapped_grpc_server_credentials *)emalloc( + sizeof(wrapped_grpc_server_credentials)); memset(intern, 0, sizeof(wrapped_grpc_server_credentials)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t) zend_objects_destroy_object, - free_wrapped_grpc_server_credentials, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_server_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } -zval *grpc_php_wrap_server_credentials(grpc_server_credentials *wrapped){ +zval *grpc_php_wrap_server_credentials(grpc_server_credentials *wrapped) { zval *server_credentials_object; MAKE_STD_ZVAL(server_credentials_object); object_init_ex(server_credentials_object, grpc_ce_server_credentials); wrapped_grpc_server_credentials *server_credentials = - (wrapped_grpc_server_credentials*)zend_object_store_get_object( - server_credentials_object TSRMLS_CC); + (wrapped_grpc_server_credentials *)zend_object_store_get_object( + server_credentials_object TSRMLS_CC); server_credentials->wrapped = wrapped; return server_credentials_object; } @@ -66,7 +64,7 @@ zval *grpc_php_wrap_server_credentials(grpc_server_credentials *wrapped){ * @param string pem_cert_chain PEM encoding of the client's certificate chain * @return Credentials The new SSL credentials object */ -PHP_METHOD(ServerCredentials, createSsl){ +PHP_METHOD(ServerCredentials, createSsl) { char *pem_root_certs = 0; char *pem_private_key; char *pem_cert_chain; @@ -74,20 +72,18 @@ PHP_METHOD(ServerCredentials, createSsl){ int root_certs_length = 0, private_key_length, cert_chain_length; /* "s!ss" == 1 nullable string, 2 strings */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "s!ss", - &pem_root_certs, &root_certs_length, - &pem_private_key, &private_key_length, - &pem_cert_chain, &cert_chain_length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!ss", &pem_root_certs, + &root_certs_length, &pem_private_key, + &private_key_length, &pem_cert_chain, + &cert_chain_length) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "createSsl expects 3 strings", - 1 TSRMLS_CC); + "createSsl expects 3 strings", 1 TSRMLS_CC); return; } grpc_server_credentials *creds = grpc_ssl_server_credentials_create( - (unsigned char*)pem_root_certs, (size_t)root_certs_length, - (unsigned char*)pem_private_key, (size_t)private_key_length, - (unsigned char*)pem_cert_chain, (size_t)cert_chain_length); + (unsigned char *)pem_root_certs, (size_t)root_certs_length, + (unsigned char *)pem_private_key, (size_t)private_key_length, + (unsigned char *)pem_cert_chain, (size_t)cert_chain_length); zval *creds_object = grpc_php_wrap_server_credentials(creds); RETURN_DESTROY_ZVAL(creds_object); } @@ -96,7 +92,7 @@ PHP_METHOD(ServerCredentials, createSsl){ * Create fake credentials. Only to be used for testing. * @return ServerCredentials The new fake credentials object */ -PHP_METHOD(ServerCredentials, createFake){ +PHP_METHOD(ServerCredentials, createFake) { grpc_server_credentials *creds = grpc_fake_transport_security_server_credentials_create(); zval *creds_object = grpc_php_wrap_server_credentials(creds); @@ -104,12 +100,12 @@ PHP_METHOD(ServerCredentials, createFake){ } static zend_function_entry server_credentials_methods[] = { - PHP_ME(ServerCredentials, createSsl, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(ServerCredentials, createFake, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_FE_END -}; + PHP_ME(ServerCredentials, createSsl, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(ServerCredentials, createFake, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END}; -void grpc_init_server_credentials(TSRMLS_D){ +void grpc_init_server_credentials(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\ServerCredentials", server_credentials_methods); ce.create_object = create_wrapped_grpc_server_credentials; diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c old mode 100755 new mode 100644 index 7b7e0e6443b..a5508115e47 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -18,36 +18,32 @@ #include "grpc/support/time.h" /* Frees and destroys an instance of wrapped_grpc_call */ -void free_wrapped_grpc_timeval(void *object TSRMLS_DC){ - efree(object); -} +void free_wrapped_grpc_timeval(void *object TSRMLS_DC) { efree(object); } /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_timeval( - zend_class_entry *class_type TSRMLS_DC){ +zend_object_value create_wrapped_grpc_timeval(zend_class_entry *class_type + TSRMLS_DC) { zend_object_value retval; wrapped_grpc_timeval *intern; - intern = (wrapped_grpc_timeval*)emalloc(sizeof(wrapped_grpc_timeval)); + intern = (wrapped_grpc_timeval *)emalloc(sizeof(wrapped_grpc_timeval)); memset(intern, 0, sizeof(wrapped_grpc_timeval)); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); retval.handle = zend_objects_store_put( - intern, - (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_timeval, - NULL TSRMLS_CC); + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, + free_wrapped_grpc_timeval, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; } -zval *grpc_php_wrap_timeval(gpr_timespec wrapped){ +zval *grpc_php_wrap_timeval(gpr_timespec wrapped) { zval *timeval_object; MAKE_STD_ZVAL(timeval_object); object_init_ex(timeval_object, grpc_ce_timeval); wrapped_grpc_timeval *timeval = - (wrapped_grpc_timeval*)zend_object_store_get_object( - timeval_object TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object( + timeval_object TSRMLS_CC); memcpy(&timeval->wrapped, &wrapped, sizeof(gpr_timespec)); return timeval_object; } @@ -56,17 +52,15 @@ zval *grpc_php_wrap_timeval(gpr_timespec wrapped){ * Constructs a new instance of the Timeval class * @param long $usec The number of microseconds in the interval */ -PHP_METHOD(Timeval, __construct){ +PHP_METHOD(Timeval, __construct) { wrapped_grpc_timeval *timeval = - (wrapped_grpc_timeval*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); long microseconds; /* "l" == 1 long */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "l", - µseconds) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", µseconds) == + FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "Timeval expects a long", - 1 TSRMLS_CC); + "Timeval expects a long", 1 TSRMLS_CC); return; } gpr_timespec time = gpr_time_from_micros(microseconds); @@ -79,23 +73,21 @@ PHP_METHOD(Timeval, __construct){ * @param Timeval $other The other Timeval object to add * @return Timeval A new Timeval object containing the sum */ -PHP_METHOD(Timeval, add){ +PHP_METHOD(Timeval, add) { zval *other_obj; /* "O" == 1 Object */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", - &other_obj, grpc_ce_timeval) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &other_obj, + grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "add expects a Timeval", - 1 TSRMLS_CC); + "add expects a Timeval", 1 TSRMLS_CC); return; } wrapped_grpc_timeval *self = - (wrapped_grpc_timeval*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); wrapped_grpc_timeval *other = - (wrapped_grpc_timeval*)zend_object_store_get_object(other_obj TSRMLS_CC); - zval *sum = grpc_php_wrap_timeval(gpr_time_add(self->wrapped, - other->wrapped)); + (wrapped_grpc_timeval *)zend_object_store_get_object(other_obj TSRMLS_CC); + zval *sum = + grpc_php_wrap_timeval(gpr_time_add(self->wrapped, other->wrapped)); RETURN_DESTROY_ZVAL(sum); } @@ -105,23 +97,21 @@ PHP_METHOD(Timeval, add){ * @param Timeval $other The other Timeval object to subtract * @param Timeval A new Timeval object containing the sum */ -PHP_METHOD(Timeval, subtract){ +PHP_METHOD(Timeval, subtract) { zval *other_obj; /* "O" == 1 Object */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "O", - &other_obj, grpc_ce_timeval) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &other_obj, + grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "subtract expects a Timeval", - 1 TSRMLS_CC); + "subtract expects a Timeval", 1 TSRMLS_CC); return; } wrapped_grpc_timeval *self = - (wrapped_grpc_timeval*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); wrapped_grpc_timeval *other = - (wrapped_grpc_timeval*)zend_object_store_get_object(other_obj TSRMLS_CC); - zval *diff = grpc_php_wrap_timeval(gpr_time_sub(self->wrapped, - other->wrapped)); + (wrapped_grpc_timeval *)zend_object_store_get_object(other_obj TSRMLS_CC); + zval *diff = + grpc_php_wrap_timeval(gpr_time_sub(self->wrapped, other->wrapped)); RETURN_DESTROY_ZVAL(diff); } @@ -132,22 +122,20 @@ PHP_METHOD(Timeval, subtract){ * @param Timeval $b The second time to compare * @return long */ -PHP_METHOD(Timeval, compare){ +PHP_METHOD(Timeval, compare) { zval *a_obj, *b_obj; /* "OO" == 2 Objects */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "OO", - &a_obj, grpc_ce_timeval, - &b_obj, grpc_ce_timeval) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OO", &a_obj, + grpc_ce_timeval, &b_obj, + grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "compare expects two Timevals", - 1 TSRMLS_CC); + "compare expects two Timevals", 1 TSRMLS_CC); return; } wrapped_grpc_timeval *a = - (wrapped_grpc_timeval*)zend_object_store_get_object(a_obj TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(a_obj TSRMLS_CC); wrapped_grpc_timeval *b = - (wrapped_grpc_timeval*)zend_object_store_get_object(b_obj TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(b_obj TSRMLS_CC); long result = gpr_time_cmp(a->wrapped, b->wrapped); RETURN_LONG(result); } @@ -159,25 +147,23 @@ PHP_METHOD(Timeval, compare){ * @param Timeval $threshold The threshold to check against * @return bool True if $a and $b are within $threshold, False otherwise */ -PHP_METHOD(Timeval, similar){ +PHP_METHOD(Timeval, similar) { zval *a_obj, *b_obj, *thresh_obj; /* "OOO" == 3 Objects */ - if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, - "OOO", - &a_obj, grpc_ce_timeval, - &b_obj, grpc_ce_timeval, - &thresh_obj, grpc_ce_timeval) == FAILURE){ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OOO", &a_obj, + grpc_ce_timeval, &b_obj, grpc_ce_timeval, + &thresh_obj, grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "compare expects three Timevals", - 1 TSRMLS_CC); + "compare expects three Timevals", 1 TSRMLS_CC); return; } wrapped_grpc_timeval *a = - (wrapped_grpc_timeval*)zend_object_store_get_object(a_obj TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(a_obj TSRMLS_CC); wrapped_grpc_timeval *b = - (wrapped_grpc_timeval*)zend_object_store_get_object(b_obj TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(b_obj TSRMLS_CC); wrapped_grpc_timeval *thresh = - (wrapped_grpc_timeval*)zend_object_store_get_object(thresh_obj TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object( + thresh_obj TSRMLS_CC); int result = gpr_time_similar(a->wrapped, b->wrapped, thresh->wrapped); RETURN_BOOL(result); } @@ -186,7 +172,7 @@ PHP_METHOD(Timeval, similar){ * Returns the current time as a timeval object * @return Timeval The current time */ -PHP_METHOD(Timeval, now){ +PHP_METHOD(Timeval, now) { zval *now = grpc_php_wrap_timeval(gpr_now()); RETURN_DESTROY_ZVAL(now); } @@ -195,7 +181,7 @@ PHP_METHOD(Timeval, now){ * Returns the zero time interval as a timeval object * @return Timeval Zero length time interval */ -PHP_METHOD(Timeval, zero){ +PHP_METHOD(Timeval, zero) { zval *grpc_php_timeval_zero = grpc_php_wrap_timeval(gpr_time_0); RETURN_ZVAL(grpc_php_timeval_zero, false, /* Copy original before returning? */ @@ -206,7 +192,7 @@ PHP_METHOD(Timeval, zero){ * Returns the infinite future time value as a timeval object * @return Timeval Infinite future time value */ -PHP_METHOD(Timeval, inf_future){ +PHP_METHOD(Timeval, inf_future) { zval *grpc_php_timeval_inf_future = grpc_php_wrap_timeval(gpr_inf_future); RETURN_DESTROY_ZVAL(grpc_php_timeval_inf_future); } @@ -215,7 +201,7 @@ PHP_METHOD(Timeval, inf_future){ * Returns the infinite past time value as a timeval object * @return Timeval Infinite past time value */ -PHP_METHOD(Timeval, inf_past){ +PHP_METHOD(Timeval, inf_past) { zval *grpc_php_timeval_inf_past = grpc_php_wrap_timeval(gpr_inf_past); RETURN_DESTROY_ZVAL(grpc_php_timeval_inf_past); } @@ -224,32 +210,33 @@ PHP_METHOD(Timeval, inf_past){ * Sleep until this time, interpreted as an absolute timeout * @return void */ -PHP_METHOD(Timeval, sleep_until){ +PHP_METHOD(Timeval, sleep_until) { wrapped_grpc_timeval *this = - (wrapped_grpc_timeval*)zend_object_store_get_object(getThis() TSRMLS_CC); + (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); gpr_sleep_until(this->wrapped); } static zend_function_entry timeval_methods[] = { - PHP_ME(Timeval, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Timeval, add, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Timeval, compare, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Timeval, inf_future, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Timeval, inf_past, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Timeval, now, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Timeval, similar, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Timeval, sleep_until, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Timeval, subtract, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Timeval, zero, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_FE_END -}; - -void grpc_init_timeval(TSRMLS_D){ + PHP_ME(Timeval, __construct, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_ME( + Timeval, add, NULL, + ZEND_ACC_PUBLIC) PHP_ME(Timeval, compare, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Timeval, inf_future, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Timeval, inf_past, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Timeval, now, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Timeval, similar, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Timeval, sleep_until, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Timeval, subtract, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Timeval, zero, NULL, + ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_FE_END}; + +void grpc_init_timeval(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "Grpc\\Timeval", timeval_methods); ce.create_object = create_wrapped_grpc_timeval; grpc_ce_timeval = zend_register_internal_class(&ce TSRMLS_CC); } -void grpc_shutdown_timeval(TSRMLS_D){ -} +void grpc_shutdown_timeval(TSRMLS_D) {} diff --git a/src/ruby/ext/grpc/rb_byte_buffer.c b/src/ruby/ext/grpc/rb_byte_buffer.c index b75e853d6bf..f73b12c417f 100644 --- a/src/ruby/ext/grpc/rb_byte_buffer.c +++ b/src/ruby/ext/grpc/rb_byte_buffer.c @@ -49,7 +49,6 @@ typedef struct grpc_rb_byte_buffer { grpc_byte_buffer *wrapped; } grpc_rb_byte_buffer; - /* Destroys ByteBuffer instances. */ static void grpc_rb_byte_buffer_free(void *p) { grpc_rb_byte_buffer *bb = NULL; @@ -169,7 +168,6 @@ static VALUE grpc_rb_byte_buffer_to_s(VALUE self) { return output_obj; } - /* Initializes ByteBuffer instances. */ static VALUE grpc_rb_byte_buffer_init(VALUE self, VALUE src) { gpr_slice a_slice; @@ -205,8 +203,8 @@ static VALUE grpc_rb_byte_buffer_init(VALUE self, VALUE src) { VALUE rb_cByteBuffer = Qnil; void Init_google_rpc_byte_buffer() { - rb_cByteBuffer = rb_define_class_under(rb_mGoogleRpcCore, "ByteBuffer", - rb_cObject); + rb_cByteBuffer = + rb_define_class_under(rb_mGoogleRpcCore, "ByteBuffer", rb_cObject); /* Allocates an object managed by the ruby runtime */ rb_define_alloc_func(rb_cByteBuffer, grpc_rb_byte_buffer_alloc); @@ -223,7 +221,7 @@ void Init_google_rpc_byte_buffer() { id_empty = rb_intern(""); } -VALUE grpc_rb_byte_buffer_create_with_mark(VALUE mark, grpc_byte_buffer* bb) { +VALUE grpc_rb_byte_buffer_create_with_mark(VALUE mark, grpc_byte_buffer *bb) { grpc_rb_byte_buffer *byte_buffer = NULL; if (bb == NULL) { return Qnil; @@ -236,7 +234,7 @@ VALUE grpc_rb_byte_buffer_create_with_mark(VALUE mark, grpc_byte_buffer* bb) { } /* Gets the wrapped byte_buffer from the ruby wrapper */ -grpc_byte_buffer* grpc_rb_get_wrapped_byte_buffer(VALUE v) { +grpc_byte_buffer *grpc_rb_get_wrapped_byte_buffer(VALUE v) { grpc_rb_byte_buffer *wrapper = NULL; Data_Get_Struct(v, grpc_rb_byte_buffer, wrapper); return wrapper->wrapped; diff --git a/src/ruby/ext/grpc/rb_byte_buffer.h b/src/ruby/ext/grpc/rb_byte_buffer.h index 1bdcfe40199..322c268f377 100644 --- a/src/ruby/ext/grpc/rb_byte_buffer.h +++ b/src/ruby/ext/grpc/rb_byte_buffer.h @@ -51,4 +51,4 @@ VALUE grpc_rb_byte_buffer_create_with_mark(VALUE mark, grpc_byte_buffer* bb); /* Gets the wrapped byte_buffer from its ruby object. */ grpc_byte_buffer* grpc_rb_get_wrapped_byte_buffer(VALUE v); -#endif /* GRPC_RB_BYTE_BUFFER_H_ */ +#endif /* GRPC_RB_BYTE_BUFFER_H_ */ diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c index bf292fac757..76b80bcaa16 100644 --- a/src/ruby/ext/grpc/rb_call.c +++ b/src/ruby/ext/grpc/rb_call.c @@ -78,7 +78,7 @@ void grpc_rb_call_destroy(void *p) { ref_count = rb_hash_aref(hash_all_calls, OFFT2NUM((VALUE)call)); if (ref_count == Qnil) { - return; /* No longer in the hash, so already deleted */ + return; /* No longer in the hash, so already deleted */ } else if (NUM2UINT(ref_count) == 1) { rb_hash_delete(hash_all_calls, OFFT2NUM((VALUE)call)); grpc_call_destroy(call); @@ -92,9 +92,9 @@ void grpc_rb_call_destroy(void *p) { VALUE rb_error_code_details; /* Obtains the error detail string for given error code */ -const char* grpc_call_error_detail_of(grpc_call_error err) { +const char *grpc_call_error_detail_of(grpc_call_error err) { VALUE detail_ref = rb_hash_aref(rb_error_code_details, UINT2NUM(err)); - const char* detail = "unknown error code!"; + const char *detail = "unknown error code!"; if (detail_ref != Qnil) { detail = StringValueCStr(detail_ref); } @@ -164,7 +164,7 @@ static VALUE grpc_rb_call_add_metadata(int argc, VALUE *argv, VALUE self) { /* "11" == 1 mandatory args, 1 (flags) is optional */ rb_scan_args(argc, argv, "11", &metadata, &flags); if (NIL_P(flags)) { - flags = UINT2NUM(0); /* Default to no flags */ + flags = UINT2NUM(0); /* Default to no flags */ } if (TYPE(metadata) != T_HASH) { rb_raise(rb_eTypeError, "add metadata failed: metadata should be a hash"); @@ -217,14 +217,13 @@ static VALUE grpc_rb_call_start_invoke(int argc, VALUE *argv, VALUE self) { rb_scan_args(argc, argv, "41", &cqueue, &invoke_accepted_tag, &metadata_read_tag, &finished_tag, &flags); if (NIL_P(flags)) { - flags = UINT2NUM(0); /* Default to no flags */ + flags = UINT2NUM(0); /* Default to no flags */ } cq = grpc_rb_get_wrapped_completion_queue(cqueue); Data_Get_Struct(self, grpc_call, call); err = grpc_call_start_invoke(call, cq, ROBJECT(invoke_accepted_tag), ROBJECT(metadata_read_tag), - ROBJECT(finished_tag), - NUM2UINT(flags)); + ROBJECT(finished_tag), NUM2UINT(flags)); if (err != GRPC_CALL_OK) { rb_raise(rb_eCallError, "invoke failed: %s (code=%d)", grpc_call_error_detail_of(err), err); @@ -329,7 +328,7 @@ static VALUE grpc_rb_call_start_write(int argc, VALUE *argv, VALUE self) { /* "21" == 2 mandatory args, 1 (flags) is optional */ rb_scan_args(argc, argv, "21", &byte_buffer, &tag, &flags); if (NIL_P(flags)) { - flags = UINT2NUM(0); /* Default to no flags */ + flags = UINT2NUM(0); /* Default to no flags */ } bfr = grpc_rb_get_wrapped_byte_buffer(byte_buffer); Data_Get_Struct(self, grpc_call, call); @@ -405,7 +404,7 @@ static VALUE grpc_rb_call_server_end_initial_metadata(int argc, VALUE *argv, /* "01" == 1 (flags) is optional */ rb_scan_args(argc, argv, "01", &flags); if (NIL_P(flags)) { - flags = UINT2NUM(0); /* Default to no flags */ + flags = UINT2NUM(0); /* Default to no flags */ } Data_Get_Struct(self, grpc_call, call); err = grpc_call_server_end_initial_metadata(call, NUM2UINT(flags)); @@ -445,7 +444,6 @@ static VALUE grpc_rb_call_server_accept(VALUE self, VALUE cqueue, return Qnil; } - /* rb_cCall is the ruby class that proxies grpc_call. */ VALUE rb_cCall = Qnil; @@ -477,8 +475,8 @@ void Init_google_rpc_error_codes() { /* Add the detail strings to a Hash */ rb_error_code_details = rb_hash_new(); - rb_hash_aset(rb_error_code_details, - UINT2NUM(GRPC_CALL_OK), rb_str_new2("ok")); + rb_hash_aset(rb_error_code_details, UINT2NUM(GRPC_CALL_OK), + rb_str_new2("ok")); rb_hash_aset(rb_error_code_details, UINT2NUM(GRPC_CALL_ERROR), rb_str_new2("unknown error")); rb_hash_aset(rb_error_code_details, UINT2NUM(GRPC_CALL_ERROR_NOT_ON_SERVER), @@ -506,8 +504,8 @@ void Init_google_rpc_error_codes() { void Init_google_rpc_call() { /* CallError inherits from Exception to signal that it is non-recoverable */ - rb_eCallError = rb_define_class_under(rb_mGoogleRpcCore, "CallError", - rb_eException); + rb_eCallError = + rb_define_class_under(rb_mGoogleRpcCore, "CallError", rb_eException); rb_cCall = rb_define_class_under(rb_mGoogleRpcCore, "Call", rb_cObject); /* Prevent allocation or inialization of the Call class */ @@ -519,8 +517,7 @@ void Init_google_rpc_call() { rb_define_method(rb_cCall, "server_accept", grpc_rb_call_server_accept, 2); rb_define_method(rb_cCall, "server_end_initial_metadata", grpc_rb_call_server_end_initial_metadata, -1); - rb_define_method(rb_cCall, "add_metadata", grpc_rb_call_add_metadata, - -1); + rb_define_method(rb_cCall, "add_metadata", grpc_rb_call_add_metadata, -1); rb_define_method(rb_cCall, "cancel", grpc_rb_call_cancel, 0); rb_define_method(rb_cCall, "start_invoke", grpc_rb_call_start_invoke, -1); rb_define_method(rb_cCall, "start_read", grpc_rb_call_start_read, 1); @@ -551,25 +548,24 @@ void Init_google_rpc_call() { } /* Gets the call from the ruby object */ -grpc_call* grpc_rb_get_wrapped_call(VALUE v) { +grpc_call *grpc_rb_get_wrapped_call(VALUE v) { grpc_call *c = NULL; Data_Get_Struct(v, grpc_call, c); return c; } /* Obtains the wrapped object for a given call */ -VALUE grpc_rb_wrap_call(grpc_call* c) { +VALUE grpc_rb_wrap_call(grpc_call *c) { VALUE obj = Qnil; if (c == NULL) { return Qnil; } obj = rb_hash_aref(hash_all_calls, OFFT2NUM((VALUE)c)); - if (obj == Qnil) { /* Not in the hash add it */ + if (obj == Qnil) { /* Not in the hash add it */ rb_hash_aset(hash_all_calls, OFFT2NUM((VALUE)c), UINT2NUM(1)); } else { rb_hash_aset(hash_all_calls, OFFT2NUM((VALUE)c), UINT2NUM(NUM2UINT(obj) + 1)); } - return Data_Wrap_Struct(rb_cCall, GC_NOT_MARKED, grpc_rb_call_destroy, - c); + return Data_Wrap_Struct(rb_cCall, GC_NOT_MARKED, grpc_rb_call_destroy, c); } diff --git a/src/ruby/ext/grpc/rb_call.h b/src/ruby/ext/grpc/rb_call.h index 422e7e7a6cc..965e9eef409 100644 --- a/src/ruby/ext/grpc/rb_call.h +++ b/src/ruby/ext/grpc/rb_call.h @@ -56,4 +56,4 @@ extern VALUE rb_eCallError; /* Initializes the Call class. */ void Init_google_rpc_call(); -#endif /* GRPC_RB_CALL_H_ */ +#endif /* GRPC_RB_CALL_H_ */ diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c index d9518476621..c0187d2d117 100644 --- a/src/ruby/ext/grpc/rb_channel.c +++ b/src/ruby/ext/grpc/rb_channel.c @@ -137,7 +137,7 @@ static VALUE grpc_rb_channel_init(int argc, VALUE *argv, VALUE self) { ch = grpc_secure_channel_create(creds, target_chars, &args); } if (args.args != NULL) { - xfree(args.args); /* Allocated by grpc_rb_hash_convert_to_channel_args */ + xfree(args.args); /* Allocated by grpc_rb_hash_convert_to_channel_args */ } if (ch == NULL) { rb_raise(rb_eRuntimeError, "could not create an rpc channel to target:%s", @@ -256,7 +256,7 @@ void Init_google_rpc_channel() { } /* Gets the wrapped channel from the ruby wrapper */ -grpc_channel* grpc_rb_get_wrapped_channel(VALUE v) { +grpc_channel *grpc_rb_get_wrapped_channel(VALUE v) { grpc_rb_channel *wrapper = NULL; Data_Get_Struct(v, grpc_rb_channel, wrapper); return wrapper->wrapped; diff --git a/src/ruby/ext/grpc/rb_channel.h b/src/ruby/ext/grpc/rb_channel.h index b0a36344746..6c1210e812d 100644 --- a/src/ruby/ext/grpc/rb_channel.h +++ b/src/ruby/ext/grpc/rb_channel.h @@ -46,4 +46,4 @@ void Init_google_rpc_channel(); /* Gets the wrapped channel from the ruby wrapper */ grpc_channel* grpc_rb_get_wrapped_channel(VALUE v); -#endif /* GRPC_RB_CHANNEL_H_ */ +#endif /* GRPC_RB_CHANNEL_H_ */ diff --git a/src/ruby/ext/grpc/rb_channel_args.c b/src/ruby/ext/grpc/rb_channel_args.c index eebced0bd80..b918e1264ed 100644 --- a/src/ruby/ext/grpc/rb_channel_args.c +++ b/src/ruby/ext/grpc/rb_channel_args.c @@ -46,7 +46,6 @@ static int grpc_rb_channel_create_in_process_add_args_hash_cb(VALUE key, grpc_channel_args* args; switch (TYPE(key)) { - case T_STRING: the_key = StringValuePtr(key); break; @@ -68,13 +67,12 @@ static int grpc_rb_channel_create_in_process_add_args_hash_cb(VALUE key, return ST_STOP; } - args->args[args->num_args - 1].key = (char *)the_key; + args->args[args->num_args - 1].key = (char*)the_key; switch (TYPE(val)) { - case T_SYMBOL: args->args[args->num_args - 1].type = GRPC_ARG_STRING; args->args[args->num_args - 1].value.string = - (char *)rb_id2name(SYM2ID(val)); + (char*)rb_id2name(SYM2ID(val)); --args->num_args; return ST_CONTINUE; @@ -109,11 +107,10 @@ typedef struct channel_convert_params { grpc_channel_args* dst; } channel_convert_params; - static VALUE grpc_rb_hash_convert_to_channel_args0(VALUE as_value) { ID id_size = rb_intern("size"); VALUE rb_cChannelArgs = rb_define_class("TmpChannelArgs", rb_cObject); - channel_convert_params* params = (channel_convert_params *)as_value; + channel_convert_params* params = (channel_convert_params*)as_value; size_t num_args = 0; if (!NIL_P(params->src_hash) && TYPE(params->src_hash) != T_HASH) { @@ -146,7 +143,7 @@ void grpc_rb_hash_convert_to_channel_args(VALUE src_hash, /* Make a protected call to grpc_rb_hash_convert_channel_args */ params.src_hash = src_hash; params.dst = dst; - rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE) ¶ms, &status); + rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE)¶ms, &status); if (status != 0) { if (dst->args != NULL) { /* Free any allocated memory before propagating the error */ diff --git a/src/ruby/ext/grpc/rb_channel_args.h b/src/ruby/ext/grpc/rb_channel_args.h index bbff017c1ec..07be6627930 100644 --- a/src/ruby/ext/grpc/rb_channel_args.h +++ b/src/ruby/ext/grpc/rb_channel_args.h @@ -49,5 +49,4 @@ void grpc_rb_hash_convert_to_channel_args(VALUE src_hash, grpc_channel_args* dst); - -#endif /* GRPC_RB_CHANNEL_ARGS_H_ */ +#endif /* GRPC_RB_CHANNEL_ARGS_H_ */ diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c index dc95838ef58..c1b74e2606d 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.c +++ b/src/ruby/ext/grpc/rb_completion_queue.c @@ -45,33 +45,28 @@ typedef struct next_call_stack { grpc_completion_queue *cq; grpc_event *event; gpr_timespec timeout; - void* tag; + void *tag; } next_call_stack; /* Calls grpc_completion_queue_next without holding the ruby GIL */ -static void *grpc_rb_completion_queue_next_no_gil( - next_call_stack *next_call) { - next_call->event = grpc_completion_queue_next(next_call->cq, - next_call->timeout); +static void *grpc_rb_completion_queue_next_no_gil(next_call_stack *next_call) { + next_call->event = + grpc_completion_queue_next(next_call->cq, next_call->timeout); return NULL; } /* Calls grpc_completion_queue_pluck without holding the ruby GIL */ -static void *grpc_rb_completion_queue_pluck_no_gil( - next_call_stack *next_call) { - next_call->event = grpc_completion_queue_pluck(next_call->cq, - next_call->tag, +static void *grpc_rb_completion_queue_pluck_no_gil(next_call_stack *next_call) { + next_call->event = grpc_completion_queue_pluck(next_call->cq, next_call->tag, next_call->timeout); return NULL; } - /* Shuts down and drains the completion queue if necessary. * * This is done when the ruby completion queue object is about to be GCed. */ -static void grpc_rb_completion_queue_shutdown_drain( - grpc_completion_queue* cq) { +static void grpc_rb_completion_queue_shutdown_drain(grpc_completion_queue *cq) { next_call_stack next_call; grpc_completion_type type; int drained = 0; @@ -120,13 +115,12 @@ static void grpc_rb_completion_queue_destroy(void *p) { /* Allocates a completion queue. */ static VALUE grpc_rb_completion_queue_alloc(VALUE cls) { - grpc_completion_queue* cq = grpc_completion_queue_create(); + grpc_completion_queue *cq = grpc_completion_queue_create(); if (cq == NULL) { - rb_raise(rb_eArgError, - "could not create a completion queue: not sure why"); + rb_raise(rb_eArgError, "could not create a completion queue: not sure why"); } - return Data_Wrap_Struct(cls, GC_NOT_MARKED, - grpc_rb_completion_queue_destroy, cq); + return Data_Wrap_Struct(cls, GC_NOT_MARKED, grpc_rb_completion_queue_destroy, + cq); } /* Blocks until the next event is available, and returns the event. */ @@ -166,9 +160,8 @@ static VALUE grpc_rb_completion_queue_pluck(VALUE self, VALUE tag, VALUE rb_cCompletionQueue = Qnil; void Init_google_rpc_completion_queue() { - rb_cCompletionQueue = rb_define_class_under(rb_mGoogleRpcCore, - "CompletionQueue", - rb_cObject); + rb_cCompletionQueue = + rb_define_class_under(rb_mGoogleRpcCore, "CompletionQueue", rb_cObject); /* constructor: uses an alloc func without an initializer. Using a simple alloc func works here as the grpc header does not specify any args for @@ -176,16 +169,16 @@ void Init_google_rpc_completion_queue() { rb_define_alloc_func(rb_cCompletionQueue, grpc_rb_completion_queue_alloc); /* Add the next method that waits for the next event. */ - rb_define_method(rb_cCompletionQueue, "next", - grpc_rb_completion_queue_next, 1); + rb_define_method(rb_cCompletionQueue, "next", grpc_rb_completion_queue_next, + 1); /* Add the pluck method that waits for the next event of given tag */ - rb_define_method(rb_cCompletionQueue, "pluck", - grpc_rb_completion_queue_pluck, 2); + rb_define_method(rb_cCompletionQueue, "pluck", grpc_rb_completion_queue_pluck, + 2); } /* Gets the wrapped completion queue from the ruby wrapper */ -grpc_completion_queue* grpc_rb_get_wrapped_completion_queue(VALUE v) { +grpc_completion_queue *grpc_rb_get_wrapped_completion_queue(VALUE v) { grpc_completion_queue *cq = NULL; Data_Get_Struct(v, grpc_completion_queue, cq); return cq; diff --git a/src/ruby/ext/grpc/rb_completion_queue.h b/src/ruby/ext/grpc/rb_completion_queue.h index 1ec2718ed4e..c563662c2d4 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.h +++ b/src/ruby/ext/grpc/rb_completion_queue.h @@ -47,4 +47,4 @@ extern VALUE rb_cCompletionQueue; /* Initializes the CompletionQueue class. */ void Init_google_rpc_completion_queue(); -#endif /* GRPC_RB_COMPLETION_QUEUE_H_ */ +#endif /* GRPC_RB_COMPLETION_QUEUE_H_ */ diff --git a/src/ruby/ext/grpc/rb_credentials.c b/src/ruby/ext/grpc/rb_credentials.c index 658adacc062..5dec51824d9 100644 --- a/src/ruby/ext/grpc/rb_credentials.c +++ b/src/ruby/ext/grpc/rb_credentials.c @@ -40,7 +40,6 @@ #include "rb_grpc.h" - /* grpc_rb_credentials wraps a grpc_credentials. It provides a * peer ruby object, 'mark' to minimize copying when a credential is * created from ruby. */ @@ -92,8 +91,7 @@ static VALUE grpc_rb_credentials_alloc(VALUE cls) { wrapper->wrapped = NULL; wrapper->mark = Qnil; return Data_Wrap_Struct(cls, grpc_rb_credentials_mark, - grpc_rb_credentials_free, - wrapper); + grpc_rb_credentials_free, wrapper); } /* Clones Credentials instances. @@ -111,8 +109,7 @@ static VALUE grpc_rb_credentials_init_copy(VALUE copy, VALUE orig) { /* Raise an error if orig is not a credentials object or a subclass. */ if (TYPE(orig) != T_DATA || RDATA(orig)->dfree != (RUBY_DATA_FUNC)grpc_rb_credentials_free) { - rb_raise(rb_eTypeError, "not a %s", - rb_obj_classname(rb_cCredentials)); + rb_raise(rb_eTypeError, "not a %s", rb_obj_classname(rb_cCredentials)); } Data_Get_Struct(orig, grpc_rb_credentials, orig_cred); @@ -238,14 +235,12 @@ static VALUE grpc_rb_credentials_init(int argc, VALUE *argv, VALUE self) { RSTRING_PTR(pem_cert_chain), RSTRING_LEN(pem_cert_chain)); } else if (pem_private_key == Qnil) { creds = grpc_ssl_credentials_create( - RSTRING_PTR(pem_root_certs), RSTRING_LEN(pem_root_certs), - NULL, 0, + RSTRING_PTR(pem_root_certs), RSTRING_LEN(pem_root_certs), NULL, 0, RSTRING_PTR(pem_cert_chain), RSTRING_LEN(pem_cert_chain)); } else { creds = grpc_ssl_credentials_create( RSTRING_PTR(pem_root_certs), RSTRING_LEN(pem_root_certs), - RSTRING_PTR(pem_private_key), RSTRING_LEN(pem_private_key), - NULL, 0); + RSTRING_PTR(pem_private_key), RSTRING_LEN(pem_private_key), NULL, 0); } if (creds == NULL) { rb_raise(rb_eRuntimeError, "could not create a credentials, not sure why"); @@ -265,15 +260,14 @@ static VALUE grpc_rb_credentials_init(int argc, VALUE *argv, VALUE self) { VALUE rb_cCredentials = Qnil; void Init_google_rpc_credentials() { - rb_cCredentials = rb_define_class_under(rb_mGoogleRpcCore, "Credentials", - rb_cObject); + rb_cCredentials = + rb_define_class_under(rb_mGoogleRpcCore, "Credentials", rb_cObject); /* Allocates an object managed by the ruby runtime */ rb_define_alloc_func(rb_cCredentials, grpc_rb_credentials_alloc); /* Provides a ruby constructor and support for dup/clone. */ - rb_define_method(rb_cCredentials, "initialize", - grpc_rb_credentials_init, -1); + rb_define_method(rb_cCredentials, "initialize", grpc_rb_credentials_init, -1); rb_define_method(rb_cCredentials, "initialize_copy", grpc_rb_credentials_init_copy, 1); @@ -294,7 +288,7 @@ void Init_google_rpc_credentials() { } /* Gets the wrapped grpc_credentials from the ruby wrapper */ -grpc_credentials* grpc_rb_get_wrapped_credentials(VALUE v) { +grpc_credentials *grpc_rb_get_wrapped_credentials(VALUE v) { grpc_rb_credentials *wrapper = NULL; Data_Get_Struct(v, grpc_rb_credentials, wrapper); return wrapper->wrapped; diff --git a/src/ruby/ext/grpc/rb_credentials.h b/src/ruby/ext/grpc/rb_credentials.h index d18c88ac34e..fada3639d58 100644 --- a/src/ruby/ext/grpc/rb_credentials.h +++ b/src/ruby/ext/grpc/rb_credentials.h @@ -47,4 +47,4 @@ void Init_google_rpc_credentials(); /* Gets the wrapped credentials from the ruby wrapper */ grpc_credentials* grpc_rb_get_wrapped_credentials(VALUE v); -#endif /* GRPC_RB_CREDENTIALS_H_ */ +#endif /* GRPC_RB_CREDENTIALS_H_ */ diff --git a/src/ruby/ext/grpc/rb_event.c b/src/ruby/ext/grpc/rb_event.c index 9200f923cc7..0fae9502c30 100644 --- a/src/ruby/ext/grpc/rb_event.c +++ b/src/ruby/ext/grpc/rb_event.c @@ -50,7 +50,6 @@ typedef struct grpc_rb_event { grpc_event *wrapped; } grpc_rb_event; - /* rb_mCompletionType is a ruby module that holds the completion type values */ VALUE rb_mCompletionType = Qnil; @@ -107,15 +106,15 @@ static VALUE grpc_rb_event_type(VALUE self) { return rb_const_get(rb_mCompletionType, rb_intern("READ")); case GRPC_INVOKE_ACCEPTED: - grpc_rb_event_result(self); /* validates the result */ + grpc_rb_event_result(self); /* validates the result */ return rb_const_get(rb_mCompletionType, rb_intern("INVOKE_ACCEPTED")); case GRPC_WRITE_ACCEPTED: - grpc_rb_event_result(self); /* validates the result */ + grpc_rb_event_result(self); /* validates the result */ return rb_const_get(rb_mCompletionType, rb_intern("WRITE_ACCEPTED")); case GRPC_FINISH_ACCEPTED: - grpc_rb_event_result(self); /* validates the result */ + grpc_rb_event_result(self); /* validates the result */ return rb_const_get(rb_mCompletionType, rb_intern("FINISH_ACCEPTED")); case GRPC_CLIENT_METADATA_READ: @@ -129,8 +128,8 @@ static VALUE grpc_rb_event_type(VALUE self) { return rb_const_get(rb_mCompletionType, rb_intern("SERVER_RPC_NEW")); default: - rb_raise(rb_eRuntimeError, - "unrecognized event code for an rpc event:%d", event->type); + rb_raise(rb_eRuntimeError, "unrecognized event code for an rpc event:%d", + event->type); } return Qnil; /* should not be reached */ } @@ -189,7 +188,6 @@ static VALUE grpc_rb_event_metadata(VALUE self) { /* Figure out which metadata to read. */ event = wrapper->wrapped; switch (event->type) { - case GRPC_CLIENT_METADATA_READ: count = event->data.client_metadata_read.count; metadata = event->data.client_metadata_read.elements; @@ -218,22 +216,18 @@ static VALUE grpc_rb_event_metadata(VALUE self) { key = rb_str_new2(metadata[i].key); value = rb_hash_aref(result, key); if (value == Qnil) { - value = rb_str_new( - metadata[i].value, - metadata[i].value_length); + value = rb_str_new(metadata[i].value, metadata[i].value_length); rb_hash_aset(result, key, value); } else if (TYPE(value) == T_ARRAY) { /* Add the string to the returned array */ - rb_ary_push(value, rb_str_new( - metadata[i].value, - metadata[i].value_length)); + rb_ary_push(value, + rb_str_new(metadata[i].value, metadata[i].value_length)); } else { /* Add the current value with this key and the new one to an array */ new_ary = rb_ary_new(); rb_ary_push(new_ary, value); - rb_ary_push(new_ary, rb_str_new( - metadata[i].value, - metadata[i].value_length)); + rb_ary_push(new_ary, + rb_str_new(metadata[i].value, metadata[i].value_length)); rb_hash_aset(result, key, new_ary); } } @@ -252,7 +246,6 @@ static VALUE grpc_rb_event_result(VALUE self) { event = wrapper->wrapped; switch (event->type) { - case GRPC_QUEUE_SHUTDOWN: return Qnil; @@ -287,29 +280,24 @@ static VALUE grpc_rb_event_result(VALUE self) { return grpc_rb_event_metadata(self); case GRPC_FINISHED: - return rb_struct_new( - rb_sStatus, - UINT2NUM(event->data.finished.status), - (event->data.finished.details == NULL ? - Qnil : rb_str_new2(event->data.finished.details)), - grpc_rb_event_metadata(self), - NULL); + return rb_struct_new(rb_sStatus, UINT2NUM(event->data.finished.status), + (event->data.finished.details == NULL + ? Qnil + : rb_str_new2(event->data.finished.details)), + grpc_rb_event_metadata(self), NULL); break; case GRPC_SERVER_RPC_NEW: return rb_struct_new( - rb_sNewServerRpc, - rb_str_new2(event->data.server_rpc_new.method), + rb_sNewServerRpc, rb_str_new2(event->data.server_rpc_new.method), rb_str_new2(event->data.server_rpc_new.host), - Data_Wrap_Struct( - rb_cTimeVal, GC_NOT_MARKED, GC_DONT_FREE, - (void *)&event->data.server_rpc_new.deadline), - grpc_rb_event_metadata(self), - NULL); + Data_Wrap_Struct(rb_cTimeVal, GC_NOT_MARKED, GC_DONT_FREE, + (void *)&event->data.server_rpc_new.deadline), + grpc_rb_event_metadata(self), NULL); default: - rb_raise(rb_eRuntimeError, - "unrecognized event code for an rpc event:%d", event->type); + rb_raise(rb_eRuntimeError, "unrecognized event code for an rpc event:%d", + event->type); } return Qfalse; @@ -319,7 +307,7 @@ static VALUE grpc_rb_event_finish(VALUE self) { grpc_event *event = NULL; grpc_rb_event *wrapper = NULL; Data_Get_Struct(self, grpc_rb_event, wrapper); - if (wrapper->wrapped == NULL) { /* already closed */ + if (wrapper->wrapped == NULL) { /* already closed */ return Qnil; } event = wrapper->wrapped; @@ -337,8 +325,8 @@ VALUE rb_cEvent = Qnil; VALUE rb_eEventError = Qnil; void Init_google_rpc_event() { - rb_eEventError = rb_define_class_under(rb_mGoogleRpcCore, "EventError", - rb_eStandardError); + rb_eEventError = + rb_define_class_under(rb_mGoogleRpcCore, "EventError", rb_eStandardError); rb_cEvent = rb_define_class_under(rb_mGoogleRpcCore, "Event", rb_cObject); /* Prevent allocation or inialization from ruby. */ @@ -355,8 +343,8 @@ void Init_google_rpc_event() { rb_define_alias(rb_cEvent, "close", "finish"); /* Constants representing the completion types */ - rb_mCompletionType = rb_define_module_under(rb_mGoogleRpcCore, - "CompletionType"); + rb_mCompletionType = + rb_define_module_under(rb_mGoogleRpcCore, "CompletionType"); rb_define_const(rb_mCompletionType, "QUEUE_SHUTDOWN", INT2NUM(GRPC_QUEUE_SHUTDOWN)); rb_define_const(rb_mCompletionType, "READ", INT2NUM(GRPC_READ)); @@ -368,8 +356,7 @@ void Init_google_rpc_event() { INT2NUM(GRPC_FINISH_ACCEPTED)); rb_define_const(rb_mCompletionType, "CLIENT_METADATA_READ", INT2NUM(GRPC_CLIENT_METADATA_READ)); - rb_define_const(rb_mCompletionType, "FINISHED", - INT2NUM(GRPC_FINISHED)); + rb_define_const(rb_mCompletionType, "FINISHED", INT2NUM(GRPC_FINISHED)); rb_define_const(rb_mCompletionType, "SERVER_RPC_NEW", INT2NUM(GRPC_SERVER_RPC_NEW)); rb_define_const(rb_mCompletionType, "RESERVED", diff --git a/src/ruby/ext/grpc/rb_event.h b/src/ruby/ext/grpc/rb_event.h index e4e4a796c22..a406e9e9f17 100644 --- a/src/ruby/ext/grpc/rb_event.h +++ b/src/ruby/ext/grpc/rb_event.h @@ -50,4 +50,4 @@ VALUE grpc_rb_new_event(grpc_event *ev); /* Initializes the Event and EventError classes. */ void Init_google_rpc_event(); -#endif /* GRPC_RB_EVENT_H_ */ +#endif /* GRPC_RB_EVENT_H_ */ diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c index eae011d33bd..8feefb047cc 100644 --- a/src/ruby/ext/grpc/rb_grpc.c +++ b/src/ruby/ext/grpc/rb_grpc.c @@ -98,18 +98,16 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) { const char *want = " want |