diff --git a/Makefile b/Makefile index 8be6c5fd0a44bdeaa4c8c15e619090f22846f60c..0742994982e09a94e6eafc9d5c63f4c2352f4ed2 100644 --- a/Makefile +++ b/Makefile @@ -37,12 +37,38 @@ HOST_SYSTEM = $(shell uname | cut -f 1 -d_) ifeq ($(SYSTEM),) SYSTEM = $(HOST_SYSTEM) endif +ifeq ($(SYSTEM),MSYS) +SYSTEM = MINGW32 +endif ifndef BUILDDIR BUILDDIR = . endif +HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false) + +ifeq ($(HAS_CC),true) +DEFAULT_CC = cc +DEFAULT_CXX = c++ +else +ifeq ($(HAS_GCC),true) +DEFAULT_CC = gcc +DEFAULT_CXX = g++ +else +ifeq ($(HAS_CLANG),true) +DEFAULT_CC = clang +DEFAULT_CXX = clang++ +else +DEFAULT_CC = no_c_compiler +DEFAULT_CXX = no_c++_compiler +endif +endif +endif + + BINDIR = $(BUILDDIR)/bins OBJDIR = $(BUILDDIR)/objs LIBDIR = $(BUILDDIR)/libs @@ -51,29 +77,29 @@ GENDIR = $(BUILDDIR)/gens # Configurations VALID_CONFIG_opt = 1 -CC_opt = cc -CXX_opt = c++ -LD_opt = cc -LDXX_opt = c++ +CC_opt = $(DEFAULT_CC) +CXX_opt = $(DEFAULT_CXX) +LD_opt = $(DEFAULT_CC) +LDXX_opt = $(DEFAULT_CXX) CPPFLAGS_opt = -O2 LDFLAGS_opt = DEFINES_opt = NDEBUG VALID_CONFIG_dbg = 1 -CC_dbg = cc -CXX_dbg = c++ -LD_dbg = cc -LDXX_dbg = c++ +CC_dbg = $(DEFAULT_CC) +CXX_dbg = $(DEFAULT_CXX) +LD_dbg = $(DEFAULT_CC) +LDXX_dbg = $(DEFAULT_CXX) CPPFLAGS_dbg = -O0 LDFLAGS_dbg = DEFINES_dbg = _DEBUG DEBUG VALID_CONFIG_valgrind = 1 REQUIRE_CUSTOM_LIBRARIES_valgrind = 1 -CC_valgrind = cc -CXX_valgrind = c++ -LD_valgrind = cc -LDXX_valgrind = c++ +CC_valgrind = $(DEFAULT_CC) +CXX_valgrind = $(DEFAULT_CXX) +LD_valgrind = $(DEFAULT_CC) +LDXX_valgrind = $(DEFAULT_CXX) CPPFLAGS_valgrind = -O0 OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = @@ -194,8 +220,14 @@ else CXXFLAGS += -std=c++0x DEFINES += GRPC_OLD_CXX endif -CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -LDFLAGS += -g -fPIC +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter +LDFLAGS += -g + +ifneq ($(SYSTEM),MINGW32) +PIC_CPPFLAGS = -fPIC +CPPFLAGS += -fPIC +LDFLAGS += -fPIC +endif INCLUDES = . include $(GENDIR) ifeq ($(SYSTEM),Darwin) @@ -218,11 +250,18 @@ endif ifneq ($(wildcard /usr/local/lib),) LDFLAGS += -L/usr/local/lib endif -else +endif + +ifeq ($(SYSTEM),Linux) LIBS = rt m z pthread LDFLAGS += -pthread endif +ifeq ($(SYSTEM),MINGW32) +LIBS = m z pthread +LDFLAGS += -pthread +endif + ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),) GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest else @@ -272,13 +311,31 @@ else IS_GIT_FOLDER = true endif -OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS) +ifeq ($(SYSTEM),Linux) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),Darwin) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),MINGW32) +OPENSSL_LIBS = ssl32 eay32 +else +OPENSSL_LIBS = ssl crypto +endif + +OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS) PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) -PROTOC_CMD = which protoc +PROTOC_CMD = which protoc > /dev/null PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3 +ifeq ($(OPENSSL_REQUIRES_DL),true) +OPENSSL_ALPN_CHECK_CMD += -ldl +endif + ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG) HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_SYSTEM_PERFTOOLS),true) @@ -299,7 +356,7 @@ HAS_SYSTEM_ZLIB = false HAS_SYSTEM_PROTOBUF = false endif -HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) +HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false) else @@ -344,12 +401,17 @@ OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/o # need to prefix these to ensure overriding system libraries CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS) LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS) +ifeq ($(OPENSSL_REQUIRES_DL),true) LIBS_SECURE = dl +endif else NO_SECURE = true endif else -LIBS_SECURE = ssl crypto dl +LIBS_SECURE = $(OPENSSL_LIBS) +ifeq ($(OPENSSL_REQUIRES_DL),true) +LIBS_SECURE += dl +endif endif LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE)) @@ -555,6 +617,7 @@ transport_security_test: $(BINDIR)/$(CONFIG)/transport_security_test async_end2end_test: $(BINDIR)/$(CONFIG)/async_end2end_test channel_arguments_test: $(BINDIR)/$(CONFIG)/channel_arguments_test credentials_test: $(BINDIR)/$(CONFIG)/credentials_test +cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test end2end_test: $(BINDIR)/$(CONFIG)/end2end_test generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test grpc_cpp_plugin: $(BINDIR)/$(CONFIG)/grpc_cpp_plugin @@ -923,7 +986,7 @@ run_dep_checks: $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(E) "[MAKE] Building zlib" - $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) + $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) $(Q)$(MAKE) -C third_party/zlib clean $(Q)$(MAKE) -C third_party/zlib $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib @@ -932,9 +995,29 @@ $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(LIBDIR)/$(CONFIG)/openssl/libssl.a: $(E) "[MAKE] Building openssl for $(SYSTEM)" ifeq ($(SYSTEM),Darwin) - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) else - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +ifeq ($(SYSTEM),MINGW32) + @echo "We currently don't have a good way to compile OpenSSL in-place under msys." + @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system." + @echo + @echo "Note that you can find a compatible version of the libraries here:" + @echo + @echo "http://slproweb.com/products/Win32OpenSSL.html" + @echo + @echo "If you decide to install that one, take the full version. The light" + @echo "version only contains compiled DLLs, without the development files." + @echo + @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries" + @echo "directory. This way we'll link to them directly." + @echo + @echo "You can then re-start the build the following way:" + @echo + @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make" + @false +else + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +endif endif $(Q)$(MAKE) -C third_party/openssl clean $(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl @@ -948,9 +1031,9 @@ third_party/protobuf/configure: $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure $(E) "[MAKE] Building protobuf" ifeq ($(HAVE_CXX11),true) - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) else - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) endif $(Q)$(MAKE) -C third_party/protobuf clean $(Q)$(MAKE) -C third_party/protobuf @@ -987,7 +1070,7 @@ buildtests: buildtests_c buildtests_cxx buildtests_c: privatelibs_c $(BINDIR)/$(CONFIG)/alarm_heap_test $(BINDIR)/$(CONFIG)/alarm_list_test $(BINDIR)/$(CONFIG)/alarm_test $(BINDIR)/$(CONFIG)/alpn_test $(BINDIR)/$(CONFIG)/bin_encoder_test $(BINDIR)/$(CONFIG)/census_hash_table_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_circular_buffer_test $(BINDIR)/$(CONFIG)/census_statistics_multiple_writers_test $(BINDIR)/$(CONFIG)/census_statistics_performance_test $(BINDIR)/$(CONFIG)/census_statistics_quick_test $(BINDIR)/$(CONFIG)/census_statistics_small_log_test $(BINDIR)/$(CONFIG)/census_stub_test $(BINDIR)/$(CONFIG)/census_window_stats_test $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test $(BINDIR)/$(CONFIG)/chttp2_stream_encoder_test $(BINDIR)/$(CONFIG)/chttp2_stream_map_test $(BINDIR)/$(CONFIG)/chttp2_transport_end2end_test $(BINDIR)/$(CONFIG)/dualstack_socket_test $(BINDIR)/$(CONFIG)/echo_client $(BINDIR)/$(CONFIG)/echo_server $(BINDIR)/$(CONFIG)/echo_test $(BINDIR)/$(CONFIG)/fd_posix_test $(BINDIR)/$(CONFIG)/fling_client $(BINDIR)/$(CONFIG)/fling_server $(BINDIR)/$(CONFIG)/fling_stream_test $(BINDIR)/$(CONFIG)/fling_test $(BINDIR)/$(CONFIG)/gpr_cancellable_test $(BINDIR)/$(CONFIG)/gpr_cmdline_test $(BINDIR)/$(CONFIG)/gpr_env_test $(BINDIR)/$(CONFIG)/gpr_file_test $(BINDIR)/$(CONFIG)/gpr_histogram_test $(BINDIR)/$(CONFIG)/gpr_host_port_test $(BINDIR)/$(CONFIG)/gpr_log_test $(BINDIR)/$(CONFIG)/gpr_slice_buffer_test $(BINDIR)/$(CONFIG)/gpr_slice_test $(BINDIR)/$(CONFIG)/gpr_string_test $(BINDIR)/$(CONFIG)/gpr_sync_test $(BINDIR)/$(CONFIG)/gpr_thd_test $(BINDIR)/$(CONFIG)/gpr_time_test $(BINDIR)/$(CONFIG)/gpr_useful_test $(BINDIR)/$(CONFIG)/grpc_base64_test $(BINDIR)/$(CONFIG)/grpc_byte_buffer_reader_test $(BINDIR)/$(CONFIG)/grpc_channel_stack_test $(BINDIR)/$(CONFIG)/grpc_completion_queue_test $(BINDIR)/$(CONFIG)/grpc_credentials_test $(BINDIR)/$(CONFIG)/grpc_json_token_test $(BINDIR)/$(CONFIG)/grpc_stream_op_test $(BINDIR)/$(CONFIG)/hpack_parser_test $(BINDIR)/$(CONFIG)/hpack_table_test $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(BINDIR)/$(CONFIG)/httpcli_parser_test $(BINDIR)/$(CONFIG)/httpcli_test $(BINDIR)/$(CONFIG)/json_rewrite $(BINDIR)/$(CONFIG)/json_rewrite_test $(BINDIR)/$(CONFIG)/json_test $(BINDIR)/$(CONFIG)/lame_client_test $(BINDIR)/$(CONFIG)/message_compress_test $(BINDIR)/$(CONFIG)/metadata_buffer_test $(BINDIR)/$(CONFIG)/multi_init_test $(BINDIR)/$(CONFIG)/murmur_hash_test $(BINDIR)/$(CONFIG)/no_server_test $(BINDIR)/$(CONFIG)/poll_kick_posix_test $(BINDIR)/$(CONFIG)/resolve_address_test $(BINDIR)/$(CONFIG)/secure_endpoint_test $(BINDIR)/$(CONFIG)/sockaddr_utils_test $(BINDIR)/$(CONFIG)/tcp_client_posix_test $(BINDIR)/$(CONFIG)/tcp_posix_test $(BINDIR)/$(CONFIG)/tcp_server_posix_test $(BINDIR)/$(CONFIG)/time_averaged_stats_test $(BINDIR)/$(CONFIG)/time_test $(BINDIR)/$(CONFIG)/timeout_encoding_test $(BINDIR)/$(CONFIG)/transport_metadata_test $(BINDIR)/$(CONFIG)/transport_security_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fake_security_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_fullstack_uds_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_simple_ssl_with_oauth2_fullstack_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_writes_done_hangs_with_pending_read_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_census_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_disappearing_server_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_no_op_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_request_with_payload_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_simple_request_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_thread_stress_legacy_test $(BINDIR)/$(CONFIG)/chttp2_socket_pair_one_byte_at_a_time_writes_done_hangs_with_pending_read_legacy_test -buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/generic_end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test +buildtests_cxx: privatelibs_cxx $(BINDIR)/$(CONFIG)/async_end2end_test $(BINDIR)/$(CONFIG)/channel_arguments_test $(BINDIR)/$(CONFIG)/credentials_test $(BINDIR)/$(CONFIG)/cxx_time_test $(BINDIR)/$(CONFIG)/end2end_test $(BINDIR)/$(CONFIG)/generic_end2end_test $(BINDIR)/$(CONFIG)/interop_client $(BINDIR)/$(CONFIG)/interop_server $(BINDIR)/$(CONFIG)/interop_test $(BINDIR)/$(CONFIG)/pubsub_client $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(BINDIR)/$(CONFIG)/qps_driver $(BINDIR)/$(CONFIG)/qps_worker $(BINDIR)/$(CONFIG)/status_test $(BINDIR)/$(CONFIG)/thread_pool_test test: test_c test_cxx @@ -1821,6 +1904,8 @@ test_cxx: buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/channel_arguments_test || ( echo test channel_arguments_test failed ; exit 1 ) $(E) "[RUN] Testing credentials_test" $(Q) $(BINDIR)/$(CONFIG)/credentials_test || ( echo test credentials_test failed ; exit 1 ) + $(E) "[RUN] Testing cxx_time_test" + $(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 ) $(E) "[RUN] Testing end2end_test" $(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 ) $(E) "[RUN] Testing generic_end2end_test" @@ -2210,6 +2295,7 @@ LIBGPR_SRC = \ src/core/support/alloc.c \ src/core/support/cancellable.c \ src/core/support/cmdline.c \ + src/core/support/cpu_iphone.c \ src/core/support/cpu_linux.c \ src/core/support/cpu_posix.c \ src/core/support/cpu_windows.c \ @@ -2249,6 +2335,7 @@ PUBLIC_HEADERS_C += \ include/grpc/support/atm_win32.h \ include/grpc/support/cancellable_platform.h \ include/grpc/support/cmdline.h \ + include/grpc/support/cpu.h \ include/grpc/support/histogram.h \ include/grpc/support/host_port.h \ include/grpc/support/log.h \ @@ -2302,6 +2389,7 @@ endif $(OBJDIR)/$(CONFIG)/src/core/support/alloc.o: $(OBJDIR)/$(CONFIG)/src/core/support/cancellable.o: $(OBJDIR)/$(CONFIG)/src/core/support/cmdline.o: +$(OBJDIR)/$(CONFIG)/src/core/support/cpu_iphone.o: $(OBJDIR)/$(CONFIG)/src/core/support/cpu_linux.o: $(OBJDIR)/$(CONFIG)/src/core/support/cpu_posix.o: $(OBJDIR)/$(CONFIG)/src/core/support/cpu_windows.o: @@ -2503,6 +2591,7 @@ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/grpc.h \ + include/grpc/grpc_http.h \ include/grpc/status.h \ LIBGRPC_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_SRC)))) @@ -2984,6 +3073,7 @@ PUBLIC_HEADERS_C += \ include/grpc/byte_buffer.h \ include/grpc/byte_buffer_reader.h \ include/grpc/grpc.h \ + include/grpc/grpc_http.h \ include/grpc/status.h \ LIBGRPC_UNSECURE_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_UNSECURE_SRC)))) @@ -3157,6 +3247,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ + include/grpc++/generic_stub.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/internal_stub.h \ @@ -3401,6 +3492,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ + include/grpc++/generic_stub.h \ include/grpc++/impl/call.h \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/internal_stub.h \ @@ -3493,6 +3585,44 @@ $(OBJDIR)/$(CONFIG)/src/cpp/util/status.o: $(OBJDIR)/$(CONFIG)/src/cpp/util/time.o: +LIBGRPC_PYTHON_PLUGIN_SUPPORT_SRC = \ + src/compiler/python_generator.cc \ + +PUBLIC_HEADERS_CXX += \ + src/compiler/python_generator.h \ + +LIBGRPC_PYTHON_PLUGIN_SUPPORT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC_PYTHON_PLUGIN_SUPPORT_SRC)))) + +ifeq ($(NO_PROTOBUF),true) + +# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay. + +$(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a: protobuf_dep_error + + +else + +$(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a: $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBGRPC_PYTHON_PLUGIN_SUPPORT_OBJS) + $(E) "[AR] Creating $@" + $(Q) mkdir -p `dirname $@` + $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a + $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a $(LIBGRPC_PYTHON_PLUGIN_SUPPORT_OBJS) +ifeq ($(SYSTEM),Darwin) + $(Q) ranlib $(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a +endif + + + + +endif + +ifneq ($(NO_DEPS),true) +-include $(LIBGRPC_PYTHON_PLUGIN_SUPPORT_OBJS:.o=.dep) +endif + +$(OBJDIR)/$(CONFIG)/src/compiler/python_generator.o: + + LIBPUBSUB_CLIENT_LIB_SRC = \ $(GENDIR)/examples/pubsub/label.pb.cc \ $(GENDIR)/examples/pubsub/empty.pb.cc \ @@ -7931,6 +8061,48 @@ endif endif +CXX_TIME_TEST_SRC = \ + test/cpp/util/time_test.cc \ + +CXX_TIME_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CXX_TIME_TEST_SRC)))) + +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL with ALPN. + +$(BINDIR)/$(CONFIG)/cxx_time_test: openssl_dep_error + +else + + +ifeq ($(NO_PROTOBUF),true) + +# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+. + +$(BINDIR)/$(CONFIG)/cxx_time_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/cxx_time_test: $(PROTOBUF_DEP) $(CXX_TIME_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(CXX_TIME_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/cxx_time_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/util/time_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_cxx_time_test: $(CXX_TIME_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(CXX_TIME_TEST_OBJS:.o=.dep) +endif +endif + + END2END_TEST_SRC = \ test/cpp/end2end/end2end_test.cc \ @@ -8048,7 +8220,6 @@ endif GRPC_PYTHON_PLUGIN_SRC = \ - src/compiler/python_generator.cc \ src/compiler/python_plugin.cc \ GRPC_PYTHON_PLUGIN_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GRPC_PYTHON_PLUGIN_SRC)))) @@ -8062,15 +8233,14 @@ $(BINDIR)/$(CONFIG)/grpc_python_plugin: protobuf_dep_error else -$(BINDIR)/$(CONFIG)/grpc_python_plugin: $(PROTOBUF_DEP) $(GRPC_PYTHON_PLUGIN_OBJS) +$(BINDIR)/$(CONFIG)/grpc_python_plugin: $(PROTOBUF_DEP) $(GRPC_PYTHON_PLUGIN_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a $(E) "[HOSTLD] Linking $@" $(Q) mkdir -p `dirname $@` - $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(GRPC_PYTHON_PLUGIN_OBJS) $(HOST_LDLIBSXX) $(HOST_LDLIBS_PROTOC) $(HOST_LDLIBS) $(HOST_LDLIBS_PROTOC) -o $(BINDIR)/$(CONFIG)/grpc_python_plugin + $(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(GRPC_PYTHON_PLUGIN_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a $(HOST_LDLIBSXX) $(HOST_LDLIBS_PROTOC) $(HOST_LDLIBS) $(HOST_LDLIBS_PROTOC) -o $(BINDIR)/$(CONFIG)/grpc_python_plugin endif -$(OBJDIR)/$(CONFIG)/src/compiler/python_generator.o: -$(OBJDIR)/$(CONFIG)/src/compiler/python_plugin.o: +$(OBJDIR)/$(CONFIG)/src/compiler/python_plugin.o: $(LIBDIR)/$(CONFIG)/libgrpc_python_plugin_support.a deps_grpc_python_plugin: $(GRPC_PYTHON_PLUGIN_OBJS:.o=.dep) diff --git a/build.json b/build.json index 999e140c5a12f033e42e75212f4307b934fc1a7d..a46866263f6c5afdc0e6199fbbce8e6eeb0cff25 100644 --- a/build.json +++ b/build.json @@ -22,6 +22,7 @@ "include/grpc++/config.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", + "include/grpc++/generic_stub.h", "include/grpc++/impl/call.h", "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/internal_stub.h", @@ -76,6 +77,7 @@ "include/grpc/byte_buffer.h", "include/grpc/byte_buffer_reader.h", "include/grpc/grpc.h", + "include/grpc/grpc_http.h", "include/grpc/status.h" ], "headers": [ @@ -143,6 +145,7 @@ "src/core/surface/init.h", "src/core/surface/server.h", "src/core/surface/surface_trace.h", + "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", "src/core/transport/chttp2/frame_data.h", @@ -278,6 +281,7 @@ "include/grpc/support/atm_win32.h", "include/grpc/support/cancellable_platform.h", "include/grpc/support/cmdline.h", + "include/grpc/support/cpu.h", "include/grpc/support/histogram.h", "include/grpc/support/host_port.h", "include/grpc/support/log.h", @@ -305,6 +309,7 @@ "src/core/support/alloc.c", "src/core/support/cancellable.c", "src/core/support/cmdline.c", + "src/core/support/cpu_iphone.c", "src/core/support/cpu_linux.c", "src/core/support/cpu_posix.c", "src/core/support/cpu_windows.c", @@ -367,6 +372,7 @@ "src/core/security/base64.h", "src/core/security/credentials.h", "src/core/security/json_token.h", + "src/core/security/secure_endpoint.h", "src/core/security/secure_transport_setup.h", "src/core/security/security_context.h", "src/core/tsi/fake_transport_security.h", @@ -491,6 +497,19 @@ ], "secure": "no" }, + { + "name": "grpc_python_plugin_support", + "build": "protoc", + "language": "c++", + "public_headers": [ + "src/compiler/python_generator.h" + ], + "src": [ + "src/compiler/python_generator.cc" + ], + "deps": [], + "secure": "no" + }, { "name": "pubsub_client_lib", "build": "private", @@ -1688,6 +1707,21 @@ "gpr" ] }, + { + "name": "cxx_time_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/time_test.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, { "name": "end2end_test", "build": "test", @@ -1739,14 +1773,12 @@ "name": "grpc_python_plugin", "build": "protoc", "language": "c++", - "headers": [ - "src/compiler/python_generator.h" - ], "src": [ - "src/compiler/python_generator.cc", "src/compiler/python_plugin.cc" ], - "deps": [], + "deps": [ + "grpc_python_plugin_support" + ], "secure": "no" }, { diff --git a/examples/pubsub/publisher_test.cc b/examples/pubsub/publisher_test.cc index f9b6bb3418d21fcfcc7db4a5af343bb25ff540dd..62442c738477473c895ad28f9838294759f78c5c 100644 --- a/examples/pubsub/publisher_test.cc +++ b/examples/pubsub/publisher_test.cc @@ -107,7 +107,7 @@ class PublisherTest : public ::testing::Test { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; ServerBuilder builder; - builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); builder.RegisterService(&service_); server_ = builder.BuildAndStart(); diff --git a/examples/pubsub/subscriber_test.cc b/examples/pubsub/subscriber_test.cc index 2d606336adde9177fd040256bff9909c2dddb36a..b8dd1f9486e3f228c5d9b915922d91de71ff0d76 100644 --- a/examples/pubsub/subscriber_test.cc +++ b/examples/pubsub/subscriber_test.cc @@ -105,7 +105,7 @@ class SubscriberTest : public ::testing::Test { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; ServerBuilder builder; - builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); builder.RegisterService(&service_); server_ = builder.BuildAndStart(); diff --git a/include/grpc++/async_generic_service.h b/include/grpc++/async_generic_service.h index d10a56c7f78d0e327c5b6654f80ca6b99df5d9fa..911d31cb1f4dbc352321f907b8ee402cee2d4383 100644 --- a/include/grpc++/async_generic_service.h +++ b/include/grpc++/async_generic_service.h @@ -41,7 +41,8 @@ struct grpc_server; namespace grpc { -typedef ServerAsyncReaderWriter<ByteBuffer, ByteBuffer> GenericServerAsyncReaderWriter; +typedef ServerAsyncReaderWriter<ByteBuffer, ByteBuffer> + GenericServerAsyncReaderWriter; class GenericServerContext GRPC_FINAL : public ServerContext { public: @@ -74,6 +75,6 @@ class AsyncGenericService GRPC_FINAL { Server* server_; }; -} // namespace grpc +} // namespace grpc #endif // GRPCXX_ASYNC_GENERIC_SERVICE_H diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h index 658941bb6d47ed78b5e4d8f8508367bb19490aea..d1d5be5b50e37b13e76bd383efd72a004eb63fe4 100644 --- a/include/grpc++/async_unary_call.h +++ b/include/grpc++/async_unary_call.h @@ -48,10 +48,9 @@ template <class R> class ClientAsyncResponseReader GRPC_FINAL { public: ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, - const RpcMethod& method, ClientContext* context, - const grpc::protobuf::Message& request, void* tag) - : context_(context), - call_(channel->CreateCall(method, context, cq)) { + const RpcMethod& method, ClientContext* context, + const grpc::protobuf::Message& request, void* tag) + : context_(context), call_(channel->CreateCall(method, context, cq)) { init_buf_.Reset(tag); init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_); init_buf_.AddSendMessage(request); diff --git a/include/grpc++/byte_buffer.h b/include/grpc++/byte_buffer.h index e864ca3bba2d5de72cd42bffbef9c98093f65033..ceb62622fdb21d1872db9a5ef117a0194a40bb6b 100644 --- a/include/grpc++/byte_buffer.h +++ b/include/grpc++/byte_buffer.h @@ -72,9 +72,7 @@ class ByteBuffer GRPC_FINAL { buffer_ = buf; } - grpc_byte_buffer* buffer() const { - return buffer_; - } + grpc_byte_buffer* buffer() const { return buffer_; } grpc_byte_buffer* buffer_; }; diff --git a/include/grpc++/channel_interface.h b/include/grpc++/channel_interface.h index 51260aed3d708f1e1cb2d9bac07f142ada4df13d..7d50b452801a6d852d90de52b348a79be9cb233f 100644 --- a/include/grpc++/channel_interface.h +++ b/include/grpc++/channel_interface.h @@ -51,8 +51,8 @@ class ChannelInterface : public CallHook { public: virtual ~ChannelInterface() {} - virtual Call CreateCall(const RpcMethod &method, ClientContext *context, - CompletionQueue *cq) = 0; + virtual Call CreateCall(const RpcMethod& method, ClientContext* context, + CompletionQueue* cq) = 0; }; } // namespace grpc diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index c55d7c2d5860fb2c602066549cff1354e7c4a8f4..4e7f5a7be0e5d34d1cc1004f2e2149c2727a8904 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -74,8 +74,8 @@ class ClientContext { ClientContext(); ~ClientContext(); - void AddMetadata(const grpc::string &meta_key, - const grpc::string &meta_value); + void AddMetadata(const grpc::string& meta_key, + const grpc::string& meta_value); const std::multimap<grpc::string, grpc::string>& GetServerInitialMetadata() { GPR_ASSERT(initial_metadata_received_); @@ -87,19 +87,17 @@ class ClientContext { return trailing_metadata_; } - void set_absolute_deadline(const system_clock::time_point &deadline); + void set_absolute_deadline(const system_clock::time_point& deadline); system_clock::time_point absolute_deadline(); - void set_authority(const grpc::string& authority) { - authority_ = authority; - } + void set_authority(const grpc::string& authority) { authority_ = authority; } void TryCancel(); private: // Disallow copy and assign. - ClientContext(const ClientContext &); - ClientContext &operator=(const ClientContext &); + ClientContext(const ClientContext&); + ClientContext& operator=(const ClientContext&); friend class CallOpBuffer; friend class Channel; @@ -118,24 +116,22 @@ class ClientContext { template <class R> friend class ::grpc::ClientAsyncResponseReader; - grpc_call *call() { return call_; } - void set_call(grpc_call *call) { + grpc_call* call() { return call_; } + void set_call(grpc_call* call) { GPR_ASSERT(call_ == nullptr); call_ = call; } - grpc_completion_queue *cq() { return cq_; } - void set_cq(grpc_completion_queue *cq) { cq_ = cq; } + grpc_completion_queue* cq() { return cq_; } + void set_cq(grpc_completion_queue* cq) { cq_ = cq; } gpr_timespec RawDeadline() { return absolute_deadline_; } - grpc::string authority() { - return authority_; - } + grpc::string authority() { return authority_; } bool initial_metadata_received_; - grpc_call *call_; - grpc_completion_queue *cq_; + grpc_call* call_; + grpc_completion_queue* cq_; gpr_timespec absolute_deadline_; grpc::string authority_; std::multimap<grpc::string, grpc::string> send_initial_metadata_; diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 6b2f539fa27196fe84dc2865c7902e25ee656110..e6a8c6fe552b2db54d19ad833dbdaf539a188174 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -36,6 +36,7 @@ #include <chrono> #include <grpc++/impl/client_unary_call.h> +#include <grpc/support/time.h> struct grpc_completion_queue; @@ -66,37 +67,36 @@ class CompletionQueueTag { // to do) // If this function returns false, the tag is dropped and not returned // from the completion queue - virtual bool FinalizeResult(void **tag, bool *status) = 0; + virtual bool FinalizeResult(void** tag, bool* status) = 0; }; // grpc_completion_queue wrapper class class CompletionQueue { public: CompletionQueue(); - explicit CompletionQueue(grpc_completion_queue *take); + explicit CompletionQueue(grpc_completion_queue* take); ~CompletionQueue(); // Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT - enum NextStatus {SHUTDOWN, GOT_EVENT, TIMEOUT}; + enum NextStatus { SHUTDOWN, GOT_EVENT, TIMEOUT }; // Nonblocking (until deadline) read from queue. // Cannot rely on result of tag or ok if return is TIMEOUT - NextStatus AsyncNext(void **tag, bool *ok, - std::chrono::system_clock::time_point deadline); + NextStatus AsyncNext(void** tag, bool* ok, + std::chrono::system_clock::time_point deadline); // Blocking (until deadline) read from queue. // Returns false if the queue is ready for destruction, true if event - bool Next(void **tag, bool *ok) { - return (AsyncNext(tag,ok, - (std::chrono::system_clock::time_point::max)()) != - SHUTDOWN); + + bool Next(void** tag, bool* ok) { + return (AsyncNextInternal(tag, ok, gpr_inf_future) != SHUTDOWN); } // Shutdown has to be called, and the CompletionQueue can only be // destructed when false is returned from Next(). void Shutdown(); - grpc_completion_queue *cq() { return cq_; } + grpc_completion_queue* cq() { return cq_; } private: // Friend synchronous wrappers so that they can access Pluck(), which is @@ -115,20 +115,22 @@ class CompletionQueue { friend class ::grpc::ServerReaderWriter; friend class ::grpc::Server; friend class ::grpc::ServerContext; - friend Status BlockingUnaryCall(ChannelInterface *channel, - const RpcMethod &method, - ClientContext *context, - const grpc::protobuf::Message &request, - grpc::protobuf::Message *result); + friend Status BlockingUnaryCall(ChannelInterface* channel, + const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result); + + NextStatus AsyncNextInternal(void** tag, bool* ok, gpr_timespec deadline); // Wraps grpc_completion_queue_pluck. // Cannot be mixed with calls to Next(). - bool Pluck(CompletionQueueTag *tag); + bool Pluck(CompletionQueueTag* tag); // Does a single polling pluck on tag - void TryPluck(CompletionQueueTag *tag); + void TryPluck(CompletionQueueTag* tag); - grpc_completion_queue *cq_; // owned + grpc_completion_queue* cq_; // owned }; } // namespace grpc diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 0267b8521599237db822d785ae243f33cbdf3fa9..35bf50736477b536f3a2176eae5162f387b58c01 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -59,11 +59,12 @@ #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM #include <google/protobuf/io/zero_copy_stream.h> -#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ::google::protobuf::io::ZeroCopyOutputStream -#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ::google::protobuf::io::ZeroCopyInputStream +#define GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM \ + ::google::protobuf::io::ZeroCopyOutputStream +#define GRPC_CUSTOM_ZEROCOPYINPUTSTREAM \ + ::google::protobuf::io::ZeroCopyInputStream #endif - namespace grpc { typedef GRPC_CUSTOM_STRING string; diff --git a/include/grpc++/generic_stub.h b/include/grpc++/generic_stub.h index 6038d7c66ccfd92c8355e1f39a843522751d480e..d4c8380ad4558cb25148bbfd9845a63b5c412bfe 100644 --- a/include/grpc++/generic_stub.h +++ b/include/grpc++/generic_stub.h @@ -57,6 +57,6 @@ class GenericStub GRPC_FINAL { std::shared_ptr<ChannelInterface> channel_; }; -} // namespace grpc +} // namespace grpc #endif // GRPCXX_GENERIC_STUB_H diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index a8551ad45958fc5550acba3a60daa9557c6d87f9..e117ac6313ed40ceb011e4fa6648f82e81a2af2f 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -55,89 +55,89 @@ class CallOpBuffer : public CompletionQueueTag { CallOpBuffer(); ~CallOpBuffer(); - void Reset(void *next_return_tag); + void Reset(void* next_return_tag); // Does not take ownership. void AddSendInitialMetadata( - std::multimap<grpc::string, grpc::string> *metadata); - void AddSendInitialMetadata(ClientContext *ctx); - void AddRecvInitialMetadata(ClientContext *ctx); - void AddSendMessage(const grpc::protobuf::Message &message); + std::multimap<grpc::string, grpc::string>* metadata); + void AddSendInitialMetadata(ClientContext* ctx); + void AddRecvInitialMetadata(ClientContext* ctx); + void AddSendMessage(const grpc::protobuf::Message& message); void AddSendMessage(const ByteBuffer& message); - void AddRecvMessage(grpc::protobuf::Message *message); - void AddRecvMessage(ByteBuffer *message); + void AddRecvMessage(grpc::protobuf::Message* message); + void AddRecvMessage(ByteBuffer* message); void AddClientSendClose(); - void AddClientRecvStatus(ClientContext *ctx, Status *status); - void AddServerSendStatus(std::multimap<grpc::string, grpc::string> *metadata, - const Status &status); - void AddServerRecvClose(bool *cancelled); + void AddClientRecvStatus(ClientContext* ctx, Status* status); + void AddServerSendStatus(std::multimap<grpc::string, grpc::string>* metadata, + const Status& status); + void AddServerRecvClose(bool* cancelled); // INTERNAL API: // Convert to an array of grpc_op elements - void FillOps(grpc_op *ops, size_t *nops); + void FillOps(grpc_op* ops, size_t* nops); // Called by completion queue just prior to returning from Next() or Pluck() - bool FinalizeResult(void **tag, bool *status) GRPC_OVERRIDE; + bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE; bool got_message; private: - void *return_tag_; + void* return_tag_; // Send initial metadata bool send_initial_metadata_; size_t initial_metadata_count_; - grpc_metadata *initial_metadata_; + grpc_metadata* initial_metadata_; // Recv initial metadta - std::multimap<grpc::string, grpc::string> *recv_initial_metadata_; + std::multimap<grpc::string, grpc::string>* recv_initial_metadata_; grpc_metadata_array recv_initial_metadata_arr_; // Send message - const grpc::protobuf::Message *send_message_; - const ByteBuffer *send_message_buffer_; - grpc_byte_buffer *send_buf_; + const grpc::protobuf::Message* send_message_; + const ByteBuffer* send_message_buffer_; + grpc_byte_buffer* send_buf_; // Recv message - grpc::protobuf::Message *recv_message_; - ByteBuffer *recv_message_buffer_; - grpc_byte_buffer *recv_buf_; + grpc::protobuf::Message* recv_message_; + ByteBuffer* recv_message_buffer_; + grpc_byte_buffer* recv_buf_; // Client send close bool client_send_close_; // Client recv status - std::multimap<grpc::string, grpc::string> *recv_trailing_metadata_; - Status *recv_status_; + std::multimap<grpc::string, grpc::string>* recv_trailing_metadata_; + Status* recv_status_; grpc_metadata_array recv_trailing_metadata_arr_; grpc_status_code status_code_; - char *status_details_; + char* status_details_; size_t status_details_capacity_; // Server send status - const Status *send_status_; + const Status* send_status_; size_t trailing_metadata_count_; - grpc_metadata *trailing_metadata_; + grpc_metadata* trailing_metadata_; int cancelled_buf_; - bool *recv_closed_; + bool* recv_closed_; }; // Channel and Server implement this to allow them to hook performing ops class CallHook { public: virtual ~CallHook() {} - virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) = 0; + virtual void PerformOpsOnCall(CallOpBuffer* ops, Call* call) = 0; }; // Straightforward wrapping of the C call object class Call GRPC_FINAL { public: /* call is owned by the caller */ - Call(grpc_call *call, CallHook *call_hook_, CompletionQueue *cq); + Call(grpc_call* call, CallHook* call_hook_, CompletionQueue* cq); - void PerformOps(CallOpBuffer *buffer); + void PerformOps(CallOpBuffer* buffer); - grpc_call *call() { return call_; } - CompletionQueue *cq() { return cq_; } + grpc_call* call() { return call_; } + CompletionQueue* cq() { return cq_; } private: - CallHook *call_hook_; - CompletionQueue *cq_; - grpc_call *call_; + CallHook* call_hook_; + CompletionQueue* cq_; + grpc_call* call_; }; } // namespace grpc diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h index fd9715da504f9d29bbccd29ed0fde2cfbfb64ee4..0e8aeed78162bca78d20f506a4cca815cad320e8 100644 --- a/include/grpc++/impl/client_unary_call.h +++ b/include/grpc++/impl/client_unary_call.h @@ -45,10 +45,10 @@ class RpcMethod; class Status; // Wrapper that performs a blocking unary call -Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const grpc::protobuf::Message &request, - grpc::protobuf::Message *result); +Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result); } // namespace grpc diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 8cd0a4f6681cf0853a57b93ca4875eaf7af8eccc..bddb4f62aa86ef5eccaecc2dd0f0ae1d74569c6b 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -86,7 +86,7 @@ class Server GRPC_FINAL : private CallHook, bool RegisterAsyncService(AsynchronousService* service); void RegisterAsyncGenericService(AsyncGenericService* service); // Add a listening port. Can be called multiple times. - int AddPort(const grpc::string& addr, ServerCredentials* creds); + int AddListeningPort(const grpc::string& addr, ServerCredentials* creds); // Start the server. bool Start(); diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index c09c8fee52ce923240f1ba114b100870ab25870e..9a9932ebe01f33432301a9e39ab3fd5bd422a48d 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -69,9 +69,9 @@ class ServerBuilder { void RegisterAsyncGenericService(AsyncGenericService* service); // Add a listening port. Can be called multiple times. - void AddPort(const grpc::string& addr, - std::shared_ptr<ServerCredentials> creds, - int* selected_port = nullptr); + void AddListeningPort(const grpc::string& addr, + std::shared_ptr<ServerCredentials> creds, + int* selected_port = nullptr); // Set the thread pool used for running appliation rpc handlers. // Does not take ownership. diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 9e3b80c6411d4d810a84742ac4c60ab16b242aac..36cbae87a00ad5fa764ee662dd6108c09be1d3fc 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -78,8 +78,6 @@ class ServerContext { void AddInitialMetadata(const grpc::string& key, const grpc::string& value); void AddTrailingMetadata(const grpc::string& key, const grpc::string& value); - bool IsCancelled(); - const std::multimap<grpc::string, grpc::string>& client_metadata() { return client_metadata_; } @@ -112,7 +110,6 @@ class ServerContext { std::chrono::system_clock::time_point deadline_; grpc_call* call_; - CompletionQueue* cq_; bool sent_initial_metadata_; std::multimap<grpc::string, grpc::string> client_metadata_; std::multimap<grpc::string, grpc::string> initial_metadata_; diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/atm_win32.h index 8b5322488ec28d6c9f780031c6210315b8224674..4a21b5b547ccce9059b42e0846a95856540f3594 100644 --- a/include/grpc/support/atm_win32.h +++ b/include/grpc/support/atm_win32.h @@ -63,25 +63,31 @@ static __inline int gpr_atm_no_barrier_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { /* InterlockedCompareExchangePointerNoFence() not available on vista or windows7 */ #ifdef GPR_ARCH_64 - return o == (gpr_atm)InterlockedCompareExchangeAcquire64(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire64((volatile LONGLONG *) p, + (LONGLONG) n, (LONGLONG) o); #else - return o == (gpr_atm)InterlockedCompareExchangeAcquire(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG *) p, + (LONG) n, (LONG) o); #endif } static __inline int gpr_atm_acq_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { #ifdef GPR_ARCH_64 - return o == (gpr_atm)InterlockedCompareExchangeAcquire64(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire64((volatile LONGLONG) p, + (LONGLONG) n, (LONGLONG) o); #else - return o == (gpr_atm)InterlockedCompareExchangeAcquire(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeAcquire((volatile LONG *) p, + (LONG) n, (LONG) o); #endif } static __inline int gpr_atm_rel_cas(gpr_atm *p, gpr_atm o, gpr_atm n) { #ifdef GPR_ARCH_64 - return o == (gpr_atm)InterlockedCompareExchangeRelease64(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeRelease64((volatile LONGLONG *) p, + (LONGLONG) n, (LONGLONG) o); #else - return o == (gpr_atm)InterlockedCompareExchangeRelease(p, n, o); + return o == (gpr_atm)InterlockedCompareExchangeRelease((volatile LONG *) p, + (LONG) n, (LONG) o); #endif } @@ -101,11 +107,15 @@ static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) { #ifdef GPR_ARCH_64 do { old = *p; - } while (old != (gpr_atm)InterlockedCompareExchange64(p, old + delta, old)); + } while (old != (gpr_atm)InterlockedCompareExchange64((volatile LONGLONG *) p, + (LONGLONG) old + delta, + (LONGLONG) old)); #else do { old = *p; - } while (old != (gpr_atm)InterlockedCompareExchange(p, old + delta, old)); + } while (old != (gpr_atm)InterlockedCompareExchange((volatile LONG *) p, + (LONG) old + delta, + (LONG) old)); #endif return old; } diff --git a/include/grpc/support/cpu.h b/include/grpc/support/cpu.h index 005c3c721cc9965c1a3543fdfd180a7f4c42bdb2..2b2a56168aca58a9f6d176430c9c9b4879685922 100644 --- a/include/grpc/support/cpu.h +++ b/include/grpc/support/cpu.h @@ -41,7 +41,7 @@ extern "C" { /* Interface providing CPU information for currently running system */ /* Return the number of CPU cores on the current system. Will return 0 if - if information is not available. */ + the information is not available. */ unsigned gpr_cpu_num_cores(void); /* Return the CPU on which the current thread is executing; N.B. This should diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h index 1b613dc2fd76675fc541baef7282658aa9e71ec9..9b639cf82deef09dff160cf8d79c067bc0e95bb8 100644 --- a/include/grpc/support/port_platform.h +++ b/include/grpc/support/port_platform.h @@ -124,10 +124,15 @@ #define GPR_ARCH_32 1 #endif /* _LP64 */ #elif defined(__APPLE__) +#include <TargetConditionals.h> #ifndef _BSD_SOURCE #define _BSD_SOURCE #endif +#if TARGET_OS_IPHONE +#define GPR_CPU_IPHONE 1 +#else /* TARGET_OS_IPHONE */ #define GPR_CPU_POSIX 1 +#endif #define GPR_GCC_ATOMIC 1 #define GPR_POSIX_LOG 1 #define GPR_POSIX_MULTIPOLL_WITH_POLL 1 @@ -185,8 +190,8 @@ #error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64 #endif -#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) != 1 -#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32 +#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) + defined(GPR_CPU_IPHONE) != 1 +#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32, GPR_CPU_IPHONE #endif #if defined(GPR_POSIX_MULTIPOLL_WITH_POLL) && !defined(GPR_POSIX_SOCKET) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index e4f85450f5a8c33ff54697e1da6a36805209c6bd..c2d4cda31a78d746f2ad51040484a032fec0e9ae 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -36,25 +36,28 @@ #include <cctype> #include <cstring> #include <map> +#include <memory> #include <ostream> #include <sstream> +#include <tuple> #include <vector> +#include "grpc++/config.h" +#include "src/compiler/config.h" #include "src/compiler/generator_helpers.h" #include "src/compiler/python_generator.h" -#include <google/protobuf/io/printer.h> -#include <google/protobuf/io/zero_copy_stream_impl_lite.h> -#include <google/protobuf/descriptor.pb.h> -#include <google/protobuf/descriptor.h> using grpc_generator::StringReplace; using grpc_generator::StripProto; -using google::protobuf::Descriptor; -using google::protobuf::FileDescriptor; -using google::protobuf::MethodDescriptor; -using google::protobuf::ServiceDescriptor; -using google::protobuf::io::Printer; -using google::protobuf::io::StringOutputStream; +using grpc::protobuf::Descriptor; +using grpc::protobuf::FileDescriptor; +using grpc::protobuf::MethodDescriptor; +using grpc::protobuf::ServiceDescriptor; +using grpc::protobuf::compiler::GeneratorContext; +using grpc::protobuf::io::CodedOutputStream; +using grpc::protobuf::io::Printer; +using grpc::protobuf::io::StringOutputStream; +using grpc::protobuf::io::ZeroCopyOutputStream; using std::initializer_list; using std::make_pair; using std::map; @@ -63,6 +66,41 @@ using std::replace; using std::vector; namespace grpc_python_generator { + +PythonGrpcGenerator::PythonGrpcGenerator(const GeneratorConfiguration& config) + : config_(config) {} + +PythonGrpcGenerator::~PythonGrpcGenerator() {} + +bool PythonGrpcGenerator::Generate( + const FileDescriptor* file, const grpc::string& parameter, + GeneratorContext* context, grpc::string* error) const { + // Get output file name. + grpc::string file_name; + static const int proto_suffix_length = strlen(".proto"); + if (file->name().size() > static_cast<size_t>(proto_suffix_length) && + file->name().find_last_of(".proto") == file->name().size() - 1) { + file_name = file->name().substr( + 0, file->name().size() - proto_suffix_length) + "_pb2.py"; + } else { + *error = "Invalid proto file name. Proto file must end with .proto"; + return false; + } + + std::unique_ptr<ZeroCopyOutputStream> output( + context->OpenForInsert(file_name, "module_scope")); + CodedOutputStream coded_out(output.get()); + bool success = false; + grpc::string code = ""; + tie(success, code) = grpc_python_generator::GetServices(file, config_); + if (success) { + coded_out.WriteRaw(code.data(), code.size()); + return true; + } else { + return false; + } +} + namespace { ////////////////////////////////// // BEGIN FORMATTING BOILERPLATE // @@ -70,14 +108,15 @@ namespace { // Converts an initializer list of the form { key0, value0, key1, value1, ... } // into a map of key* to value*. Is merely a readability helper for later code. -map<std::string, std::string> ListToDict(const initializer_list<std::string>& values) { +map<grpc::string, grpc::string> ListToDict( + const initializer_list<grpc::string>& values) { assert(values.size() % 2 == 0); - map<std::string, std::string> value_map; + map<grpc::string, grpc::string> value_map; auto value_iter = values.begin(); for (unsigned i = 0; i < values.size()/2; ++i) { - std::string key = *value_iter; + grpc::string key = *value_iter; ++value_iter; - std::string value = *value_iter; + grpc::string value = *value_iter; value_map[key] = value; ++value_iter; } @@ -111,8 +150,8 @@ class IndentScope { bool PrintServicer(const ServiceDescriptor* service, Printer* out) { - std::string doc = "<fill me in later!>"; - map<std::string, std::string> dict = ListToDict({ + grpc::string doc = "<fill me in later!>"; + map<grpc::string, grpc::string> dict = ListToDict({ "Service", service->name(), "Documentation", doc, }); @@ -123,7 +162,7 @@ bool PrintServicer(const ServiceDescriptor* service, out->Print("__metaclass__ = abc.ABCMeta\n"); for (int i = 0; i < service->method_count(); ++i) { auto meth = service->method(i); - std::string arg_name = meth->client_streaming() ? + grpc::string arg_name = meth->client_streaming() ? "request_iterator" : "request"; out->Print("@abc.abstractmethod\n"); out->Print("def $Method$(self, $ArgName$, context):\n", @@ -138,8 +177,8 @@ bool PrintServicer(const ServiceDescriptor* service, } bool PrintServer(const ServiceDescriptor* service, Printer* out) { - std::string doc = "<fill me in later!>"; - map<std::string, std::string> dict = ListToDict({ + grpc::string doc = "<fill me in later!>"; + map<grpc::string, grpc::string> dict = ListToDict({ "Service", service->name(), "Documentation", doc, }); @@ -167,8 +206,8 @@ bool PrintServer(const ServiceDescriptor* service, Printer* out) { bool PrintStub(const ServiceDescriptor* service, Printer* out) { - std::string doc = "<fill me in later!>"; - map<std::string, std::string> dict = ListToDict({ + grpc::string doc = "<fill me in later!>"; + map<grpc::string, grpc::string> dict = ListToDict({ "Service", service->name(), "Documentation", doc, }); @@ -179,7 +218,7 @@ bool PrintStub(const ServiceDescriptor* service, out->Print("__metaclass__ = abc.ABCMeta\n"); for (int i = 0; i < service->method_count(); ++i) { const MethodDescriptor* meth = service->method(i); - std::string arg_name = meth->client_streaming() ? + grpc::string arg_name = meth->client_streaming() ? "request_iterator" : "request"; auto methdict = ListToDict({"Method", meth->name(), "ArgName", arg_name}); out->Print("@abc.abstractmethod\n"); @@ -196,29 +235,29 @@ bool PrintStub(const ServiceDescriptor* service, // TODO(protobuf team): Export `ModuleName` from protobuf's // `src/google/protobuf/compiler/python/python_generator.cc` file. -std::string ModuleName(const std::string& filename) { - std::string basename = StripProto(filename); +grpc::string ModuleName(const grpc::string& filename) { + grpc::string basename = StripProto(filename); basename = StringReplace(basename, "-", "_"); basename = StringReplace(basename, "/", "."); return basename + "_pb2"; } bool GetModuleAndMessagePath(const Descriptor* type, - pair<std::string, std::string>* out) { + pair<grpc::string, grpc::string>* out) { const Descriptor* path_elem_type = type; vector<const Descriptor*> message_path; do { message_path.push_back(path_elem_type); path_elem_type = path_elem_type->containing_type(); } while (path_elem_type != nullptr); - std::string file_name = type->file()->name(); + grpc::string file_name = type->file()->name(); static const int proto_suffix_length = strlen(".proto"); if (!(file_name.size() > static_cast<size_t>(proto_suffix_length) && file_name.find_last_of(".proto") == file_name.size() - 1)) { return false; } - std::string module = ModuleName(file_name); - std::string message_type; + grpc::string module = ModuleName(file_name); + grpc::string message_type; for (auto path_iter = message_path.rbegin(); path_iter != message_path.rend(); ++path_iter) { message_type += (*path_iter)->name() + "."; @@ -229,28 +268,30 @@ bool GetModuleAndMessagePath(const Descriptor* type, return true; } -bool PrintServerFactory(const std::string& package_qualified_service_name, +bool PrintServerFactory(const grpc::string& package_qualified_service_name, const ServiceDescriptor* service, Printer* out) { out->Print("def early_adopter_create_$Service$_server(servicer, port, " "root_certificates, key_chain_pairs):\n", "Service", service->name()); { IndentScope raii_create_server_indent(out); - map<std::string, std::string> method_description_constructors; - map<std::string, pair<std::string, std::string>> input_message_modules_and_classes; - map<std::string, pair<std::string, std::string>> output_message_modules_and_classes; + map<grpc::string, grpc::string> method_description_constructors; + map<grpc::string, pair<grpc::string, grpc::string>> + input_message_modules_and_classes; + map<grpc::string, pair<grpc::string, grpc::string>> + output_message_modules_and_classes; for (int i = 0; i < service->method_count(); ++i) { const MethodDescriptor* method = service->method(i); - const std::string method_description_constructor = - std::string(method->client_streaming() ? "stream_" : "unary_") + - std::string(method->server_streaming() ? "stream_" : "unary_") + + const grpc::string method_description_constructor = + grpc::string(method->client_streaming() ? "stream_" : "unary_") + + grpc::string(method->server_streaming() ? "stream_" : "unary_") + "service_description"; - pair<std::string, std::string> input_message_module_and_class; + pair<grpc::string, grpc::string> input_message_module_and_class; if (!GetModuleAndMessagePath(method->input_type(), &input_message_module_and_class)) { return false; } - pair<std::string, std::string> output_message_module_and_class; + pair<grpc::string, grpc::string> output_message_module_and_class; if (!GetModuleAndMessagePath(method->output_type(), &output_message_module_and_class)) { return false; @@ -271,7 +312,7 @@ bool PrintServerFactory(const std::string& package_qualified_service_name, for (auto& name_and_description_constructor : method_description_constructors) { IndentScope raii_descriptions_indent(out); - const std::string method_name = name_and_description_constructor.first; + const grpc::string method_name = name_and_description_constructor.first; auto input_message_module_and_class = input_message_modules_and_classes.find(method_name); auto output_message_module_and_class = @@ -304,29 +345,31 @@ bool PrintServerFactory(const std::string& package_qualified_service_name, return true; } -bool PrintStubFactory(const std::string& package_qualified_service_name, +bool PrintStubFactory(const grpc::string& package_qualified_service_name, const ServiceDescriptor* service, Printer* out) { - map<std::string, std::string> dict = ListToDict({ + map<grpc::string, grpc::string> dict = ListToDict({ "Service", service->name(), }); out->Print(dict, "def early_adopter_create_$Service$_stub(host, port):\n"); { IndentScope raii_create_server_indent(out); - map<std::string, std::string> method_description_constructors; - map<std::string, pair<std::string, std::string>> input_message_modules_and_classes; - map<std::string, pair<std::string, std::string>> output_message_modules_and_classes; + map<grpc::string, grpc::string> method_description_constructors; + map<grpc::string, pair<grpc::string, grpc::string>> + input_message_modules_and_classes; + map<grpc::string, pair<grpc::string, grpc::string>> + output_message_modules_and_classes; for (int i = 0; i < service->method_count(); ++i) { const MethodDescriptor* method = service->method(i); - const std::string method_description_constructor = - std::string(method->client_streaming() ? "stream_" : "unary_") + - std::string(method->server_streaming() ? "stream_" : "unary_") + + const grpc::string method_description_constructor = + grpc::string(method->client_streaming() ? "stream_" : "unary_") + + grpc::string(method->server_streaming() ? "stream_" : "unary_") + "invocation_description"; - pair<std::string, std::string> input_message_module_and_class; + pair<grpc::string, grpc::string> input_message_module_and_class; if (!GetModuleAndMessagePath(method->input_type(), &input_message_module_and_class)) { return false; } - pair<std::string, std::string> output_message_module_and_class; + pair<grpc::string, grpc::string> output_message_module_and_class; if (!GetModuleAndMessagePath(method->output_type(), &output_message_module_and_class)) { return false; @@ -347,7 +390,7 @@ bool PrintStubFactory(const std::string& package_qualified_service_name, for (auto& name_and_description_constructor : method_description_constructors) { IndentScope raii_descriptions_indent(out); - const std::string method_name = name_and_description_constructor.first; + const grpc::string method_name = name_and_description_constructor.first; auto input_message_module_and_class = input_message_modules_and_classes.find(method_name); auto output_message_module_and_class = @@ -378,22 +421,25 @@ bool PrintStubFactory(const std::string& package_qualified_service_name, return true; } -bool PrintPreamble(const FileDescriptor* file, Printer* out) { +bool PrintPreamble(const FileDescriptor* file, + const GeneratorConfiguration& config, Printer* out) { out->Print("import abc\n"); - out->Print("from grpc.early_adopter import implementations\n"); + out->Print("from $Package$ import implementations\n", + "Package", config.implementations_package_root); out->Print("from grpc.framework.alpha import utilities\n"); return true; } } // namespace -pair<bool, std::string> GetServices(const FileDescriptor* file) { - std::string output; +pair<bool, grpc::string> GetServices(const FileDescriptor* file, + const GeneratorConfiguration& config) { + grpc::string output; { // Scope the output stream so it closes and finalizes output to the string. StringOutputStream output_stream(&output); Printer out(&output_stream, '$'); - if (!PrintPreamble(file, &out)) { + if (!PrintPreamble(file, config, &out)) { return make_pair(false, ""); } auto package = file->package(); diff --git a/src/compiler/python_generator.h b/src/compiler/python_generator.h index df29ca17e3ebc1cf27e65d1e215e0357d55aa94f..b47f3c124341531986a9fa436d35195c1b7adc20 100644 --- a/src/compiler/python_generator.h +++ b/src/compiler/python_generator.h @@ -34,18 +34,34 @@ #ifndef GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H #define GRPC_INTERNAL_COMPILER_PYTHON_GENERATOR_H -#include <string> #include <utility> -namespace google { -namespace protobuf { -class FileDescriptor; -} // namespace protobuf -} // namespace google +#include "src/compiler/config.h" namespace grpc_python_generator { -std::pair<bool, std::string> GetServices(const google::protobuf::FileDescriptor* file); +// Data pertaining to configuration of the generator with respect to anything +// that may be used internally at Google. +struct GeneratorConfiguration { + grpc::string implementations_package_root; +}; + +class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator { + public: + PythonGrpcGenerator(const GeneratorConfiguration& config); + ~PythonGrpcGenerator(); + + bool Generate(const grpc::protobuf::FileDescriptor* file, + const grpc::string& parameter, + grpc::protobuf::compiler::GeneratorContext* context, + grpc::string* error) const; + private: + GeneratorConfiguration config_; +}; + +std::pair<bool, grpc::string> GetServices( + const grpc::protobuf::FileDescriptor* file, + const GeneratorConfiguration& config); } // namespace grpc_python_generator diff --git a/src/compiler/python_plugin.cc b/src/compiler/python_plugin.cc index e7d172f7bf4f9c66b7c7276b0dfadff145a8ad20..d1f49442dabebc9c951a1b5bb2b55578aaa831af 100644 --- a/src/compiler/python_plugin.cc +++ b/src/compiler/python_plugin.cc @@ -33,60 +33,12 @@ // Generates a Python gRPC service interface out of Protobuf IDL. -#include <cstring> -#include <memory> -#include <string> -#include <tuple> - +#include "src/compiler/config.h" #include "src/compiler/python_generator.h" -#include <google/protobuf/compiler/code_generator.h> -#include <google/protobuf/compiler/plugin.h> -#include <google/protobuf/io/coded_stream.h> -#include <google/protobuf/io/zero_copy_stream.h> -#include <google/protobuf/descriptor.h> - -using google::protobuf::FileDescriptor; -using google::protobuf::compiler::CodeGenerator; -using google::protobuf::compiler::GeneratorContext; -using google::protobuf::compiler::PluginMain; -using google::protobuf::io::CodedOutputStream; -using google::protobuf::io::ZeroCopyOutputStream; - -class PythonGrpcGenerator : public CodeGenerator { - public: - PythonGrpcGenerator() {} - ~PythonGrpcGenerator() {} - - bool Generate(const FileDescriptor* file, const std::string& parameter, - GeneratorContext* context, std::string* error) const { - // Get output file name. - std::string file_name; - static const int proto_suffix_length = strlen(".proto"); - if (file->name().size() > static_cast<size_t>(proto_suffix_length) && - file->name().find_last_of(".proto") == file->name().size() - 1) { - file_name = file->name().substr( - 0, file->name().size() - proto_suffix_length) + "_pb2.py"; - } else { - *error = "Invalid proto file name. Proto file must end with .proto"; - return false; - } - - std::unique_ptr<ZeroCopyOutputStream> output( - context->OpenForInsert(file_name, "module_scope")); - CodedOutputStream coded_out(output.get()); - bool success = false; - std::string code = ""; - tie(success, code) = grpc_python_generator::GetServices(file); - if (success) { - coded_out.WriteRaw(code.data(), code.size()); - return true; - } else { - return false; - } - } -}; int main(int argc, char* argv[]) { - PythonGrpcGenerator generator; - return PluginMain(argc, argv, &generator); + grpc_python_generator::GeneratorConfiguration config; + config.implementations_package_root = "grpc.early_adopter"; + grpc_python_generator::PythonGrpcGenerator generator(config); + return grpc::protobuf::compiler::PluginMain(argc, argv, &generator); } diff --git a/src/core/iomgr/sockaddr_win32.h b/src/core/iomgr/sockaddr_win32.h index 3a5f27bb3453160f9d2d2028a79314e8e7c006b0..c0385ea61481042bd1bb1d840f27fb0df2e1f464 100644 --- a/src/core/iomgr/sockaddr_win32.h +++ b/src/core/iomgr/sockaddr_win32.h @@ -38,4 +38,9 @@ #include <winsock2.h> #include <mswsock.h> +#ifdef __MINGW32__ +/* mingw seems to be missing that definition. */ +const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); +#endif + #endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H */ diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index 59319da26d118c48939ef61c918238055ddafd7a..0c3ab1dc911ddf9d146836be108f048b3e111373 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -53,9 +53,6 @@ #define INIT_PORT_CAP 2 #define MIN_SAFE_ACCEPT_QUEUE_SIZE 100 -static gpr_once s_init_max_accept_queue_size; -static int s_max_accept_queue_size; - /* one listening port */ typedef struct server_port { gpr_uint8 addresses[sizeof(struct sockaddr_in6) * 2 + 32]; diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c index 3efd69a71b9985f0d2f40cf4a3a054a25530a106..ec5496e7eef05cad5306291fea634cbf96cda9cf 100644 --- a/src/core/iomgr/tcp_windows.c +++ b/src/core/iomgr/tcp_windows.c @@ -172,7 +172,7 @@ static void win_notify_on_read(grpc_endpoint *ep, tcp->read_slice = gpr_slice_malloc(8192); buffer.len = GPR_SLICE_LENGTH(tcp->read_slice); - buffer.buf = GPR_SLICE_START_PTR(tcp->read_slice); + buffer.buf = (char *)GPR_SLICE_START_PTR(tcp->read_slice); gpr_log(GPR_DEBUG, "win_notify_on_read: calling WSARecv without overlap"); status = WSARecv(tcp->socket->socket, &buffer, 1, &bytes_read, &flags, @@ -284,7 +284,7 @@ static grpc_endpoint_write_status win_write(grpc_endpoint *ep, for (i = 0; i < tcp->write_slices.count; i++) { buffers[i].len = GPR_SLICE_LENGTH(tcp->write_slices.slices[i]); - buffers[i].buf = GPR_SLICE_START_PTR(tcp->write_slices.slices[i]); + buffers[i].buf = (char *)GPR_SLICE_START_PTR(tcp->write_slices.slices[i]); } gpr_log(GPR_DEBUG, "win_write: calling WSASend without overlap"); diff --git a/src/core/support/cpu_iphone.c b/src/core/support/cpu_iphone.c new file mode 100644 index 0000000000000000000000000000000000000000..d412a6d7ee6013922db6c7e3a6c81b8bce026e86 --- /dev/null +++ b/src/core/support/cpu_iphone.c @@ -0,0 +1,53 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include <grpc/support/port_platform.h> + +#ifdef GPR_CPU_IPHONE + +/* Probably 2 instead of 1, but see comment on gpr_cpu_current_cpu. */ +unsigned gpr_cpu_num_cores(void) { + return 1; +} + +/* Most code that's using this is using it to shard across work queues. So + unless profiling shows it's a problem or there appears a way to detect the + currently running CPU core, let's have it shard the default way. + Note that the interface in cpu.h lets gpr_cpu_num_cores return 0, but doing + it makes it impossible for gpr_cpu_current_cpu to satisfy its stated range, + and some code might be relying on it. */ +unsigned gpr_cpu_current_cpu(void) { + return 0; +} + +#endif /* GPR_CPU_IPHONE */ diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c index 5f45fb0bc36986e8ba7d4e01641359be30b3602d..99484e37fbc87bfd2b26abcce8aef64fe01d68e3 100644 --- a/src/core/support/cpu_posix.c +++ b/src/core/support/cpu_posix.c @@ -74,4 +74,4 @@ unsigned gpr_cpu_current_cpu(void) { return shard_ptr(&magic_thread_local); } -#endif /* GPR_CPU_LINUX */ +#endif /* GPR_CPU_POSIX */ diff --git a/src/core/support/env_win32.c b/src/core/support/env_win32.c index 177cc36a30a00b4dc0254ccf0f0a7a9d30ef489d..9b4cd698ad59769bfe8bd0527fb8c895fcea0119 100644 --- a/src/core/support/env_win32.c +++ b/src/core/support/env_win32.c @@ -36,6 +36,7 @@ #ifdef GPR_WIN32 #include "src/core/support/env.h" +#include "src/core/support/string.h" #include <stdlib.h> @@ -43,14 +44,16 @@ #include <grpc/support/log.h> char *gpr_getenv(const char *name) { - size_t required_size; + size_t size; char *result = NULL; + char *duplicated; + errno_t err; - getenv_s(&required_size, NULL, 0, name); - if (required_size == 0) return NULL; - result = gpr_malloc(required_size); - getenv_s(&required_size, result, required_size, name); - return result; + err = _dupenv_s(&result, &size, name); + if (err) return NULL; + duplicated = gpr_strdup(result); + free(result); + return duplicated; } void gpr_setenv(const char *name, const char *value) { diff --git a/src/core/support/file_win32.c b/src/core/support/file_win32.c index fe209af9b2dc5c0e978ec788c0cb40beb55b6fb5..f59d3af397c451cece3ff9fae94976e1e3018a5c 100644 --- a/src/core/support/file_win32.c +++ b/src/core/support/file_win32.c @@ -72,7 +72,7 @@ FILE *gpr_tmpfile(const char *prefix, char **tmp_filename_out) { if (_tfopen_s(&result, tmp_filename, TEXT("wb+")) != 0) goto end; end: - if (result && tmp_filename) { + if (result && tmp_filename_out) { *tmp_filename_out = gpr_tchar_to_char(tmp_filename); } diff --git a/src/core/support/log_win32.c b/src/core/support/log_win32.c index 720dc141f51c8d119e70706419557df8e3843f03..159c7e052c522407f0b29516d3a05fae2013e4c4 100644 --- a/src/core/support/log_win32.c +++ b/src/core/support/log_win32.c @@ -43,6 +43,7 @@ #include <grpc/support/log.h> #include <grpc/support/time.h> +#include "src/core/support/string.h" #include "src/core/support/string_win32.h" void gpr_log(const char *file, int line, gpr_log_severity severity, @@ -55,7 +56,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, va_start(args, format); ret = _vscprintf(format, args); va_end(args); - if (!(0 <= ret && ret < ~(size_t)0)) { + if (ret < 0) { message = NULL; } else { /* Allocate a new buffer, with space for the NUL terminator. */ @@ -66,7 +67,7 @@ void gpr_log(const char *file, int line, gpr_log_severity severity, va_start(args, format); ret = vsnprintf_s(message, strp_buflen, _TRUNCATE, format, args); va_end(args); - if (ret != strp_buflen - 1) { + if ((size_t)ret != strp_buflen - 1) { /* This should never happen. */ gpr_free(message); message = NULL; @@ -90,7 +91,7 @@ void gpr_default_log(gpr_log_func_args *args) { strcpy(time_buffer, "error:strftime"); } - fprintf(stderr, "%s%s.%09u %5u %s:%d] %s\n", + fprintf(stderr, "%s%s.%09u %5lu %s:%d] %s\n", gpr_log_severity_string(args->severity), time_buffer, (int)(now.tv_nsec), GetCurrentThreadId(), args->file, args->line, args->message); @@ -105,6 +106,7 @@ char *gpr_format_message(DWORD messageid) { NULL, messageid, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)(&tmessage), 0, NULL); + if (status == 0) return gpr_strdup("Unable to retreive error string"); message = gpr_tchar_to_char(tmessage); LocalFree(tmessage); return message; diff --git a/src/core/support/string_win32.c b/src/core/support/string_win32.c index 583abd27d82f587e41eda2dae451bf5431670371..6d1d6337a939b8a30d6cf0869d91e0a2794521be 100644 --- a/src/core/support/string_win32.c +++ b/src/core/support/string_win32.c @@ -44,6 +44,8 @@ #include <grpc/support/alloc.h> +#include "src/core/support/string.h" + int gpr_asprintf(char **strp, const char *format, ...) { va_list args; int ret; @@ -53,7 +55,7 @@ int gpr_asprintf(char **strp, const char *format, ...) { va_start(args, format); ret = _vscprintf(format, args); va_end(args); - if (!(0 <= ret && ret < ~(size_t)0)) { + if (ret < 0) { *strp = NULL; return -1; } @@ -69,7 +71,7 @@ int gpr_asprintf(char **strp, const char *format, ...) { va_start(args, format); ret = vsnprintf_s(*strp, strp_buflen, _TRUNCATE, format, args); va_end(args); - if (ret == strp_buflen - 1) { + if ((size_t)ret == strp_buflen - 1) { return ret; } diff --git a/src/core/support/sync_win32.c b/src/core/support/sync_win32.c index c9a977cc80eed9f757f19274ed28d3dc7919204a..cc31d9b052d4839acadc0b4447cd36c4bf7ebad2 100644 --- a/src/core/support/sync_win32.c +++ b/src/core/support/sync_win32.c @@ -37,6 +37,7 @@ #ifdef GPR_WIN32 +#undef _WIN32_WINNT #define _WIN32_WINNT 0x0600 #include <windows.h> #include <grpc/support/log.h> diff --git a/src/core/support/time_win32.c b/src/core/support/time_win32.c index 8256849655814d86a5bce846aec325a2211837bc..f221cb579033b4c95f61cd13e378c386873787f7 100644 --- a/src/core/support/time_win32.c +++ b/src/core/support/time_win32.c @@ -42,8 +42,8 @@ gpr_timespec gpr_now(void) { gpr_timespec now_tv; - struct __timeb32 now_tb; - _ftime32_s(&now_tb); + struct _timeb now_tb; + _ftime_s(&now_tb); now_tv.tv_sec = now_tb.time; now_tv.tv_nsec = now_tb.millitm * 1000000; return now_tv; diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h index a1de3817e6947773dbdff3d9c534f094d2132420..3980eba237dfe64bc038bf6777ff6cf669ae1dba 100644 --- a/src/cpp/client/channel.h +++ b/src/cpp/client/channel.h @@ -51,16 +51,16 @@ class StreamContextInterface; class Channel GRPC_FINAL : public ChannelInterface { public: - Channel(const grpc::string &target, grpc_channel *c_channel); + Channel(const grpc::string& target, grpc_channel* c_channel); ~Channel() GRPC_OVERRIDE; - virtual Call CreateCall(const RpcMethod &method, ClientContext *context, - CompletionQueue *cq) GRPC_OVERRIDE; - virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) GRPC_OVERRIDE; + virtual Call CreateCall(const RpcMethod& method, ClientContext* context, + CompletionQueue* cq) GRPC_OVERRIDE; + virtual void PerformOpsOnCall(CallOpBuffer* ops, Call* call) GRPC_OVERRIDE; private: const grpc::string target_; - grpc_channel *const c_channel_; // owned + grpc_channel* const c_channel_; // owned }; } // namespace grpc diff --git a/src/cpp/client/channel_arguments.cc b/src/cpp/client/channel_arguments.cc index abf0fc1c0ad7a44dfb59d619d66c1cdfbadfbd7d..87f8349eefd28278de0c0367a85687917bed6ca2 100644 --- a/src/cpp/client/channel_arguments.cc +++ b/src/cpp/client/channel_arguments.cc @@ -37,7 +37,7 @@ namespace grpc { -void ChannelArguments::SetSslTargetNameOverride(const grpc::string &name) { +void ChannelArguments::SetSslTargetNameOverride(const grpc::string& name) { SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG, name); } @@ -50,32 +50,32 @@ grpc::string ChannelArguments::GetSslTargetNameOverride() const { return ""; } -void ChannelArguments::SetInt(const grpc::string &key, int value) { +void ChannelArguments::SetInt(const grpc::string& key, int value) { grpc_arg arg; arg.type = GRPC_ARG_INTEGER; strings_.push_back(key); - arg.key = const_cast<char *>(strings_.back().c_str()); + arg.key = const_cast<char*>(strings_.back().c_str()); arg.value.integer = value; args_.push_back(arg); } -void ChannelArguments::SetString(const grpc::string &key, - const grpc::string &value) { +void ChannelArguments::SetString(const grpc::string& key, + const grpc::string& value) { grpc_arg arg; arg.type = GRPC_ARG_STRING; strings_.push_back(key); - arg.key = const_cast<char *>(strings_.back().c_str()); + arg.key = const_cast<char*>(strings_.back().c_str()); strings_.push_back(value); - arg.value.string = const_cast<char *>(strings_.back().c_str()); + arg.value.string = const_cast<char*>(strings_.back().c_str()); args_.push_back(arg); } -void ChannelArguments::SetChannelArgs(grpc_channel_args *channel_args) const { +void ChannelArguments::SetChannelArgs(grpc_channel_args* channel_args) const { channel_args->num_args = args_.size(); if (channel_args->num_args > 0) { - channel_args->args = const_cast<grpc_arg *>(&args_[0]); + channel_args->args = const_cast<grpc_arg*>(&args_[0]); } } diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 9f99f7bcd55ba092b30a1163915bee91cb157714..de9f8c7201da6e770f4f12086d1a9cb0ee2b21ae 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -53,7 +53,7 @@ ClientContext::~ClientContext() { if (cq_) { grpc_completion_queue_shutdown(cq_); // Drain cq_. - grpc_event *ev; + grpc_event* ev; grpc_completion_type t; do { ev = grpc_completion_queue_next(cq_, gpr_inf_future); @@ -65,7 +65,7 @@ ClientContext::~ClientContext() { } void ClientContext::set_absolute_deadline( - const system_clock::time_point &deadline) { + const system_clock::time_point& deadline) { Timepoint2Timespec(deadline, &absolute_deadline_); } @@ -73,8 +73,8 @@ system_clock::time_point ClientContext::absolute_deadline() { return Timespec2Timepoint(absolute_deadline_); } -void ClientContext::AddMetadata(const grpc::string &meta_key, - const grpc::string &meta_value) { +void ClientContext::AddMetadata(const grpc::string& meta_key, + const grpc::string& meta_value) { send_initial_metadata_.insert(std::make_pair(meta_key, meta_value)); } diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index 5c179de9d8feffeba5834811321aed6df71c4cdd..7e7ea78bcde380689a770d87522f59c133512e16 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -42,10 +42,10 @@ namespace grpc { // Wrapper that performs a blocking unary call -Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const grpc::protobuf::Message &request, - grpc::protobuf::Message *result) { +Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context, + const grpc::protobuf::Message& request, + grpc::protobuf::Message* result) { CompletionQueue cq; Call call(channel->CreateCall(method, context, &cq)); CallOpBuffer buf; diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc index 57d215d0f333a8a91c1bfe4755fe45eb17cc9098..301430572a24b6e896e6d729784fe745ebc135b3 100644 --- a/src/cpp/client/create_channel.cc +++ b/src/cpp/client/create_channel.cc @@ -41,9 +41,10 @@ namespace grpc { class ChannelArguments; std::shared_ptr<ChannelInterface> CreateChannel( - const grpc::string &target, const std::unique_ptr<Credentials> &creds, - const ChannelArguments &args) { - return creds ? creds->CreateChannel(target, args) : - std::shared_ptr<ChannelInterface>(new Channel(target, grpc_lame_client_channel_create())); + const grpc::string& target, const std::unique_ptr<Credentials>& creds, + const ChannelArguments& args) { + return creds ? creds->CreateChannel(target, args) + : std::shared_ptr<ChannelInterface>( + new Channel(target, grpc_lame_client_channel_create())); } } // namespace grpc diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index ebe7deec70254f6699a73ee883de203891b373db..5c26a1ad7c3b6a4dcb98dcc5afb99d0b48387046 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -48,7 +48,6 @@ CallOpBuffer::CallOpBuffer() initial_metadata_count_(0), initial_metadata_(nullptr), recv_initial_metadata_(nullptr), - recv_initial_metadata_arr_{0, 0, nullptr}, send_message_(nullptr), send_message_buffer_(nullptr), send_buf_(nullptr), @@ -58,7 +57,6 @@ CallOpBuffer::CallOpBuffer() client_send_close_(false), recv_trailing_metadata_(nullptr), recv_status_(nullptr), - recv_trailing_metadata_arr_{0, 0, nullptr}, status_code_(GRPC_STATUS_OK), status_details_(nullptr), status_details_capacity_(0), @@ -66,7 +64,12 @@ CallOpBuffer::CallOpBuffer() trailing_metadata_count_(0), trailing_metadata_(nullptr), cancelled_buf_(0), - recv_closed_(nullptr) {} + recv_closed_(nullptr) { + memset(&recv_trailing_metadata_arr_, 0, sizeof(recv_trailing_metadata_arr_)); + memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_)); + recv_trailing_metadata_arr_.metadata = nullptr; + recv_initial_metadata_arr_.metadata = nullptr; +} void CallOpBuffer::Reset(void* next_return_tag) { return_tag_ = next_return_tag; diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index fede2da01650fa788614815270ef94f4c03bffb2..cea2d24831cfdc8d751806b93af183552ff82986 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -36,7 +36,6 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> -#include <grpc/support/time.h> #include "src/cpp/util/time.h" namespace grpc { @@ -57,15 +56,12 @@ class EventDeleter { } }; -CompletionQueue::NextStatus -CompletionQueue::AsyncNext(void** tag, bool* ok, - std::chrono::system_clock::time_point deadline) { +CompletionQueue::NextStatus CompletionQueue::AsyncNextInternal( + void** tag, bool* ok, gpr_timespec deadline) { std::unique_ptr<grpc_event, EventDeleter> ev; - gpr_timespec gpr_deadline; - Timepoint2Timespec(deadline, &gpr_deadline); for (;;) { - ev.reset(grpc_completion_queue_next(cq_, gpr_deadline)); + ev.reset(grpc_completion_queue_next(cq_, deadline)); if (!ev) { /* got a NULL back because deadline passed */ return TIMEOUT; } @@ -81,6 +77,13 @@ CompletionQueue::AsyncNext(void** tag, bool* ok, } } +CompletionQueue::NextStatus CompletionQueue::AsyncNext( + void** tag, bool* ok, std::chrono::system_clock::time_point deadline) { + gpr_timespec gpr_deadline; + Timepoint2Timespec(deadline, &gpr_deadline); + return AsyncNextInternal(tag, ok, gpr_deadline); +} + bool CompletionQueue::Pluck(CompletionQueueTag* tag) { std::unique_ptr<grpc_event, EventDeleter> ev; diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 9254e5879f238a2a28b1f7ecd36670d2c9e3fcbf..b8de2ea173525288bf472e002056b2651bbf5a37 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -45,7 +45,7 @@ const int kMaxBufferLength = 8192; class GrpcBufferWriter GRPC_FINAL : public ::grpc::protobuf::io::ZeroCopyOutputStream { public: - explicit GrpcBufferWriter(grpc_byte_buffer **bp, + explicit GrpcBufferWriter(grpc_byte_buffer** bp, int block_size = kMaxBufferLength) : block_size_(block_size), byte_count_(0), have_backup_(false) { *bp = grpc_byte_buffer_create(NULL, 0); @@ -58,7 +58,7 @@ class GrpcBufferWriter GRPC_FINAL } } - bool Next(void **data, int *size) GRPC_OVERRIDE { + bool Next(void** data, int* size) GRPC_OVERRIDE { if (have_backup_) { slice_ = backup_slice_; have_backup_ = false; @@ -89,7 +89,7 @@ class GrpcBufferWriter GRPC_FINAL private: const int block_size_; gpr_int64 byte_count_; - gpr_slice_buffer *slice_buffer_; + gpr_slice_buffer* slice_buffer_; bool have_backup_; gpr_slice backup_slice_; gpr_slice slice_; @@ -98,7 +98,7 @@ class GrpcBufferWriter GRPC_FINAL class GrpcBufferReader GRPC_FINAL : public ::grpc::protobuf::io::ZeroCopyInputStream { public: - explicit GrpcBufferReader(grpc_byte_buffer *buffer) + explicit GrpcBufferReader(grpc_byte_buffer* buffer) : byte_count_(0), backup_count_(0) { reader_ = grpc_byte_buffer_reader_create(buffer); } @@ -106,7 +106,7 @@ class GrpcBufferReader GRPC_FINAL grpc_byte_buffer_reader_destroy(reader_); } - bool Next(const void **data, int *size) GRPC_OVERRIDE { + bool Next(const void** data, int* size) GRPC_OVERRIDE { if (backup_count_ > 0) { *data = GPR_SLICE_START_PTR(slice_) + GPR_SLICE_LENGTH(slice_) - backup_count_; @@ -123,12 +123,10 @@ class GrpcBufferReader GRPC_FINAL return true; } - void BackUp(int count) GRPC_OVERRIDE { - backup_count_ = count; - } + void BackUp(int count) GRPC_OVERRIDE { backup_count_ = count; } bool Skip(int count) GRPC_OVERRIDE { - const void *data; + const void* data; int size; while (Next(&data, &size)) { if (size >= count) { @@ -149,18 +147,18 @@ class GrpcBufferReader GRPC_FINAL private: gpr_int64 byte_count_; gpr_int64 backup_count_; - grpc_byte_buffer_reader *reader_; + grpc_byte_buffer_reader* reader_; gpr_slice slice_; }; namespace grpc { -bool SerializeProto(const grpc::protobuf::Message &msg, grpc_byte_buffer **bp) { +bool SerializeProto(const grpc::protobuf::Message& msg, grpc_byte_buffer** bp) { GrpcBufferWriter writer(bp); return msg.SerializeToZeroCopyStream(&writer); } -bool DeserializeProto(grpc_byte_buffer *buffer, grpc::protobuf::Message *msg) { +bool DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg) { GrpcBufferReader reader(buffer); return msg->ParseFromZeroCopyStream(&reader); } diff --git a/src/cpp/proto/proto_utils.h b/src/cpp/proto/proto_utils.h index 7a1b1f8b7cb289776c681d72b6a1feca1234de39..bc60dc9929679565632ef1c04ddbf245c8ce8133 100644 --- a/src/cpp/proto/proto_utils.h +++ b/src/cpp/proto/proto_utils.h @@ -43,11 +43,11 @@ namespace grpc { // Serialize the msg into a buffer created inside the function. The caller // should destroy the returned buffer when done with it. If serialization fails, // false is returned and buffer is left unchanged. -bool SerializeProto(const grpc::protobuf::Message &msg, - grpc_byte_buffer **buffer); +bool SerializeProto(const grpc::protobuf::Message& msg, + grpc_byte_buffer** buffer); // The caller keeps ownership of buffer and msg. -bool DeserializeProto(grpc_byte_buffer *buffer, grpc::protobuf::Message *msg); +bool DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg); } // namespace grpc diff --git a/src/cpp/server/async_generic_service.cc b/src/cpp/server/async_generic_service.cc index 2009af7cbd120217d32f11dd1b15c9d19e1eee85..07cb933715289d0061e2424cb7bd159e47353e8e 100644 --- a/src/cpp/server/async_generic_service.cc +++ b/src/cpp/server/async_generic_service.cc @@ -47,5 +47,4 @@ CompletionQueue* AsyncGenericService::completion_queue() { return &server_->cq_; } -} // namespace grpc - +} // namespace grpc diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index f21efcfb19ac2c0b82986ce88bfcf9127b093c76..628822a338749b2644a822d9cc246bf77c9a5ce0 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -42,7 +42,7 @@ namespace grpc { AsyncServerContext::AsyncServerContext( - grpc_call *call, const grpc::string &method, const grpc::string &host, + grpc_call* call, const grpc::string& method, const grpc::string& host, system_clock::time_point absolute_deadline) : method_(method), host_(host), @@ -52,22 +52,22 @@ AsyncServerContext::AsyncServerContext( AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } -void AsyncServerContext::Accept(grpc_completion_queue *cq) { +void AsyncServerContext::Accept(grpc_completion_queue* cq) { GPR_ASSERT(grpc_call_server_accept_old(call_, cq, this) == GRPC_CALL_OK); GPR_ASSERT(grpc_call_server_end_initial_metadata_old( call_, GRPC_WRITE_BUFFER_HINT) == GRPC_CALL_OK); } -bool AsyncServerContext::StartRead(grpc::protobuf::Message *request) { +bool AsyncServerContext::StartRead(grpc::protobuf::Message* request) { GPR_ASSERT(request); request_ = request; grpc_call_error err = grpc_call_start_read_old(call_, this); return err == GRPC_CALL_OK; } -bool AsyncServerContext::StartWrite(const grpc::protobuf::Message &response, +bool AsyncServerContext::StartWrite(const grpc::protobuf::Message& response, int flags) { - grpc_byte_buffer *buffer = nullptr; + grpc_byte_buffer* buffer = nullptr; if (!SerializeProto(response, &buffer)) { return false; } @@ -76,16 +76,16 @@ bool AsyncServerContext::StartWrite(const grpc::protobuf::Message &response, return err == GRPC_CALL_OK; } -bool AsyncServerContext::StartWriteStatus(const Status &status) { +bool AsyncServerContext::StartWriteStatus(const Status& status) { grpc_call_error err = grpc_call_start_write_status_old( call_, static_cast<grpc_status_code>(status.code()), status.details().empty() ? nullptr - : const_cast<char *>(status.details().c_str()), + : const_cast<char*>(status.details().c_str()), this); return err == GRPC_CALL_OK; } -bool AsyncServerContext::ParseRead(grpc_byte_buffer *read_buffer) { +bool AsyncServerContext::ParseRead(grpc_byte_buffer* read_buffer) { GPR_ASSERT(request_); bool success = DeserializeProto(read_buffer, request_); request_ = nullptr; diff --git a/src/cpp/server/insecure_server_credentials.cc b/src/cpp/server/insecure_server_credentials.cc index f5e4732f73050bcf9db1b78655db2ed7a6c68cc4..55dd90d7a7e850601ccb1ee9f567ace0fb21f43d 100644 --- a/src/cpp/server/insecure_server_credentials.cc +++ b/src/cpp/server/insecure_server_credentials.cc @@ -46,7 +46,8 @@ class InsecureServerCredentialsImpl GRPC_FINAL : public ServerCredentials { } // namespace std::shared_ptr<ServerCredentials> InsecureServerCredentials() { - return std::shared_ptr<ServerCredentials>(new InsecureServerCredentialsImpl()); + return std::shared_ptr<ServerCredentials>( + new InsecureServerCredentialsImpl()); } } // namespace grpc diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc index ff356385034e7a4a10a43b8134e151abf115ad1d..88f7a9b1a98d22004a5080e782a9ac4c64bbc125 100644 --- a/src/cpp/server/secure_server_credentials.cc +++ b/src/cpp/server/secure_server_credentials.cc @@ -40,7 +40,8 @@ namespace grpc { namespace { class SecureServerCredentials GRPC_FINAL : public ServerCredentials { public: - explicit SecureServerCredentials(grpc_server_credentials* creds) : creds_(creds) {} + explicit SecureServerCredentials(grpc_server_credentials* creds) + : creds_(creds) {} ~SecureServerCredentials() GRPC_OVERRIDE { grpc_server_credentials_release(creds_); } @@ -56,16 +57,17 @@ class SecureServerCredentials GRPC_FINAL : public ServerCredentials { } // namespace std::shared_ptr<ServerCredentials> SslServerCredentials( - const SslServerCredentialsOptions &options) { + const SslServerCredentialsOptions& options) { std::vector<grpc_ssl_pem_key_cert_pair> pem_key_cert_pairs; - for (const auto &key_cert_pair : options.pem_key_cert_pairs) { + for (const auto& key_cert_pair : options.pem_key_cert_pairs) { pem_key_cert_pairs.push_back( {key_cert_pair.private_key.c_str(), key_cert_pair.cert_chain.c_str()}); } - grpc_server_credentials *c_creds = grpc_ssl_server_credentials_create( + grpc_server_credentials* c_creds = grpc_ssl_server_credentials_create( options.pem_root_certs.empty() ? nullptr : options.pem_root_certs.c_str(), &pem_key_cert_pairs[0], pem_key_cert_pairs.size()); - return std::shared_ptr<ServerCredentials>(new SecureServerCredentials(c_creds)); + return std::shared_ptr<ServerCredentials>( + new SecureServerCredentials(c_creds)); } } // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 4d5e77e6337e4efe02de5ce8ff70f160d1b50fbf..5a4ca6915a4f773d297599dc4c84d7b06477c4ce 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -234,7 +234,8 @@ void Server::RegisterAsyncGenericService(AsyncGenericService* service) { service->server_ = this; } -int Server::AddPort(const grpc::string& addr, ServerCredentials* creds) { +int Server::AddListeningPort(const grpc::string& addr, + ServerCredentials* creds) { GPR_ASSERT(!started_); return creds->AddPortToServer(addr, server_); } @@ -322,11 +323,10 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { payload_(nullptr) { memset(&array_, 0, sizeof(array_)); grpc_call_details_init(&call_details_); - grpc_server_request_call( - server->server_, &call_, &call_details_, &array_, cq->cq(), this); + grpc_server_request_call(server->server_, &call_, &call_details_, &array_, + cq->cq(), this); } - ~AsyncRequest() { if (payload_) { grpc_byte_buffer_destroy(payload_); diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index 835596d393a3e5a2d658beb1150b27b850ba1b72..58bf9d937f3a72daf9dd765e4e6e3fefa23e603f 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -56,15 +56,16 @@ void ServerBuilder::RegisterAsyncGenericService(AsyncGenericService* service) { if (generic_service_) { gpr_log(GPR_ERROR, "Adding multiple AsyncGenericService is unsupported for now. " - "Dropping the service %p", service); + "Dropping the service %p", + service); return; } generic_service_ = service; } -void ServerBuilder::AddPort(const grpc::string& addr, - std::shared_ptr<ServerCredentials> creds, - int* selected_port) { +void ServerBuilder::AddListeningPort(const grpc::string& addr, + std::shared_ptr<ServerCredentials> creds, + int* selected_port) { ports_.push_back(Port{addr, creds, selected_port}); } @@ -99,7 +100,7 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() { server->RegisterAsyncGenericService(generic_service_); } for (auto& port : ports_) { - int r = server->AddPort(port.addr, port.creds.get()); + int r = server->AddListeningPort(port.addr, port.creds.get()); if (!r) return nullptr; if (port.selected_port != nullptr) { *port.selected_port = r; diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index bb3c2d1405fb273210f8e909ae3037a51fd75882..435a060be5a026980e0facf7919859311aeef292 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -94,7 +94,6 @@ bool ServerContext::CompletionOp::FinalizeResult(void** tag, bool* status) { ServerContext::ServerContext() : completion_op_(nullptr), call_(nullptr), - cq_(nullptr), sent_initial_metadata_(false) {} ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, @@ -102,7 +101,6 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, : completion_op_(nullptr), deadline_(Timespec2Timepoint(deadline)), call_(nullptr), - cq_(nullptr), sent_initial_metadata_(false) { for (size_t i = 0; i < metadata_count; i++) { client_metadata_.insert(std::make_pair( @@ -137,8 +135,4 @@ void ServerContext::AddTrailingMetadata(const grpc::string& key, trailing_metadata_.insert(std::make_pair(key, value)); } -bool ServerContext::IsCancelled() { - return completion_op_ && completion_op_->CheckCancelled(cq_); -} - } // namespace grpc diff --git a/src/cpp/server/thread_pool.cc b/src/cpp/server/thread_pool.cc index 5dc9bcf916501c2ef8ba423018904a56377e3172..d3013b806c0c669ee2b586435b1f68a033c57c99 100644 --- a/src/cpp/server/thread_pool.cc +++ b/src/cpp/server/thread_pool.cc @@ -66,12 +66,12 @@ ThreadPool::~ThreadPool() { shutdown_ = true; cv_.notify_all(); } - for (auto &t : threads_) { + for (auto& t : threads_) { t.join(); } } -void ThreadPool::ScheduleCallback(const std::function<void()> &callback) { +void ThreadPool::ScheduleCallback(const std::function<void()>& callback) { std::lock_guard<std::mutex> lock(mu_); callbacks_.push(callback); cv_.notify_one(); diff --git a/src/cpp/server/thread_pool.h b/src/cpp/server/thread_pool.h index 6157e403e955dd9b3c40ec624f5dcbc5cbde2127..6225d82a0b65e09fc3f44f7b1eb9cf1de2e7b420 100644 --- a/src/cpp/server/thread_pool.h +++ b/src/cpp/server/thread_pool.h @@ -50,7 +50,7 @@ class ThreadPool GRPC_FINAL : public ThreadPoolInterface { explicit ThreadPool(int num_threads); ~ThreadPool(); - void ScheduleCallback(const std::function<void()> &callback) GRPC_OVERRIDE; + void ScheduleCallback(const std::function<void()>& callback) GRPC_OVERRIDE; private: std::mutex mu_; diff --git a/src/cpp/util/slice.cc b/src/cpp/util/slice.cc index a549c5008dff07f4d72df53db2175ab7d4899add..57370dabc68fd170f6e8a5534cf55241a3280603 100644 --- a/src/cpp/util/slice.cc +++ b/src/cpp/util/slice.cc @@ -37,9 +37,7 @@ namespace grpc { Slice::Slice() : slice_(gpr_empty_slice()) {} -Slice::~Slice() { - gpr_slice_unref(slice_); -} +Slice::~Slice() { gpr_slice_unref(slice_); } Slice::Slice(gpr_slice slice, AddRef) : slice_(gpr_slice_ref(slice)) {} diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index bbf803066869500cbec90d5e0ccbd72019ff116a..b694a513e7573eeb47784d6732de4c035b77524e 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -35,7 +35,7 @@ namespace grpc { -const Status &Status::OK = Status(); -const Status &Status::Cancelled = Status(StatusCode::CANCELLED); +const Status& Status::OK = Status(); +const Status& Status::Cancelled = Status(StatusCode::CANCELLED); } // namespace grpc diff --git a/src/cpp/util/time.cc b/src/cpp/util/time.cc index 919e5623fa31eb48995c23afaf58c46be9a3e3ee..059ea72abf69271e5337ae6c23aaa4a2e8005ed4 100644 --- a/src/cpp/util/time.cc +++ b/src/cpp/util/time.cc @@ -42,11 +42,15 @@ using std::chrono::system_clock; namespace grpc { -// TODO(yangg) prevent potential overflow. -void Timepoint2Timespec(const system_clock::time_point &from, - gpr_timespec *to) { +void Timepoint2Timespec(const system_clock::time_point& from, + gpr_timespec* to) { system_clock::duration deadline = from.time_since_epoch(); seconds secs = duration_cast<seconds>(deadline); + if (from == system_clock::time_point::max() || + secs.count() >= gpr_inf_future.tv_sec || secs.count() < 0) { + *to = gpr_inf_future; + return; + } nanoseconds nsecs = duration_cast<nanoseconds>(deadline - secs); to->tv_sec = secs.count(); to->tv_nsec = nsecs.count(); diff --git a/src/cpp/util/time.h b/src/cpp/util/time.h index 1994848eb21b09d026a9b619cff1b3ab5e6c46f0..8b7fcf55f78ea564f77df3ccbf799498e27723f2 100644 --- a/src/cpp/util/time.h +++ b/src/cpp/util/time.h @@ -41,8 +41,8 @@ namespace grpc { // from and to should be absolute time. -void Timepoint2Timespec(const std::chrono::system_clock::time_point &from, - gpr_timespec *to); +void Timepoint2Timespec(const std::chrono::system_clock::time_point& from, + gpr_timespec* to); std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t); diff --git a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs index 807f5a6ded4d34e9080a6375828ad1350bdb4867..3da9e33e5364b1a5ad92fa677ea13df9773bd2d1 100644 --- a/src/csharp/Grpc.Core.Tests/ClientServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ClientServerTest.cs @@ -74,7 +74,7 @@ namespace Grpc.Core.Tests ServerServiceDefinition.CreateBuilder(serviceName) .AddMethod(unaryEchoStringMethod, HandleUnaryEchoString).Build()); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) @@ -97,7 +97,7 @@ namespace Grpc.Core.Tests ServerServiceDefinition.CreateBuilder(serviceName) .AddMethod(unaryEchoStringMethod, HandleUnaryEchoString).Build()); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) @@ -117,7 +117,7 @@ namespace Grpc.Core.Tests server.AddServiceDefinition( ServerServiceDefinition.CreateBuilder(serviceName).Build()); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); using (Channel channel = new Channel(host + ":" + port)) diff --git a/src/csharp/Grpc.Core.Tests/ServerTest.cs b/src/csharp/Grpc.Core.Tests/ServerTest.cs index 12f914bfad1bfcb77e5bfb3332eaba773a0f0fcb..2a1855da675bdd26c810af0e13e3c1c8bfd01c64 100644 --- a/src/csharp/Grpc.Core.Tests/ServerTest.cs +++ b/src/csharp/Grpc.Core.Tests/ServerTest.cs @@ -47,7 +47,7 @@ namespace Grpc.Core.Tests GrpcEnvironment.Initialize(); Server server = new Server(); - server.AddPort("localhost:0"); + server.AddListeningPort("localhost:0"); server.Start(); server.ShutdownAsync().Wait(); diff --git a/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs b/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs index dc4781e7966b86ecf6e1d7fa29dc72c7b156a27b..a59da0982215178791f698a96c66d65b0a16fa6a 100644 --- a/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs +++ b/src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs @@ -80,12 +80,12 @@ namespace Grpc.Core.Internal return grpcsharp_server_create(cq, args); } - public int AddPort(string addr) + public int AddListeningPort(string addr) { return grpcsharp_server_add_http2_port(this, addr); } - public int AddPort(string addr, ServerCredentialsSafeHandle credentials) + public int AddListeningPort(string addr, ServerCredentialsSafeHandle credentials) { return grpcsharp_server_add_secure_http2_port(this, addr, credentials); } diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index 2439cdb6dc3c9d4752530fbfa66dda779ad6a080..f086fa8beb957124d6ef22066eaf80103a2150d0 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -76,17 +76,17 @@ namespace Grpc.Core } // only call before Start() - public int AddPort(string addr) + public int AddListeningPort(string addr) { - return handle.AddPort(addr); + return handle.AddListeningPort(addr); } // only call before Start() - public int AddPort(string addr, ServerCredentials credentials) + public int AddListeningPort(string addr, ServerCredentials credentials) { using (var nativeCredentials = credentials.ToNativeCredentials()) { - return handle.AddPort(addr, nativeCredentials); + return handle.AddListeningPort(addr, nativeCredentials); } } diff --git a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs index 32a523f2135d9abf77bc61cf7a10a6053e9cda79..85f213cb39161da5e8c61723c8ce4b1ff1b4df09 100644 --- a/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs +++ b/src/csharp/Grpc.Examples.Tests/MathClientServerTests.cs @@ -58,7 +58,7 @@ namespace math.Tests server = new Server(); server.AddServiceDefinition(MathGrpc.BindService(new MathServiceImpl())); - int port = server.AddPort(host + ":0"); + int port = server.AddListeningPort(host + ":0"); server.Start(); channel = new Channel(host + ":" + port); diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs index 814f6311f2321c21ab569789974d241dbed6758c..1e76d3df2134873a5ad79295377a3647b7793490 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs @@ -59,7 +59,7 @@ namespace Grpc.IntegrationTesting server = new Server(); server.AddServiceDefinition(TestServiceGrpc.BindService(new TestServiceImpl())); - int port = server.AddPort(host + ":0", TestCredentials.CreateTestServerCredentials()); + int port = server.AddListeningPort(host + ":0", TestCredentials.CreateTestServerCredentials()); server.Start(); var channelArgs = ChannelArgs.CreateBuilder() diff --git a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs index 5e580280b6119411d015d6dd21007e5905d08607..ad5200774f5840ec6dd2869434ac29ae99aae929 100644 --- a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs +++ b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs @@ -96,11 +96,11 @@ namespace Grpc.IntegrationTesting string addr = "0.0.0.0:" + options.port; if (options.useTls) { - server.AddPort(addr, TestCredentials.CreateTestServerCredentials()); + server.AddListeningPort(addr, TestCredentials.CreateTestServerCredentials()); } else { - server.AddPort(addr); + server.AddListeningPort(addr); } Console.WriteLine("Running server on " + addr); server.Start(); diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js index 8060baf82711a7f49d58578a1822915d35e3a30f..77804cf595b0035bdaa3a3f8645b1f4a95aa7c75 100644 --- a/src/node/interop/interop_client.js +++ b/src/node/interop/interop_client.js @@ -35,6 +35,7 @@ var fs = require('fs'); var path = require('path'); +var _ = require('underscore'); var grpc = require('..'); var testProto = grpc.load(__dirname + '/test.proto').grpc.testing; var GoogleAuth = require('google-auth-library'); @@ -45,6 +46,8 @@ var AUTH_SCOPE = 'https://www.googleapis.com/auth/xapi.zoo'; var AUTH_SCOPE_RESPONSE = 'xapi.zoo'; var AUTH_USER = ('155450119199-3psnrh1sdr3d8cpj1v46naggf81mhdnk' + '@developer.gserviceaccount.com'); +var COMPUTE_ENGINE_USER = ('155450119199-r5aaqa2vqoa9g5mv2m6s3m1l293rlmel' + + '@developer.gserviceaccount.com'); /** * Create a buffer filled with size zeroes @@ -265,11 +268,12 @@ function cancelAfterFirstResponse(client, done) { /** * Run one of the authentication tests. + * @param {string} expected_user The expected username in the response * @param {Client} client The client to test against * @param {function} done Callback to call when the test is completed. Included * primarily for use with mocha */ -function authTest(client, done) { +function authTest(expected_user, client, done) { (new GoogleAuth()).getApplicationDefault(function(err, credential) { assert.ifError(err); if (credential.createScopedRequired()) { @@ -290,7 +294,7 @@ function authTest(client, done) { assert.strictEqual(resp.payload.type, testProto.PayloadType.COMPRESSABLE); assert.strictEqual(resp.payload.body.limit - resp.payload.body.offset, 314159); - assert.strictEqual(resp.username, AUTH_USER); + assert.strictEqual(resp.username, expected_user); assert.strictEqual(resp.oauth_scope, AUTH_SCOPE_RESPONSE); }); call.on('status', function(status) { @@ -314,8 +318,8 @@ var test_cases = { empty_stream: emptyStream, cancel_after_begin: cancelAfterBegin, cancel_after_first_response: cancelAfterFirstResponse, - compute_engine_creds: authTest, - service_account_creds: authTest + compute_engine_creds: _.partial(authTest, AUTH_USER), + service_account_creds: _.partial(authTest, COMPUTE_ENGINE_USER) }; /** diff --git a/templates/Makefile.template b/templates/Makefile.template index 6845b911aa10039f75e58e5146ccd260e4258e46..36d11425df425345314173e4860080cf1b3f61f0 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -54,12 +54,38 @@ HOST_SYSTEM = $(shell uname | cut -f 1 -d_) ifeq ($(SYSTEM),) SYSTEM = $(HOST_SYSTEM) endif +ifeq ($(SYSTEM),MSYS) +SYSTEM = MINGW32 +endif ifndef BUILDDIR BUILDDIR = . endif +HAS_GCC = $(shell which gcc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CC = $(shell which cc > /dev/null 2> /dev/null && echo true || echo false) +HAS_CLANG = $(shell which clang > /dev/null 2> /dev/null && echo true || echo false) + +ifeq ($(HAS_CC),true) +DEFAULT_CC = cc +DEFAULT_CXX = c++ +else +ifeq ($(HAS_GCC),true) +DEFAULT_CC = gcc +DEFAULT_CXX = g++ +else +ifeq ($(HAS_CLANG),true) +DEFAULT_CC = clang +DEFAULT_CXX = clang++ +else +DEFAULT_CC = no_c_compiler +DEFAULT_CXX = no_c++_compiler +endif +endif +endif + + BINDIR = $(BUILDDIR)/bins OBJDIR = $(BUILDDIR)/objs LIBDIR = $(BUILDDIR)/libs @@ -68,29 +94,29 @@ GENDIR = $(BUILDDIR)/gens # Configurations VALID_CONFIG_opt = 1 -CC_opt = cc -CXX_opt = c++ -LD_opt = cc -LDXX_opt = c++ +CC_opt = $(DEFAULT_CC) +CXX_opt = $(DEFAULT_CXX) +LD_opt = $(DEFAULT_CC) +LDXX_opt = $(DEFAULT_CXX) CPPFLAGS_opt = -O2 LDFLAGS_opt = DEFINES_opt = NDEBUG VALID_CONFIG_dbg = 1 -CC_dbg = cc -CXX_dbg = c++ -LD_dbg = cc -LDXX_dbg = c++ +CC_dbg = $(DEFAULT_CC) +CXX_dbg = $(DEFAULT_CXX) +LD_dbg = $(DEFAULT_CC) +LDXX_dbg = $(DEFAULT_CXX) CPPFLAGS_dbg = -O0 LDFLAGS_dbg = DEFINES_dbg = _DEBUG DEBUG VALID_CONFIG_valgrind = 1 REQUIRE_CUSTOM_LIBRARIES_valgrind = 1 -CC_valgrind = cc -CXX_valgrind = c++ -LD_valgrind = cc -LDXX_valgrind = c++ +CC_valgrind = $(DEFAULT_CC) +CXX_valgrind = $(DEFAULT_CXX) +LD_valgrind = $(DEFAULT_CC) +LDXX_valgrind = $(DEFAULT_CXX) CPPFLAGS_valgrind = -O0 OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = @@ -211,8 +237,14 @@ else CXXFLAGS += -std=c++0x DEFINES += GRPC_OLD_CXX endif -CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -LDFLAGS += -g -fPIC +CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter +LDFLAGS += -g + +ifneq ($(SYSTEM),MINGW32) +PIC_CPPFLAGS = -fPIC +CPPFLAGS += -fPIC +LDFLAGS += -fPIC +endif INCLUDES = . include $(GENDIR) ifeq ($(SYSTEM),Darwin) @@ -235,11 +267,18 @@ endif ifneq ($(wildcard /usr/local/lib),) LDFLAGS += -L/usr/local/lib endif -else +endif + +ifeq ($(SYSTEM),Linux) LIBS = rt m z pthread LDFLAGS += -pthread endif +ifeq ($(SYSTEM),MINGW32) +LIBS = m z pthread +LDFLAGS += -pthread +endif + ifneq ($(wildcard /usr/src/gtest/src/gtest-all.cc),) GTEST_LIB = /usr/src/gtest/src/gtest-all.cc -I/usr/src/gtest else @@ -289,13 +328,31 @@ else IS_GIT_FOLDER = true endif -OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS) +ifeq ($(SYSTEM),Linux) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),Darwin) +OPENSSL_REQUIRES_DL = true +endif + +ifeq ($(SYSTEM),MINGW32) +OPENSSL_LIBS = ssl32 eay32 +else +OPENSSL_LIBS = ssl crypto +endif + +OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/openssl-alpn.c $(addprefix -l, $(OPENSSL_LIBS)) $(LDFLAGS) ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/zlib.c -lz $(LDFLAGS) PERFTOOLS_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/perftools.c -lprofiler $(LDFLAGS) PROTOBUF_CHECK_CMD = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $(TMPOUT) test/build/protobuf.cc -lprotobuf $(LDFLAGS) -PROTOC_CMD = which protoc +PROTOC_CMD = which protoc > /dev/null PROTOC_CHECK_CMD = protoc --version | grep -q libprotoc.3 +ifeq ($(OPENSSL_REQUIRES_DL),true) +OPENSSL_ALPN_CHECK_CMD += -ldl +endif + ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG) HAS_SYSTEM_PERFTOOLS = $(shell $(PERFTOOLS_CHECK_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_SYSTEM_PERFTOOLS),true) @@ -316,7 +373,7 @@ HAS_SYSTEM_ZLIB = false HAS_SYSTEM_PROTOBUF = false endif -HAS_PROTOC = $(shell $(PROTOC_CMD) > /dev/null && echo true || echo false) +HAS_PROTOC = $(shell $(PROTOC_CMD) 2> /dev/null && echo true || echo false) ifeq ($(HAS_PROTOC),true) HAS_VALID_PROTOC = $(shell $(PROTOC_CHECK_CMD) 2> /dev/null && echo true || echo false) else @@ -361,12 +418,17 @@ OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/o # need to prefix these to ensure overriding system libraries CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS) LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS) +ifeq ($(OPENSSL_REQUIRES_DL),true) LIBS_SECURE = dl +endif else NO_SECURE = true endif else -LIBS_SECURE = ssl crypto dl +LIBS_SECURE = $(OPENSSL_LIBS) +ifeq ($(OPENSSL_REQUIRES_DL),true) +LIBS_SECURE += dl +endif endif LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE)) @@ -513,7 +575,7 @@ run_dep_checks: $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(E) "[MAKE] Building zlib" - $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) + $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static) $(Q)$(MAKE) -C third_party/zlib clean $(Q)$(MAKE) -C third_party/zlib $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib @@ -522,9 +584,29 @@ $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(LIBDIR)/$(CONFIG)/openssl/libssl.a: $(E) "[MAKE] Building openssl for $(SYSTEM)" ifeq ($(SYSTEM),Darwin) - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./Configure darwin64-x86_64-cc) else - $(Q)(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +ifeq ($(SYSTEM),MINGW32) + @echo "We currently don't have a good way to compile OpenSSL in-place under msys." + @echo "Please provide an ALPN-capable OpenSSL in your mingw32 system." + @echo + @echo "Note that you can find a compatible version of the libraries here:" + @echo + @echo "http://slproweb.com/products/Win32OpenSSL.html" + @echo + @echo "If you decide to install that one, take the full version. The light" + @echo "version only contains compiled DLLs, without the development files." + @echo + @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries" + @echo "directory. This way we'll link to them directly." + @echo + @echo "You can then re-start the build the following way:" + @echo + @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make" + @false +else + $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) +endif endif $(Q)$(MAKE) -C third_party/openssl clean $(Q)$(MAKE) -C third_party/openssl build_crypto build_ssl @@ -538,9 +620,9 @@ third_party/protobuf/configure: $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure $(E) "[MAKE] Building protobuf" ifeq ($(HAVE_CXX11),true) - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) else - $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) + $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="$(PIC_CPPFLAGS) $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) endif $(Q)$(MAKE) -C third_party/protobuf clean $(Q)$(MAKE) -C third_party/protobuf diff --git a/templates/vsprojects/vs2013/grpc++.vcxproj.filters.template b/templates/vsprojects/vs2013/grpc++.vcxproj.filters.template new file mode 100644 index 0000000000000000000000000000000000000000..d74cce8c78f9bf58ddfce445aa2fa6ba1ca65b90 --- /dev/null +++ b/templates/vsprojects/vs2013/grpc++.vcxproj.filters.template @@ -0,0 +1,2 @@ +<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\ +${gen_filters('grpc++', libs, targets)} diff --git a/templates/vsprojects/vs2013/grpc++.vcxproj.template b/templates/vsprojects/vs2013/grpc++.vcxproj.template new file mode 100644 index 0000000000000000000000000000000000000000..93994bb392e530e9331878d39f212029cdc9b5eb --- /dev/null +++ b/templates/vsprojects/vs2013/grpc++.vcxproj.template @@ -0,0 +1,2 @@ +<%namespace file="vcxproj_defs.include" import="gen_project"/>\ +${gen_project('grpc++', libs, targets)} \ No newline at end of file diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index f345cebdb6afdd818e78c2cc4f2bd0e8210b2681..66b5407d3c5e9f13dbbed828d7f9076a23d76c18 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -178,7 +178,7 @@ static void test_things_stick_around(void) { grpc_mdctx *ctx; int i, j; char *buffer; - int nstrs = 10000; + int nstrs = 1000; grpc_mdstr **strs = gpr_malloc(sizeof(grpc_mdstr *) * nstrs); int *shuf = gpr_malloc(sizeof(int) * nstrs); grpc_mdstr *test; diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 59ca33cc2979f33eb88a676ced1c305c99ba6c1e..24251f297be5c14b8e013707cf7623476e6909d2 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -54,7 +54,7 @@ TEST_F(CredentialsTest, InvalidServiceAccountCreds) { } // namespace testing } // namespace grpc -int main(int argc, char **argv) { +int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); grpc_init(); int ret = RUN_ALL_TESTS(); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index e011b788ff00a7a230af54f4d4dfc9f036e971e7..4c71831dec8eeba1bd0bf1bd11f1b8e9ff572a65 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -66,7 +66,7 @@ namespace testing { namespace { -void* tag(int i) { return (void*)(gpr_intptr)i; } +void* tag(int i) { return (void*)(gpr_intptr) i; } void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { bool ok; @@ -76,11 +76,11 @@ void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { EXPECT_EQ(tag(i), got_tag); } -void verify_timed_ok(CompletionQueue* cq, int i, bool expect_ok, - std::chrono::system_clock::time_point deadline = - std::chrono::system_clock::time_point::max(), - CompletionQueue::NextStatus expected_outcome = - CompletionQueue::GOT_EVENT) { +void verify_timed_ok( + CompletionQueue* cq, int i, bool expect_ok, + std::chrono::system_clock::time_point deadline = + std::chrono::system_clock::time_point::max(), + CompletionQueue::NextStatus expected_outcome = CompletionQueue::GOT_EVENT) { bool ok; void* got_tag; EXPECT_EQ(cq->AsyncNext(&got_tag, &ok, deadline), expected_outcome); @@ -99,7 +99,7 @@ class AsyncEnd2endTest : public ::testing::Test { server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; - builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); builder.RegisterAsyncService(&service_); server_ = builder.BuildAndStart(); } @@ -195,18 +195,17 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { grpc::ServerAsyncResponseWriter<EchoResponse> response_writer(&srv_ctx); send_request.set_message("Hello"); - std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > - response_reader(stub_->AsyncEcho(&cli_ctx, send_request, - &cli_cq_, tag(1))); + std::unique_ptr<ClientAsyncResponseReader<EchoResponse> > response_reader( + stub_->AsyncEcho(&cli_ctx, send_request, &cli_cq_, tag(1))); - std::chrono::system_clock::time_point - time_now(std::chrono::system_clock::now()), - time_limit(std::chrono::system_clock::now()+std::chrono::seconds(5)); + std::chrono::system_clock::time_point time_now( + std::chrono::system_clock::now()), + time_limit(std::chrono::system_clock::now() + std::chrono::seconds(5)); verify_timed_ok(&srv_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); verify_timed_ok(&cli_cq_, -1, true, time_now, CompletionQueue::TIMEOUT); service_.RequestEcho(&srv_ctx, &recv_request, &response_writer, &srv_cq_, - tag(2)); + tag(2)); verify_timed_ok(&srv_cq_, 2, true, time_limit); EXPECT_EQ(send_request.message(), recv_request.message()); @@ -221,9 +220,8 @@ TEST_F(AsyncEnd2endTest, AsyncNextRpc) { EXPECT_EQ(send_response.message(), recv_response.message()); EXPECT_TRUE(recv_status.IsOk()); - } - + // Two pings and a final pong. TEST_F(AsyncEnd2endTest, SimpleClientStreaming) { ResetStub(); diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index c586849349cbfa7237f5a1d373c0bb3eb5b74e16..41c266953366d55d89ce74fb386580246ad73c27 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -151,7 +151,7 @@ class End2endTest : public ::testing::Test { server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; - builder.AddPort(server_address_.str(), InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), InsecureServerCredentials()); builder.RegisterService(&service_); builder.RegisterService(&dup_pkg_service_); builder.SetThreadPool(&thread_pool_); diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 4a0d2c5c01dd6ae08621e66ac55f74fe4ddd5347..711f1b95405d250c50080719d697df9970ca6b71 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -68,7 +68,7 @@ namespace grpc { namespace testing { namespace { -void* tag(int i) { return (void*)(gpr_intptr)i; } +void* tag(int i) { return (void*)(gpr_intptr) i; } void verify_ok(CompletionQueue* cq, int i, bool expect_ok) { bool ok; @@ -91,14 +91,14 @@ bool ParseFromByteBuffer(ByteBuffer* buffer, grpc::protobuf::Message* message) { class GenericEnd2endTest : public ::testing::Test { protected: - GenericEnd2endTest() : generic_service_("*") {} + GenericEnd2endTest() : generic_service_("*") {} void SetUp() GRPC_OVERRIDE { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; // Setup server ServerBuilder builder; - builder.AddPort(server_address_.str(), InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), InsecureServerCredentials()); builder.RegisterAsyncGenericService(&generic_service_); server_ = builder.BuildAndStart(); } @@ -116,8 +116,8 @@ class GenericEnd2endTest : public ::testing::Test { } void ResetStub() { - std::shared_ptr<ChannelInterface> channel = - CreateChannel(server_address_.str(), InsecureCredentials(), ChannelArguments()); + std::shared_ptr<ChannelInterface> channel = CreateChannel( + server_address_.str(), InsecureCredentials(), ChannelArguments()); stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel)); } @@ -238,7 +238,6 @@ TEST_F(GenericEnd2endTest, SimpleBidiStreaming) { client_ok(6); EXPECT_EQ(send_response.message(), recv_response.message()); - cli_stream->WritesDone(tag(7)); client_ok(7); diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 3bf299b1b5d62f2ddef0d2432324d864b8b3f586..de6c6b7b77e6289ce5ed813ac4d72fd2f13a6dac 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -165,8 +165,8 @@ void AssertOkOrPrintErrorStatus(const grpc::Status& s) { if (s.IsOk()) { return; } - gpr_log(GPR_INFO, "Error status code: %d, message: %s", - s.code(), s.details().c_str()); + gpr_log(GPR_INFO, "Error status code: %d, message: %s", s.code(), + s.details().c_str()); GPR_ASSERT(0); } @@ -246,8 +246,7 @@ void DoServiceAccountCreds() { } void DoJwtTokenCreds() { - gpr_log(GPR_INFO, - "Sending a large unary rpc with JWT token credentials ..."); + gpr_log(GPR_INFO, "Sending a large unary rpc with JWT token credentials ..."); std::shared_ptr<ChannelInterface> channel = CreateChannelForTestCase("jwt_token_creds"); SimpleRequest request; diff --git a/test/cpp/interop/interop_test.cc b/test/cpp/interop/interop_test.cc index 811e0eb009a3941595c20aa49254182f21c0753f..a7a5cc0b2c44e8ee8588ac84e8d793c8e230f2d1 100644 --- a/test/cpp/interop/interop_test.cc +++ b/test/cpp/interop/interop_test.cc @@ -54,13 +54,13 @@ extern "C" { #include <grpc/support/log.h> #include "test/core/util/port.h" -int test_client(const char *root, const char *host, int port) { +int test_client(const char* root, const char* host, int port) { int status; pid_t cli; cli = fork(); if (cli == 0) { - char *binary_path; - char *port_arg; + char* binary_path; + char* port_arg; gpr_asprintf(&binary_path, "%s/interop_client", root); gpr_asprintf(&port_arg, "--server_port=%d", port); @@ -78,9 +78,9 @@ int test_client(const char *root, const char *host, int port) { return 0; } -int main(int argc, char **argv) { - char *me = argv[0]; - char *lslash = strrchr(me, '/'); +int main(int argc, char** argv) { + char* me = argv[0]; + char* lslash = strrchr(me, '/'); char root[1024]; int port = grpc_pick_unused_port_or_die(); int status; @@ -104,8 +104,8 @@ int main(int argc, char **argv) { /* start the server */ svr = fork(); if (svr == 0) { - char *binary_path; - char *port_arg; + char* binary_path; + char* port_arg; gpr_asprintf(&binary_path, "%s/interop_server", root); gpr_asprintf(&port_arg, "--port=%d", port); diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 743482e967103d291f151f391179ccab735152f3..eceb600d4ce5a123833622422aa1acc95a96c1ad 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -217,7 +217,7 @@ void RunServer() { "", {{test_server1_key, test_server1_cert}}}; creds = grpc::SslServerCredentials(ssl_opts); } - builder.AddPort(server_address.str(), creds); + builder.AddListeningPort(server_address.str(), creds); std::unique_ptr<Server> server(builder.BuildAndStart()); gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str()); while (!got_sigint) { diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 30317d11e16fba2ed791f74ec57099c2f0978bae..3fd9628bd984add685f6ab922f2a907e21012cc6 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -61,11 +61,11 @@ class ClientRpcContext { ClientRpcContext() {} virtual ~ClientRpcContext() {} // next state, return false if done. Collect stats when appropriate - virtual bool RunNextState(bool, Histogram *hist) = 0; + virtual bool RunNextState(bool, Histogram* hist) = 0; virtual void StartNewClone() = 0; - static void *tag(ClientRpcContext *c) { return reinterpret_cast<void *>(c); } - static ClientRpcContext *detag(void *t) { - return reinterpret_cast<ClientRpcContext *>(t); + static void* tag(ClientRpcContext* c) { return reinterpret_cast<void*>(c); } + static ClientRpcContext* detag(void* t) { + return reinterpret_cast<ClientRpcContext*>(t); } }; @@ -73,12 +73,12 @@ template <class RequestType, class ResponseType> class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl( - TestService::Stub *stub, const RequestType &req, + TestService::Stub* stub, const RequestType& req, std::function< std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>( - TestService::Stub *, grpc::ClientContext *, const RequestType &, - void *)> start_req, - std::function<void(grpc::Status, ResponseType *)> on_done) + TestService::Stub*, grpc::ClientContext*, const RequestType&, + void*)> start_req, + std::function<void(grpc::Status, ResponseType*)> on_done) : context_(), stub_(stub), req_(req), @@ -90,7 +90,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { response_reader_( start_req(stub_, &context_, req_, ClientRpcContext::tag(this))) {} ~ClientRpcContextUnaryImpl() GRPC_OVERRIDE {} - bool RunNextState(bool ok, Histogram *hist) GRPC_OVERRIDE { + bool RunNextState(bool ok, Histogram* hist) GRPC_OVERRIDE { bool ret = (this->*next_state_)(ok); if (!ret) { hist->Add((Timer::Now() - start_) * 1e9); @@ -117,13 +117,13 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { return false; } grpc::ClientContext context_; - TestService::Stub *stub_; + TestService::Stub* stub_; RequestType req_; ResponseType response_; bool (ClientRpcContextUnaryImpl::*next_state_)(bool); - std::function<void(grpc::Status, ResponseType *)> callback_; + std::function<void(grpc::Status, ResponseType*)> callback_; std::function<std::unique_ptr<grpc::ClientAsyncResponseReader<ResponseType>>( - TestService::Stub *, grpc::ClientContext *, const RequestType &, void *)> + TestService::Stub*, grpc::ClientContext*, const RequestType&, void*)> start_req_; grpc::Status status_; double start_; @@ -133,13 +133,13 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { class AsyncUnaryClient GRPC_FINAL : public Client { public: - explicit AsyncUnaryClient(const ClientConfig &config) : Client(config) { + explicit AsyncUnaryClient(const ClientConfig& config) : Client(config) { for (int i = 0; i < config.async_client_threads(); i++) { cli_cqs_.emplace_back(new CompletionQueue); } auto payload_size = config.payload_size(); - auto check_done = [payload_size](grpc::Status s, SimpleResponse *response) { + auto check_done = [payload_size](grpc::Status s, SimpleResponse* response) { GPR_ASSERT(s.IsOk() && (response->payload().type() == grpc::testing::PayloadType::COMPRESSABLE) && (response->payload().body().length() == @@ -148,16 +148,16 @@ class AsyncUnaryClient GRPC_FINAL : public Client { int t = 0; for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { - for (auto &channel : channels_) { - auto *cq = cli_cqs_[t].get(); + for (auto& channel : channels_) { + auto* cq = cli_cqs_[t].get(); t = (t + 1) % cli_cqs_.size(); - auto start_req = [cq](TestService::Stub *stub, grpc::ClientContext *ctx, - const SimpleRequest &request, void *tag) { + auto start_req = [cq](TestService::Stub* stub, grpc::ClientContext* ctx, + const SimpleRequest& request, void* tag) { return stub->AsyncUnaryCall(ctx, request, cq, tag); }; - TestService::Stub *stub = channel.get_stub(); - const SimpleRequest &request = request_; + TestService::Stub* stub = channel.get_stub(); + const SimpleRequest& request = request_; new ClientRpcContextUnaryImpl<SimpleRequest, SimpleResponse>( stub, request, start_req, check_done); } @@ -169,9 +169,9 @@ class AsyncUnaryClient GRPC_FINAL : public Client { ~AsyncUnaryClient() GRPC_OVERRIDE { EndThreads(); - for (auto &cq : cli_cqs_) { + for (auto& cq : cli_cqs_) { cq->Shutdown(); - void *got_tag; + void* got_tag; bool ok; while (cq->Next(&got_tag, &ok)) { delete ClientRpcContext::detag(got_tag); @@ -179,12 +179,12 @@ class AsyncUnaryClient GRPC_FINAL : public Client { } } - void ThreadFunc(Histogram *histogram, size_t thread_idx) GRPC_OVERRIDE { - void *got_tag; + void ThreadFunc(Histogram* histogram, size_t thread_idx) GRPC_OVERRIDE { + void* got_tag; bool ok; cli_cqs_[thread_idx]->Next(&got_tag, &ok); - ClientRpcContext *ctx = ClientRpcContext::detag(got_tag); + ClientRpcContext* ctx = ClientRpcContext::detag(got_tag); if (ctx->RunNextState(ok, histogram) == false) { // call the callback and then delete it ctx->RunNextState(ok, histogram); @@ -329,10 +329,10 @@ class AsyncStreamingClient GRPC_FINAL : public Client { std::vector<std::unique_ptr<CompletionQueue>> cli_cqs_; }; -std::unique_ptr<Client> CreateAsyncUnaryClient(const ClientConfig &args) { +std::unique_ptr<Client> CreateAsyncUnaryClient(const ClientConfig& args) { return std::unique_ptr<Client>(new AsyncUnaryClient(args)); } -std::unique_ptr<Client> CreateAsyncStreamingClient(const ClientConfig &args) { +std::unique_ptr<Client> CreateAsyncStreamingClient(const ClientConfig& args) { return std::unique_ptr<Client>(new AsyncStreamingClient(args)); } diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc index f531094c7746baceaea66689bba912e1f48d495b..f7aa8e2aba69e9fd6e2d4e32e1810749e976e9fc 100644 --- a/test/cpp/qps/qps_driver.cc +++ b/test/cpp/qps/qps_driver.cc @@ -71,7 +71,7 @@ namespace gflags {} using namespace google; using namespace gflags; -int main(int argc, char **argv) { +int main(int argc, char** argv) { grpc_init(); ParseCommandLineFlags(&argc, &argv, true); diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc index c6c6c9543d2910829a3b11ed40aa1e91964dee54..258c5e145b8d47b593fa8e314fa655f57e1fa29b 100644 --- a/test/cpp/qps/server.cc +++ b/test/cpp/qps/server.cc @@ -73,8 +73,8 @@ using grpc::Status; // In some distros, gflags is in the namespace google, and in some others, // in gflags. This hack is enabling us to find both. -namespace google { } -namespace gflags { } +namespace google {} +namespace gflags {} using namespace google; using namespace gflags; @@ -137,7 +137,7 @@ static void RunServer() { SimpleResponse response; ServerBuilder builder; - builder.AddPort(server_address, grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); builder.RegisterService(&service); std::unique_ptr<ThreadPool> pool(new ThreadPool(FLAGS_server_threads)); diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 5a27fff09a421b56bbfa8c78f322e8a3e23c5c3d..1ec1928ab74872d6714d279923812da8c5e341c4 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -64,14 +64,14 @@ namespace testing { class AsyncQpsServerTest : public Server { public: - AsyncQpsServerTest(const ServerConfig &config, int port) + AsyncQpsServerTest(const ServerConfig& config, int port) : srv_cq_(), async_service_(&srv_cq_), server_(nullptr), shutdown_(false) { - char *server_address = NULL; + char* server_address = NULL; gpr_join_host_port(&server_address, "::", port); ServerBuilder builder; - builder.AddPort(server_address, InsecureServerCredentials()); + builder.AddListeningPort(server_address, InsecureServerCredentials()); gpr_free(server_address); builder.RegisterAsyncService(&async_service_); @@ -96,15 +96,16 @@ class AsyncQpsServerTest : public Server { threads_.push_back(std::thread([=]() { // Wait until work is available or we are shutting down bool ok; - void *got_tag; + void* got_tag; while (srv_cq_.Next(&got_tag, &ok)) { - ServerRpcContext *ctx = detag(got_tag); + ServerRpcContext* ctx = detag(got_tag); // The tag is a pointer to an RPC context to invoke if (ctx->RunNextState(ok) == false) { // this RPC context is done, so refresh it std::lock_guard<std::mutex> g(shutdown_mutex_); - if (!shutdown_) + if (!shutdown_) { ctx->Reset(); + } } } return; @@ -118,7 +119,7 @@ class AsyncQpsServerTest : public Server { shutdown_ = true; srv_cq_.Shutdown(); } - for (auto &thr : threads_) { + for (auto& thr : threads_) { thr.join(); } while (!contexts_.empty()) { @@ -135,21 +136,21 @@ class AsyncQpsServerTest : public Server { virtual bool RunNextState(bool) = 0; // next state, return false if done virtual void Reset() = 0; // start this back at a clean state }; - static void *tag(ServerRpcContext *func) { - return reinterpret_cast<void *>(func); + static void* tag(ServerRpcContext* func) { + return reinterpret_cast<void*>(func); } - static ServerRpcContext *detag(void *tag) { - return reinterpret_cast<ServerRpcContext *>(tag); + static ServerRpcContext* detag(void* tag) { + return reinterpret_cast<ServerRpcContext*>(tag); } template <class RequestType, class ResponseType> class ServerRpcContextUnaryImpl GRPC_FINAL : public ServerRpcContext { public: ServerRpcContextUnaryImpl( - std::function<void(ServerContext *, RequestType *, - grpc::ServerAsyncResponseWriter<ResponseType> *, - void *)> request_method, - std::function<grpc::Status(const RequestType *, ResponseType *)> + std::function<void(ServerContext*, RequestType*, + grpc::ServerAsyncResponseWriter<ResponseType>*, + void*)> request_method, + std::function<grpc::Status(const RequestType*, ResponseType*)> invoke_method) : next_state_(&ServerRpcContextUnaryImpl::invoker), request_method_(request_method), @@ -191,10 +192,10 @@ class AsyncQpsServerTest : public Server { ServerContext srv_ctx_; RequestType req_; bool (ServerRpcContextUnaryImpl::*next_state_)(bool); - std::function<void(ServerContext *, RequestType *, - grpc::ServerAsyncResponseWriter<ResponseType> *, void *)> + std::function<void(ServerContext*, RequestType*, + grpc::ServerAsyncResponseWriter<ResponseType>*, void*)> request_method_; - std::function<grpc::Status(const RequestType *, ResponseType *)> + std::function<grpc::Status(const RequestType*, ResponseType*)> invoke_method_; grpc::ServerAsyncResponseWriter<ResponseType> response_writer_; }; @@ -278,8 +279,8 @@ class AsyncQpsServerTest : public Server { grpc::ServerAsyncReaderWriter<ResponseType,RequestType> stream_; }; - static Status ProcessRPC(const SimpleRequest *request, - SimpleResponse *response) { + static Status ProcessRPC(const SimpleRequest* request, + SimpleResponse* response) { if (request->response_size() > 0) { if (!SetPayload(request->response_type(), request->response_size(), response->mutable_payload())) { @@ -292,19 +293,19 @@ class AsyncQpsServerTest : public Server { TestService::AsyncService async_service_; std::vector<std::thread> threads_; std::unique_ptr<grpc::Server> server_; - std::function<void(ServerContext *, SimpleRequest *, - grpc::ServerAsyncResponseWriter<SimpleResponse> *, void *)> + std::function<void(ServerContext*, SimpleRequest*, + grpc::ServerAsyncResponseWriter<SimpleResponse>*, void*)> request_unary_; - std::function<void(ServerContext *, grpc::ServerAsyncReaderWriter< - SimpleResponse,SimpleRequest> *, void *)> + std::function<void(ServerContext*, grpc::ServerAsyncReaderWriter< + SimpleResponse,SimpleRequest>*, void*)> request_streaming_; - std::forward_list<ServerRpcContext *> contexts_; + std::forward_list<ServerRpcContext*> contexts_; std::mutex shutdown_mutex_; bool shutdown_; }; -std::unique_ptr<Server> CreateAsyncServer(const ServerConfig &config, +std::unique_ptr<Server> CreateAsyncServer(const ServerConfig& config, int port) { return std::unique_ptr<Server>(new AsyncQpsServerTest(config, port)); } diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc index 1dbdd64a34e7f99d364c6dcee44a3ed6419eb16d..6724b8f79af490ee032b960960716d33673375fc 100644 --- a/test/cpp/qps/server_sync.cc +++ b/test/cpp/qps/server_sync.cc @@ -101,7 +101,7 @@ class SynchronousServer GRPC_FINAL : public grpc::testing::Server { char* server_address = NULL; gpr_join_host_port(&server_address, "::", port); - builder.AddPort(server_address, InsecureServerCredentials()); + builder.AddListeningPort(server_address, InsecureServerCredentials()); gpr_free(server_address); builder.RegisterService(&service_); diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index afe3ce90861eaa1c2f1132330ab173a7afe7cb9e..dddc4c9850778ceaac4a88f41b055d74c7884cc3 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -213,7 +213,7 @@ static void RunServer() { WorkerImpl service; ServerBuilder builder; - builder.AddPort(server_address, InsecureServerCredentials()); + builder.AddListeningPort(server_address, InsecureServerCredentials()); builder.RegisterService(&service); gpr_free(server_address); diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc index d3b84b29653631133dbc2070d24a5d75f6620fd5..f040acc4b1fcba91105f75d3e23816aad69acd91 100644 --- a/test/cpp/util/create_test_channel.cc +++ b/test/cpp/util/create_test_channel.cc @@ -72,8 +72,7 @@ std::shared_ptr<ChannelInterface> CreateTestChannel( const grpc::string& connect_to = server.empty() ? override_hostname : server; if (creds.get()) { - channel_creds = - CompositeCredentials(creds, channel_creds); + channel_creds = CompositeCredentials(creds, channel_creds); } return CreateChannel(connect_to, channel_creds, channel_args); } else { diff --git a/test/cpp/util/status_test.cc b/test/cpp/util/status_test.cc index 8c6a3354fe46dc068bd3047d2c0f4a7b0ad6a276..17b92ab06a28ed896395807af452e6c5e480e908 100644 --- a/test/cpp/util/status_test.cc +++ b/test/cpp/util/status_test.cc @@ -36,7 +36,7 @@ #include <grpc/support/log.h> // Make sure the existing grpc_status_code match with grpc::Code. -int main(int argc, char **argv) { +int main(int argc, char** argv) { GPR_ASSERT(grpc::StatusCode::OK == static_cast<grpc::StatusCode>(GRPC_STATUS_OK)); GPR_ASSERT(grpc::StatusCode::CANCELLED == diff --git a/test/cpp/util/time_test.cc b/test/cpp/util/time_test.cc index 2e17add67faabca80cafc6293f08b5483511fed7..4641fdb4daec90a21a19cfb8920779c857c74b01 100644 --- a/test/cpp/util/time_test.cc +++ b/test/cpp/util/time_test.cc @@ -61,11 +61,24 @@ TEST_F(TimeTest, AbsolutePointTest) { EXPECT_TRUE(tp == tp_converted_2); } -// gpr_inf_future is treated specially and mapped to time_point::max() +// gpr_inf_future is treated specially and mapped to/from time_point::max() TEST_F(TimeTest, InfFuture) { EXPECT_EQ(system_clock::time_point::max(), Timespec2Timepoint(gpr_inf_future)); + gpr_timespec from_time_point_max; + Timepoint2Timespec(system_clock::time_point::max(), &from_time_point_max); + EXPECT_EQ(0, gpr_time_cmp(gpr_inf_future, from_time_point_max)); + // This will cause an overflow + Timepoint2Timespec( + std::chrono::time_point<system_clock, std::chrono::seconds>::max(), + &from_time_point_max); + EXPECT_EQ(0, gpr_time_cmp(gpr_inf_future, from_time_point_max)); } } // namespace } // namespace grpc + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/third_party/openssl b/third_party/openssl index 4ac0329582829f5378d8078c8d314ad37db87736..3df69d3aefde7671053d4e3c242b228e5d79c83f 160000 --- a/third_party/openssl +++ b/third_party/openssl @@ -1 +1 @@ -Subproject commit 4ac0329582829f5378d8078c8d314ad37db87736 +Subproject commit 3df69d3aefde7671053d4e3c242b228e5d79c83f diff --git a/tools/buildgen/plugins/generate_vsprojects.py b/tools/buildgen/plugins/generate_vsprojects.py index 6cbd74df6679b48c49ad656c67cf952fe9137f6c..f00c1762149bd3aca9f7106a1bfb8ba23231c335 100755 --- a/tools/buildgen/plugins/generate_vsprojects.py +++ b/tools/buildgen/plugins/generate_vsprojects.py @@ -57,9 +57,8 @@ def mako_plugin(dictionary): projects = [project for project in projects if project.get('vs_project_guid', None)] - # Exclude C++ projects for now projects = [project for project in projects - if not project['language'] == 'c++'] + if project['language'] != 'c++' or project['build'] == 'all'] project_dict = dict([(p['name'], p) for p in projects]) diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 355d5735cdc53f241ec29574130ad0ee4b767c8c..0150fd4a5d8ec239b9cc188acc8c0fc6494918a3 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -351,6 +351,11 @@ "language": "c++", "name": "credentials_test" }, + { + "flaky": false, + "language": "c++", + "name": "cxx_time_test" + }, { "flaky": false, "language": "c++", diff --git a/vsprojects/vs2013/global.props b/vsprojects/vs2013/global.props index 27efc13b2476be39c16e2a99427c696d1f2b16e4..ae44e18d4ea446cfd90a922b07d70a2ade2c04b8 100644 --- a/vsprojects/vs2013/global.props +++ b/vsprojects/vs2013/global.props @@ -5,7 +5,7 @@ <PropertyGroup /> <ItemDefinitionGroup> <ClCompile> - <AdditionalIncludeDirectories>$(SolutionDir)\..\..;$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\third_party\zlib;$(SolutionDir)\..\third_party;$(SolutionDir)\..\..\third_party\openssl\inc32</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)\..\..;$(SolutionDir)\..\..\include;$(SolutionDir)\..\..\third_party\zlib;$(SolutionDir)\..\third_party;$(SolutionDir)\..\..\third_party\openssl\inc32;$(SolutionDir)\..\..\third_party\protobuf\src</AdditionalIncludeDirectories> <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>EnableAllWarnings</WarningLevel> </ClCompile> diff --git a/vsprojects/vs2013/gpr.vcxproj b/vsprojects/vs2013/gpr.vcxproj index 3d970079a423fa41147e4822ae2263221e4fe9c8..4b44cc645fd269ca8908f184131d086b8f450557 100644 --- a/vsprojects/vs2013/gpr.vcxproj +++ b/vsprojects/vs2013/gpr.vcxproj @@ -85,6 +85,7 @@ <ClInclude Include="..\..\include\grpc\support\atm_win32.h" /> <ClInclude Include="..\..\include\grpc\support\cancellable_platform.h" /> <ClInclude Include="..\..\include\grpc\support\cmdline.h" /> + <ClInclude Include="..\..\include\grpc\support\cpu.h" /> <ClInclude Include="..\..\include\grpc\support\histogram.h" /> <ClInclude Include="..\..\include\grpc\support\host_port.h" /> <ClInclude Include="..\..\include\grpc\support\log.h" /> @@ -115,6 +116,8 @@ </ClCompile> <ClCompile Include="..\..\src\core\support\cmdline.c"> </ClCompile> + <ClCompile Include="..\..\src\core\support\cpu_iphone.c"> + </ClCompile> <ClCompile Include="..\..\src\core\support\cpu_linux.c"> </ClCompile> <ClCompile Include="..\..\src\core\support\cpu_posix.c"> diff --git a/vsprojects/vs2013/gpr.vcxproj.filters b/vsprojects/vs2013/gpr.vcxproj.filters index 9b78c3a390a2c4d8447baeb6a83fa4332d970279..dffaf1e62dffd2fdb1ef227affc52cbf379fa3f8 100644 --- a/vsprojects/vs2013/gpr.vcxproj.filters +++ b/vsprojects/vs2013/gpr.vcxproj.filters @@ -10,6 +10,9 @@ <ClCompile Include="..\..\src\core\support\cmdline.c"> <Filter>src\core\support</Filter> </ClCompile> + <ClCompile Include="..\..\src\core\support\cpu_iphone.c"> + <Filter>src\core\support</Filter> + </ClCompile> <ClCompile Include="..\..\src\core\support\cpu_linux.c"> <Filter>src\core\support</Filter> </ClCompile> @@ -123,6 +126,9 @@ <ClInclude Include="..\..\include\grpc\support\cmdline.h"> <Filter>include\grpc\support</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc\support\cpu.h"> + <Filter>include\grpc\support</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc\support\histogram.h"> <Filter>include\grpc\support</Filter> </ClInclude> diff --git a/vsprojects/vs2013/gpr_shared.vcxproj b/vsprojects/vs2013/gpr_shared.vcxproj index 892490e3248197edeb1b10f55b41facdd99c84f5..85339652ed22052814b14f5053ebe8e192c28f0f 100644 --- a/vsprojects/vs2013/gpr_shared.vcxproj +++ b/vsprojects/vs2013/gpr_shared.vcxproj @@ -85,6 +85,7 @@ <ClInclude Include="..\..\include\grpc\support\atm_win32.h" /> <ClInclude Include="..\..\include\grpc\support\cancellable_platform.h" /> <ClInclude Include="..\..\include\grpc\support\cmdline.h" /> + <ClInclude Include="..\..\include\grpc\support\cpu.h" /> <ClInclude Include="..\..\include\grpc\support\histogram.h" /> <ClInclude Include="..\..\include\grpc\support\host_port.h" /> <ClInclude Include="..\..\include\grpc\support\log.h" /> @@ -115,6 +116,8 @@ </ClCompile> <ClCompile Include="..\..\src\core\support\cmdline.c"> </ClCompile> + <ClCompile Include="..\..\src\core\support\cpu_iphone.c"> + </ClCompile> <ClCompile Include="..\..\src\core\support\cpu_linux.c"> </ClCompile> <ClCompile Include="..\..\src\core\support\cpu_posix.c"> diff --git a/vsprojects/vs2013/gpr_shared.vcxproj.filters b/vsprojects/vs2013/gpr_shared.vcxproj.filters index 9b78c3a390a2c4d8447baeb6a83fa4332d970279..dffaf1e62dffd2fdb1ef227affc52cbf379fa3f8 100644 --- a/vsprojects/vs2013/gpr_shared.vcxproj.filters +++ b/vsprojects/vs2013/gpr_shared.vcxproj.filters @@ -10,6 +10,9 @@ <ClCompile Include="..\..\src\core\support\cmdline.c"> <Filter>src\core\support</Filter> </ClCompile> + <ClCompile Include="..\..\src\core\support\cpu_iphone.c"> + <Filter>src\core\support</Filter> + </ClCompile> <ClCompile Include="..\..\src\core\support\cpu_linux.c"> <Filter>src\core\support</Filter> </ClCompile> @@ -123,6 +126,9 @@ <ClInclude Include="..\..\include\grpc\support\cmdline.h"> <Filter>include\grpc\support</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc\support\cpu.h"> + <Filter>include\grpc\support</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc\support\histogram.h"> <Filter>include\grpc\support</Filter> </ClInclude> diff --git a/vsprojects/vs2013/grpc++.vcxproj b/vsprojects/vs2013/grpc++.vcxproj new file mode 100644 index 0000000000000000000000000000000000000000..6d921e7353e7e82c20a52c4db7ffe8c6d76355d2 --- /dev/null +++ b/vsprojects/vs2013/grpc++.vcxproj @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</ProjectGuid> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + <IntDir>$(Configuration)\$(ProjectName)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <IntDir>$(Configuration)\$(ProjectName)\</IntDir> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="global.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="global.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <TargetName>grpc++</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <TargetName>grpc++</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\include\grpc++\async_generic_service.h" /> + <ClInclude Include="..\..\include\grpc++\async_unary_call.h" /> + <ClInclude Include="..\..\include\grpc++\byte_buffer.h" /> + <ClInclude Include="..\..\include\grpc++\channel_arguments.h" /> + <ClInclude Include="..\..\include\grpc++\channel_interface.h" /> + <ClInclude Include="..\..\include\grpc++\client_context.h" /> + <ClInclude Include="..\..\include\grpc++\completion_queue.h" /> + <ClInclude Include="..\..\include\grpc++\config.h" /> + <ClInclude Include="..\..\include\grpc++\create_channel.h" /> + <ClInclude Include="..\..\include\grpc++\credentials.h" /> + <ClInclude Include="..\..\include\grpc++\generic_stub.h" /> + <ClInclude Include="..\..\include\grpc++\impl\call.h" /> + <ClInclude Include="..\..\include\grpc++\impl\client_unary_call.h" /> + <ClInclude Include="..\..\include\grpc++\impl\internal_stub.h" /> + <ClInclude Include="..\..\include\grpc++\impl\rpc_method.h" /> + <ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h" /> + <ClInclude Include="..\..\include\grpc++\impl\service_type.h" /> + <ClInclude Include="..\..\include\grpc++\server.h" /> + <ClInclude Include="..\..\include\grpc++\server_builder.h" /> + <ClInclude Include="..\..\include\grpc++\server_context.h" /> + <ClInclude Include="..\..\include\grpc++\server_credentials.h" /> + <ClInclude Include="..\..\include\grpc++\slice.h" /> + <ClInclude Include="..\..\include\grpc++\status.h" /> + <ClInclude Include="..\..\include\grpc++\status_code_enum.h" /> + <ClInclude Include="..\..\include\grpc++\stream.h" /> + <ClInclude Include="..\..\include\grpc++\thread_pool_interface.h" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\src\cpp\client\channel.h" /> + <ClInclude Include="..\..\src\cpp\proto\proto_utils.h" /> + <ClInclude Include="..\..\src\cpp\server\thread_pool.h" /> + <ClInclude Include="..\..\src\cpp\util\time.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\cpp\client\secure_credentials.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\secure_server_credentials.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\channel.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\channel_arguments.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\client_context.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\client_unary_call.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\create_channel.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\credentials.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\insecure_credentials.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\internal_stub.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\common\call.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\common\completion_queue.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\common\rpc_method.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\proto\proto_utils.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\async_generic_service.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\insecure_server_credentials.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server_builder.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server_context.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server_credentials.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\thread_pool.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\byte_buffer.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\slice.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\status.cc"> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\time.cc"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="gpr.vcxproj"> + <Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project> + </ProjectReference> + <ProjectReference Include="grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> diff --git a/vsprojects/vs2013/grpc++.vcxproj.filters b/vsprojects/vs2013/grpc++.vcxproj.filters new file mode 100644 index 0000000000000000000000000000000000000000..61b3bc537f1bbf27092ff0e2558503dc3ce88f73 --- /dev/null +++ b/vsprojects/vs2013/grpc++.vcxproj.filters @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClCompile Include="..\..\src\cpp\client\secure_credentials.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\secure_server_credentials.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\channel.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\channel_arguments.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\client_context.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\client_unary_call.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\create_channel.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\credentials.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\insecure_credentials.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\client\internal_stub.cc"> + <Filter>src\cpp\client</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\common\call.cc"> + <Filter>src\cpp\common</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\common\completion_queue.cc"> + <Filter>src\cpp\common</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\common\rpc_method.cc"> + <Filter>src\cpp\common</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\proto\proto_utils.cc"> + <Filter>src\cpp\proto</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\async_generic_service.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\insecure_server_credentials.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server_builder.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server_context.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\server_credentials.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\server\thread_pool.cc"> + <Filter>src\cpp\server</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\byte_buffer.cc"> + <Filter>src\cpp\util</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\slice.cc"> + <Filter>src\cpp\util</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\status.cc"> + <Filter>src\cpp\util</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cpp\util\time.cc"> + <Filter>src\cpp\util</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\grpc++\async_generic_service.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\async_unary_call.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\byte_buffer.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\channel_arguments.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\channel_interface.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\client_context.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\completion_queue.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\config.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\create_channel.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\credentials.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\generic_stub.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\call.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\client_unary_call.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\internal_stub.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\rpc_method.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\service_type.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\server.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\server_builder.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\server_context.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\server_credentials.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\slice.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\status.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\status_code_enum.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\stream.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + <ClInclude Include="..\..\include\grpc++\thread_pool_interface.h"> + <Filter>include\grpc++</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\src\cpp\client\channel.h"> + <Filter>src\cpp\client</Filter> + </ClInclude> + <ClInclude Include="..\..\src\cpp\proto\proto_utils.h"> + <Filter>src\cpp\proto</Filter> + </ClInclude> + <ClInclude Include="..\..\src\cpp\server\thread_pool.h"> + <Filter>src\cpp\server</Filter> + </ClInclude> + <ClInclude Include="..\..\src\cpp\util\time.h"> + <Filter>src\cpp\util</Filter> + </ClInclude> + </ItemGroup> + + <ItemGroup> + <Filter Include="include"> + <UniqueIdentifier>{82445414-24cd-8198-1fe1-4267c3f3df00}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++"> + <UniqueIdentifier>{784a0281-f547-aeb0-9f55-b26b7de9c769}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++\impl"> + <UniqueIdentifier>{0da8cd95-314f-da1b-5ce7-7791a5be1f1a}</UniqueIdentifier> + </Filter> + <Filter Include="src"> + <UniqueIdentifier>{328ff211-2886-406e-56f9-18ba1686f363}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp"> + <UniqueIdentifier>{2420a905-e4f1-a5aa-a364-6a112878a39e}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp\client"> + <UniqueIdentifier>{7febf32a-d7a6-76fa-9e17-f189f591c062}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp\common"> + <UniqueIdentifier>{2336e396-7e0b-8bf9-3b09-adc6ad1f0e5b}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp\proto"> + <UniqueIdentifier>{c22e8b9b-d2eb-a2e8-0cb8-3f7e3c902a7b}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp\server"> + <UniqueIdentifier>{321b0980-74ad-e8ca-f23b-deffa5d6bb8f}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp\util"> + <UniqueIdentifier>{f842537a-2bf1-1ec3-b495-7d62c64a1c06}</UniqueIdentifier> + </Filter> + </ItemGroup> +</Project> + diff --git a/vsprojects/vs2013/grpc.sln b/vsprojects/vs2013/grpc.sln index fd21ea782ea7b57f07ebd235d0cd93ea2cd6a5e4..a3915b3591b4429289346c8a02423293fe9f6bec 100644 --- a/vsprojects/vs2013/grpc.sln +++ b/vsprojects/vs2013/grpc.sln @@ -26,6 +26,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_unsecure", "grpc_unsec {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++", "grpc++.vcxproj", "{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}" + ProjectSection(ProjectDependencies) = postProject + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_csharp_ext", "grpc_csharp_ext.vcxproj", "{D64C6D63-4458-4A88-AB38-35678384A7E4}" ProjectSection(ProjectDependencies) = postProject {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} @@ -68,6 +74,10 @@ Global {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}.Debug|Win32.Build.0 = Debug|Win32 {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}.Release|Win32.ActiveCfg = Release|Win32 {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}.Release|Win32.Build.0 = Release|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Debug|Win32.ActiveCfg = Debug|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Debug|Win32.Build.0 = Debug|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release|Win32.ActiveCfg = Release|Win32 + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release|Win32.Build.0 = Release|Win32 {D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.ActiveCfg = Debug|Win32 {D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.Build.0 = Debug|Win32 {D64C6D63-4458-4A88-AB38-35678384A7E4}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vs2013/grpc.vcxproj b/vsprojects/vs2013/grpc.vcxproj index 9d0bcb327163f30a4e6899b08b7c7974763a4315..754c89985f195f559c9579aeb44ff67872e9924d 100644 --- a/vsprojects/vs2013/grpc.vcxproj +++ b/vsprojects/vs2013/grpc.vcxproj @@ -82,6 +82,7 @@ <ClInclude Include="..\..\include\grpc\byte_buffer.h" /> <ClInclude Include="..\..\include\grpc\byte_buffer_reader.h" /> <ClInclude Include="..\..\include\grpc\grpc.h" /> + <ClInclude Include="..\..\include\grpc\grpc_http.h" /> <ClInclude Include="..\..\include\grpc\status.h" /> </ItemGroup> <ItemGroup> @@ -93,6 +94,7 @@ <ClInclude Include="..\..\src\core\security\base64.h" /> <ClInclude Include="..\..\src\core\security\credentials.h" /> <ClInclude Include="..\..\src\core\security\json_token.h" /> + <ClInclude Include="..\..\src\core\security\secure_endpoint.h" /> <ClInclude Include="..\..\src\core\security\secure_transport_setup.h" /> <ClInclude Include="..\..\src\core\security\security_context.h" /> <ClInclude Include="..\..\src\core\tsi\fake_transport_security.h" /> @@ -163,6 +165,7 @@ <ClInclude Include="..\..\src\core\surface\init.h" /> <ClInclude Include="..\..\src\core\surface\server.h" /> <ClInclude Include="..\..\src\core\surface\surface_trace.h" /> + <ClInclude Include="..\..\src\core\transport\chttp2\alpn.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\bin_encoder.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\frame.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\frame_data.h" /> diff --git a/vsprojects/vs2013/grpc.vcxproj.filters b/vsprojects/vs2013/grpc.vcxproj.filters index af38d8de35ad2d37df2b247db721290a646fb91b..463a770fb8ca8182d0431597dea80004964e2ba2 100644 --- a/vsprojects/vs2013/grpc.vcxproj.filters +++ b/vsprojects/vs2013/grpc.vcxproj.filters @@ -363,6 +363,9 @@ <ClInclude Include="..\..\include\grpc\grpc.h"> <Filter>include\grpc</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc\grpc_http.h"> + <Filter>include\grpc</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc\status.h"> <Filter>include\grpc</Filter> </ClInclude> @@ -392,6 +395,9 @@ <ClInclude Include="..\..\src\core\security\json_token.h"> <Filter>src\core\security</Filter> </ClInclude> + <ClInclude Include="..\..\src\core\security\secure_endpoint.h"> + <Filter>src\core\security</Filter> + </ClInclude> <ClInclude Include="..\..\src\core\security\secure_transport_setup.h"> <Filter>src\core\security</Filter> </ClInclude> @@ -602,6 +608,9 @@ <ClInclude Include="..\..\src\core\surface\surface_trace.h"> <Filter>src\core\surface</Filter> </ClInclude> + <ClInclude Include="..\..\src\core\transport\chttp2\alpn.h"> + <Filter>src\core\transport\chttp2</Filter> + </ClInclude> <ClInclude Include="..\..\src\core\transport\chttp2\bin_encoder.h"> <Filter>src\core\transport\chttp2</Filter> </ClInclude> diff --git a/vsprojects/vs2013/grpc_shared.vcxproj b/vsprojects/vs2013/grpc_shared.vcxproj index f5575dc3f12db5abf050bdf6d44168443c848b47..927d2051a2cf379db89598cf2947759885b399bb 100644 --- a/vsprojects/vs2013/grpc_shared.vcxproj +++ b/vsprojects/vs2013/grpc_shared.vcxproj @@ -86,6 +86,7 @@ <ClInclude Include="..\..\include\grpc\byte_buffer.h" /> <ClInclude Include="..\..\include\grpc\byte_buffer_reader.h" /> <ClInclude Include="..\..\include\grpc\grpc.h" /> + <ClInclude Include="..\..\include\grpc\grpc_http.h" /> <ClInclude Include="..\..\include\grpc\status.h" /> </ItemGroup> <ItemGroup> @@ -97,6 +98,7 @@ <ClInclude Include="..\..\src\core\security\base64.h" /> <ClInclude Include="..\..\src\core\security\credentials.h" /> <ClInclude Include="..\..\src\core\security\json_token.h" /> + <ClInclude Include="..\..\src\core\security\secure_endpoint.h" /> <ClInclude Include="..\..\src\core\security\secure_transport_setup.h" /> <ClInclude Include="..\..\src\core\security\security_context.h" /> <ClInclude Include="..\..\src\core\tsi\fake_transport_security.h" /> @@ -167,6 +169,7 @@ <ClInclude Include="..\..\src\core\surface\init.h" /> <ClInclude Include="..\..\src\core\surface\server.h" /> <ClInclude Include="..\..\src\core\surface\surface_trace.h" /> + <ClInclude Include="..\..\src\core\transport\chttp2\alpn.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\bin_encoder.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\frame.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\frame_data.h" /> diff --git a/vsprojects/vs2013/grpc_shared.vcxproj.filters b/vsprojects/vs2013/grpc_shared.vcxproj.filters index af38d8de35ad2d37df2b247db721290a646fb91b..463a770fb8ca8182d0431597dea80004964e2ba2 100644 --- a/vsprojects/vs2013/grpc_shared.vcxproj.filters +++ b/vsprojects/vs2013/grpc_shared.vcxproj.filters @@ -363,6 +363,9 @@ <ClInclude Include="..\..\include\grpc\grpc.h"> <Filter>include\grpc</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc\grpc_http.h"> + <Filter>include\grpc</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc\status.h"> <Filter>include\grpc</Filter> </ClInclude> @@ -392,6 +395,9 @@ <ClInclude Include="..\..\src\core\security\json_token.h"> <Filter>src\core\security</Filter> </ClInclude> + <ClInclude Include="..\..\src\core\security\secure_endpoint.h"> + <Filter>src\core\security</Filter> + </ClInclude> <ClInclude Include="..\..\src\core\security\secure_transport_setup.h"> <Filter>src\core\security</Filter> </ClInclude> @@ -602,6 +608,9 @@ <ClInclude Include="..\..\src\core\surface\surface_trace.h"> <Filter>src\core\surface</Filter> </ClInclude> + <ClInclude Include="..\..\src\core\transport\chttp2\alpn.h"> + <Filter>src\core\transport\chttp2</Filter> + </ClInclude> <ClInclude Include="..\..\src\core\transport\chttp2\bin_encoder.h"> <Filter>src\core\transport\chttp2</Filter> </ClInclude> diff --git a/vsprojects/vs2013/grpc_unsecure.vcxproj b/vsprojects/vs2013/grpc_unsecure.vcxproj index ad7bf4762f57d451709e44349da6105c1276bef2..e1c1bc890b3398133cbf044855ab2cefcdcf3008 100644 --- a/vsprojects/vs2013/grpc_unsecure.vcxproj +++ b/vsprojects/vs2013/grpc_unsecure.vcxproj @@ -81,6 +81,7 @@ <ClInclude Include="..\..\include\grpc\byte_buffer.h" /> <ClInclude Include="..\..\include\grpc\byte_buffer_reader.h" /> <ClInclude Include="..\..\include\grpc\grpc.h" /> + <ClInclude Include="..\..\include\grpc\grpc_http.h" /> <ClInclude Include="..\..\include\grpc\status.h" /> </ItemGroup> <ItemGroup> @@ -148,6 +149,7 @@ <ClInclude Include="..\..\src\core\surface\init.h" /> <ClInclude Include="..\..\src\core\surface\server.h" /> <ClInclude Include="..\..\src\core\surface\surface_trace.h" /> + <ClInclude Include="..\..\src\core\transport\chttp2\alpn.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\bin_encoder.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\frame.h" /> <ClInclude Include="..\..\src\core\transport\chttp2\frame_data.h" /> diff --git a/vsprojects/vs2013/grpc_unsecure.vcxproj.filters b/vsprojects/vs2013/grpc_unsecure.vcxproj.filters index 205942a45099d7d05ab7db874c5f6ef7edf102f4..fe966237cb2d4e320e966daf64d18de032fd8166 100644 --- a/vsprojects/vs2013/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vs2013/grpc_unsecure.vcxproj.filters @@ -300,6 +300,9 @@ <ClInclude Include="..\..\include\grpc\grpc.h"> <Filter>include\grpc</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc\grpc_http.h"> + <Filter>include\grpc</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc\status.h"> <Filter>include\grpc</Filter> </ClInclude> @@ -497,6 +500,9 @@ <ClInclude Include="..\..\src\core\surface\surface_trace.h"> <Filter>src\core\surface</Filter> </ClInclude> + <ClInclude Include="..\..\src\core\transport\chttp2\alpn.h"> + <Filter>src\core\transport\chttp2</Filter> + </ClInclude> <ClInclude Include="..\..\src\core\transport\chttp2\bin_encoder.h"> <Filter>src\core\transport\chttp2</Filter> </ClInclude>