diff options
author | Craig Tiller <ctiller@google.com> | 2016-06-15 09:41:33 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-06-15 09:41:33 -0700 |
commit | 13c0940f662e79bed94c28a9fc351ec87a634d6d (patch) | |
tree | bfebb81c2e22c3ad32063cfbd36771c77be4e7e0 | |
parent | 8df99f2ac5bd92463d4cb676abbcde0fe2f4beae (diff) | |
parent | 52f231212f0385bae40dd6e45ed1c4bf823bf3c2 (diff) |
Merge branch 'idempotent_endpoint_shutdown' into handshake_timeout
128 files changed, 11390 insertions, 220 deletions
@@ -236,6 +236,7 @@ cc_library( "src/core/lib/transport/static_metadata.h", "src/core/lib/transport/transport.h", "src/core/lib/transport/transport_impl.h", + "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", "src/core/ext/transport/chttp2/transport/frame.h", @@ -395,6 +396,7 @@ cc_library( "src/core/lib/transport/transport.c", "src/core/lib/transport/transport_op_string.c", "src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c", + "src/core/ext/transport/chttp2/transport/bin_decoder.c", "src/core/ext/transport/chttp2/transport/bin_encoder.c", "src/core/ext/transport/chttp2/transport/chttp2_plugin.c", "src/core/ext/transport/chttp2/transport/chttp2_transport.c", @@ -619,6 +621,7 @@ cc_library( "src/core/lib/transport/transport.h", "src/core/lib/transport/transport_impl.h", "third_party/objective_c/Cronet/cronet_c_for_grpc.h", + "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", "src/core/ext/transport/chttp2/transport/frame.h", @@ -770,6 +773,7 @@ cc_library( "src/core/ext/transport/cronet/transport/cronet_api_dummy.c", "src/core/ext/transport/cronet/transport/cronet_transport.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", + "src/core/ext/transport/chttp2/transport/bin_decoder.c", "src/core/ext/transport/chttp2/transport/bin_encoder.c", "src/core/ext/transport/chttp2/transport/chttp2_plugin.c", "src/core/ext/transport/chttp2/transport/chttp2_transport.c", @@ -965,6 +969,7 @@ cc_library( "src/core/lib/transport/static_metadata.h", "src/core/lib/transport/transport.h", "src/core/lib/transport/transport_impl.h", + "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", "src/core/ext/transport/chttp2/transport/frame.h", @@ -1102,6 +1107,7 @@ cc_library( "src/core/lib/transport/transport_op_string.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c", + "src/core/ext/transport/chttp2/transport/bin_decoder.c", "src/core/ext/transport/chttp2/transport/bin_encoder.c", "src/core/ext/transport/chttp2/transport/chttp2_plugin.c", "src/core/ext/transport/chttp2/transport/chttp2_transport.c", @@ -1368,6 +1374,84 @@ cc_library( cc_library( + name = "grpc++_reflection", + srcs = [ + "src/cpp/ext/proto_server_reflection.h", + "src/cpp/ext/proto_server_reflection.cc", + "src/cpp/ext/proto_server_reflection_plugin.cc", + "src/cpp/ext/reflection.grpc.pb.cc", + "src/cpp/ext/reflection.pb.cc", + ], + hdrs = [ + "include/grpc++/ext/proto_server_reflection_plugin.h", + "include/grpc++/ext/reflection.grpc.pb.h", + "include/grpc++/ext/reflection.pb.h", + "include/grpc++/impl/codegen/proto_utils.h", + "include/grpc++/impl/codegen/async_stream.h", + "include/grpc++/impl/codegen/async_unary_call.h", + "include/grpc++/impl/codegen/call.h", + "include/grpc++/impl/codegen/call_hook.h", + "include/grpc++/impl/codegen/channel_interface.h", + "include/grpc++/impl/codegen/client_context.h", + "include/grpc++/impl/codegen/client_unary_call.h", + "include/grpc++/impl/codegen/completion_queue.h", + "include/grpc++/impl/codegen/completion_queue_tag.h", + "include/grpc++/impl/codegen/config.h", + "include/grpc++/impl/codegen/core_codegen_interface.h", + "include/grpc++/impl/codegen/create_auth_context.h", + "include/grpc++/impl/codegen/grpc_library.h", + "include/grpc++/impl/codegen/method_handler_impl.h", + "include/grpc++/impl/codegen/rpc_method.h", + "include/grpc++/impl/codegen/rpc_service_method.h", + "include/grpc++/impl/codegen/security/auth_context.h", + "include/grpc++/impl/codegen/serialization_traits.h", + "include/grpc++/impl/codegen/server_context.h", + "include/grpc++/impl/codegen/server_interface.h", + "include/grpc++/impl/codegen/service_type.h", + "include/grpc++/impl/codegen/status.h", + "include/grpc++/impl/codegen/status_code_enum.h", + "include/grpc++/impl/codegen/string_ref.h", + "include/grpc++/impl/codegen/stub_options.h", + "include/grpc++/impl/codegen/sync.h", + "include/grpc++/impl/codegen/sync_cxx11.h", + "include/grpc++/impl/codegen/sync_no_cxx11.h", + "include/grpc++/impl/codegen/sync_stream.h", + "include/grpc++/impl/codegen/time.h", + "include/grpc/impl/codegen/byte_buffer.h", + "include/grpc/impl/codegen/byte_buffer_reader.h", + "include/grpc/impl/codegen/compression_types.h", + "include/grpc/impl/codegen/connectivity_state.h", + "include/grpc/impl/codegen/grpc_types.h", + "include/grpc/impl/codegen/propagation_bits.h", + "include/grpc/impl/codegen/status.h", + "include/grpc/impl/codegen/alloc.h", + "include/grpc/impl/codegen/atm.h", + "include/grpc/impl/codegen/atm_gcc_atomic.h", + "include/grpc/impl/codegen/atm_gcc_sync.h", + "include/grpc/impl/codegen/atm_windows.h", + "include/grpc/impl/codegen/log.h", + "include/grpc/impl/codegen/port_platform.h", + "include/grpc/impl/codegen/slice.h", + "include/grpc/impl/codegen/slice_buffer.h", + "include/grpc/impl/codegen/sync.h", + "include/grpc/impl/codegen/sync_generic.h", + "include/grpc/impl/codegen/sync_posix.h", + "include/grpc/impl/codegen/sync_windows.h", + "include/grpc/impl/codegen/time.h", + "include/grpc++/impl/codegen/config_protobuf.h", + ], + includes = [ + "include", + ".", + ], + deps = [ + ":grpc++", + ], +) + + + +cc_library( name = "grpc++_unsecure", srcs = [ "src/cpp/client/create_channel_internal.h", @@ -1779,6 +1863,7 @@ objc_library( "src/core/lib/transport/transport.c", "src/core/lib/transport/transport_op_string.c", "src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c", + "src/core/ext/transport/chttp2/transport/bin_decoder.c", "src/core/ext/transport/chttp2/transport/bin_encoder.c", "src/core/ext/transport/chttp2/transport/chttp2_plugin.c", "src/core/ext/transport/chttp2/transport/chttp2_transport.c", @@ -1981,6 +2066,7 @@ objc_library( "src/core/lib/transport/static_metadata.h", "src/core/lib/transport/transport.h", "src/core/lib/transport/transport_impl.h", + "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", "src/core/ext/transport/chttp2/transport/frame.h", @@ -889,6 +889,7 @@ algorithm_test: $(BINDIR)/$(CONFIG)/algorithm_test alloc_test: $(BINDIR)/$(CONFIG)/alloc_test alpn_test: $(BINDIR)/$(CONFIG)/alpn_test api_fuzzer: $(BINDIR)/$(CONFIG)/api_fuzzer +bin_decoder_test: $(BINDIR)/$(CONFIG)/bin_decoder_test bin_encoder_test: $(BINDIR)/$(CONFIG)/bin_encoder_test census_context_test: $(BINDIR)/$(CONFIG)/census_context_test channel_create_test: $(BINDIR)/$(CONFIG)/channel_create_test @@ -1032,6 +1033,7 @@ interop_test: $(BINDIR)/$(CONFIG)/interop_test json_run_localhost: $(BINDIR)/$(CONFIG)/json_run_localhost metrics_client: $(BINDIR)/$(CONFIG)/metrics_client mock_test: $(BINDIR)/$(CONFIG)/mock_test +proto_server_reflection_test: $(BINDIR)/$(CONFIG)/proto_server_reflection_test qps_interarrival_test: $(BINDIR)/$(CONFIG)/qps_interarrival_test qps_json_driver: $(BINDIR)/$(CONFIG)/qps_json_driver qps_openloop_test: $(BINDIR)/$(CONFIG)/qps_openloop_test @@ -1170,13 +1172,13 @@ static: static_c static_cxx static_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc_cronet.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a static_zookeeper_libs -static_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a +static_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a shared: shared_c shared_cxx shared_c: pc_c pc_c_unsecure cache.mk pc_c_zookeeper $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)gpr$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION).$(SHARED_EXT) shared_zookeeper_libs -shared_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT) +shared_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT) shared_csharp: shared_c $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION).$(SHARED_EXT) ifeq ($(HAS_ZOOKEEPER),true) @@ -1227,6 +1229,7 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/algorithm_test \ $(BINDIR)/$(CONFIG)/alloc_test \ $(BINDIR)/$(CONFIG)/alpn_test \ + $(BINDIR)/$(CONFIG)/bin_decoder_test \ $(BINDIR)/$(CONFIG)/bin_encoder_test \ $(BINDIR)/$(CONFIG)/census_context_test \ $(BINDIR)/$(CONFIG)/channel_create_test \ @@ -1405,6 +1408,7 @@ buildtests_cxx: buildtests_zookeeper privatelibs_cxx \ $(BINDIR)/$(CONFIG)/json_run_localhost \ $(BINDIR)/$(CONFIG)/metrics_client \ $(BINDIR)/$(CONFIG)/mock_test \ + $(BINDIR)/$(CONFIG)/proto_server_reflection_test \ $(BINDIR)/$(CONFIG)/qps_interarrival_test \ $(BINDIR)/$(CONFIG)/qps_json_driver \ $(BINDIR)/$(CONFIG)/qps_openloop_test \ @@ -1482,6 +1486,8 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/alloc_test || ( echo test alloc_test failed ; exit 1 ) $(E) "[RUN] Testing alpn_test" $(Q) $(BINDIR)/$(CONFIG)/alpn_test || ( echo test alpn_test failed ; exit 1 ) + $(E) "[RUN] Testing bin_decoder_test" + $(Q) $(BINDIR)/$(CONFIG)/bin_decoder_test || ( echo test bin_decoder_test failed ; exit 1 ) $(E) "[RUN] Testing bin_encoder_test" $(Q) $(BINDIR)/$(CONFIG)/bin_encoder_test || ( echo test bin_encoder_test failed ; exit 1 ) $(E) "[RUN] Testing census_context_test" @@ -1732,6 +1738,8 @@ test_cxx: test_zookeeper buildtests_cxx $(Q) $(BINDIR)/$(CONFIG)/interop_test || ( echo test interop_test failed ; exit 1 ) $(E) "[RUN] Testing mock_test" $(Q) $(BINDIR)/$(CONFIG)/mock_test || ( echo test mock_test failed ; exit 1 ) + $(E) "[RUN] Testing proto_server_reflection_test" + $(Q) $(BINDIR)/$(CONFIG)/proto_server_reflection_test || ( echo test proto_server_reflection_test failed ; exit 1 ) $(E) "[RUN] Testing qps_openloop_test" $(Q) $(BINDIR)/$(CONFIG)/qps_openloop_test || ( echo test qps_openloop_test failed ; exit 1 ) $(E) "[RUN] Testing secure_auth_context_test" @@ -1812,6 +1820,8 @@ strip-static_cxx: static_cxx ifeq ($(CONFIG),opt) $(E) "[STRIP] Stripping libgrpc++.a" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++.a + $(E) "[STRIP] Stripping libgrpc++_reflection.a" + $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(E) "[STRIP] Stripping libgrpc++_unsecure.a" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a endif @@ -1834,6 +1844,8 @@ strip-shared_cxx: shared_cxx ifeq ($(CONFIG),opt) $(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT) + $(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT)" + $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT) endif @@ -2145,6 +2157,9 @@ install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx $(E) "[INSTALL] Installing libgrpc++.a" $(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(prefix)/lib/libgrpc++.a + $(E) "[INSTALL] Installing libgrpc++_reflection.a" + $(Q) $(INSTALL) -d $(prefix)/lib + $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(prefix)/lib/libgrpc++_reflection.a $(E) "[INSTALL] Installing libgrpc++_unsecure.a" $(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a $(prefix)/lib/libgrpc++_unsecure.a @@ -2207,6 +2222,15 @@ else ifneq ($(SYSTEM),Darwin) $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/libgrpc++.so.0 $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/libgrpc++.so endif + $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT)" + $(Q) $(INSTALL) -d $(prefix)/lib + $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) +ifeq ($(SYSTEM),MINGW32) + $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection-imp.a $(prefix)/lib/libgrpc++_reflection-imp.a +else ifneq ($(SYSTEM),Darwin) + $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/libgrpc++_reflection.so.0 + $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/libgrpc++_reflection.so +endif $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT)" $(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT) @@ -2554,6 +2578,7 @@ LIBGRPC_SRC = \ src/core/lib/transport/transport.c \ src/core/lib/transport/transport_op_string.c \ src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c \ + src/core/ext/transport/chttp2/transport/bin_decoder.c \ src/core/ext/transport/chttp2/transport/bin_encoder.c \ src/core/ext/transport/chttp2/transport/chttp2_plugin.c \ src/core/ext/transport/chttp2/transport/chttp2_transport.c \ @@ -2826,6 +2851,7 @@ LIBGRPC_CRONET_SRC = \ src/core/ext/transport/cronet/transport/cronet_api_dummy.c \ src/core/ext/transport/cronet/transport/cronet_transport.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ + src/core/ext/transport/chttp2/transport/bin_decoder.c \ src/core/ext/transport/chttp2/transport/bin_encoder.c \ src/core/ext/transport/chttp2/transport/chttp2_plugin.c \ src/core/ext/transport/chttp2/transport/chttp2_transport.c \ @@ -3162,6 +3188,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/lib/transport/transport_op_string.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ + src/core/ext/transport/chttp2/transport/bin_decoder.c \ src/core/ext/transport/chttp2/transport/bin_encoder.c \ src/core/ext/transport/chttp2/transport/chttp2_plugin.c \ src/core/ext/transport/chttp2/transport/chttp2_transport.c \ @@ -3571,6 +3598,133 @@ endif endif +LIBGRPC++_REFLECTION_SRC = \ + src/cpp/ext/proto_server_reflection.cc \ + src/cpp/ext/proto_server_reflection_plugin.cc \ + src/cpp/ext/reflection.grpc.pb.cc \ + src/cpp/ext/reflection.pb.cc \ + +PUBLIC_HEADERS_CXX += \ + include/grpc++/ext/proto_server_reflection_plugin.h \ + include/grpc++/ext/reflection.grpc.pb.h \ + include/grpc++/ext/reflection.pb.h \ + include/grpc++/impl/codegen/proto_utils.h \ + include/grpc++/impl/codegen/async_stream.h \ + include/grpc++/impl/codegen/async_unary_call.h \ + include/grpc++/impl/codegen/call.h \ + include/grpc++/impl/codegen/call_hook.h \ + include/grpc++/impl/codegen/channel_interface.h \ + include/grpc++/impl/codegen/client_context.h \ + include/grpc++/impl/codegen/client_unary_call.h \ + include/grpc++/impl/codegen/completion_queue.h \ + include/grpc++/impl/codegen/completion_queue_tag.h \ + include/grpc++/impl/codegen/config.h \ + include/grpc++/impl/codegen/core_codegen_interface.h \ + include/grpc++/impl/codegen/create_auth_context.h \ + include/grpc++/impl/codegen/grpc_library.h \ + include/grpc++/impl/codegen/method_handler_impl.h \ + include/grpc++/impl/codegen/rpc_method.h \ + include/grpc++/impl/codegen/rpc_service_method.h \ + include/grpc++/impl/codegen/security/auth_context.h \ + include/grpc++/impl/codegen/serialization_traits.h \ + include/grpc++/impl/codegen/server_context.h \ + include/grpc++/impl/codegen/server_interface.h \ + include/grpc++/impl/codegen/service_type.h \ + include/grpc++/impl/codegen/status.h \ + include/grpc++/impl/codegen/status_code_enum.h \ + include/grpc++/impl/codegen/string_ref.h \ + include/grpc++/impl/codegen/stub_options.h \ + include/grpc++/impl/codegen/sync.h \ + include/grpc++/impl/codegen/sync_cxx11.h \ + include/grpc++/impl/codegen/sync_no_cxx11.h \ + include/grpc++/impl/codegen/sync_stream.h \ + include/grpc++/impl/codegen/time.h \ + include/grpc/impl/codegen/byte_buffer.h \ + include/grpc/impl/codegen/byte_buffer_reader.h \ + include/grpc/impl/codegen/compression_types.h \ + include/grpc/impl/codegen/connectivity_state.h \ + include/grpc/impl/codegen/grpc_types.h \ + include/grpc/impl/codegen/propagation_bits.h \ + include/grpc/impl/codegen/status.h \ + include/grpc/impl/codegen/alloc.h \ + include/grpc/impl/codegen/atm.h \ + include/grpc/impl/codegen/atm_gcc_atomic.h \ + include/grpc/impl/codegen/atm_gcc_sync.h \ + include/grpc/impl/codegen/atm_windows.h \ + include/grpc/impl/codegen/log.h \ + include/grpc/impl/codegen/port_platform.h \ + include/grpc/impl/codegen/slice.h \ + include/grpc/impl/codegen/slice_buffer.h \ + include/grpc/impl/codegen/sync.h \ + include/grpc/impl/codegen/sync_generic.h \ + include/grpc/impl/codegen/sync_posix.h \ + include/grpc/impl/codegen/sync_windows.h \ + include/grpc/impl/codegen/time.h \ + include/grpc++/impl/codegen/config_protobuf.h \ + +LIBGRPC++_REFLECTION_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_REFLECTION_SRC)))) + + +ifeq ($(NO_SECURE),true) + +# You can't build secure libraries if you don't have OpenSSL. + +$(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a: openssl_dep_error + +$(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT): openssl_dep_error + +else + +ifeq ($(NO_PROTOBUF),true) + +# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay. + +$(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a: protobuf_dep_error + +$(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT): protobuf_dep_error + +else + +$(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LIBGRPC++_REFLECTION_OBJS) + $(E) "[AR] Creating $@" + $(Q) mkdir -p `dirname $@` + $(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a + $(Q) $(AR) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBGRPC++_REFLECTION_OBJS) +ifeq ($(SYSTEM),Darwin) + $(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a +endif + + + +ifeq ($(SYSTEM),MINGW32) +$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++.$(SHARED_EXT) $(OPENSSL_DEP) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared grpc++_reflection.def -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++-imp +else +$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION).$(SHARED_EXT): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT) $(OPENSSL_DEP) + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` +ifeq ($(SYSTEM),Darwin) + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++ +else + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.0 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++ + $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION).so.0 + $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION).so +endif +endif + +endif + +endif + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(LIBGRPC++_REFLECTION_OBJS:.o=.dep) +endif +endif + + LIBGRPC++_TEST_CONFIG_SRC = \ test/cpp/util/test_config.cc \ @@ -6445,6 +6599,38 @@ endif endif +BIN_DECODER_TEST_SRC = \ + test/core/transport/chttp2/bin_decoder_test.c \ + +BIN_DECODER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BIN_DECODER_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/bin_decoder_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/bin_decoder_test: $(BIN_DECODER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(BIN_DECODER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/bin_decoder_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/transport/chttp2/bin_decoder_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a + +deps_bin_decoder_test: $(BIN_DECODER_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(BIN_DECODER_TEST_OBJS:.o=.dep) +endif +endif + + BIN_ENCODER_TEST_SRC = \ test/core/transport/chttp2/bin_encoder_test.c \ @@ -11325,6 +11511,52 @@ endif endif +PROTO_SERVER_REFLECTION_TEST_SRC = \ + test/cpp/end2end/proto_server_reflection_test.cc \ + test/cpp/util/proto_reflection_descriptor_database.cc \ + +PROTO_SERVER_REFLECTION_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PROTO_SERVER_REFLECTION_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/proto_server_reflection_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)/proto_server_reflection_test: protobuf_dep_error + +else + +$(BINDIR)/$(CONFIG)/proto_server_reflection_test: $(PROTOBUF_DEP) $(PROTO_SERVER_REFLECTION_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(PROTO_SERVER_REFLECTION_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/proto_server_reflection_test + +endif + +endif + +$(OBJDIR)/$(CONFIG)/test/cpp/end2end/proto_server_reflection_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +$(OBJDIR)/$(CONFIG)/test/cpp/util/proto_reflection_descriptor_database.o: $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_proto_server_reflection_test: $(PROTO_SERVER_REFLECTION_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(PROTO_SERVER_REFLECTION_TEST_OBJS:.o=.dep) +endif +endif + + QPS_INTERARRIVAL_TEST_SRC = \ test/cpp/qps/qps_interarrival_test.cc \ @@ -14630,6 +14862,10 @@ src/cpp/common/auth_property_iterator.cc: $(OPENSSL_DEP) src/cpp/common/secure_auth_context.cc: $(OPENSSL_DEP) src/cpp/common/secure_channel_arguments.cc: $(OPENSSL_DEP) src/cpp/common/secure_create_auth_context.cc: $(OPENSSL_DEP) +src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP) +src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP) +src/cpp/ext/reflection.grpc.pb.cc: $(OPENSSL_DEP) +src/cpp/ext/reflection.pb.cc: $(OPENSSL_DEP) src/cpp/server/secure_server_credentials.cc: $(OPENSSL_DEP) src/csharp/ext/grpc_csharp_ext.c: $(OPENSSL_DEP) test/core/bad_client/bad_client.c: $(OPENSSL_DEP) diff --git a/binding.gyp b/binding.gyp index ccea9fa020..3150d1083b 100644 --- a/binding.gyp +++ b/binding.gyp @@ -649,6 +649,7 @@ 'src/core/lib/transport/transport.c', 'src/core/lib/transport/transport_op_string.c', 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c', + 'src/core/ext/transport/chttp2/transport/bin_decoder.c', 'src/core/ext/transport/chttp2/transport/bin_encoder.c', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.c', 'src/core/ext/transport/chttp2/transport/chttp2_transport.c', diff --git a/build.yaml b/build.yaml index 96086ea7dc..38fb2c94a0 100644 --- a/build.yaml +++ b/build.yaml @@ -510,6 +510,7 @@ filegroups: - gpr_test_util - name: grpc_transport_chttp2 headers: + - src/core/ext/transport/chttp2/transport/bin_decoder.h - src/core/ext/transport/chttp2/transport/bin_encoder.h - src/core/ext/transport/chttp2/transport/chttp2_transport.h - src/core/ext/transport/chttp2/transport/frame.h @@ -531,6 +532,7 @@ filegroups: - src/core/ext/transport/chttp2/transport/timeout_encoding.h - src/core/ext/transport/chttp2/transport/varint.h src: + - src/core/ext/transport/chttp2/transport/bin_decoder.c - src/core/ext/transport/chttp2/transport/bin_encoder.c - src/core/ext/transport/chttp2/transport/chttp2_plugin.c - src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -949,6 +951,24 @@ libs: - grpc++_codegen_base_src secure: check vs_project_guid: '{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}' +- name: grpc++_reflection + build: all + language: c++ + public_headers: + - include/grpc++/ext/proto_server_reflection_plugin.h + - include/grpc++/ext/reflection.grpc.pb.h + - include/grpc++/ext/reflection.pb.h + headers: + - src/cpp/ext/proto_server_reflection.h + src: + - src/cpp/ext/proto_server_reflection.cc + - src/cpp/ext/proto_server_reflection_plugin.cc + - src/cpp/ext/reflection.grpc.pb.cc + - src/cpp/ext/reflection.pb.cc + deps: + - grpc++ + filegroups: + - grpc++_codegen_proto - name: grpc++_test_config build: private language: c++ @@ -1218,6 +1238,14 @@ targets: - test/core/end2end/fuzzers/api_fuzzer_corpus dict: test/core/end2end/fuzzers/api_fuzzer.dictionary maxlen: 2048 +- name: bin_decoder_test + build: test + language: c + src: + - test/core/transport/chttp2/bin_decoder_test.c + deps: + - grpc_test_util + - grpc - name: bin_encoder_test build: test language: c @@ -2812,6 +2840,23 @@ targets: - grpc - gpr_test_util - gpr +- name: proto_server_reflection_test + gtest: true + build: test + language: c++ + headers: + - test/cpp/util/proto_reflection_descriptor_database.h + src: + - test/cpp/end2end/proto_server_reflection_test.cc + - test/cpp/util/proto_reflection_descriptor_database.cc + deps: + - grpc++_reflection + - grpc++_test_util + - grpc_test_util + - grpc++ + - grpc + - gpr_test_util + - gpr - name: qps_interarrival_test build: test run: false diff --git a/composer.json b/composer.json index b77a59e351..05ac003714 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "grpc/grpc", "type": "library", "description": "gRPC library for PHP", - "version": "0.15.0", "keywords": ["rpc"], "homepage": "http://grpc.io", "license": "BSD-3-Clause", @@ -168,6 +168,7 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/transport/transport.c \ src/core/lib/transport/transport_op_string.c \ src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c \ + src/core/ext/transport/chttp2/transport/bin_decoder.c \ src/core/ext/transport/chttp2/transport/bin_encoder.c \ src/core/ext/transport/chttp2/transport/chttp2_plugin.c \ src/core/ext/transport/chttp2/transport/chttp2_transport.c \ diff --git a/doc/c-style-guide.md b/doc/c-style-guide.md index 87de8892dd..d6f9bbd7d4 100644 --- a/doc/c-style-guide.md +++ b/doc/c-style-guide.md @@ -11,7 +11,7 @@ General - Layout rules are defined by clang-format, and all code should be passed through clang-format. A (docker-based) script to do so is included in - tools/distrib/clang_format_code.sh. + [tools/distrib/clang\_format\_code.sh] (../tools/distrib/clang_format_code.sh). Header Files ------------ diff --git a/doc/cpp-style-guide.md b/doc/cpp-style-guide.md new file mode 100644 index 0000000000..9408c4abd6 --- /dev/null +++ b/doc/cpp-style-guide.md @@ -0,0 +1,85 @@ +GRPC C++ STYLE GUIDE +===================== + +Background +---------- + +Here we document style rules for C++ usage in the gRPC C++ bindings +and tests. + +General +------- + +- The majority of gRPC's C++ requirements are drawn from the [Google C++ style +guide] (https://google.github.io/styleguide/cppguide.html) + - However, gRPC has some additional requirements to maintain + [portability] (#portability) +- As in C, layout rules are defined by clang-format, and all code +should be passed through clang-format. A (docker-based) script to do +so is included in [tools/distrib/clang\_format\_code.sh] +(../tools/distrib/clang_format_code.sh). + +<a name="portability"></a> +Portability Restrictions +------------------- + +gRPC supports a large number of compilers, ranging from those that are +missing many key C++11 features to those that have quite detailed +analysis. As a result, gRPC compiles with a high level of warnings and +treat all warnings as errors. gRPC also forbids the use of some common +C++11 constructs. Here are some guidelines, to be extended as needed: +- Do not use range-based for. Expressions of the form + ```c + for (auto& i: vec) { + // code + } + ``` + + are not allowed and should be replaced with code such as + ```c + for (auto it = vec.begin; it != vec.end(); it++) { + auto& i = *it; + // code + } + ``` + +- Do not use lambda of any kind (no capture, explicit capture, or +default capture). Other C++ functional features such as +`std::function` or `std::bind` are allowed +- Do not use brace-list initializers. +- Do not compare a pointer to `nullptr` . This is because gcc 4.4 + does not support `nullptr` directly and gRPC implements a subset of + its features in [include/grpc++/impl/codegen/config.h] + (../include/grpc++/impl/codegen/config.h). Instead, pointers should + be checked for validity using their implicit conversion to `bool`. + In other words, use `if (p)` rather than `if (p != nullptr)` +- Do not use `final` or `override` as these are not supported by some + compilers. Instead use `GRPC_FINAL` and `GRPC_OVERRIDE` . These + compile down to the traditional C++ forms for compilers that support + them but are just elided if the compiler does not support those features. +- In the [include] (../../../tree/master/include/grpc++) and [src] + (../../../tree/master/src/cpp) directory trees, you should also not + use certain STL objects like `std::mutex`, `std::lock_guard`, + `std::unique_lock`, `std::nullptr`, `std::thread` . Instead, use + `grpc::mutex`, `grpc::lock_guard`, etc., which are gRPC + implementations of the prominent features of these objects that are + not always available. You can use the `std` versions of those in [test] + (../../../tree/master/test/cpp) +- Similarly, in the same directories, do not use `std::chrono` unless + it is guarded by `#ifndef GRPC_CXX0X_NO_CHRONO` . For platforms that + lack`std::chrono,` there is a C-language timer called gpr_timespec that can + be used instead. +- `std::unique_ptr` must be used with extreme care in any kind of + collection. For example `vector<std::unique_ptr>` does not work in + gcc 4.4 if the vector is constructed to its full size at + initialization but does work if elements are added to the vector + using functions like `push_back`. `map` and other pair-based + collections do not work with `unique_ptr` under gcc 4.4. The issue + is that many of these collection implementations assume a copy + constructor + to be available. +- Don't use `std::this_thread` . Use `gpr_sleep_until` for sleeping a thread. +- [Some adjacent character combinations cause problems] + (https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C). If declaring a + template against some class relative to the global namespace, + `<::name` will be non-portable. Separate the `<` from the `:` and use `< ::name`. diff --git a/doc/statuscodes.md b/doc/statuscodes.md index 84258c8d12..c918f9ed9a 100644 --- a/doc/statuscodes.md +++ b/doc/statuscodes.md @@ -21,6 +21,8 @@ Only a subset of the pre-defined status codes are generated by the gRPC librarie | Flow-control protocol violation | INTERNAL | Both | | Error parsing returned status | UNKNOWN | Client | | Incorrect Auth metadata ( Credentials failed to get metadata, Incompatible credentials set on channel and call, Invalid host set in `:authority` metadata, etc.) | UNAUTHENTICATED | Both | +| Request cardinality violation (method requires exactly one request but client sent some other number of requests) | UNIMPLEMENTED | Server| +| Response cardinality violation (method requires exactly one response but server sent some other number of responses) | UNIMPLEMENTED | Client| | Error parsing response proto | INTERNAL | Client| | Error parsing request proto | INTERNAL | Server| diff --git a/gRPC.podspec b/gRPC.podspec index 1c49b5a0c4..ff8373637a 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -239,6 +239,7 @@ Pod::Spec.new do |s| 'src/core/lib/transport/static_metadata.h', 'src/core/lib/transport/transport.h', 'src/core/lib/transport/transport_impl.h', + 'src/core/ext/transport/chttp2/transport/bin_decoder.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', 'src/core/ext/transport/chttp2/transport/frame.h', @@ -432,6 +433,7 @@ Pod::Spec.new do |s| 'src/core/lib/transport/transport.c', 'src/core/lib/transport/transport_op_string.c', 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c', + 'src/core/ext/transport/chttp2/transport/bin_decoder.c', 'src/core/ext/transport/chttp2/transport/bin_encoder.c', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.c', 'src/core/ext/transport/chttp2/transport/chttp2_transport.c', @@ -617,6 +619,7 @@ Pod::Spec.new do |s| 'src/core/lib/transport/static_metadata.h', 'src/core/lib/transport/transport.h', 'src/core/lib/transport/transport_impl.h', + 'src/core/ext/transport/chttp2/transport/bin_decoder.h', 'src/core/ext/transport/chttp2/transport/bin_encoder.h', 'src/core/ext/transport/chttp2/transport/chttp2_transport.h', 'src/core/ext/transport/chttp2/transport/frame.h', diff --git a/grpc.gemspec b/grpc.gemspec index b3e076a7a3..184a548591 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -248,6 +248,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/transport/static_metadata.h ) s.files += %w( src/core/lib/transport/transport.h ) s.files += %w( src/core/lib/transport/transport_impl.h ) + s.files += %w( src/core/ext/transport/chttp2/transport/bin_decoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h ) s.files += %w( src/core/ext/transport/chttp2/transport/frame.h ) @@ -411,6 +412,7 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/transport/transport.c ) s.files += %w( src/core/lib/transport/transport_op_string.c ) s.files += %w( src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c ) + s.files += %w( src/core/ext/transport/chttp2/transport/bin_decoder.c ) s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.c ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_plugin.c ) s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.c ) diff --git a/include/grpc++/ext/proto_server_reflection_plugin.h b/include/grpc++/ext/proto_server_reflection_plugin.h new file mode 100644 index 0000000000..517c4737f5 --- /dev/null +++ b/include/grpc++/ext/proto_server_reflection_plugin.h @@ -0,0 +1,69 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H +#define GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H + +#include <grpc++/impl/server_builder_plugin.h> +#include <grpc++/support/config.h> + +namespace grpc { +class ServerInitializer; +class ProtoServerReflection; +} // namespace grpc + +namespace grpc { +namespace reflection { + +class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin { + public: + ProtoServerReflectionPlugin(); + ::grpc::string name() GRPC_OVERRIDE; + void InitServer(::grpc::ServerInitializer* si) GRPC_OVERRIDE; + void Finish(::grpc::ServerInitializer* si) GRPC_OVERRIDE; + void ChangeArguments(const ::grpc::string& name, void* value) GRPC_OVERRIDE; + bool has_async_methods() const GRPC_OVERRIDE; + bool has_sync_methods() const GRPC_OVERRIDE; + + private: + std::shared_ptr<::grpc::ProtoServerReflection> reflection_service_; +}; + +// Add proto reflection plugin to ServerBuilder. This function should be called +// at the static initialization time. +void InitProtoReflectionServerBuilderPlugin(); + +} // namespace reflection +} // namespace grpc + +#endif // GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H diff --git a/include/grpc++/ext/reflection.grpc.pb.h b/include/grpc++/ext/reflection.grpc.pb.h new file mode 100644 index 0000000000..0b4ef86147 --- /dev/null +++ b/include/grpc++/ext/reflection.grpc.pb.h @@ -0,0 +1,184 @@ +/* + * + * 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. + * + */ + + +// Generated by the gRPC protobuf plugin. +// If you make any local change, they will be lost. +// source: reflection.proto +// Original file comments: +// Copyright 2016, 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. +// +// Service exported by server reflection +// +#ifndef GRPC_reflection_2eproto__INCLUDED +#define GRPC_reflection_2eproto__INCLUDED + +#include <grpc++/ext/reflection.pb.h> + +#include <grpc++/impl/codegen/async_stream.h> +#include <grpc++/impl/codegen/async_unary_call.h> +#include <grpc++/impl/codegen/proto_utils.h> +#include <grpc++/impl/codegen/rpc_method.h> +#include <grpc++/impl/codegen/service_type.h> +#include <grpc++/impl/codegen/status.h> +#include <grpc++/impl/codegen/stub_options.h> +#include <grpc++/impl/codegen/sync_stream.h> + +namespace grpc { +class CompletionQueue; +class Channel; +class RpcService; +class ServerCompletionQueue; +class ServerContext; +} // namespace grpc + +namespace grpc { +namespace reflection { +namespace v1alpha { + +class ServerReflection GRPC_FINAL { + public: + class StubInterface { + public: + virtual ~StubInterface() {} + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) { + return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag)); + } + private: + virtual ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) = 0; + virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; + }; + class Stub GRPC_FINAL : public StubInterface { + public: + Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); + std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) { + return std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context)); + } + std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { + return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag)); + } + + private: + std::shared_ptr< ::grpc::ChannelInterface> channel_; + ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) GRPC_OVERRIDE; + ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) GRPC_OVERRIDE; + const ::grpc::RpcMethod rpcmethod_ServerReflectionInfo_; + }; + static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); + + class Service : public ::grpc::Service { + public: + Service(); + virtual ~Service(); + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + virtual ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream); + }; + template <class BaseClass> + class WithAsyncMethod_ServerReflectionInfo : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithAsyncMethod_ServerReflectionInfo() { + ::grpc::Service::MarkMethodAsync(0); + } + ~WithAsyncMethod_ServerReflectionInfo() GRPC_OVERRIDE { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + void RequestServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { + ::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); + } + }; + typedef WithAsyncMethod_ServerReflectionInfo<Service > AsyncService; + template <class BaseClass> + class WithGenericMethod_ServerReflectionInfo : public BaseClass { + private: + void BaseClassMustBeDerivedFromService(const Service *service) {} + public: + WithGenericMethod_ServerReflectionInfo() { + ::grpc::Service::MarkMethodGeneric(0); + } + ~WithGenericMethod_ServerReflectionInfo() GRPC_OVERRIDE { + BaseClassMustBeDerivedFromService(this); + } + // disable synchronous version of this method + ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE { + abort(); + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); + } + }; +}; + +} // namespace v1alpha +} // namespace reflection +} // namespace grpc + + +#endif // GRPC_reflection_2eproto__INCLUDED diff --git a/include/grpc++/ext/reflection.pb.h b/include/grpc++/ext/reflection.pb.h new file mode 100644 index 0000000000..00d07735ee --- /dev/null +++ b/include/grpc++/ext/reflection.pb.h @@ -0,0 +1,2035 @@ +/* + * + * 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. + * + */ + + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: reflection.proto + +#ifndef PROTOBUF_reflection_2eproto__INCLUDED +#define PROTOBUF_reflection_2eproto__INCLUDED + +#include <string> + +#include <google/protobuf/stubs/common.h> + +#if GOOGLE_PROTOBUF_VERSION < 3000000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include <google/protobuf/arena.h> +#include <google/protobuf/arenastring.h> +#include <google/protobuf/generated_message_util.h> +#include <google/protobuf/metadata.h> +#include <google/protobuf/message.h> +#include <google/protobuf/repeated_field.h> +#include <google/protobuf/extension_set.h> +#include <google/protobuf/unknown_field_set.h> +// @@protoc_insertion_point(includes) + +namespace grpc { +namespace reflection { +namespace v1alpha { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_reflection_2eproto(); +void protobuf_AssignDesc_reflection_2eproto(); +void protobuf_ShutdownFile_reflection_2eproto(); + +class ErrorResponse; +class ExtensionNumberResponse; +class ExtensionRequest; +class FileDescriptorResponse; +class ListServiceResponse; +class ServerReflectionRequest; +class ServerReflectionResponse; +class ServiceResponse; + +// =================================================================== + +class ServerReflectionRequest : public ::google::protobuf::Message { + public: + ServerReflectionRequest(); + virtual ~ServerReflectionRequest(); + + ServerReflectionRequest(const ServerReflectionRequest& from); + + inline ServerReflectionRequest& operator=(const ServerReflectionRequest& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ServerReflectionRequest& default_instance(); + + enum MessageRequestCase { + kFileByFilename = 3, + kFileContainingSymbol = 4, + kFileContainingExtension = 5, + kAllExtensionNumbersOfType = 6, + kListServices = 7, + MESSAGE_REQUEST_NOT_SET = 0, + }; + + void Swap(ServerReflectionRequest* other); + + // implements Message ---------------------------------------------- + + inline ServerReflectionRequest* New() const { return New(NULL); } + + ServerReflectionRequest* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ServerReflectionRequest& from); + void MergeFrom(const ServerReflectionRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ServerReflectionRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string host = 1; + void clear_host(); + static const int kHostFieldNumber = 1; + const ::std::string& host() const; + void set_host(const ::std::string& value); + void set_host(const char* value); + void set_host(const char* value, size_t size); + ::std::string* mutable_host(); + ::std::string* release_host(); + void set_allocated_host(::std::string* host); + + // optional string file_by_filename = 3; + private: + bool has_file_by_filename() const; + public: + void clear_file_by_filename(); + static const int kFileByFilenameFieldNumber = 3; + const ::std::string& file_by_filename() const; + void set_file_by_filename(const ::std::string& value); + void set_file_by_filename(const char* value); + void set_file_by_filename(const char* value, size_t size); + ::std::string* mutable_file_by_filename(); + ::std::string* release_file_by_filename(); + void set_allocated_file_by_filename(::std::string* file_by_filename); + + // optional string file_containing_symbol = 4; + private: + bool has_file_containing_symbol() const; + public: + void clear_file_containing_symbol(); + static const int kFileContainingSymbolFieldNumber = 4; + const ::std::string& file_containing_symbol() const; + void set_file_containing_symbol(const ::std::string& value); + void set_file_containing_symbol(const char* value); + void set_file_containing_symbol(const char* value, size_t size); + ::std::string* mutable_file_containing_symbol(); + ::std::string* release_file_containing_symbol(); + void set_allocated_file_containing_symbol(::std::string* file_containing_symbol); + + // optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; + bool has_file_containing_extension() const; + void clear_file_containing_extension(); + static const int kFileContainingExtensionFieldNumber = 5; + const ::grpc::reflection::v1alpha::ExtensionRequest& file_containing_extension() const; + ::grpc::reflection::v1alpha::ExtensionRequest* mutable_file_containing_extension(); + ::grpc::reflection::v1alpha::ExtensionRequest* release_file_containing_extension(); + void set_allocated_file_containing_extension(::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension); + + // optional string all_extension_numbers_of_type = 6; + private: + bool has_all_extension_numbers_of_type() const; + public: + void clear_all_extension_numbers_of_type(); + static const int kAllExtensionNumbersOfTypeFieldNumber = 6; + const ::std::string& all_extension_numbers_of_type() const; + void set_all_extension_numbers_of_type(const ::std::string& value); + void set_all_extension_numbers_of_type(const char* value); + void set_all_extension_numbers_of_type(const char* value, size_t size); + ::std::string* mutable_all_extension_numbers_of_type(); + ::std::string* release_all_extension_numbers_of_type(); + void set_allocated_all_extension_numbers_of_type(::std::string* all_extension_numbers_of_type); + + // optional string list_services = 7; + private: + bool has_list_services() const; + public: + void clear_list_services(); + static const int kListServicesFieldNumber = 7; + const ::std::string& list_services() const; + void set_list_services(const ::std::string& value); + void set_list_services(const char* value); + void set_list_services(const char* value, size_t size); + ::std::string* mutable_list_services(); + ::std::string* release_list_services(); + void set_allocated_list_services(::std::string* list_services); + + MessageRequestCase message_request_case() const; + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ServerReflectionRequest) + private: + inline void set_has_file_by_filename(); + inline void set_has_file_containing_symbol(); + inline void set_has_file_containing_extension(); + inline void set_has_all_extension_numbers_of_type(); + inline void set_has_list_services(); + + inline bool has_message_request() const; + void clear_message_request(); + inline void clear_has_message_request(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::internal::ArenaStringPtr host_; + union MessageRequestUnion { + MessageRequestUnion() {} + ::google::protobuf::internal::ArenaStringPtr file_by_filename_; + ::google::protobuf::internal::ArenaStringPtr file_containing_symbol_; + ::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension_; + ::google::protobuf::internal::ArenaStringPtr all_extension_numbers_of_type_; + ::google::protobuf::internal::ArenaStringPtr list_services_; + } message_request_; + mutable int _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ServerReflectionRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ExtensionRequest : public ::google::protobuf::Message { + public: + ExtensionRequest(); + virtual ~ExtensionRequest(); + + ExtensionRequest(const ExtensionRequest& from); + + inline ExtensionRequest& operator=(const ExtensionRequest& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ExtensionRequest& default_instance(); + + void Swap(ExtensionRequest* other); + + // implements Message ---------------------------------------------- + + inline ExtensionRequest* New() const { return New(NULL); } + + ExtensionRequest* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ExtensionRequest& from); + void MergeFrom(const ExtensionRequest& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ExtensionRequest* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string containing_type = 1; + void clear_containing_type(); + static const int kContainingTypeFieldNumber = 1; + const ::std::string& containing_type() const; + void set_containing_type(const ::std::string& value); + void set_containing_type(const char* value); + void set_containing_type(const char* value, size_t size); + ::std::string* mutable_containing_type(); + ::std::string* release_containing_type(); + void set_allocated_containing_type(::std::string* containing_type); + + // optional int32 extension_number = 2; + void clear_extension_number(); + static const int kExtensionNumberFieldNumber = 2; + ::google::protobuf::int32 extension_number() const; + void set_extension_number(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ExtensionRequest) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::internal::ArenaStringPtr containing_type_; + ::google::protobuf::int32 extension_number_; + mutable int _cached_size_; + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ExtensionRequest* default_instance_; +}; +// ------------------------------------------------------------------- + +class ServerReflectionResponse : public ::google::protobuf::Message { + public: + ServerReflectionResponse(); + virtual ~ServerReflectionResponse(); + + ServerReflectionResponse(const ServerReflectionResponse& from); + + inline ServerReflectionResponse& operator=(const ServerReflectionResponse& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ServerReflectionResponse& default_instance(); + + enum MessageResponseCase { + kFileDescriptorResponse = 4, + kAllExtensionNumbersResponse = 5, + kListServicesResponse = 6, + kErrorResponse = 7, + MESSAGE_RESPONSE_NOT_SET = 0, + }; + + void Swap(ServerReflectionResponse* other); + + // implements Message ---------------------------------------------- + + inline ServerReflectionResponse* New() const { return New(NULL); } + + ServerReflectionResponse* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ServerReflectionResponse& from); + void MergeFrom(const ServerReflectionResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ServerReflectionResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string valid_host = 1; + void clear_valid_host(); + static const int kValidHostFieldNumber = 1; + const ::std::string& valid_host() const; + void set_valid_host(const ::std::string& value); + void set_valid_host(const char* value); + void set_valid_host(const char* value, size_t size); + ::std::string* mutable_valid_host(); + ::std::string* release_valid_host(); + void set_allocated_valid_host(::std::string* valid_host); + + // optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; + bool has_original_request() const; + void clear_original_request(); + static const int kOriginalRequestFieldNumber = 2; + const ::grpc::reflection::v1alpha::ServerReflectionRequest& original_request() const; + ::grpc::reflection::v1alpha::ServerReflectionRequest* mutable_original_request(); + ::grpc::reflection::v1alpha::ServerReflectionRequest* release_original_request(); + void set_allocated_original_request(::grpc::reflection::v1alpha::ServerReflectionRequest* original_request); + + // optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; + bool has_file_descriptor_response() const; + void clear_file_descriptor_response(); + static const int kFileDescriptorResponseFieldNumber = 4; + const ::grpc::reflection::v1alpha::FileDescriptorResponse& file_descriptor_response() const; + ::grpc::reflection::v1alpha::FileDescriptorResponse* mutable_file_descriptor_response(); + ::grpc::reflection::v1alpha::FileDescriptorResponse* release_file_descriptor_response(); + void set_allocated_file_descriptor_response(::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response); + + // optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; + bool has_all_extension_numbers_response() const; + void clear_all_extension_numbers_response(); + static const int kAllExtensionNumbersResponseFieldNumber = 5; + const ::grpc::reflection::v1alpha::ExtensionNumberResponse& all_extension_numbers_response() const; + ::grpc::reflection::v1alpha::ExtensionNumberResponse* mutable_all_extension_numbers_response(); + ::grpc::reflection::v1alpha::ExtensionNumberResponse* release_all_extension_numbers_response(); + void set_allocated_all_extension_numbers_response(::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response); + + // optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; + bool has_list_services_response() const; + void clear_list_services_response(); + static const int kListServicesResponseFieldNumber = 6; + const ::grpc::reflection::v1alpha::ListServiceResponse& list_services_response() const; + ::grpc::reflection::v1alpha::ListServiceResponse* mutable_list_services_response(); + ::grpc::reflection::v1alpha::ListServiceResponse* release_list_services_response(); + void set_allocated_list_services_response(::grpc::reflection::v1alpha::ListServiceResponse* list_services_response); + + // optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; + bool has_error_response() const; + void clear_error_response(); + static const int kErrorResponseFieldNumber = 7; + const ::grpc::reflection::v1alpha::ErrorResponse& error_response() const; + ::grpc::reflection::v1alpha::ErrorResponse* mutable_error_response(); + ::grpc::reflection::v1alpha::ErrorResponse* release_error_response(); + void set_allocated_error_response(::grpc::reflection::v1alpha::ErrorResponse* error_response); + + MessageResponseCase message_response_case() const; + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ServerReflectionResponse) + private: + inline void set_has_file_descriptor_response(); + inline void set_has_all_extension_numbers_response(); + inline void set_has_list_services_response(); + inline void set_has_error_response(); + + inline bool has_message_response() const; + void clear_message_response(); + inline void clear_has_message_response(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::internal::ArenaStringPtr valid_host_; + ::grpc::reflection::v1alpha::ServerReflectionRequest* original_request_; + union MessageResponseUnion { + MessageResponseUnion() {} + ::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response_; + ::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response_; + ::grpc::reflection::v1alpha::ListServiceResponse* list_services_response_; + ::grpc::reflection::v1alpha::ErrorResponse* error_response_; + } message_response_; + mutable int _cached_size_; + ::google::protobuf::uint32 _oneof_case_[1]; + + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ServerReflectionResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class FileDescriptorResponse : public ::google::protobuf::Message { + public: + FileDescriptorResponse(); + virtual ~FileDescriptorResponse(); + + FileDescriptorResponse(const FileDescriptorResponse& from); + + inline FileDescriptorResponse& operator=(const FileDescriptorResponse& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FileDescriptorResponse& default_instance(); + + void Swap(FileDescriptorResponse* other); + + // implements Message ---------------------------------------------- + + inline FileDescriptorResponse* New() const { return New(NULL); } + + FileDescriptorResponse* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FileDescriptorResponse& from); + void MergeFrom(const FileDescriptorResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FileDescriptorResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated bytes file_descriptor_proto = 1; + int file_descriptor_proto_size() const; + void clear_file_descriptor_proto(); + static const int kFileDescriptorProtoFieldNumber = 1; + const ::std::string& file_descriptor_proto(int index) const; + ::std::string* mutable_file_descriptor_proto(int index); + void set_file_descriptor_proto(int index, const ::std::string& value); + void set_file_descriptor_proto(int index, const char* value); + void set_file_descriptor_proto(int index, const void* value, size_t size); + ::std::string* add_file_descriptor_proto(); + void add_file_descriptor_proto(const ::std::string& value); + void add_file_descriptor_proto(const char* value); + void add_file_descriptor_proto(const void* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& file_descriptor_proto() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_file_descriptor_proto(); + + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.FileDescriptorResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::RepeatedPtrField< ::std::string> file_descriptor_proto_; + mutable int _cached_size_; + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static FileDescriptorResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ExtensionNumberResponse : public ::google::protobuf::Message { + public: + ExtensionNumberResponse(); + virtual ~ExtensionNumberResponse(); + + ExtensionNumberResponse(const ExtensionNumberResponse& from); + + inline ExtensionNumberResponse& operator=(const ExtensionNumberResponse& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ExtensionNumberResponse& default_instance(); + + void Swap(ExtensionNumberResponse* other); + + // implements Message ---------------------------------------------- + + inline ExtensionNumberResponse* New() const { return New(NULL); } + + ExtensionNumberResponse* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ExtensionNumberResponse& from); + void MergeFrom(const ExtensionNumberResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ExtensionNumberResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string base_type_name = 1; + void clear_base_type_name(); + static const int kBaseTypeNameFieldNumber = 1; + const ::std::string& base_type_name() const; + void set_base_type_name(const ::std::string& value); + void set_base_type_name(const char* value); + void set_base_type_name(const char* value, size_t size); + ::std::string* mutable_base_type_name(); + ::std::string* release_base_type_name(); + void set_allocated_base_type_name(::std::string* base_type_name); + + // repeated int32 extension_number = 2; + int extension_number_size() const; + void clear_extension_number(); + static const int kExtensionNumberFieldNumber = 2; + ::google::protobuf::int32 extension_number(int index) const; + void set_extension_number(int index, ::google::protobuf::int32 value); + void add_extension_number(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + extension_number() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_extension_number(); + + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ExtensionNumberResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::internal::ArenaStringPtr base_type_name_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > extension_number_; + mutable int _extension_number_cached_byte_size_; + mutable int _cached_size_; + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ExtensionNumberResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ListServiceResponse : public ::google::protobuf::Message { + public: + ListServiceResponse(); + virtual ~ListServiceResponse(); + + ListServiceResponse(const ListServiceResponse& from); + + inline ListServiceResponse& operator=(const ListServiceResponse& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ListServiceResponse& default_instance(); + + void Swap(ListServiceResponse* other); + + // implements Message ---------------------------------------------- + + inline ListServiceResponse* New() const { return New(NULL); } + + ListServiceResponse* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ListServiceResponse& from); + void MergeFrom(const ListServiceResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ListServiceResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; + int service_size() const; + void clear_service(); + static const int kServiceFieldNumber = 1; + const ::grpc::reflection::v1alpha::ServiceResponse& service(int index) const; + ::grpc::reflection::v1alpha::ServiceResponse* mutable_service(int index); + ::grpc::reflection::v1alpha::ServiceResponse* add_service(); + ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >* + mutable_service(); + const ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >& + service() const; + + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ListServiceResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse > service_; + mutable int _cached_size_; + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ListServiceResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ServiceResponse : public ::google::protobuf::Message { + public: + ServiceResponse(); + virtual ~ServiceResponse(); + + ServiceResponse(const ServiceResponse& from); + + inline ServiceResponse& operator=(const ServiceResponse& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ServiceResponse& default_instance(); + + void Swap(ServiceResponse* other); + + // implements Message ---------------------------------------------- + + inline ServiceResponse* New() const { return New(NULL); } + + ServiceResponse* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ServiceResponse& from); + void MergeFrom(const ServiceResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ServiceResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ServiceResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::internal::ArenaStringPtr name_; + mutable int _cached_size_; + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ServiceResponse* default_instance_; +}; +// ------------------------------------------------------------------- + +class ErrorResponse : public ::google::protobuf::Message { + public: + ErrorResponse(); + virtual ~ErrorResponse(); + + ErrorResponse(const ErrorResponse& from); + + inline ErrorResponse& operator=(const ErrorResponse& from) { + CopyFrom(from); + return *this; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ErrorResponse& default_instance(); + + void Swap(ErrorResponse* other); + + // implements Message ---------------------------------------------- + + inline ErrorResponse* New() const { return New(NULL); } + + ErrorResponse* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ErrorResponse& from); + void MergeFrom(const ErrorResponse& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ErrorResponse* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 error_code = 1; + void clear_error_code(); + static const int kErrorCodeFieldNumber = 1; + ::google::protobuf::int32 error_code() const; + void set_error_code(::google::protobuf::int32 value); + + // optional string error_message = 2; + void clear_error_message(); + static const int kErrorMessageFieldNumber = 2; + const ::std::string& error_message() const; + void set_error_message(const ::std::string& value); + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + ::std::string* mutable_error_message(); + ::std::string* release_error_message(); + void set_allocated_error_message(::std::string* error_message); + + // @@protoc_insertion_point(class_scope:grpc.reflection.v1alpha.ErrorResponse) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + bool _is_default_instance_; + ::google::protobuf::internal::ArenaStringPtr error_message_; + ::google::protobuf::int32 error_code_; + mutable int _cached_size_; + friend void protobuf_AddDesc_reflection_2eproto(); + friend void protobuf_AssignDesc_reflection_2eproto(); + friend void protobuf_ShutdownFile_reflection_2eproto(); + + void InitAsDefaultInstance(); + static ErrorResponse* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// ServerReflectionRequest + +// optional string host = 1; +inline void ServerReflectionRequest::clear_host() { + host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ServerReflectionRequest::host() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.host) + return host_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServerReflectionRequest::set_host(const ::std::string& value) { + + host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} +inline void ServerReflectionRequest::set_host(const char* value) { + + host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} +inline void ServerReflectionRequest::set_host(const char* value, size_t size) { + + host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} +inline ::std::string* ServerReflectionRequest::mutable_host() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.host) + return host_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerReflectionRequest::release_host() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.host) + + return host_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServerReflectionRequest::set_allocated_host(::std::string* host) { + if (host != NULL) { + + } else { + + } + host_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} + +// optional string file_by_filename = 3; +inline bool ServerReflectionRequest::has_file_by_filename() const { + return message_request_case() == kFileByFilename; +} +inline void ServerReflectionRequest::set_has_file_by_filename() { + _oneof_case_[0] = kFileByFilename; +} +inline void ServerReflectionRequest::clear_file_by_filename() { + if (has_file_by_filename()) { + message_request_.file_by_filename_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} +inline const ::std::string& ServerReflectionRequest::file_by_filename() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + if (has_file_by_filename()) { + return message_request_.file_by_filename_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void ServerReflectionRequest::set_file_by_filename(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} +inline void ServerReflectionRequest::set_file_by_filename(const char* value) { + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} +inline void ServerReflectionRequest::set_file_by_filename(const char* value, size_t size) { + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} +inline ::std::string* ServerReflectionRequest::mutable_file_by_filename() { + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + return message_request_.file_by_filename_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerReflectionRequest::release_file_by_filename() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + if (has_file_by_filename()) { + clear_has_message_request(); + return message_request_.file_by_filename_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} +inline void ServerReflectionRequest::set_allocated_file_by_filename(::std::string* file_by_filename) { + if (!has_file_by_filename()) { + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (file_by_filename != NULL) { + set_has_file_by_filename(); + message_request_.file_by_filename_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + file_by_filename); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} + +// optional string file_containing_symbol = 4; +inline bool ServerReflectionRequest::has_file_containing_symbol() const { + return message_request_case() == kFileContainingSymbol; +} +inline void ServerReflectionRequest::set_has_file_containing_symbol() { + _oneof_case_[0] = kFileContainingSymbol; +} +inline void ServerReflectionRequest::clear_file_containing_symbol() { + if (has_file_containing_symbol()) { + message_request_.file_containing_symbol_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} +inline const ::std::string& ServerReflectionRequest::file_containing_symbol() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + if (has_file_containing_symbol()) { + return message_request_.file_containing_symbol_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void ServerReflectionRequest::set_file_containing_symbol(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} +inline void ServerReflectionRequest::set_file_containing_symbol(const char* value) { + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} +inline void ServerReflectionRequest::set_file_containing_symbol(const char* value, size_t size) { + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} +inline ::std::string* ServerReflectionRequest::mutable_file_containing_symbol() { + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + return message_request_.file_containing_symbol_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerReflectionRequest::release_file_containing_symbol() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + if (has_file_containing_symbol()) { + clear_has_message_request(); + return message_request_.file_containing_symbol_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} +inline void ServerReflectionRequest::set_allocated_file_containing_symbol(::std::string* file_containing_symbol) { + if (!has_file_containing_symbol()) { + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (file_containing_symbol != NULL) { + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + file_containing_symbol); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} + +// optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; +inline bool ServerReflectionRequest::has_file_containing_extension() const { + return message_request_case() == kFileContainingExtension; +} +inline void ServerReflectionRequest::set_has_file_containing_extension() { + _oneof_case_[0] = kFileContainingExtension; +} +inline void ServerReflectionRequest::clear_file_containing_extension() { + if (has_file_containing_extension()) { + delete message_request_.file_containing_extension_; + clear_has_message_request(); + } +} +inline const ::grpc::reflection::v1alpha::ExtensionRequest& ServerReflectionRequest::file_containing_extension() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) + return has_file_containing_extension() + ? *message_request_.file_containing_extension_ + : ::grpc::reflection::v1alpha::ExtensionRequest::default_instance(); +} +inline ::grpc::reflection::v1alpha::ExtensionRequest* ServerReflectionRequest::mutable_file_containing_extension() { + if (!has_file_containing_extension()) { + clear_message_request(); + set_has_file_containing_extension(); + message_request_.file_containing_extension_ = new ::grpc::reflection::v1alpha::ExtensionRequest; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) + return message_request_.file_containing_extension_; +} +inline ::grpc::reflection::v1alpha::ExtensionRequest* ServerReflectionRequest::release_file_containing_extension() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) + if (has_file_containing_extension()) { + clear_has_message_request(); + ::grpc::reflection::v1alpha::ExtensionRequest* temp = message_request_.file_containing_extension_; + message_request_.file_containing_extension_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void ServerReflectionRequest::set_allocated_file_containing_extension(::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension) { + clear_message_request(); + if (file_containing_extension) { + set_has_file_containing_extension(); + message_request_.file_containing_extension_ = file_containing_extension; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) +} + +// optional string all_extension_numbers_of_type = 6; +inline bool ServerReflectionRequest::has_all_extension_numbers_of_type() const { + return message_request_case() == kAllExtensionNumbersOfType; +} +inline void ServerReflectionRequest::set_has_all_extension_numbers_of_type() { + _oneof_case_[0] = kAllExtensionNumbersOfType; +} +inline void ServerReflectionRequest::clear_all_extension_numbers_of_type() { + if (has_all_extension_numbers_of_type()) { + message_request_.all_extension_numbers_of_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} +inline const ::std::string& ServerReflectionRequest::all_extension_numbers_of_type() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + if (has_all_extension_numbers_of_type()) { + return message_request_.all_extension_numbers_of_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void ServerReflectionRequest::set_all_extension_numbers_of_type(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} +inline void ServerReflectionRequest::set_all_extension_numbers_of_type(const char* value) { + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} +inline void ServerReflectionRequest::set_all_extension_numbers_of_type(const char* value, size_t size) { + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} +inline ::std::string* ServerReflectionRequest::mutable_all_extension_numbers_of_type() { + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + return message_request_.all_extension_numbers_of_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerReflectionRequest::release_all_extension_numbers_of_type() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + if (has_all_extension_numbers_of_type()) { + clear_has_message_request(); + return message_request_.all_extension_numbers_of_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} +inline void ServerReflectionRequest::set_allocated_all_extension_numbers_of_type(::std::string* all_extension_numbers_of_type) { + if (!has_all_extension_numbers_of_type()) { + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (all_extension_numbers_of_type != NULL) { + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + all_extension_numbers_of_type); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} + +// optional string list_services = 7; +inline bool ServerReflectionRequest::has_list_services() const { + return message_request_case() == kListServices; +} +inline void ServerReflectionRequest::set_has_list_services() { + _oneof_case_[0] = kListServices; +} +inline void ServerReflectionRequest::clear_list_services() { + if (has_list_services()) { + message_request_.list_services_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} +inline const ::std::string& ServerReflectionRequest::list_services() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + if (has_list_services()) { + return message_request_.list_services_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} +inline void ServerReflectionRequest::set_list_services(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} +inline void ServerReflectionRequest::set_list_services(const char* value) { + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} +inline void ServerReflectionRequest::set_list_services(const char* value, size_t size) { + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} +inline ::std::string* ServerReflectionRequest::mutable_list_services() { + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + return message_request_.list_services_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerReflectionRequest::release_list_services() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + if (has_list_services()) { + clear_has_message_request(); + return message_request_.list_services_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} +inline void ServerReflectionRequest::set_allocated_list_services(::std::string* list_services) { + if (!has_list_services()) { + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (list_services != NULL) { + set_has_list_services(); + message_request_.list_services_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + list_services); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} + +inline bool ServerReflectionRequest::has_message_request() const { + return message_request_case() != MESSAGE_REQUEST_NOT_SET; +} +inline void ServerReflectionRequest::clear_has_message_request() { + _oneof_case_[0] = MESSAGE_REQUEST_NOT_SET; +} +inline ServerReflectionRequest::MessageRequestCase ServerReflectionRequest::message_request_case() const { + return ServerReflectionRequest::MessageRequestCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// ExtensionRequest + +// optional string containing_type = 1; +inline void ExtensionRequest::clear_containing_type() { + containing_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ExtensionRequest::containing_type() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionRequest.containing_type) + return containing_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExtensionRequest::set_containing_type(const ::std::string& value) { + + containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} +inline void ExtensionRequest::set_containing_type(const char* value) { + + containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} +inline void ExtensionRequest::set_containing_type(const char* value, size_t size) { + + containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} +inline ::std::string* ExtensionRequest::mutable_containing_type() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ExtensionRequest.containing_type) + return containing_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ExtensionRequest::release_containing_type() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ExtensionRequest.containing_type) + + return containing_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExtensionRequest::set_allocated_containing_type(::std::string* containing_type) { + if (containing_type != NULL) { + + } else { + + } + containing_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), containing_type); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} + +// optional int32 extension_number = 2; +inline void ExtensionRequest::clear_extension_number() { + extension_number_ = 0; +} +inline ::google::protobuf::int32 ExtensionRequest::extension_number() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionRequest.extension_number) + return extension_number_; +} +inline void ExtensionRequest::set_extension_number(::google::protobuf::int32 value) { + + extension_number_ = value; + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionRequest.extension_number) +} + +// ------------------------------------------------------------------- + +// ServerReflectionResponse + +// optional string valid_host = 1; +inline void ServerReflectionResponse::clear_valid_host() { + valid_host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ServerReflectionResponse::valid_host() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) + return valid_host_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServerReflectionResponse::set_valid_host(const ::std::string& value) { + + valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} +inline void ServerReflectionResponse::set_valid_host(const char* value) { + + valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} +inline void ServerReflectionResponse::set_valid_host(const char* value, size_t size) { + + valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} +inline ::std::string* ServerReflectionResponse::mutable_valid_host() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) + return valid_host_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServerReflectionResponse::release_valid_host() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) + + return valid_host_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServerReflectionResponse::set_allocated_valid_host(::std::string* valid_host) { + if (valid_host != NULL) { + + } else { + + } + valid_host_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), valid_host); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} + +// optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; +inline bool ServerReflectionResponse::has_original_request() const { + return !_is_default_instance_ && original_request_ != NULL; +} +inline void ServerReflectionResponse::clear_original_request() { + if (GetArenaNoVirtual() == NULL && original_request_ != NULL) delete original_request_; + original_request_ = NULL; +} +inline const ::grpc::reflection::v1alpha::ServerReflectionRequest& ServerReflectionResponse::original_request() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) + return original_request_ != NULL ? *original_request_ : *default_instance_->original_request_; +} +inline ::grpc::reflection::v1alpha::ServerReflectionRequest* ServerReflectionResponse::mutable_original_request() { + + if (original_request_ == NULL) { + original_request_ = new ::grpc::reflection::v1alpha::ServerReflectionRequest; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) + return original_request_; +} +inline ::grpc::reflection::v1alpha::ServerReflectionRequest* ServerReflectionResponse::release_original_request() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) + + ::grpc::reflection::v1alpha::ServerReflectionRequest* temp = original_request_; + original_request_ = NULL; + return temp; +} +inline void ServerReflectionResponse::set_allocated_original_request(::grpc::reflection::v1alpha::ServerReflectionRequest* original_request) { + delete original_request_; + original_request_ = original_request; + if (original_request) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) +} + +// optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; +inline bool ServerReflectionResponse::has_file_descriptor_response() const { + return message_response_case() == kFileDescriptorResponse; +} +inline void ServerReflectionResponse::set_has_file_descriptor_response() { + _oneof_case_[0] = kFileDescriptorResponse; +} +inline void ServerReflectionResponse::clear_file_descriptor_response() { + if (has_file_descriptor_response()) { + delete message_response_.file_descriptor_response_; + clear_has_message_response(); + } +} +inline const ::grpc::reflection::v1alpha::FileDescriptorResponse& ServerReflectionResponse::file_descriptor_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) + return has_file_descriptor_response() + ? *message_response_.file_descriptor_response_ + : ::grpc::reflection::v1alpha::FileDescriptorResponse::default_instance(); +} +inline ::grpc::reflection::v1alpha::FileDescriptorResponse* ServerReflectionResponse::mutable_file_descriptor_response() { + if (!has_file_descriptor_response()) { + clear_message_response(); + set_has_file_descriptor_response(); + message_response_.file_descriptor_response_ = new ::grpc::reflection::v1alpha::FileDescriptorResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) + return message_response_.file_descriptor_response_; +} +inline ::grpc::reflection::v1alpha::FileDescriptorResponse* ServerReflectionResponse::release_file_descriptor_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) + if (has_file_descriptor_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::FileDescriptorResponse* temp = message_response_.file_descriptor_response_; + message_response_.file_descriptor_response_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void ServerReflectionResponse::set_allocated_file_descriptor_response(::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response) { + clear_message_response(); + if (file_descriptor_response) { + set_has_file_descriptor_response(); + message_response_.file_descriptor_response_ = file_descriptor_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) +} + +// optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; +inline bool ServerReflectionResponse::has_all_extension_numbers_response() const { + return message_response_case() == kAllExtensionNumbersResponse; +} +inline void ServerReflectionResponse::set_has_all_extension_numbers_response() { + _oneof_case_[0] = kAllExtensionNumbersResponse; +} +inline void ServerReflectionResponse::clear_all_extension_numbers_response() { + if (has_all_extension_numbers_response()) { + delete message_response_.all_extension_numbers_response_; + clear_has_message_response(); + } +} +inline const ::grpc::reflection::v1alpha::ExtensionNumberResponse& ServerReflectionResponse::all_extension_numbers_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) + return has_all_extension_numbers_response() + ? *message_response_.all_extension_numbers_response_ + : ::grpc::reflection::v1alpha::ExtensionNumberResponse::default_instance(); +} +inline ::grpc::reflection::v1alpha::ExtensionNumberResponse* ServerReflectionResponse::mutable_all_extension_numbers_response() { + if (!has_all_extension_numbers_response()) { + clear_message_response(); + set_has_all_extension_numbers_response(); + message_response_.all_extension_numbers_response_ = new ::grpc::reflection::v1alpha::ExtensionNumberResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) + return message_response_.all_extension_numbers_response_; +} +inline ::grpc::reflection::v1alpha::ExtensionNumberResponse* ServerReflectionResponse::release_all_extension_numbers_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) + if (has_all_extension_numbers_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::ExtensionNumberResponse* temp = message_response_.all_extension_numbers_response_; + message_response_.all_extension_numbers_response_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void ServerReflectionResponse::set_allocated_all_extension_numbers_response(::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response) { + clear_message_response(); + if (all_extension_numbers_response) { + set_has_all_extension_numbers_response(); + message_response_.all_extension_numbers_response_ = all_extension_numbers_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) +} + +// optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; +inline bool ServerReflectionResponse::has_list_services_response() const { + return message_response_case() == kListServicesResponse; +} +inline void ServerReflectionResponse::set_has_list_services_response() { + _oneof_case_[0] = kListServicesResponse; +} +inline void ServerReflectionResponse::clear_list_services_response() { + if (has_list_services_response()) { + delete message_response_.list_services_response_; + clear_has_message_response(); + } +} +inline const ::grpc::reflection::v1alpha::ListServiceResponse& ServerReflectionResponse::list_services_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) + return has_list_services_response() + ? *message_response_.list_services_response_ + : ::grpc::reflection::v1alpha::ListServiceResponse::default_instance(); +} +inline ::grpc::reflection::v1alpha::ListServiceResponse* ServerReflectionResponse::mutable_list_services_response() { + if (!has_list_services_response()) { + clear_message_response(); + set_has_list_services_response(); + message_response_.list_services_response_ = new ::grpc::reflection::v1alpha::ListServiceResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) + return message_response_.list_services_response_; +} +inline ::grpc::reflection::v1alpha::ListServiceResponse* ServerReflectionResponse::release_list_services_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) + if (has_list_services_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::ListServiceResponse* temp = message_response_.list_services_response_; + message_response_.list_services_response_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void ServerReflectionResponse::set_allocated_list_services_response(::grpc::reflection::v1alpha::ListServiceResponse* list_services_response) { + clear_message_response(); + if (list_services_response) { + set_has_list_services_response(); + message_response_.list_services_response_ = list_services_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) +} + +// optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; +inline bool ServerReflectionResponse::has_error_response() const { + return message_response_case() == kErrorResponse; +} +inline void ServerReflectionResponse::set_has_error_response() { + _oneof_case_[0] = kErrorResponse; +} +inline void ServerReflectionResponse::clear_error_response() { + if (has_error_response()) { + delete message_response_.error_response_; + clear_has_message_response(); + } +} +inline const ::grpc::reflection::v1alpha::ErrorResponse& ServerReflectionResponse::error_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) + return has_error_response() + ? *message_response_.error_response_ + : ::grpc::reflection::v1alpha::ErrorResponse::default_instance(); +} +inline ::grpc::reflection::v1alpha::ErrorResponse* ServerReflectionResponse::mutable_error_response() { + if (!has_error_response()) { + clear_message_response(); + set_has_error_response(); + message_response_.error_response_ = new ::grpc::reflection::v1alpha::ErrorResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) + return message_response_.error_response_; +} +inline ::grpc::reflection::v1alpha::ErrorResponse* ServerReflectionResponse::release_error_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) + if (has_error_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::ErrorResponse* temp = message_response_.error_response_; + message_response_.error_response_ = NULL; + return temp; + } else { + return NULL; + } +} +inline void ServerReflectionResponse::set_allocated_error_response(::grpc::reflection::v1alpha::ErrorResponse* error_response) { + clear_message_response(); + if (error_response) { + set_has_error_response(); + message_response_.error_response_ = error_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) +} + +inline bool ServerReflectionResponse::has_message_response() const { + return message_response_case() != MESSAGE_RESPONSE_NOT_SET; +} +inline void ServerReflectionResponse::clear_has_message_response() { + _oneof_case_[0] = MESSAGE_RESPONSE_NOT_SET; +} +inline ServerReflectionResponse::MessageResponseCase ServerReflectionResponse::message_response_case() const { + return ServerReflectionResponse::MessageResponseCase(_oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// FileDescriptorResponse + +// repeated bytes file_descriptor_proto = 1; +inline int FileDescriptorResponse::file_descriptor_proto_size() const { + return file_descriptor_proto_.size(); +} +inline void FileDescriptorResponse::clear_file_descriptor_proto() { + file_descriptor_proto_.Clear(); +} +inline const ::std::string& FileDescriptorResponse::file_descriptor_proto(int index) const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_.Get(index); +} +inline ::std::string* FileDescriptorResponse::mutable_file_descriptor_proto(int index) { + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_.Mutable(index); +} +inline void FileDescriptorResponse::set_file_descriptor_proto(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + file_descriptor_proto_.Mutable(index)->assign(value); +} +inline void FileDescriptorResponse::set_file_descriptor_proto(int index, const char* value) { + file_descriptor_proto_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} +inline void FileDescriptorResponse::set_file_descriptor_proto(int index, const void* value, size_t size) { + file_descriptor_proto_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} +inline ::std::string* FileDescriptorResponse::add_file_descriptor_proto() { + // @@protoc_insertion_point(field_add_mutable:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_.Add(); +} +inline void FileDescriptorResponse::add_file_descriptor_proto(const ::std::string& value) { + file_descriptor_proto_.Add()->assign(value); + // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} +inline void FileDescriptorResponse::add_file_descriptor_proto(const char* value) { + file_descriptor_proto_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} +inline void FileDescriptorResponse::add_file_descriptor_proto(const void* value, size_t size) { + file_descriptor_proto_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +FileDescriptorResponse::file_descriptor_proto() const { + // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +FileDescriptorResponse::mutable_file_descriptor_proto() { + // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return &file_descriptor_proto_; +} + +// ------------------------------------------------------------------- + +// ExtensionNumberResponse + +// optional string base_type_name = 1; +inline void ExtensionNumberResponse::clear_base_type_name() { + base_type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ExtensionNumberResponse::base_type_name() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) + return base_type_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExtensionNumberResponse::set_base_type_name(const ::std::string& value) { + + base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} +inline void ExtensionNumberResponse::set_base_type_name(const char* value) { + + base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} +inline void ExtensionNumberResponse::set_base_type_name(const char* value, size_t size) { + + base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} +inline ::std::string* ExtensionNumberResponse::mutable_base_type_name() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) + return base_type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ExtensionNumberResponse::release_base_type_name() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) + + return base_type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ExtensionNumberResponse::set_allocated_base_type_name(::std::string* base_type_name) { + if (base_type_name != NULL) { + + } else { + + } + base_type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), base_type_name); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} + +// repeated int32 extension_number = 2; +inline int ExtensionNumberResponse::extension_number_size() const { + return extension_number_.size(); +} +inline void ExtensionNumberResponse::clear_extension_number() { + extension_number_.Clear(); +} +inline ::google::protobuf::int32 ExtensionNumberResponse::extension_number(int index) const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) + return extension_number_.Get(index); +} +inline void ExtensionNumberResponse::set_extension_number(int index, ::google::protobuf::int32 value) { + extension_number_.Set(index, value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) +} +inline void ExtensionNumberResponse::add_extension_number(::google::protobuf::int32 value) { + extension_number_.Add(value); + // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +ExtensionNumberResponse::extension_number() const { + // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) + return extension_number_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +ExtensionNumberResponse::mutable_extension_number() { + // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) + return &extension_number_; +} + +// ------------------------------------------------------------------- + +// ListServiceResponse + +// repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; +inline int ListServiceResponse::service_size() const { + return service_.size(); +} +inline void ListServiceResponse::clear_service() { + service_.Clear(); +} +inline const ::grpc::reflection::v1alpha::ServiceResponse& ListServiceResponse::service(int index) const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_.Get(index); +} +inline ::grpc::reflection::v1alpha::ServiceResponse* ListServiceResponse::mutable_service(int index) { + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_.Mutable(index); +} +inline ::grpc::reflection::v1alpha::ServiceResponse* ListServiceResponse::add_service() { + // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >* +ListServiceResponse::mutable_service() { + // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.ListServiceResponse.service) + return &service_; +} +inline const ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >& +ListServiceResponse::service() const { + // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_; +} + +// ------------------------------------------------------------------- + +// ServiceResponse + +// optional string name = 1; +inline void ServiceResponse::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ServiceResponse::name() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServiceResponse.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServiceResponse::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServiceResponse.name) +} +inline void ServiceResponse::set_name(const char* value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServiceResponse.name) +} +inline void ServiceResponse::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServiceResponse.name) +} +inline ::std::string* ServiceResponse::mutable_name() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServiceResponse.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServiceResponse::release_name() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServiceResponse.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServiceResponse::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServiceResponse.name) +} + +// ------------------------------------------------------------------- + +// ErrorResponse + +// optional int32 error_code = 1; +inline void ErrorResponse::clear_error_code() { + error_code_ = 0; +} +inline ::google::protobuf::int32 ErrorResponse::error_code() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ErrorResponse.error_code) + return error_code_; +} +inline void ErrorResponse::set_error_code(::google::protobuf::int32 value) { + + error_code_ = value; + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ErrorResponse.error_code) +} + +// optional string error_message = 2; +inline void ErrorResponse::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline const ::std::string& ErrorResponse::error_message() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ErrorResponse.error_message) + return error_message_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ErrorResponse::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ErrorResponse.error_message) +} +inline void ErrorResponse::set_error_message(const char* value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ErrorResponse.error_message) +} +inline void ErrorResponse::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ErrorResponse.error_message) +} +inline ::std::string* ErrorResponse::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ErrorResponse.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ErrorResponse::release_error_message() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ErrorResponse.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ErrorResponse::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ErrorResponse.error_message) +} + +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace v1alpha +} // namespace reflection +} // namespace grpc + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_reflection_2eproto__INCLUDED diff --git a/include/grpc++/impl/codegen/config_protobuf.h b/include/grpc++/impl/codegen/config_protobuf.h index f1b6beaca7..4bee1bc422 100644 --- a/include/grpc++/impl/codegen/config_protobuf.h +++ b/include/grpc++/impl/codegen/config_protobuf.h @@ -44,6 +44,19 @@ #define GRPC_CUSTOM_MESSAGE ::google::protobuf::Message #endif +#ifndef GRPC_CUSTOM_DESCRIPTOR +#include <google/protobuf/descriptor.h> +#include <google/protobuf/descriptor.pb.h> +#define GRPC_CUSTOM_DESCRIPTOR ::google::protobuf::Descriptor +#define GRPC_CUSTOM_DESCRIPTORPOOL ::google::protobuf::DescriptorPool +#define GPRC_CUSTOM_FIELDDESCRIPTOR ::google::protobuf::FieldDescriptor +#define GRPC_CUSTOM_FILEDESCRIPTOR ::google::protobuf::FileDescriptor +#define GRPC_CUSTOM_FILEDESCRIPTORPROTO ::google::protobuf::FileDescriptorProto +#define GRPC_CUSTOM_METHODDESCRIPTOR ::google::protobuf::MethodDescriptor +#define GRPC_CUSTOM_SERVICEDESCRIPTOR ::google::protobuf::ServiceDescriptor +#define GRPC_CUSTOM_SOURCELOCATION ::google::protobuf::SourceLocation +#endif + #ifndef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/io/zero_copy_stream.h> @@ -60,6 +73,15 @@ namespace protobuf { typedef GRPC_CUSTOM_MESSAGE Message; typedef GRPC_CUSTOM_PROTOBUF_INT64 int64; +typedef GRPC_CUSTOM_DESCRIPTOR Descriptor; +typedef GRPC_CUSTOM_DESCRIPTORPOOL DescriptorPool; +typedef GPRC_CUSTOM_FIELDDESCRIPTOR FieldDescriptor; +typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor; +typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto; +typedef GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor; +typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor; +typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation; + namespace io { typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream; diff --git a/include/grpc++/impl/codegen/server_interface.h b/include/grpc++/impl/codegen/server_interface.h index 7b7d5aa90b..3a3e052d9e 100644 --- a/include/grpc++/impl/codegen/server_interface.h +++ b/include/grpc++/impl/codegen/server_interface.h @@ -62,6 +62,10 @@ class ServerInterface : public CallHook { /// Shutdown the server, blocking until all rpc processing finishes. /// Forcefully terminate pending calls after \a deadline expires. /// + /// All completion queue associated with the server (for example, for async + /// serving) must be shutdown *after* this method has returned: + /// See \a ServerBuilder::AddCompletionQueue for details. + /// /// \param deadline How long to wait until pending rpcs are forcefully /// terminated. template <class T> @@ -70,6 +74,10 @@ class ServerInterface : public CallHook { } /// Shutdown the server, waiting for all rpc processing to finish. + /// + /// All completion queue associated with the server (for example, for async + /// serving) must be shutdown *after* this method has returned: + /// See \a ServerBuilder::AddCompletionQueue for details. void Shutdown() { ShutdownInternal(gpr_inf_future(GPR_CLOCK_MONOTONIC)); } /// Block waiting for all work to complete. diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 54f01d11b5..aa7588d34d 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -119,9 +119,20 @@ class ServerBuilder { std::shared_ptr<ServerCredentials> creds, int* selected_port = nullptr); - /// Add a completion queue for handling asynchronous services - /// Caller is required to keep this completion queue live until - /// the server is destroyed. + /// Add a completion queue for handling asynchronous services. + /// + /// Caller is required to shutdown the server prior to shutting down the + /// returned completion queue. A typical usage scenario: + /// + /// // While building the server: + /// ServerBuilder builder; + /// ... + /// cq_ = builder.AddCompletionQueue(); + /// server_ = builder.BuildAndStart(); + /// + /// // While shutting down the server; + /// server_->Shutdown(); + /// cq_->Shutdown(); // Always *after* the associated server's Shutdown()! /// /// \param is_frequently_polled This is an optional parameter to inform GRPC /// library about whether this completion queue would be frequently polled diff --git a/include/grpc/impl/codegen/log.h b/include/grpc/impl/codegen/log.h index aa86fc4c17..e5010c29da 100644 --- a/include/grpc/impl/codegen/log.h +++ b/include/grpc/impl/codegen/log.h @@ -34,6 +34,7 @@ #ifndef GRPC_IMPL_CODEGEN_LOG_H #define GRPC_IMPL_CODEGEN_LOG_H +#include <inttypes.h> #include <stdarg.h> #include <stdlib.h> /* for abort() */ @@ -74,7 +75,7 @@ const char *gpr_log_severity_string(gpr_log_severity severity); /* Log a message. It's advised to use GPR_xxx above to generate the context * for each message */ GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, - const char *format, ...); + const char *format, ...) GPRC_PRINT_FORMAT_CHECK(4, 5); GPRAPI void gpr_log_message(const char *file, int line, gpr_log_severity severity, const char *message); diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 7fff36cb78..9640ab6008 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -434,6 +434,15 @@ typedef unsigned __int64 uint64_t; #endif #endif +#ifndef GPRC_PRINT_FORMAT_CHECK +#ifdef __GNUC__ +#define GPRC_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) \ + __attribute__((format(printf, FORMAT_STR, ARGS))) +#else +#define GPRC_PRINT_FORMAT_CHECK(FORMAT_STR, ARGS) +#endif +#endif /* GPRC_PRINT_FORMAT_CHECK */ + #if GPR_FORBID_UNREACHABLE_CODE #define GPR_UNREACHABLE_CODE(STATEMENT) #else diff --git a/include/grpc/support/string_util.h b/include/grpc/support/string_util.h index f981bc0db0..952cbfc26b 100644 --- a/include/grpc/support/string_util.h +++ b/include/grpc/support/string_util.h @@ -54,7 +54,8 @@ GPRAPI char *gpr_strdup(const char *src); On error, returns -1 and sets *strp to NULL. If the format string is bad, the result is undefined. */ -GPRAPI int gpr_asprintf(char **strp, const char *format, ...); +GPRAPI int gpr_asprintf(char **strp, const char *format, ...) + GPRC_PRINT_FORMAT_CHECK(2, 3); #ifdef __cplusplus } diff --git a/package.xml b/package.xml index 415bfe8fb3..5e4b5b216f 100644 --- a/package.xml +++ b/package.xml @@ -255,6 +255,7 @@ <file baseinstalldir="/" name="src/core/lib/transport/static_metadata.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/transport/transport.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/transport/transport_impl.h" role="src" /> + <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_decoder.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_encoder.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/chttp2_transport.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/frame.h" role="src" /> @@ -418,6 +419,7 @@ <file baseinstalldir="/" name="src/core/lib/transport/transport.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/transport/transport_op_string.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c" role="src" /> + <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_decoder.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/bin_encoder.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/chttp2_plugin.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/chttp2_transport.c" role="src" /> diff --git a/src/compiler/config.h b/src/compiler/config.h index f2abb85186..1cbd842f0a 100644 --- a/src/compiler/config.h +++ b/src/compiler/config.h @@ -36,17 +36,6 @@ #include <grpc++/impl/codegen/config_protobuf.h> -#ifndef GRPC_CUSTOM_DESCRIPTOR -#include <google/protobuf/descriptor.h> -#include <google/protobuf/descriptor.pb.h> -#define GRPC_CUSTOM_DESCRIPTOR ::google::protobuf::Descriptor -#define GRPC_CUSTOM_FILEDESCRIPTOR ::google::protobuf::FileDescriptor -#define GRPC_CUSTOM_FILEDESCRIPTORPROTO ::google::protobuf::FileDescriptorProto -#define GRPC_CUSTOM_METHODDESCRIPTOR ::google::protobuf::MethodDescriptor -#define GRPC_CUSTOM_SERVICEDESCRIPTOR ::google::protobuf::ServiceDescriptor -#define GRPC_CUSTOM_SOURCELOCATION ::google::protobuf::SourceLocation -#endif - #ifndef GRPC_CUSTOM_CODEGENERATOR #include <google/protobuf/compiler/code_generator.h> #define GRPC_CUSTOM_CODEGENERATOR ::google::protobuf::compiler::CodeGenerator @@ -84,12 +73,7 @@ namespace grpc { typedef GRPC_CUSTOM_STRING string; namespace protobuf { -typedef GRPC_CUSTOM_DESCRIPTOR Descriptor; -typedef GRPC_CUSTOM_FILEDESCRIPTOR FileDescriptor; -typedef GRPC_CUSTOM_FILEDESCRIPTORPROTO FileDescriptorProto; -typedef GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor; -typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor; -typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation; + namespace compiler { typedef GRPC_CUSTOM_CODEGENERATOR CodeGenerator; typedef GRPC_CUSTOM_GENERATORCONTEXT GeneratorContext; diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index cd5ddd8832..15cda474cc 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -342,7 +342,7 @@ bool PrintBetaServerFactory(const grpc::string& package_qualified_service_name, out->Print("}\n"); out->Print("method_implementations = {\n"); for (auto name_and_implementation_constructor = - method_implementation_constructors.begin(); + method_implementation_constructors.begin(); name_and_implementation_constructor != method_implementation_constructors.end(); name_and_implementation_constructor++) { @@ -457,8 +457,149 @@ bool PrintBetaStubFactory(const grpc::string& package_qualified_service_name, return true; } +bool PrintStub(const grpc::string& package_qualified_service_name, + const ServiceDescriptor* service, Printer* out) { + out->Print("\n\n"); + out->Print("class $Service$Stub(object):\n", "Service", service->name()); + { + IndentScope raii_class_indent(out); + PrintAllComments(service, out); + out->Print("\n"); + out->Print("def __init__(self, channel):\n"); + { + IndentScope raii_init_indent(out); + out->Print("\"\"\"Constructor.\n"); + out->Print("\n"); + out->Print("Args:\n"); + { + IndentScope raii_args_indent(out); + out->Print("channel: A grpc.Channel.\n"); + } + out->Print("\"\"\"\n"); + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); + auto multi_callable_constructor = + grpc::string(method->client_streaming() ? "stream" : "unary") + + "_" + + grpc::string(method->server_streaming() ? "stream" : "unary"); + grpc::string request_module_and_class; + if (!GetModuleAndMessagePath(method->input_type(), service, + &request_module_and_class)) { + return false; + } + grpc::string response_module_and_class; + if (!GetModuleAndMessagePath(method->output_type(), service, + &response_module_and_class)) { + return false; + } + out->Print("self.$Method$ = channel.$MultiCallableConstructor$(\n", + "Method", method->name(), + "MultiCallableConstructor", multi_callable_constructor); + { + IndentScope raii_first_attribute_indent(out); + IndentScope raii_second_attribute_indent(out); + out->Print( + "'/$PackageQualifiedService$/$Method$',\n", + "PackageQualifiedService", package_qualified_service_name, + "Method", method->name()); + out->Print( + "request_serializer=$RequestModuleAndClass$.SerializeToString,\n", + "RequestModuleAndClass", request_module_and_class); + out->Print( + "response_deserializer=$ResponseModuleAndClass$.FromString,\n", + "ResponseModuleAndClass", response_module_and_class); + out->Print(")\n"); + } + } + } + } + return true; +} + +bool PrintServicer(const ServiceDescriptor* service, Printer* out) { + out->Print("\n\n"); + out->Print("class $Service$Servicer(object):\n", "Service", service->name()); + { + IndentScope raii_class_indent(out); + PrintAllComments(service, out); + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); + grpc::string arg_name = method->client_streaming() ? + "request_iterator" : "request"; + out->Print("\n"); + out->Print("def $Method$(self, $ArgName$, context):\n", + "Method", method->name(), "ArgName", arg_name); + { + IndentScope raii_method_indent(out); + PrintAllComments(method, out); + out->Print("context.set_code(grpc.StatusCode.UNIMPLEMENTED)\n"); + out->Print("context.set_details('Method not implemented!')\n"); + out->Print("raise NotImplementedError('Method not implemented!')\n"); + } + } + } + return true; +} + +bool PrintAddServicerToServer(const grpc::string& package_qualified_service_name, + const ServiceDescriptor* service, Printer* out) { + out->Print("\n\n"); + out->Print("def add_$Service$Servicer_to_server(servicer, server):\n", + "Service", service->name()); + { + IndentScope raii_class_indent(out); + out->Print("rpc_method_handlers = {\n"); + { + IndentScope raii_dict_first_indent(out); + IndentScope raii_dict_second_indent(out); + for (int i = 0; i < service->method_count(); ++i) { + auto method = service->method(i); + auto method_handler_constructor = + grpc::string(method->client_streaming() ? "stream" : "unary") + + "_" + + grpc::string(method->server_streaming() ? "stream" : "unary") + + "_rpc_method_handler"; + grpc::string request_module_and_class; + if (!GetModuleAndMessagePath(method->input_type(), service, + &request_module_and_class)) { + return false; + } + grpc::string response_module_and_class; + if (!GetModuleAndMessagePath(method->output_type(), service, + &response_module_and_class)) { + return false; + } + out->Print("'$Method$': grpc.$MethodHandlerConstructor$(\n", + "Method", method->name(), + "MethodHandlerConstructor", method_handler_constructor); + { + IndentScope raii_call_first_indent(out); + IndentScope raii_call_second_indent(out); + out->Print("servicer.$Method$,\n", "Method", method->name()); + out->Print("request_deserializer=$RequestModuleAndClass$.FromString,\n", + "RequestModuleAndClass", request_module_and_class); + out->Print("response_serializer=$ResponseModuleAndClass$.SerializeToString,\n", + "ResponseModuleAndClass", response_module_and_class); + } + out->Print("),\n"); + } + } + out->Print("}\n"); + out->Print("generic_handler = grpc.method_handlers_generic_handler(\n"); + { + IndentScope raii_call_first_indent(out); + IndentScope raii_call_second_indent(out); + out->Print("'$PackageQualifiedServiceName$', rpc_method_handlers)\n", + "PackageQualifiedServiceName", package_qualified_service_name); + } + out->Print("server.add_generic_rpc_handlers((generic_handler,))\n"); + } + return true; +} + bool PrintPreamble(const FileDescriptor* file, const GeneratorConfiguration& config, Printer* out) { + out->Print("import $Package$\n", "Package", config.grpc_package_root); out->Print("from $Package$ import implementations as beta_implementations\n", "Package", config.beta_package_root); out->Print("from $Package$ import interfaces as beta_interfaces\n", @@ -487,7 +628,10 @@ pair<bool, grpc::string> GetServices(const FileDescriptor* file, for (int i = 0; i < file->service_count(); ++i) { auto service = file->service(i); auto package_qualified_service_name = package + service->name(); - if (!(PrintBetaServicer(service, &out) && + if (!(PrintStub(package_qualified_service_name, service, &out) && + PrintServicer(service, &out) && + PrintAddServicerToServer(package_qualified_service_name, service, &out) && + PrintBetaServicer(service, &out) && PrintBetaStub(service, &out) && PrintBetaServerFactory(package_qualified_service_name, service, &out) && PrintBetaStubFactory(package_qualified_service_name, service, &out))) { diff --git a/src/compiler/python_generator.h b/src/compiler/python_generator.h index e56b6790ef..fc51b48dae 100644 --- a/src/compiler/python_generator.h +++ b/src/compiler/python_generator.h @@ -43,6 +43,7 @@ namespace grpc_python_generator { // Data pertaining to configuration of the generator with respect to anything // that may be used internally at Google. struct GeneratorConfiguration { + grpc::string grpc_package_root; grpc::string beta_package_root; }; diff --git a/src/compiler/python_plugin.cc b/src/compiler/python_plugin.cc index 92a07b2f80..fc76ee5ec6 100644 --- a/src/compiler/python_plugin.cc +++ b/src/compiler/python_plugin.cc @@ -38,6 +38,7 @@ int main(int argc, char* argv[]) { grpc_python_generator::GeneratorConfiguration config; + config.grpc_package_root = "grpc"; config.beta_package_root = "grpc.beta"; grpc_python_generator::PythonGrpcGenerator generator(config); return grpc::protobuf::compiler::PluginMain(argc, argv, &generator); diff --git a/src/core/ext/lb_policy/round_robin/round_robin.c b/src/core/ext/lb_policy/round_robin/round_robin.c index eb085c7350..7bcf608ab9 100644 --- a/src/core/ext/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/lb_policy/round_robin/round_robin.c @@ -337,7 +337,7 @@ static void start_picking(grpc_exec_ctx *exec_ctx, round_robin_lb_policy *p) { p->started_picking = 1; if (grpc_lb_round_robin_trace) { - gpr_log(GPR_DEBUG, "LB_POLICY: p=%p num_subchannels=%d", p, + gpr_log(GPR_DEBUG, "LB_POLICY: p=%p num_subchannels=%" PRIuPTR, p, p->num_subchannels); } diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 71e20eef10..31ac968670 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -195,7 +195,7 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg, r->have_retry_timer = true; GRPC_RESOLVER_REF(&r->base, "retry-timer"); if (gpr_time_cmp(timeout, gpr_time_0(timeout.clock_type)) <= 0) { - gpr_log(GPR_DEBUG, "retrying in %d.%09d seconds", timeout.tv_sec, + gpr_log(GPR_DEBUG, "retrying in %" PRId64 ".%09d seconds", timeout.tv_sec, timeout.tv_nsec); } else { gpr_log(GPR_DEBUG, "retrying immediately"); diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c index 2bcb295a05..9bae3a94f9 100644 --- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c @@ -82,7 +82,7 @@ int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr) { grpc_resolved_addresses *resolved = NULL; grpc_tcp_server *tcp = NULL; size_t i; - unsigned count = 0; + size_t count = 0; int port_num = -1; int port_temp; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; @@ -119,13 +119,15 @@ int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr) { } if (count == 0) { char *msg; - gpr_asprintf(&msg, "No address added out of total %d resolved", naddrs); + gpr_asprintf(&msg, "No address added out of total %" PRIuPTR " resolved", + naddrs); err = GRPC_ERROR_CREATE_REFERENCING(msg, errors, naddrs); gpr_free(msg); goto error; } else if (count != naddrs) { char *msg; - gpr_asprintf(&msg, "Only %d addresses added out of total %d resolved", + gpr_asprintf(&msg, "Only %" PRIuPTR + " addresses added out of total %" PRIuPTR " resolved", count, naddrs); err = GRPC_ERROR_CREATE_REFERENCING(msg, errors, naddrs); gpr_free(msg); diff --git a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c index 103107c6a7..ead8a4d566 100644 --- a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +++ b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c @@ -175,7 +175,7 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, grpc_tcp_server *tcp = NULL; server_secure_state *state = NULL; size_t i; - unsigned count = 0; + size_t count = 0; int port_num = -1; int port_temp; grpc_security_status status = GRPC_SECURITY_ERROR; @@ -245,14 +245,15 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, } if (count == 0) { char *msg; - gpr_asprintf(&msg, "No address added out of total %d resolved", + gpr_asprintf(&msg, "No address added out of total %" PRIuPTR " resolved", resolved->naddrs); err = GRPC_ERROR_CREATE_REFERENCING(msg, errors, resolved->naddrs); gpr_free(msg); goto error; } else if (count != resolved->naddrs) { char *msg; - gpr_asprintf(&msg, "Only %d addresses added out of total %d resolved", + gpr_asprintf(&msg, "Only %" PRIuPTR + " addresses added out of total %" PRIuPTR " resolved", count, resolved->naddrs); err = GRPC_ERROR_CREATE_REFERENCING(msg, errors, resolved->naddrs); gpr_free(msg); diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.c b/src/core/ext/transport/chttp2/transport/bin_decoder.c new file mode 100644 index 0000000000..2d90b01cd8 --- /dev/null +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.c @@ -0,0 +1,232 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/ext/transport/chttp2/transport/bin_decoder.h" +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include "src/core/lib/support/string.h" + +static uint8_t decode_table[] = { + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 62, 0x40, 0x40, 0x40, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40}; + +static const uint8_t tail_xtra[4] = {0, 0, 1, 2}; + +static bool input_is_valid(uint8_t *input_ptr, size_t length) { + size_t i; + + for (i = 0; i < length; ++i) { + if ((decode_table[input_ptr[i]] & 0xC0) != 0) { + gpr_log(GPR_ERROR, + "Base64 decoding failed, invalid character '%c' in base64 " + "input.\n", + (char)(*input_ptr)); + return false; + } + } + return true; +} + +#define COMPOSE_OUTPUT_BYTE_0(input_ptr) \ + (uint8_t)((decode_table[input_ptr[0]] << 2) | \ + (decode_table[input_ptr[1]] >> 4)) + +#define COMPOSE_OUTPUT_BYTE_1(input_ptr) \ + (uint8_t)((decode_table[input_ptr[1]] << 4) | \ + (decode_table[input_ptr[2]] >> 2)) + +#define COMPOSE_OUTPUT_BYTE_2(input_ptr) \ + (uint8_t)((decode_table[input_ptr[2]] << 6) | decode_table[input_ptr[3]]) + +bool grpc_base64_decode_partial(struct grpc_base64_decode_context *ctx) { + size_t input_tail; + + if (ctx->input_cur > ctx->input_end || ctx->output_cur > ctx->output_end) { + return false; + } + + // Process a block of 4 input characters and 3 output bytes + while (ctx->input_end >= ctx->input_cur + 4 && + ctx->output_end >= ctx->output_cur + 3) { + if (!input_is_valid(ctx->input_cur, 4)) return false; + ctx->output_cur[0] = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur); + ctx->output_cur[1] = COMPOSE_OUTPUT_BYTE_1(ctx->input_cur); + ctx->output_cur[2] = COMPOSE_OUTPUT_BYTE_2(ctx->input_cur); + ctx->output_cur += 3; + ctx->input_cur += 4; + } + + // Process the tail of input data + input_tail = (size_t)(ctx->input_end - ctx->input_cur); + if (input_tail == 4) { + // Process the input data with pad chars + if (ctx->input_cur[3] == '=') { + if (ctx->input_cur[2] == '=' && ctx->output_end >= ctx->output_cur + 1) { + if (!input_is_valid(ctx->input_cur, 2)) return false; + *(ctx->output_cur++) = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur); + ctx->input_cur += 4; + } else if (ctx->output_end >= ctx->output_cur + 2) { + if (!input_is_valid(ctx->input_cur, 3)) return false; + *(ctx->output_cur++) = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur); + *(ctx->output_cur++) = COMPOSE_OUTPUT_BYTE_1(ctx->input_cur); + ; + ctx->input_cur += 4; + } + } + + } else if (ctx->contains_tail && input_tail > 1) { + // Process the input data without pad chars, but constains_tail is set + if (ctx->output_end >= ctx->output_cur + tail_xtra[input_tail]) { + if (!input_is_valid(ctx->input_cur, input_tail)) return false; + switch (input_tail) { + case 3: + ctx->output_cur[1] = COMPOSE_OUTPUT_BYTE_1(ctx->input_cur); + case 2: + ctx->output_cur[0] = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur); + } + ctx->output_cur += tail_xtra[input_tail]; + ctx->input_cur += input_tail; + } + } + + return true; +} + +gpr_slice grpc_chttp2_base64_decode(gpr_slice input) { + size_t input_length = GPR_SLICE_LENGTH(input); + size_t output_length = input_length / 4 * 3; + struct grpc_base64_decode_context ctx; + gpr_slice output; + + if (input_length % 4 != 0) { + gpr_log(GPR_ERROR, + "Base64 decoding failed, input of " + "grpc_chttp2_base64_decode has a length of %d, which is not a " + "multiple of 4.\n", + (int)input_length); + return gpr_empty_slice(); + } + + if (input_length > 0) { + uint8_t *input_end = GPR_SLICE_END_PTR(input); + if (*(--input_end) == '=') { + output_length--; + if (*(--input_end) == '=') { + output_length--; + } + } + } + output = gpr_slice_malloc(output_length); + + ctx.input_cur = GPR_SLICE_START_PTR(input); + ctx.input_end = GPR_SLICE_END_PTR(input); + ctx.output_cur = GPR_SLICE_START_PTR(output); + ctx.output_end = GPR_SLICE_END_PTR(output); + ctx.contains_tail = false; + + if (!grpc_base64_decode_partial(&ctx)) { + char *s = gpr_dump_slice(input, GPR_DUMP_ASCII); + gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s); + gpr_free(s); + gpr_slice_unref(output); + return gpr_empty_slice(); + } + GPR_ASSERT(ctx.output_cur == GPR_SLICE_END_PTR(output)); + GPR_ASSERT(ctx.input_cur == GPR_SLICE_END_PTR(input)); + return output; +} + +gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input, + size_t output_length) { + size_t input_length = GPR_SLICE_LENGTH(input); + gpr_slice output = gpr_slice_malloc(output_length); + struct grpc_base64_decode_context ctx; + + // The length of a base64 string cannot be 4 * n + 1 + if (input_length % 4 == 1) { + gpr_log(GPR_ERROR, + "Base64 decoding failed, input of " + "grpc_chttp2_base64_decode_with_length has a length of %d, which " + "has a tail of 1 byte.\n", + (int)input_length); + gpr_slice_unref(output); + return gpr_empty_slice(); + } + + if (output_length > input_length / 4 * 3 + tail_xtra[input_length % 4]) { + gpr_log(GPR_ERROR, + "Base64 decoding failed, output_length %d is longer " + "than the max possible output length %d.\n", + (int)output_length, + (int)(input_length / 4 * 3 + tail_xtra[input_length % 4])); + gpr_slice_unref(output); + return gpr_empty_slice(); + } + + ctx.input_cur = GPR_SLICE_START_PTR(input); + ctx.input_end = GPR_SLICE_END_PTR(input); + ctx.output_cur = GPR_SLICE_START_PTR(output); + ctx.output_end = GPR_SLICE_END_PTR(output); + ctx.contains_tail = true; + + if (!grpc_base64_decode_partial(&ctx)) { + char *s = gpr_dump_slice(input, GPR_DUMP_ASCII); + gpr_log(GPR_ERROR, "Base64 decoding failed, input string:\n%s\n", s); + gpr_free(s); + gpr_slice_unref(output); + return gpr_empty_slice(); + } + GPR_ASSERT(ctx.output_cur == GPR_SLICE_END_PTR(output)); + GPR_ASSERT(ctx.input_cur <= GPR_SLICE_END_PTR(input)); + return output; +} diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h new file mode 100644 index 0000000000..b9d40c9b74 --- /dev/null +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h @@ -0,0 +1,66 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H +#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H + +#include <grpc/support/slice.h> +#include <stdbool.h> + +struct grpc_base64_decode_context { + /* input/output: */ + uint8_t *input_cur; + uint8_t *input_end; + uint8_t *output_cur; + uint8_t *output_end; + /* Indicate if the decoder should handle the tail of input data*/ + bool contains_tail; +}; + +/* base64 decode a grpc_base64_decode_context util either input_end is reached + or output_end is reached. When input_end is reached, (input_end - input_cur) + is less than 4. When output_end is reached, (output_end - output_cur) is less + than 3. Returns false if decoding is failed. */ +bool grpc_base64_decode_partial(struct grpc_base64_decode_context *ctx); + +/* base64 decode a slice with pad chars. Returns a new slice, does not take + ownership of the input. Returns an empty slice if decoding is failed. */ +gpr_slice grpc_chttp2_base64_decode(gpr_slice input); + +/* base64 decode a slice without pad chars, data length is needed. Returns a new + slice, does not take ownership of the input. Returns an empty slice if + decoding is failed. */ +gpr_slice grpc_chttp2_base64_decode_with_length(gpr_slice input, + size_t output_length); + +#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */ diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 872d5eaf5b..9aa39ba26c 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -981,7 +981,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, if (metadata_size > metadata_peer_limit) { gpr_log(GPR_DEBUG, "to-be-sent initial metadata size exceeds peer limit " - "(%lu vs. %lu)", + "(%" PRIuPTR " vs. %" PRIuPTR ")", metadata_size, metadata_peer_limit); cancel_from_api(exec_ctx, transport_global, stream_global, GRPC_STATUS_RESOURCE_EXHAUSTED, NULL); @@ -1040,7 +1040,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, if (metadata_size > metadata_peer_limit) { gpr_log(GPR_DEBUG, "to-be-sent trailing metadata size exceeds peer limit " - "(%lu vs. %lu)", + "(%" PRIuPTR " vs. %" PRIuPTR ")", metadata_size, metadata_peer_limit); cancel_from_api(exec_ctx, transport_global, stream_global, GRPC_STATUS_RESOURCE_EXHAUSTED, NULL); @@ -2110,10 +2110,13 @@ static char *format_flowctl_context_var(const char *context, const char *var, int64_t val, uint32_t id, char **scope) { char *underscore_pos; + char *buf; char *result; if (context == NULL) { *scope = NULL; - gpr_asprintf(&result, "%s(%lld)", var, val); + gpr_asprintf(&buf, "%s(%" PRId64 ")", var, val); + result = gpr_leftpad(buf, ' ', 40); + gpr_free(buf); return result; } underscore_pos = strchr(context, '_'); @@ -2124,7 +2127,9 @@ static char *format_flowctl_context_var(const char *context, const char *var, gpr_asprintf(scope, "%s[%d]", tmp, id); gpr_free(tmp); } - gpr_asprintf(&result, "%s.%s(%lld)", underscore_pos + 1, var, val); + gpr_asprintf(&buf, "%s.%s(%" PRId64 ")", underscore_pos + 1, var, val); + result = gpr_leftpad(buf, ' ', 40); + gpr_free(buf); return result; } @@ -2145,6 +2150,8 @@ void grpc_chttp2_flowctl_trace(const char *file, int line, const char *phase, uint32_t stream_id, int64_t val1, int64_t val2) { char *scope1; char *scope2; + char *tmp_phase; + char *tmp_scope1; char *label1 = format_flowctl_context_var(context1, var1, val1, stream_id, &scope1); char *label2 = @@ -2152,14 +2159,18 @@ void grpc_chttp2_flowctl_trace(const char *file, int line, const char *phase, char *clisvr = is_client ? "client" : "server"; char *prefix; - gpr_asprintf(&prefix, "FLOW % 8s: %s % 11s ", phase, clisvr, scope1); + tmp_phase = gpr_leftpad(phase, ' ', 8); + tmp_scope1 = gpr_leftpad(scope1, ' ', 11); + gpr_asprintf(&prefix, "FLOW %s: %s %s ", phase, clisvr, scope1); + gpr_free(tmp_phase); + gpr_free(tmp_scope1); switch (op) { case GRPC_CHTTP2_FLOWCTL_MOVE: GPR_ASSERT(samestr(scope1, scope2)); if (val2 != 0) { gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "%sMOVE % 40s <- % 40s giving %d", prefix, label1, label2, + "%sMOVE %s <- %s giving %" PRId64, prefix, label1, label2, val1 + val2); } break; @@ -2167,7 +2178,7 @@ void grpc_chttp2_flowctl_trace(const char *file, int line, const char *phase, GPR_ASSERT(val2 >= 0); if (val2 != 0) { gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "%sCREDIT % 40s by % 40s giving %d", prefix, label1, label2, + "%sCREDIT %s by %s giving %" PRId64, prefix, label1, label2, val1 + val2); } break; @@ -2175,7 +2186,7 @@ void grpc_chttp2_flowctl_trace(const char *file, int line, const char *phase, GPR_ASSERT(val2 >= 0); if (val2 != 0) { gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, - "%sDEBIT % 40s by % 40s giving %d", prefix, label1, label2, + "%sDEBIT %s by %s giving %" PRId64, prefix, label1, label2, val1 - val2); } break; diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index 72b3131d7b..91977d4571 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -87,8 +87,8 @@ void grpc_chttp2_prepare_to_read( transport_global->settings[GRPC_SENT_SETTINGS], sizeof(transport_parsing->last_sent_settings)); transport_parsing->max_frame_size = - transport_global->settings[GRPC_ACKED_SETTINGS] - [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]; + transport_global + ->settings[GRPC_ACKED_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]; /* update the parsing view of incoming window */ while (grpc_chttp2_list_pop_unannounced_incoming_window_available( @@ -559,7 +559,7 @@ static grpc_error *update_incoming_window( uint32_t incoming_frame_size = transport_parsing->incoming_frame_size; if (incoming_frame_size > transport_parsing->incoming_window) { char *msg; - gpr_asprintf(&msg, "frame of size %d overflows incoming window of %d", + gpr_asprintf(&msg, "frame of size %d overflows incoming window of %" PRId64, transport_parsing->incoming_frame_size, transport_parsing->incoming_window); grpc_error *err = GRPC_ERROR_CREATE(msg); @@ -569,7 +569,7 @@ static grpc_error *update_incoming_window( if (incoming_frame_size > stream_parsing->incoming_window) { char *msg; - gpr_asprintf(&msg, "frame of size %d overflows incoming window of %d", + gpr_asprintf(&msg, "frame of size %d overflows incoming window of %" PRId64, transport_parsing->incoming_frame_size, stream_parsing->incoming_window); grpc_error *err = GRPC_ERROR_CREATE(msg); @@ -678,7 +678,8 @@ static void on_initial_header(void *tp, grpc_mdelem *md) { if (new_size > metadata_size_limit) { if (!stream_parsing->exceeded_metadata_size) { gpr_log(GPR_DEBUG, - "received initial metadata size exceeds limit (%lu vs. %lu)", + "received initial metadata size exceeds limit (%" PRIuPTR + " vs. %" PRIuPTR ")", new_size, metadata_size_limit); stream_parsing->seen_error = true; stream_parsing->exceeded_metadata_size = true; @@ -724,7 +725,8 @@ static void on_trailing_header(void *tp, grpc_mdelem *md) { if (new_size > metadata_size_limit) { if (!stream_parsing->exceeded_metadata_size) { gpr_log(GPR_DEBUG, - "received trailing metadata size exceeds limit (%lu vs. %lu)", + "received trailing metadata size exceeds limit (%" PRIuPTR + " vs. %" PRIuPTR ")", new_size, metadata_size_limit); stream_parsing->seen_error = true; stream_parsing->exceeded_metadata_size = true; diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c index 61824c76c5..32ebe53ee6 100644 --- a/src/core/lib/channel/compress_filter.c +++ b/src/core/lib/channel/compress_filter.c @@ -177,8 +177,8 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx, const float savings_ratio = 1.0f - (float)after_size / (float)before_size; GPR_ASSERT(grpc_compression_algorithm_name(calld->compression_algorithm, &algo_name)); - gpr_log(GPR_DEBUG, - "Compressed[%s] %d bytes vs. %d bytes (%.2f%% savings)", + gpr_log(GPR_DEBUG, "Compressed[%s] %" PRIuPTR " bytes vs. %" PRIuPTR + " bytes (%.2f%% savings)", algo_name, before_size, after_size, 100 * savings_ratio); } gpr_slice_buffer_swap(&calld->slices, &tmp); @@ -188,10 +188,10 @@ static void finish_send_message(grpc_exec_ctx *exec_ctx, char *algo_name; GPR_ASSERT(grpc_compression_algorithm_name(calld->compression_algorithm, &algo_name)); - gpr_log( - GPR_DEBUG, - "Algorithm '%s' enabled but decided not to compress. Input size: %d", - algo_name, calld->slices.length); + gpr_log(GPR_DEBUG, + "Algorithm '%s' enabled but decided not to compress. Input size: " + "%" PRIuPTR, + algo_name, calld->slices.length); } } diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h index 3877ceb1e2..f9808bbda1 100644 --- a/src/core/lib/iomgr/endpoint.h +++ b/src/core/lib/iomgr/endpoint.h @@ -82,7 +82,7 @@ char *grpc_endpoint_get_peer(grpc_endpoint *ep); void grpc_endpoint_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, gpr_slice_buffer *slices, grpc_closure *cb); -/* Causes any pending read/write callbacks to run immediately with +/* Causes any pending and future read/write callbacks to run immediately with success==0 */ void grpc_endpoint_shutdown(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep); void grpc_endpoint_destroy(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep); diff --git a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c index f833e948c7..40a232c5e9 100644 --- a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c +++ b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c @@ -525,7 +525,9 @@ static grpc_error *fd_shutdown_error(bool shutdown) { static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure **st, grpc_closure *closure) { - if (*st == CLOSURE_NOT_READY) { + if (fd->shutdown) { + grpc_exec_ctx_enqueue(exec_ctx, closure, false, NULL); + } else if (*st == CLOSURE_NOT_READY) { /* not ready ==> switch to a waiting state by setting the closure */ *st = closure; } else if (*st == CLOSURE_READY) { @@ -568,13 +570,24 @@ static void set_read_notifier_pollset_locked( static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) { gpr_mu_lock(&fd->mu); - GPR_ASSERT(!fd->shutdown); - fd->shutdown = 1; - set_ready_locked(exec_ctx, fd, &fd->read_closure); - set_ready_locked(exec_ctx, fd, &fd->write_closure); + /* only shutdown once */ + if (!fd->shutdown) { + fd->shutdown = 1; + /* signal read/write closed to OS so that future operations fail */ + shutdown(fd->fd, SHUT_RDWR); + set_ready_locked(exec_ctx, fd, &fd->read_closure); + set_ready_locked(exec_ctx, fd, &fd->write_closure); + } gpr_mu_unlock(&fd->mu); } +static bool fd_is_shutdown(grpc_fd *fd) { + gpr_mu_lock(&fd->mu); + bool r = fd->shutdown; + gpr_mu_unlock(&fd->mu); + return r; +} + static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *closure) { gpr_mu_lock(&fd->mu); @@ -1988,6 +2001,7 @@ static const grpc_event_engine_vtable vtable = { .fd_wrapped_fd = fd_wrapped_fd, .fd_orphan = fd_orphan, .fd_shutdown = fd_shutdown, + .fd_is_shutdown = fd_is_shutdown, .fd_notify_on_read = fd_notify_on_read, .fd_notify_on_write = fd_notify_on_write, .fd_get_read_notifier_pollset = fd_get_read_notifier_pollset, diff --git a/src/core/lib/iomgr/ev_poll_posix.c b/src/core/lib/iomgr/ev_poll_posix.c index 532c10ce3b..1f4336946f 100644 --- a/src/core/lib/iomgr/ev_poll_posix.c +++ b/src/core/lib/iomgr/ev_poll_posix.c @@ -430,7 +430,9 @@ static grpc_error *fd_shutdown_error(bool shutdown) { static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure **st, grpc_closure *closure) { - if (*st == CLOSURE_NOT_READY) { + if (fd->shutdown) { + grpc_exec_ctx_enqueue(exec_ctx, closure, false, NULL); + } else if (*st == CLOSURE_NOT_READY) { /* not ready ==> switch to a waiting state by setting the closure */ *st = closure; } else if (*st == CLOSURE_READY) { @@ -473,13 +475,24 @@ static void set_read_notifier_pollset_locked( static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) { gpr_mu_lock(&fd->mu); - GPR_ASSERT(!fd->shutdown); - fd->shutdown = 1; - set_ready_locked(exec_ctx, fd, &fd->read_closure); - set_ready_locked(exec_ctx, fd, &fd->write_closure); + /* only shutdown once */ + if (!fd->shutdown) { + fd->shutdown = 1; + /* signal read/write closed to OS so that future operations fail */ + shutdown(fd->fd, SHUT_RDWR); + set_ready_locked(exec_ctx, fd, &fd->read_closure); + set_ready_locked(exec_ctx, fd, &fd->write_closure); + } gpr_mu_unlock(&fd->mu); } +static bool fd_is_shutdown(grpc_fd *fd) { + gpr_mu_lock(&fd->mu); + bool r = fd->shutdown; + gpr_mu_unlock(&fd->mu); + return r; +} + static void fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *closure) { gpr_mu_lock(&fd->mu); @@ -1216,6 +1229,7 @@ static const grpc_event_engine_vtable vtable = { .fd_wrapped_fd = fd_wrapped_fd, .fd_orphan = fd_orphan, .fd_shutdown = fd_shutdown, + .fd_is_shutdown = fd_is_shutdown, .fd_notify_on_read = fd_notify_on_read, .fd_notify_on_write = fd_notify_on_write, .fd_get_read_notifier_pollset = fd_get_read_notifier_pollset, diff --git a/src/core/lib/iomgr/ev_posix.c b/src/core/lib/iomgr/ev_posix.c index 3a255bc11a..4c360f13a3 100644 --- a/src/core/lib/iomgr/ev_posix.c +++ b/src/core/lib/iomgr/ev_posix.c @@ -153,6 +153,10 @@ void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) { g_event_engine->fd_shutdown(exec_ctx, fd); } +bool grpc_fd_is_shutdown(grpc_fd *fd) { + return g_event_engine->fd_is_shutdown(fd); +} + void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *closure) { g_event_engine->fd_notify_on_read(exec_ctx, fd, closure); diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h index 3058f22c91..87e9bc4d46 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -55,6 +55,7 @@ typedef struct grpc_event_engine_vtable { grpc_closure *closure); void (*fd_notify_on_write)(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *closure); + bool (*fd_is_shutdown)(grpc_fd *fd); grpc_pollset *(*fd_get_read_notifier_pollset)(grpc_exec_ctx *exec_ctx, grpc_fd *fd); @@ -116,7 +117,10 @@ int grpc_fd_wrapped_fd(grpc_fd *fd); void grpc_fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure *on_done, int *release_fd, const char *reason); -/* Cause any current callbacks to error out with GRPC_CALLBACK_CANCELLED. */ +/* Has grpc_fd_shutdown been called on an fd? */ +bool grpc_fd_is_shutdown(grpc_fd *fd); + +/* Cause any current and future callbacks to fail. */ void grpc_fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd); /* Register read interest, causing read_cb to be called once when fd becomes diff --git a/src/core/lib/iomgr/iomgr.c b/src/core/lib/iomgr/iomgr.c index 60cef8ba77..89292a153e 100644 --- a/src/core/lib/iomgr/iomgr.c +++ b/src/core/lib/iomgr/iomgr.c @@ -96,7 +96,8 @@ void grpc_iomgr_shutdown(void) { gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), last_warning_time), gpr_time_from_seconds(1, GPR_TIMESPAN)) >= 0) { if (g_root_object.next != &g_root_object) { - gpr_log(GPR_DEBUG, "Waiting for %d iomgr objects to be destroyed", + gpr_log(GPR_DEBUG, + "Waiting for %" PRIuPTR " iomgr objects to be destroyed", count_objects()); } last_warning_time = gpr_now(GPR_CLOCK_REALTIME); @@ -114,9 +115,9 @@ void grpc_iomgr_shutdown(void) { if (gpr_cv_wait(&g_rcv, &g_mu, short_deadline)) { if (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), shutdown_deadline) > 0) { if (g_root_object.next != &g_root_object) { - gpr_log(GPR_DEBUG, - "Failed to free %d iomgr objects before shutdown deadline: " - "memory leaks are likely", + gpr_log(GPR_DEBUG, "Failed to free %" PRIuPTR + " iomgr objects before shutdown deadline: " + "memory leaks are likely", count_objects()); dump_objects("LEAKED"); if (grpc_iomgr_abort_on_leaks()) { diff --git a/src/core/lib/iomgr/tcp_posix.c b/src/core/lib/iomgr/tcp_posix.c index 808367a4e0..017f52c367 100644 --- a/src/core/lib/iomgr/tcp_posix.c +++ b/src/core/lib/iomgr/tcp_posix.c @@ -410,7 +410,10 @@ static void tcp_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, if (buf->length == 0) { GPR_TIMER_END("tcp_write", 0); - grpc_exec_ctx_sched(exec_ctx, cb, GRPC_ERROR_NONE, NULL); + grpc_exec_ctx_sched(exec_ctx, cb, grpc_fd_is_shutdown(tcp->em_fd) + ? GRPC_ERROR_CREATE("EOF") + : GRPC_ERROR_NONE, + NULL); return; } tcp->outgoing_buffer = buf; diff --git a/src/core/lib/support/log_linux.c b/src/core/lib/support/log_linux.c index ca04c022e3..508fae4eec 100644 --- a/src/core/lib/support/log_linux.c +++ b/src/core/lib/support/log_linux.c @@ -95,9 +95,9 @@ void gpr_default_log(gpr_log_func_args *args) { strcpy(time_buffer, "error:strftime"); } - gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]", + gpr_asprintf(&prefix, "%s%s.%09" PRId32 " %7ld %s:%d]", gpr_log_severity_string(args->severity), time_buffer, - (int)(now.tv_nsec), gettid(), display_file, args->line); + now.tv_nsec, gettid(), display_file, args->line); fprintf(stderr, "%-60s %s\n", prefix, args->message); gpr_free(prefix); diff --git a/src/core/lib/support/string.c b/src/core/lib/support/string.c index a2ab6c5f1f..30c1e67647 100644 --- a/src/core/lib/support/string.c +++ b/src/core/lib/support/string.c @@ -194,6 +194,16 @@ int int64_ttoa(int64_t value, char *string) { return i; } +char *gpr_leftpad(const char *str, char flag, size_t length) { + const size_t str_length = strlen(str); + const size_t out_length = str_length > length ? str_length : length; + char *out = gpr_malloc(out_length + 1); + memset(out, flag, out_length - str_length); + memcpy(out + out_length - str_length, str, str_length); + out[out_length] = 0; + return out; +} + char *gpr_strjoin(const char **strs, size_t nstrs, size_t *final_length) { return gpr_strjoin_sep(strs, nstrs, "", final_length); } diff --git a/src/core/lib/support/string.h b/src/core/lib/support/string.h index ea58610914..2b6bb3eec6 100644 --- a/src/core/lib/support/string.h +++ b/src/core/lib/support/string.h @@ -83,6 +83,10 @@ int int64_ttoa(int64_t value, char *output); /* Reverse a run of bytes */ void gpr_reverse_bytes(char *str, int len); +/* Pad a string with flag characters. The given length specifies the minimum + field width. The input string is never truncated. */ +char *gpr_leftpad(const char *str, char flag, size_t length); + /* Join a set of strings, returning the resulting string. Total combined length (excluding null terminator) is returned in total_length if it is non-null. */ diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index fd3876eb7d..04291b0ee0 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1189,7 +1189,7 @@ static void validate_filtered_metadata(grpc_exec_ctx *exec_ctx, if (algo >= GRPC_COMPRESS_ALGORITHMS_COUNT) { gpr_asprintf(&error_msg, "Invalid compression algorithm value '%d'.", algo); - gpr_log(GPR_ERROR, error_msg); + gpr_log(GPR_ERROR, "%s", error_msg); close_with_status(exec_ctx, call, GRPC_STATUS_UNIMPLEMENTED, error_msg); } else if (grpc_compression_options_is_algorithm_enabled( &compression_options, algo) == 0) { @@ -1198,7 +1198,7 @@ static void validate_filtered_metadata(grpc_exec_ctx *exec_ctx, grpc_compression_algorithm_name(algo, &algo_name); gpr_asprintf(&error_msg, "Compression algorithm '%s' is disabled.", algo_name); - gpr_log(GPR_ERROR, error_msg); + gpr_log(GPR_ERROR, "%s", error_msg); close_with_status(exec_ctx, call, GRPC_STATUS_UNIMPLEMENTED, error_msg); } else { call->incoming_compression_algorithm = algo; diff --git a/src/core/lib/surface/call_log_batch.c b/src/core/lib/surface/call_log_batch.c index a6d1d5149f..31c074f15d 100644 --- a/src/core/lib/surface/call_log_batch.c +++ b/src/core/lib/surface/call_log_batch.c @@ -112,7 +112,7 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, size_t i; for (i = 0; i < nops; i++) { tmp = grpc_op_string(&ops[i]); - gpr_log(file, line, severity, "ops[%d]: %s", i, tmp); + gpr_log(file, line, severity, "ops[%" PRIuPTR "]: %s", i, tmp); gpr_free(tmp); } } diff --git a/src/core/lib/transport/metadata.c b/src/core/lib/transport/metadata.c index 79de54beb5..0677f29766 100644 --- a/src/core/lib/transport/metadata.c +++ b/src/core/lib/transport/metadata.c @@ -235,7 +235,7 @@ void grpc_mdctx_global_shutdown(void) { gc_mdtab(shard); /* TODO(ctiller): GPR_ASSERT(shard->count == 0); */ if (shard->count != 0) { - gpr_log(GPR_DEBUG, "WARNING: %d metadata elements were leaked", + gpr_log(GPR_DEBUG, "WARNING: %" PRIuPTR " metadata elements were leaked", shard->count); if (grpc_iomgr_abort_on_leaks()) { abort(); @@ -248,7 +248,7 @@ void grpc_mdctx_global_shutdown(void) { gpr_mu_destroy(&shard->mu); /* TODO(ctiller): GPR_ASSERT(shard->count == 0); */ if (shard->count != 0) { - gpr_log(GPR_DEBUG, "WARNING: %d metadata strings were leaked", + gpr_log(GPR_DEBUG, "WARNING: %" PRIuPTR " metadata strings were leaked", shard->count); for (size_t j = 0; j < shard->capacity; j++) { for (internal_string *s = shard->strs[j]; s; s = s->bucket_next) { diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc new file mode 100644 index 0000000000..348a035f0f --- /dev/null +++ b/src/cpp/ext/proto_server_reflection.cc @@ -0,0 +1,227 @@ +/* + * + * Copyright 2016, 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 <unordered_set> +#include <vector> + +#include <grpc++/grpc++.h> + +#include "src/cpp/ext/proto_server_reflection.h" + +using grpc::Status; +using grpc::StatusCode; +using grpc::reflection::v1alpha::ServerReflectionRequest; +using grpc::reflection::v1alpha::ExtensionRequest; +using grpc::reflection::v1alpha::ServerReflectionResponse; +using grpc::reflection::v1alpha::ListServiceResponse; +using grpc::reflection::v1alpha::ServiceResponse; +using grpc::reflection::v1alpha::ExtensionNumberResponse; +using grpc::reflection::v1alpha::ErrorResponse; +using grpc::reflection::v1alpha::FileDescriptorResponse; + +namespace grpc { + +ProtoServerReflection::ProtoServerReflection() + : descriptor_pool_(protobuf::DescriptorPool::generated_pool()) {} + +void ProtoServerReflection::SetServiceList( + const std::vector<grpc::string>* services) { + services_ = services; +} + +Status ProtoServerReflection::ServerReflectionInfo( + ServerContext* context, + ServerReaderWriter<ServerReflectionResponse, ServerReflectionRequest>* + stream) { + ServerReflectionRequest request; + ServerReflectionResponse response; + Status status; + while (stream->Read(&request)) { + switch (request.message_request_case()) { + case ServerReflectionRequest::MessageRequestCase::kFileByFilename: + status = GetFileByName(context, request.file_by_filename(), &response); + break; + case ServerReflectionRequest::MessageRequestCase::kFileContainingSymbol: + status = GetFileContainingSymbol( + context, request.file_containing_symbol(), &response); + break; + case ServerReflectionRequest::MessageRequestCase:: + kFileContainingExtension: + status = GetFileContainingExtension( + context, &request.file_containing_extension(), &response); + break; + case ServerReflectionRequest::MessageRequestCase:: + kAllExtensionNumbersOfType: + status = GetAllExtensionNumbers( + context, request.all_extension_numbers_of_type(), + response.mutable_all_extension_numbers_response()); + break; + case ServerReflectionRequest::MessageRequestCase::kListServices: + status = + ListService(context, response.mutable_list_services_response()); + break; + default: + status = Status(StatusCode::UNIMPLEMENTED, ""); + } + + if (!status.ok()) { + FillErrorResponse(status, response.mutable_error_response()); + } + response.set_valid_host(request.host()); + response.set_allocated_original_request( + new ServerReflectionRequest(request)); + stream->Write(response); + } + + return Status::OK; +} + +void ProtoServerReflection::FillErrorResponse(const Status& status, + ErrorResponse* error_response) { + error_response->set_error_code(status.error_code()); + error_response->set_error_message(status.error_message()); +} + +Status ProtoServerReflection::ListService(ServerContext* context, + ListServiceResponse* response) { + if (services_ == nullptr) { + return Status(StatusCode::NOT_FOUND, "Services not found."); + } + for (auto it = services_->begin(); it != services_->end(); ++it) { + ServiceResponse* service_response = response->add_service(); + service_response->set_name(*it); + } + return Status::OK; +} + +Status ProtoServerReflection::GetFileByName( + ServerContext* context, const grpc::string& filename, + ServerReflectionResponse* response) { + if (descriptor_pool_ == nullptr) { + return Status::CANCELLED; + } + + const protobuf::FileDescriptor* file_desc = + descriptor_pool_->FindFileByName(filename); + if (file_desc == nullptr) { + return Status(StatusCode::NOT_FOUND, "File not found."); + } + std::unordered_set<grpc::string> seen_files; + FillFileDescriptorResponse(file_desc, response, &seen_files); + return Status::OK; +} + +Status ProtoServerReflection::GetFileContainingSymbol( + ServerContext* context, const grpc::string& symbol, + ServerReflectionResponse* response) { + if (descriptor_pool_ == nullptr) { + return Status::CANCELLED; + } + + const protobuf::FileDescriptor* file_desc = + descriptor_pool_->FindFileContainingSymbol(symbol); + if (file_desc == nullptr) { + return Status(StatusCode::NOT_FOUND, "Symbol not found."); + } + std::unordered_set<grpc::string> seen_files; + FillFileDescriptorResponse(file_desc, response, &seen_files); + return Status::OK; +} + +Status ProtoServerReflection::GetFileContainingExtension( + ServerContext* context, const ExtensionRequest* request, + ServerReflectionResponse* response) { + if (descriptor_pool_ == nullptr) { + return Status::CANCELLED; + } + + const protobuf::Descriptor* desc = + descriptor_pool_->FindMessageTypeByName(request->containing_type()); + if (desc == nullptr) { + return Status(StatusCode::NOT_FOUND, "Type not found."); + } + + const protobuf::FieldDescriptor* field_desc = + descriptor_pool_->FindExtensionByNumber(desc, + request->extension_number()); + if (field_desc == nullptr) { + return Status(StatusCode::NOT_FOUND, "Extension not found."); + } + std::unordered_set<grpc::string> seen_files; + FillFileDescriptorResponse(field_desc->file(), response, &seen_files); + return Status::OK; +} + +Status ProtoServerReflection::GetAllExtensionNumbers( + ServerContext* context, const grpc::string& type, + ExtensionNumberResponse* response) { + if (descriptor_pool_ == nullptr) { + return Status::CANCELLED; + } + + const protobuf::Descriptor* desc = + descriptor_pool_->FindMessageTypeByName(type); + if (desc == nullptr) { + return Status(StatusCode::NOT_FOUND, "Type not found."); + } + + std::vector<const protobuf::FieldDescriptor*> extensions; + descriptor_pool_->FindAllExtensions(desc, &extensions); + for (auto extension : extensions) { + response->add_extension_number(extension->number()); + } + response->set_base_type_name(type); + return Status::OK; +} + +void ProtoServerReflection::FillFileDescriptorResponse( + const protobuf::FileDescriptor* file_desc, + ServerReflectionResponse* response, + std::unordered_set<grpc::string>* seen_files) { + if (seen_files->find(file_desc->name()) != seen_files->end()) { + return; + } + seen_files->insert(file_desc->name()); + + protobuf::FileDescriptorProto file_desc_proto; + grpc::string data; + file_desc->CopyTo(&file_desc_proto); + file_desc_proto.SerializeToString(&data); + response->mutable_file_descriptor_response()->add_file_descriptor_proto(data); + + for (int i = 0; i < file_desc->dependency_count(); ++i) { + FillFileDescriptorResponse(file_desc->dependency(i), response, seen_files); + } +} + +} // namespace grpc diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h new file mode 100644 index 0000000000..23c130513d --- /dev/null +++ b/src/cpp/ext/proto_server_reflection.h @@ -0,0 +1,94 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H +#define GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H + +#include <unordered_set> +#include <vector> + +#include <grpc++/ext/reflection.grpc.pb.h> +#include <grpc++/grpc++.h> + +namespace grpc { + +class ProtoServerReflection GRPC_FINAL + : public reflection::v1alpha::ServerReflection::Service { + public: + ProtoServerReflection(); + + // Add the full names of registered services + void SetServiceList(const std::vector<grpc::string>* services); + + // implementation of ServerReflectionInfo(stream ServerReflectionRequest) rpc + // in ServerReflection service + Status ServerReflectionInfo( + ServerContext* context, + ServerReaderWriter<reflection::v1alpha::ServerReflectionResponse, + reflection::v1alpha::ServerReflectionRequest>* stream) + GRPC_OVERRIDE; + + private: + Status ListService(ServerContext* context, + reflection::v1alpha::ListServiceResponse* response); + + Status GetFileByName(ServerContext* context, const grpc::string& file_name, + reflection::v1alpha::ServerReflectionResponse* response); + + Status GetFileContainingSymbol( + ServerContext* context, const grpc::string& symbol, + reflection::v1alpha::ServerReflectionResponse* response); + + Status GetFileContainingExtension( + ServerContext* context, + const reflection::v1alpha::ExtensionRequest* request, + reflection::v1alpha::ServerReflectionResponse* response); + + Status GetAllExtensionNumbers( + ServerContext* context, const grpc::string& type, + reflection::v1alpha::ExtensionNumberResponse* response); + + void FillFileDescriptorResponse( + const protobuf::FileDescriptor* file_desc, + reflection::v1alpha::ServerReflectionResponse* response, + std::unordered_set<grpc::string>* seen_files); + + void FillErrorResponse(const Status& status, + reflection::v1alpha::ErrorResponse* error_response); + + const protobuf::DescriptorPool* descriptor_pool_; + const std::vector<string>* services_; +}; + +} // namespace grpc + +#endif // GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H diff --git a/src/cpp/ext/proto_server_reflection_plugin.cc b/src/cpp/ext/proto_server_reflection_plugin.cc new file mode 100644 index 0000000000..f31d102a9e --- /dev/null +++ b/src/cpp/ext/proto_server_reflection_plugin.cc @@ -0,0 +1,97 @@ +/* + * + * 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++/ext/proto_server_reflection_plugin.h> +#include <grpc++/impl/server_builder_plugin.h> +#include <grpc++/impl/server_initializer.h> +#include <grpc++/server.h> + +#include "src/cpp/ext/proto_server_reflection.h" + +namespace grpc { +namespace reflection { + +ProtoServerReflectionPlugin::ProtoServerReflectionPlugin() + : reflection_service_(new grpc::ProtoServerReflection()) {} + +grpc::string ProtoServerReflectionPlugin::name() { + return "proto_server_reflection"; +} + +void ProtoServerReflectionPlugin::InitServer(grpc::ServerInitializer* si) { + si->RegisterService(reflection_service_); +} + +void ProtoServerReflectionPlugin::Finish(grpc::ServerInitializer* si) { + reflection_service_->SetServiceList(si->GetServiceList()); +} + +void ProtoServerReflectionPlugin::ChangeArguments(const grpc::string& name, + void* value) {} + +bool ProtoServerReflectionPlugin::has_sync_methods() const { + if (reflection_service_ != nullptr) { + return reflection_service_->has_synchronous_methods(); + } + return false; +} + +bool ProtoServerReflectionPlugin::has_async_methods() const { + if (reflection_service_ != nullptr) { + return reflection_service_->has_async_methods(); + } + return false; +} + +static std::unique_ptr<::grpc::ServerBuilderPlugin> CreateProtoReflection() { + return std::unique_ptr<::grpc::ServerBuilderPlugin>( + new ProtoServerReflectionPlugin()); +} + +void InitProtoReflectionServerBuilderPlugin() { + static bool already_here = false; + if (already_here) return; + already_here = true; + ::grpc::ServerBuilder::InternalAddPluginFactory(&CreateProtoReflection); +} + +// Force InitProtoReflectionServerBuilderPlugin() to be called at static +// initialization time. +struct StaticProtoReflectionPluginInitializer { + StaticProtoReflectionPluginInitializer() { + InitProtoReflectionServerBuilderPlugin(); + } +} static_proto_reflection_plugin_initializer; + +} // namespace reflection +} // namespace grpc diff --git a/src/cpp/ext/reflection.grpc.pb.cc b/src/cpp/ext/reflection.grpc.pb.cc new file mode 100644 index 0000000000..b046dfc1b8 --- /dev/null +++ b/src/cpp/ext/reflection.grpc.pb.cc @@ -0,0 +1,97 @@ +/* + * + * 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. + * + */ + + +// Generated by the gRPC protobuf plugin. +// If you make any local change, they will be lost. +// source: reflection.proto + +#include <grpc++/ext/reflection.pb.h> +#include <grpc++/ext/reflection.grpc.pb.h> + +#include <grpc++/impl/codegen/async_stream.h> +#include <grpc++/impl/codegen/async_unary_call.h> +#include <grpc++/impl/codegen/channel_interface.h> +#include <grpc++/impl/codegen/client_unary_call.h> +#include <grpc++/impl/codegen/method_handler_impl.h> +#include <grpc++/impl/codegen/rpc_service_method.h> +#include <grpc++/impl/codegen/service_type.h> +#include <grpc++/impl/codegen/sync_stream.h> +namespace grpc { +namespace reflection { +namespace v1alpha { + +static const char* ServerReflection_method_names[] = { + "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", +}; + +std::unique_ptr< ServerReflection::Stub> ServerReflection::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { + std::unique_ptr< ServerReflection::Stub> stub(new ServerReflection::Stub(channel)); + return stub; +} + +ServerReflection::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) + : channel_(channel), rpcmethod_ServerReflectionInfo_(ServerReflection_method_names[0], ::grpc::RpcMethod::BIDI_STREAMING, channel) + {} + +::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflection::Stub::ServerReflectionInfoRaw(::grpc::ClientContext* context) { + return new ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>(channel_.get(), rpcmethod_ServerReflectionInfo_, context); +} + +::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflection::Stub::AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { + return new ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>(channel_.get(), cq, rpcmethod_ServerReflectionInfo_, context, tag); +} + +ServerReflection::Service::Service() { + (void)ServerReflection_method_names; + AddMethod(new ::grpc::RpcServiceMethod( + ServerReflection_method_names[0], + ::grpc::RpcMethod::BIDI_STREAMING, + new ::grpc::BidiStreamingHandler< ServerReflection::Service, ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>( + std::mem_fn(&ServerReflection::Service::ServerReflectionInfo), this))); +} + +ServerReflection::Service::~Service() { +} + +::grpc::Status ServerReflection::Service::ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) { + (void) context; + (void) stream; + return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); +} + + +} // namespace grpc +} // namespace reflection +} // namespace v1alpha + diff --git a/src/cpp/ext/reflection.pb.cc b/src/cpp/ext/reflection.pb.cc new file mode 100644 index 0000000000..b73a65d0a0 --- /dev/null +++ b/src/cpp/ext/reflection.pb.cc @@ -0,0 +1,3946 @@ +/* + * + * 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. + * + */ + + +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: reflection.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include <grpc++/ext/reflection.pb.h> + +#include <algorithm> + +#include <google/protobuf/stubs/common.h> +#include <google/protobuf/stubs/port.h> +#include <google/protobuf/stubs/once.h> +#include <google/protobuf/io/coded_stream.h> +#include <google/protobuf/wire_format_lite_inl.h> +#include <google/protobuf/descriptor.h> +#include <google/protobuf/generated_message_reflection.h> +#include <google/protobuf/reflection_ops.h> +#include <google/protobuf/wire_format.h> +// @@protoc_insertion_point(includes) + +namespace grpc { +namespace reflection { +namespace v1alpha { + +namespace { + +const ::google::protobuf::Descriptor* ServerReflectionRequest_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ServerReflectionRequest_reflection_ = NULL; +struct ServerReflectionRequestOneofInstance { + ::google::protobuf::internal::ArenaStringPtr file_by_filename_; + ::google::protobuf::internal::ArenaStringPtr file_containing_symbol_; + const ::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension_; + ::google::protobuf::internal::ArenaStringPtr all_extension_numbers_of_type_; + ::google::protobuf::internal::ArenaStringPtr list_services_; +}* ServerReflectionRequest_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* ExtensionRequest_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ExtensionRequest_reflection_ = NULL; +const ::google::protobuf::Descriptor* ServerReflectionResponse_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ServerReflectionResponse_reflection_ = NULL; +struct ServerReflectionResponseOneofInstance { + const ::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response_; + const ::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response_; + const ::grpc::reflection::v1alpha::ListServiceResponse* list_services_response_; + const ::grpc::reflection::v1alpha::ErrorResponse* error_response_; +}* ServerReflectionResponse_default_oneof_instance_ = NULL; +const ::google::protobuf::Descriptor* FileDescriptorResponse_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FileDescriptorResponse_reflection_ = NULL; +const ::google::protobuf::Descriptor* ExtensionNumberResponse_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ExtensionNumberResponse_reflection_ = NULL; +const ::google::protobuf::Descriptor* ListServiceResponse_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ListServiceResponse_reflection_ = NULL; +const ::google::protobuf::Descriptor* ServiceResponse_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ServiceResponse_reflection_ = NULL; +const ::google::protobuf::Descriptor* ErrorResponse_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ErrorResponse_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_reflection_2eproto() { + protobuf_AddDesc_reflection_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "reflection.proto"); + GOOGLE_CHECK(file != NULL); + ServerReflectionRequest_descriptor_ = file->message_type(0); + static const int ServerReflectionRequest_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionRequest, host_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionRequest_default_oneof_instance_, file_by_filename_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionRequest_default_oneof_instance_, file_containing_symbol_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionRequest_default_oneof_instance_, file_containing_extension_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionRequest_default_oneof_instance_, all_extension_numbers_of_type_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionRequest_default_oneof_instance_, list_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionRequest, message_request_), + }; + ServerReflectionRequest_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ServerReflectionRequest_descriptor_, + ServerReflectionRequest::default_instance_, + ServerReflectionRequest_offsets_, + -1, + -1, + -1, + ServerReflectionRequest_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionRequest, _oneof_case_[0]), + sizeof(ServerReflectionRequest), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionRequest, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionRequest, _is_default_instance_)); + ExtensionRequest_descriptor_ = file->message_type(1); + static const int ExtensionRequest_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRequest, containing_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRequest, extension_number_), + }; + ExtensionRequest_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ExtensionRequest_descriptor_, + ExtensionRequest::default_instance_, + ExtensionRequest_offsets_, + -1, + -1, + -1, + sizeof(ExtensionRequest), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRequest, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionRequest, _is_default_instance_)); + ServerReflectionResponse_descriptor_ = file->message_type(2); + static const int ServerReflectionResponse_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionResponse, valid_host_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionResponse, original_request_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionResponse_default_oneof_instance_, file_descriptor_response_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionResponse_default_oneof_instance_, all_extension_numbers_response_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionResponse_default_oneof_instance_, list_services_response_), + PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ServerReflectionResponse_default_oneof_instance_, error_response_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionResponse, message_response_), + }; + ServerReflectionResponse_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ServerReflectionResponse_descriptor_, + ServerReflectionResponse::default_instance_, + ServerReflectionResponse_offsets_, + -1, + -1, + -1, + ServerReflectionResponse_default_oneof_instance_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionResponse, _oneof_case_[0]), + sizeof(ServerReflectionResponse), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerReflectionResponse, _is_default_instance_)); + FileDescriptorResponse_descriptor_ = file->message_type(3); + static const int FileDescriptorResponse_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorResponse, file_descriptor_proto_), + }; + FileDescriptorResponse_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FileDescriptorResponse_descriptor_, + FileDescriptorResponse::default_instance_, + FileDescriptorResponse_offsets_, + -1, + -1, + -1, + sizeof(FileDescriptorResponse), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorResponse, _is_default_instance_)); + ExtensionNumberResponse_descriptor_ = file->message_type(4); + static const int ExtensionNumberResponse_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionNumberResponse, base_type_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionNumberResponse, extension_number_), + }; + ExtensionNumberResponse_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ExtensionNumberResponse_descriptor_, + ExtensionNumberResponse::default_instance_, + ExtensionNumberResponse_offsets_, + -1, + -1, + -1, + sizeof(ExtensionNumberResponse), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionNumberResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ExtensionNumberResponse, _is_default_instance_)); + ListServiceResponse_descriptor_ = file->message_type(5); + static const int ListServiceResponse_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListServiceResponse, service_), + }; + ListServiceResponse_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ListServiceResponse_descriptor_, + ListServiceResponse::default_instance_, + ListServiceResponse_offsets_, + -1, + -1, + -1, + sizeof(ListServiceResponse), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListServiceResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ListServiceResponse, _is_default_instance_)); + ServiceResponse_descriptor_ = file->message_type(6); + static const int ServiceResponse_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceResponse, name_), + }; + ServiceResponse_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ServiceResponse_descriptor_, + ServiceResponse::default_instance_, + ServiceResponse_offsets_, + -1, + -1, + -1, + sizeof(ServiceResponse), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceResponse, _is_default_instance_)); + ErrorResponse_descriptor_ = file->message_type(7); + static const int ErrorResponse_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorResponse, error_code_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorResponse, error_message_), + }; + ErrorResponse_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ErrorResponse_descriptor_, + ErrorResponse::default_instance_, + ErrorResponse_offsets_, + -1, + -1, + -1, + sizeof(ErrorResponse), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorResponse, _internal_metadata_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ErrorResponse, _is_default_instance_)); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_reflection_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ServerReflectionRequest_descriptor_, &ServerReflectionRequest::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ExtensionRequest_descriptor_, &ExtensionRequest::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ServerReflectionResponse_descriptor_, &ServerReflectionResponse::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FileDescriptorResponse_descriptor_, &FileDescriptorResponse::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ExtensionNumberResponse_descriptor_, &ExtensionNumberResponse::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ListServiceResponse_descriptor_, &ListServiceResponse::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ServiceResponse_descriptor_, &ServiceResponse::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ErrorResponse_descriptor_, &ErrorResponse::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_reflection_2eproto() { + delete ServerReflectionRequest::default_instance_; + delete ServerReflectionRequest_default_oneof_instance_; + delete ServerReflectionRequest_reflection_; + delete ExtensionRequest::default_instance_; + delete ExtensionRequest_reflection_; + delete ServerReflectionResponse::default_instance_; + delete ServerReflectionResponse_default_oneof_instance_; + delete ServerReflectionResponse_reflection_; + delete FileDescriptorResponse::default_instance_; + delete FileDescriptorResponse_reflection_; + delete ExtensionNumberResponse::default_instance_; + delete ExtensionNumberResponse_reflection_; + delete ListServiceResponse::default_instance_; + delete ListServiceResponse_reflection_; + delete ServiceResponse::default_instance_; + delete ServiceResponse_reflection_; + delete ErrorResponse::default_instance_; + delete ErrorResponse_reflection_; +} + +void protobuf_AddDesc_reflection_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\020reflection.proto\022\027grpc.reflection.v1al" + "pha\"\212\002\n\027ServerReflectionRequest\022\014\n\004host\030" + "\001 \001(\t\022\032\n\020file_by_filename\030\003 \001(\tH\000\022 \n\026fil" + "e_containing_symbol\030\004 \001(\tH\000\022N\n\031file_cont" + "aining_extension\030\005 \001(\0132).grpc.reflection" + ".v1alpha.ExtensionRequestH\000\022\'\n\035all_exten" + "sion_numbers_of_type\030\006 \001(\tH\000\022\027\n\rlist_ser" + "vices\030\007 \001(\tH\000B\021\n\017message_request\"E\n\020Exte" + "nsionRequest\022\027\n\017containing_type\030\001 \001(\t\022\030\n" + "\020extension_number\030\002 \001(\005\"\321\003\n\030ServerReflec" + "tionResponse\022\022\n\nvalid_host\030\001 \001(\t\022J\n\020orig" + "inal_request\030\002 \001(\01320.grpc.reflection.v1a" + "lpha.ServerReflectionRequest\022S\n\030file_des" + "criptor_response\030\004 \001(\0132/.grpc.reflection" + ".v1alpha.FileDescriptorResponseH\000\022Z\n\036all" + "_extension_numbers_response\030\005 \001(\01320.grpc" + ".reflection.v1alpha.ExtensionNumberRespo" + "nseH\000\022N\n\026list_services_response\030\006 \001(\0132,." + "grpc.reflection.v1alpha.ListServiceRespo" + "nseH\000\022@\n\016error_response\030\007 \001(\0132&.grpc.ref" + "lection.v1alpha.ErrorResponseH\000B\022\n\020messa" + "ge_response\"7\n\026FileDescriptorResponse\022\035\n" + "\025file_descriptor_proto\030\001 \003(\014\"K\n\027Extensio" + "nNumberResponse\022\026\n\016base_type_name\030\001 \001(\t\022" + "\030\n\020extension_number\030\002 \003(\005\"P\n\023ListService" + "Response\0229\n\007service\030\001 \003(\0132(.grpc.reflect" + "ion.v1alpha.ServiceResponse\"\037\n\017ServiceRe" + "sponse\022\014\n\004name\030\001 \001(\t\":\n\rErrorResponse\022\022\n" + "\nerror_code\030\001 \001(\005\022\025\n\rerror_message\030\002 \001(\t" + "2\223\001\n\020ServerReflection\022\177\n\024ServerReflectio" + "nInfo\0220.grpc.reflection.v1alpha.ServerRe" + "flectionRequest\0321.grpc.reflection.v1alph" + "a.ServerReflectionResponse(\0010\001b\006proto3", 1318); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "reflection.proto", &protobuf_RegisterTypes); + ServerReflectionRequest::default_instance_ = new ServerReflectionRequest(); + ServerReflectionRequest_default_oneof_instance_ = new ServerReflectionRequestOneofInstance(); + ExtensionRequest::default_instance_ = new ExtensionRequest(); + ServerReflectionResponse::default_instance_ = new ServerReflectionResponse(); + ServerReflectionResponse_default_oneof_instance_ = new ServerReflectionResponseOneofInstance(); + FileDescriptorResponse::default_instance_ = new FileDescriptorResponse(); + ExtensionNumberResponse::default_instance_ = new ExtensionNumberResponse(); + ListServiceResponse::default_instance_ = new ListServiceResponse(); + ServiceResponse::default_instance_ = new ServiceResponse(); + ErrorResponse::default_instance_ = new ErrorResponse(); + ServerReflectionRequest::default_instance_->InitAsDefaultInstance(); + ExtensionRequest::default_instance_->InitAsDefaultInstance(); + ServerReflectionResponse::default_instance_->InitAsDefaultInstance(); + FileDescriptorResponse::default_instance_->InitAsDefaultInstance(); + ExtensionNumberResponse::default_instance_->InitAsDefaultInstance(); + ListServiceResponse::default_instance_->InitAsDefaultInstance(); + ServiceResponse::default_instance_->InitAsDefaultInstance(); + ErrorResponse::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_reflection_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_reflection_2eproto { + StaticDescriptorInitializer_reflection_2eproto() { + protobuf_AddDesc_reflection_2eproto(); + } +} static_descriptor_initializer_reflection_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; +static void MergeFromFail(int line) { + GOOGLE_CHECK(false) << __FILE__ << ":" << line; +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ServerReflectionRequest::kHostFieldNumber; +const int ServerReflectionRequest::kFileByFilenameFieldNumber; +const int ServerReflectionRequest::kFileContainingSymbolFieldNumber; +const int ServerReflectionRequest::kFileContainingExtensionFieldNumber; +const int ServerReflectionRequest::kAllExtensionNumbersOfTypeFieldNumber; +const int ServerReflectionRequest::kListServicesFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ServerReflectionRequest::ServerReflectionRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ServerReflectionRequest) +} + +void ServerReflectionRequest::InitAsDefaultInstance() { + _is_default_instance_ = true; + ServerReflectionRequest_default_oneof_instance_->file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ServerReflectionRequest_default_oneof_instance_->file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ServerReflectionRequest_default_oneof_instance_->file_containing_extension_ = const_cast< ::grpc::reflection::v1alpha::ExtensionRequest*>(&::grpc::reflection::v1alpha::ExtensionRequest::default_instance()); + ServerReflectionRequest_default_oneof_instance_->all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ServerReflectionRequest_default_oneof_instance_->list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ServerReflectionRequest::ServerReflectionRequest(const ServerReflectionRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ServerReflectionRequest) +} + +void ServerReflectionRequest::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + host_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); +} + +ServerReflectionRequest::~ServerReflectionRequest() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ServerReflectionRequest) + SharedDtor(); +} + +void ServerReflectionRequest::SharedDtor() { + host_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (has_message_request()) { + clear_message_request(); + } + if (this != default_instance_) { + } +} + +void ServerReflectionRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ServerReflectionRequest::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ServerReflectionRequest_descriptor_; +} + +const ServerReflectionRequest& ServerReflectionRequest::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ServerReflectionRequest* ServerReflectionRequest::default_instance_ = NULL; + +ServerReflectionRequest* ServerReflectionRequest::New(::google::protobuf::Arena* arena) const { + ServerReflectionRequest* n = new ServerReflectionRequest; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ServerReflectionRequest::clear_message_request() { +// @@protoc_insertion_point(one_of_clear_start:grpc.reflection.v1alpha.ServerReflectionRequest) + switch(message_request_case()) { + case kFileByFilename: { + message_request_.file_by_filename_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + break; + } + case kFileContainingSymbol: { + message_request_.file_containing_symbol_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + break; + } + case kFileContainingExtension: { + delete message_request_.file_containing_extension_; + break; + } + case kAllExtensionNumbersOfType: { + message_request_.all_extension_numbers_of_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + break; + } + case kListServices: { + message_request_.list_services_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + break; + } + case MESSAGE_REQUEST_NOT_SET: { + break; + } + } + _oneof_case_[0] = MESSAGE_REQUEST_NOT_SET; +} + + +void ServerReflectionRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ServerReflectionRequest) + host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_message_request(); +} + +bool ServerReflectionRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ServerReflectionRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string host = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_host())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host().data(), this->host().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServerReflectionRequest.host")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_file_by_filename; + break; + } + + // optional string file_by_filename = 3; + case 3: { + if (tag == 26) { + parse_file_by_filename: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_by_filename())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_by_filename().data(), this->file_by_filename().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_file_containing_symbol; + break; + } + + // optional string file_containing_symbol = 4; + case 4: { + if (tag == 34) { + parse_file_containing_symbol: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_file_containing_symbol())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_containing_symbol().data(), this->file_containing_symbol().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_file_containing_extension; + break; + } + + // optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; + case 5: { + if (tag == 42) { + parse_file_containing_extension: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_file_containing_extension())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_all_extension_numbers_of_type; + break; + } + + // optional string all_extension_numbers_of_type = 6; + case 6: { + if (tag == 50) { + parse_all_extension_numbers_of_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_all_extension_numbers_of_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->all_extension_numbers_of_type().data(), this->all_extension_numbers_of_type().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_list_services; + break; + } + + // optional string list_services = 7; + case 7: { + if (tag == 58) { + parse_list_services: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_list_services())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->list_services().data(), this->list_services().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServerReflectionRequest.list_services")); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ServerReflectionRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ServerReflectionRequest) + return false; +#undef DO_ +} + +void ServerReflectionRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ServerReflectionRequest) + // optional string host = 1; + if (this->host().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host().data(), this->host().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.host"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->host(), output); + } + + // optional string file_by_filename = 3; + if (has_file_by_filename()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_by_filename().data(), this->file_by_filename().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->file_by_filename(), output); + } + + // optional string file_containing_symbol = 4; + if (has_file_containing_symbol()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_containing_symbol().data(), this->file_containing_symbol().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->file_containing_symbol(), output); + } + + // optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; + if (has_file_containing_extension()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *message_request_.file_containing_extension_, output); + } + + // optional string all_extension_numbers_of_type = 6; + if (has_all_extension_numbers_of_type()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->all_extension_numbers_of_type().data(), this->all_extension_numbers_of_type().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->all_extension_numbers_of_type(), output); + } + + // optional string list_services = 7; + if (has_list_services()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->list_services().data(), this->list_services().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.list_services"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->list_services(), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ServerReflectionRequest) +} + +::google::protobuf::uint8* ServerReflectionRequest::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ServerReflectionRequest) + // optional string host = 1; + if (this->host().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->host().data(), this->host().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.host"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->host(), target); + } + + // optional string file_by_filename = 3; + if (has_file_by_filename()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_by_filename().data(), this->file_by_filename().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->file_by_filename(), target); + } + + // optional string file_containing_symbol = 4; + if (has_file_containing_symbol()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->file_containing_symbol().data(), this->file_containing_symbol().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->file_containing_symbol(), target); + } + + // optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; + if (has_file_containing_extension()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, *message_request_.file_containing_extension_, target); + } + + // optional string all_extension_numbers_of_type = 6; + if (has_all_extension_numbers_of_type()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->all_extension_numbers_of_type().data(), this->all_extension_numbers_of_type().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->all_extension_numbers_of_type(), target); + } + + // optional string list_services = 7; + if (has_list_services()) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->list_services().data(), this->list_services().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionRequest.list_services"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->list_services(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ServerReflectionRequest) + return target; +} + +int ServerReflectionRequest::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ServerReflectionRequest) + int total_size = 0; + + // optional string host = 1; + if (this->host().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->host()); + } + + switch (message_request_case()) { + // optional string file_by_filename = 3; + case kFileByFilename: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_by_filename()); + break; + } + // optional string file_containing_symbol = 4; + case kFileContainingSymbol: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->file_containing_symbol()); + break; + } + // optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; + case kFileContainingExtension: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *message_request_.file_containing_extension_); + break; + } + // optional string all_extension_numbers_of_type = 6; + case kAllExtensionNumbersOfType: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->all_extension_numbers_of_type()); + break; + } + // optional string list_services = 7; + case kListServices: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->list_services()); + break; + } + case MESSAGE_REQUEST_NOT_SET: { + break; + } + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ServerReflectionRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ServerReflectionRequest) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ServerReflectionRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ServerReflectionRequest>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ServerReflectionRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ServerReflectionRequest) + MergeFrom(*source); + } +} + +void ServerReflectionRequest::MergeFrom(const ServerReflectionRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ServerReflectionRequest) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + switch (from.message_request_case()) { + case kFileByFilename: { + set_file_by_filename(from.file_by_filename()); + break; + } + case kFileContainingSymbol: { + set_file_containing_symbol(from.file_containing_symbol()); + break; + } + case kFileContainingExtension: { + mutable_file_containing_extension()->::grpc::reflection::v1alpha::ExtensionRequest::MergeFrom(from.file_containing_extension()); + break; + } + case kAllExtensionNumbersOfType: { + set_all_extension_numbers_of_type(from.all_extension_numbers_of_type()); + break; + } + case kListServices: { + set_list_services(from.list_services()); + break; + } + case MESSAGE_REQUEST_NOT_SET: { + break; + } + } + if (from.host().size() > 0) { + + host_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.host_); + } +} + +void ServerReflectionRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ServerReflectionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ServerReflectionRequest::CopyFrom(const ServerReflectionRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ServerReflectionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ServerReflectionRequest::IsInitialized() const { + + return true; +} + +void ServerReflectionRequest::Swap(ServerReflectionRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ServerReflectionRequest::InternalSwap(ServerReflectionRequest* other) { + host_.Swap(&other->host_); + std::swap(message_request_, other->message_request_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ServerReflectionRequest::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ServerReflectionRequest_descriptor_; + metadata.reflection = ServerReflectionRequest_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ServerReflectionRequest + +// optional string host = 1; +void ServerReflectionRequest::clear_host() { + host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + const ::std::string& ServerReflectionRequest::host() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.host) + return host_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServerReflectionRequest::set_host(const ::std::string& value) { + + host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} + void ServerReflectionRequest::set_host(const char* value) { + + host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} + void ServerReflectionRequest::set_host(const char* value, size_t size) { + + host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} + ::std::string* ServerReflectionRequest::mutable_host() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.host) + return host_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServerReflectionRequest::release_host() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.host) + + return host_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServerReflectionRequest::set_allocated_host(::std::string* host) { + if (host != NULL) { + + } else { + + } + host_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), host); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.host) +} + +// optional string file_by_filename = 3; +bool ServerReflectionRequest::has_file_by_filename() const { + return message_request_case() == kFileByFilename; +} +void ServerReflectionRequest::set_has_file_by_filename() { + _oneof_case_[0] = kFileByFilename; +} +void ServerReflectionRequest::clear_file_by_filename() { + if (has_file_by_filename()) { + message_request_.file_by_filename_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} + const ::std::string& ServerReflectionRequest::file_by_filename() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + if (has_file_by_filename()) { + return message_request_.file_by_filename_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} + void ServerReflectionRequest::set_file_by_filename(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} + void ServerReflectionRequest::set_file_by_filename(const char* value) { + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} + void ServerReflectionRequest::set_file_by_filename(const char* value, size_t size) { + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_by_filename_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} + ::std::string* ServerReflectionRequest::mutable_file_by_filename() { + if (!has_file_by_filename()) { + clear_message_request(); + set_has_file_by_filename(); + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + return message_request_.file_by_filename_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServerReflectionRequest::release_file_by_filename() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) + if (has_file_by_filename()) { + clear_has_message_request(); + return message_request_.file_by_filename_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} + void ServerReflectionRequest::set_allocated_file_by_filename(::std::string* file_by_filename) { + if (!has_file_by_filename()) { + message_request_.file_by_filename_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (file_by_filename != NULL) { + set_has_file_by_filename(); + message_request_.file_by_filename_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + file_by_filename); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_by_filename) +} + +// optional string file_containing_symbol = 4; +bool ServerReflectionRequest::has_file_containing_symbol() const { + return message_request_case() == kFileContainingSymbol; +} +void ServerReflectionRequest::set_has_file_containing_symbol() { + _oneof_case_[0] = kFileContainingSymbol; +} +void ServerReflectionRequest::clear_file_containing_symbol() { + if (has_file_containing_symbol()) { + message_request_.file_containing_symbol_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} + const ::std::string& ServerReflectionRequest::file_containing_symbol() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + if (has_file_containing_symbol()) { + return message_request_.file_containing_symbol_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} + void ServerReflectionRequest::set_file_containing_symbol(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} + void ServerReflectionRequest::set_file_containing_symbol(const char* value) { + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} + void ServerReflectionRequest::set_file_containing_symbol(const char* value, size_t size) { + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.file_containing_symbol_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} + ::std::string* ServerReflectionRequest::mutable_file_containing_symbol() { + if (!has_file_containing_symbol()) { + clear_message_request(); + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + return message_request_.file_containing_symbol_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServerReflectionRequest::release_file_containing_symbol() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) + if (has_file_containing_symbol()) { + clear_has_message_request(); + return message_request_.file_containing_symbol_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} + void ServerReflectionRequest::set_allocated_file_containing_symbol(::std::string* file_containing_symbol) { + if (!has_file_containing_symbol()) { + message_request_.file_containing_symbol_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (file_containing_symbol != NULL) { + set_has_file_containing_symbol(); + message_request_.file_containing_symbol_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + file_containing_symbol); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_symbol) +} + +// optional .grpc.reflection.v1alpha.ExtensionRequest file_containing_extension = 5; +bool ServerReflectionRequest::has_file_containing_extension() const { + return message_request_case() == kFileContainingExtension; +} +void ServerReflectionRequest::set_has_file_containing_extension() { + _oneof_case_[0] = kFileContainingExtension; +} +void ServerReflectionRequest::clear_file_containing_extension() { + if (has_file_containing_extension()) { + delete message_request_.file_containing_extension_; + clear_has_message_request(); + } +} + const ::grpc::reflection::v1alpha::ExtensionRequest& ServerReflectionRequest::file_containing_extension() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) + return has_file_containing_extension() + ? *message_request_.file_containing_extension_ + : ::grpc::reflection::v1alpha::ExtensionRequest::default_instance(); +} +::grpc::reflection::v1alpha::ExtensionRequest* ServerReflectionRequest::mutable_file_containing_extension() { + if (!has_file_containing_extension()) { + clear_message_request(); + set_has_file_containing_extension(); + message_request_.file_containing_extension_ = new ::grpc::reflection::v1alpha::ExtensionRequest; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) + return message_request_.file_containing_extension_; +} +::grpc::reflection::v1alpha::ExtensionRequest* ServerReflectionRequest::release_file_containing_extension() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) + if (has_file_containing_extension()) { + clear_has_message_request(); + ::grpc::reflection::v1alpha::ExtensionRequest* temp = message_request_.file_containing_extension_; + message_request_.file_containing_extension_ = NULL; + return temp; + } else { + return NULL; + } +} +void ServerReflectionRequest::set_allocated_file_containing_extension(::grpc::reflection::v1alpha::ExtensionRequest* file_containing_extension) { + clear_message_request(); + if (file_containing_extension) { + set_has_file_containing_extension(); + message_request_.file_containing_extension_ = file_containing_extension; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.file_containing_extension) +} + +// optional string all_extension_numbers_of_type = 6; +bool ServerReflectionRequest::has_all_extension_numbers_of_type() const { + return message_request_case() == kAllExtensionNumbersOfType; +} +void ServerReflectionRequest::set_has_all_extension_numbers_of_type() { + _oneof_case_[0] = kAllExtensionNumbersOfType; +} +void ServerReflectionRequest::clear_all_extension_numbers_of_type() { + if (has_all_extension_numbers_of_type()) { + message_request_.all_extension_numbers_of_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} + const ::std::string& ServerReflectionRequest::all_extension_numbers_of_type() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + if (has_all_extension_numbers_of_type()) { + return message_request_.all_extension_numbers_of_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} + void ServerReflectionRequest::set_all_extension_numbers_of_type(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} + void ServerReflectionRequest::set_all_extension_numbers_of_type(const char* value) { + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} + void ServerReflectionRequest::set_all_extension_numbers_of_type(const char* value, size_t size) { + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.all_extension_numbers_of_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} + ::std::string* ServerReflectionRequest::mutable_all_extension_numbers_of_type() { + if (!has_all_extension_numbers_of_type()) { + clear_message_request(); + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + return message_request_.all_extension_numbers_of_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServerReflectionRequest::release_all_extension_numbers_of_type() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) + if (has_all_extension_numbers_of_type()) { + clear_has_message_request(); + return message_request_.all_extension_numbers_of_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} + void ServerReflectionRequest::set_allocated_all_extension_numbers_of_type(::std::string* all_extension_numbers_of_type) { + if (!has_all_extension_numbers_of_type()) { + message_request_.all_extension_numbers_of_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (all_extension_numbers_of_type != NULL) { + set_has_all_extension_numbers_of_type(); + message_request_.all_extension_numbers_of_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + all_extension_numbers_of_type); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.all_extension_numbers_of_type) +} + +// optional string list_services = 7; +bool ServerReflectionRequest::has_list_services() const { + return message_request_case() == kListServices; +} +void ServerReflectionRequest::set_has_list_services() { + _oneof_case_[0] = kListServices; +} +void ServerReflectionRequest::clear_list_services() { + if (has_list_services()) { + message_request_.list_services_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_message_request(); + } +} + const ::std::string& ServerReflectionRequest::list_services() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + if (has_list_services()) { + return message_request_.list_services_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + return *&::google::protobuf::internal::GetEmptyStringAlreadyInited(); +} + void ServerReflectionRequest::set_list_services(const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} + void ServerReflectionRequest::set_list_services(const char* value) { + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} + void ServerReflectionRequest::set_list_services(const char* value, size_t size) { + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + message_request_.list_services_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} + ::std::string* ServerReflectionRequest::mutable_list_services() { + if (!has_list_services()) { + clear_message_request(); + set_has_list_services(); + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + return message_request_.list_services_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServerReflectionRequest::release_list_services() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) + if (has_list_services()) { + clear_has_message_request(); + return message_request_.list_services_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } else { + return NULL; + } +} + void ServerReflectionRequest::set_allocated_list_services(::std::string* list_services) { + if (!has_list_services()) { + message_request_.list_services_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + clear_message_request(); + if (list_services != NULL) { + set_has_list_services(); + message_request_.list_services_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + list_services); + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionRequest.list_services) +} + +bool ServerReflectionRequest::has_message_request() const { + return message_request_case() != MESSAGE_REQUEST_NOT_SET; +} +void ServerReflectionRequest::clear_has_message_request() { + _oneof_case_[0] = MESSAGE_REQUEST_NOT_SET; +} +ServerReflectionRequest::MessageRequestCase ServerReflectionRequest::message_request_case() const { + return ServerReflectionRequest::MessageRequestCase(_oneof_case_[0]); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExtensionRequest::kContainingTypeFieldNumber; +const int ExtensionRequest::kExtensionNumberFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExtensionRequest::ExtensionRequest() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ExtensionRequest) +} + +void ExtensionRequest::InitAsDefaultInstance() { + _is_default_instance_ = true; +} + +ExtensionRequest::ExtensionRequest(const ExtensionRequest& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ExtensionRequest) +} + +void ExtensionRequest::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + containing_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extension_number_ = 0; +} + +ExtensionRequest::~ExtensionRequest() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ExtensionRequest) + SharedDtor(); +} + +void ExtensionRequest::SharedDtor() { + containing_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void ExtensionRequest::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ExtensionRequest::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ExtensionRequest_descriptor_; +} + +const ExtensionRequest& ExtensionRequest::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ExtensionRequest* ExtensionRequest::default_instance_ = NULL; + +ExtensionRequest* ExtensionRequest::New(::google::protobuf::Arena* arena) const { + ExtensionRequest* n = new ExtensionRequest; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ExtensionRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ExtensionRequest) + containing_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extension_number_ = 0; +} + +bool ExtensionRequest::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ExtensionRequest) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string containing_type = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_containing_type())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->containing_type().data(), this->containing_type().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ExtensionRequest.containing_type")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_extension_number; + break; + } + + // optional int32 extension_number = 2; + case 2: { + if (tag == 16) { + parse_extension_number: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &extension_number_))); + + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ExtensionRequest) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ExtensionRequest) + return false; +#undef DO_ +} + +void ExtensionRequest::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ExtensionRequest) + // optional string containing_type = 1; + if (this->containing_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->containing_type().data(), this->containing_type().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ExtensionRequest.containing_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->containing_type(), output); + } + + // optional int32 extension_number = 2; + if (this->extension_number() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->extension_number(), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ExtensionRequest) +} + +::google::protobuf::uint8* ExtensionRequest::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ExtensionRequest) + // optional string containing_type = 1; + if (this->containing_type().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->containing_type().data(), this->containing_type().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ExtensionRequest.containing_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->containing_type(), target); + } + + // optional int32 extension_number = 2; + if (this->extension_number() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->extension_number(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ExtensionRequest) + return target; +} + +int ExtensionRequest::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ExtensionRequest) + int total_size = 0; + + // optional string containing_type = 1; + if (this->containing_type().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->containing_type()); + } + + // optional int32 extension_number = 2; + if (this->extension_number() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->extension_number()); + } + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExtensionRequest::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ExtensionRequest) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ExtensionRequest* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ExtensionRequest>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ExtensionRequest) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ExtensionRequest) + MergeFrom(*source); + } +} + +void ExtensionRequest::MergeFrom(const ExtensionRequest& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ExtensionRequest) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from.containing_type().size() > 0) { + + containing_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.containing_type_); + } + if (from.extension_number() != 0) { + set_extension_number(from.extension_number()); + } +} + +void ExtensionRequest::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ExtensionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExtensionRequest::CopyFrom(const ExtensionRequest& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ExtensionRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExtensionRequest::IsInitialized() const { + + return true; +} + +void ExtensionRequest::Swap(ExtensionRequest* other) { + if (other == this) return; + InternalSwap(other); +} +void ExtensionRequest::InternalSwap(ExtensionRequest* other) { + containing_type_.Swap(&other->containing_type_); + std::swap(extension_number_, other->extension_number_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ExtensionRequest::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ExtensionRequest_descriptor_; + metadata.reflection = ExtensionRequest_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ExtensionRequest + +// optional string containing_type = 1; +void ExtensionRequest::clear_containing_type() { + containing_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + const ::std::string& ExtensionRequest::containing_type() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionRequest.containing_type) + return containing_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ExtensionRequest::set_containing_type(const ::std::string& value) { + + containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} + void ExtensionRequest::set_containing_type(const char* value) { + + containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} + void ExtensionRequest::set_containing_type(const char* value, size_t size) { + + containing_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} + ::std::string* ExtensionRequest::mutable_containing_type() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ExtensionRequest.containing_type) + return containing_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ExtensionRequest::release_containing_type() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ExtensionRequest.containing_type) + + return containing_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ExtensionRequest::set_allocated_containing_type(::std::string* containing_type) { + if (containing_type != NULL) { + + } else { + + } + containing_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), containing_type); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ExtensionRequest.containing_type) +} + +// optional int32 extension_number = 2; +void ExtensionRequest::clear_extension_number() { + extension_number_ = 0; +} + ::google::protobuf::int32 ExtensionRequest::extension_number() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionRequest.extension_number) + return extension_number_; +} + void ExtensionRequest::set_extension_number(::google::protobuf::int32 value) { + + extension_number_ = value; + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionRequest.extension_number) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ServerReflectionResponse::kValidHostFieldNumber; +const int ServerReflectionResponse::kOriginalRequestFieldNumber; +const int ServerReflectionResponse::kFileDescriptorResponseFieldNumber; +const int ServerReflectionResponse::kAllExtensionNumbersResponseFieldNumber; +const int ServerReflectionResponse::kListServicesResponseFieldNumber; +const int ServerReflectionResponse::kErrorResponseFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ServerReflectionResponse::ServerReflectionResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ServerReflectionResponse) +} + +void ServerReflectionResponse::InitAsDefaultInstance() { + _is_default_instance_ = true; + original_request_ = const_cast< ::grpc::reflection::v1alpha::ServerReflectionRequest*>(&::grpc::reflection::v1alpha::ServerReflectionRequest::default_instance()); + ServerReflectionResponse_default_oneof_instance_->file_descriptor_response_ = const_cast< ::grpc::reflection::v1alpha::FileDescriptorResponse*>(&::grpc::reflection::v1alpha::FileDescriptorResponse::default_instance()); + ServerReflectionResponse_default_oneof_instance_->all_extension_numbers_response_ = const_cast< ::grpc::reflection::v1alpha::ExtensionNumberResponse*>(&::grpc::reflection::v1alpha::ExtensionNumberResponse::default_instance()); + ServerReflectionResponse_default_oneof_instance_->list_services_response_ = const_cast< ::grpc::reflection::v1alpha::ListServiceResponse*>(&::grpc::reflection::v1alpha::ListServiceResponse::default_instance()); + ServerReflectionResponse_default_oneof_instance_->error_response_ = const_cast< ::grpc::reflection::v1alpha::ErrorResponse*>(&::grpc::reflection::v1alpha::ErrorResponse::default_instance()); +} + +ServerReflectionResponse::ServerReflectionResponse(const ServerReflectionResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ServerReflectionResponse) +} + +void ServerReflectionResponse::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + valid_host_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + original_request_ = NULL; + clear_has_message_response(); +} + +ServerReflectionResponse::~ServerReflectionResponse() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ServerReflectionResponse) + SharedDtor(); +} + +void ServerReflectionResponse::SharedDtor() { + valid_host_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (has_message_response()) { + clear_message_response(); + } + if (this != default_instance_) { + delete original_request_; + } +} + +void ServerReflectionResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ServerReflectionResponse::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ServerReflectionResponse_descriptor_; +} + +const ServerReflectionResponse& ServerReflectionResponse::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ServerReflectionResponse* ServerReflectionResponse::default_instance_ = NULL; + +ServerReflectionResponse* ServerReflectionResponse::New(::google::protobuf::Arena* arena) const { + ServerReflectionResponse* n = new ServerReflectionResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ServerReflectionResponse::clear_message_response() { +// @@protoc_insertion_point(one_of_clear_start:grpc.reflection.v1alpha.ServerReflectionResponse) + switch(message_response_case()) { + case kFileDescriptorResponse: { + delete message_response_.file_descriptor_response_; + break; + } + case kAllExtensionNumbersResponse: { + delete message_response_.all_extension_numbers_response_; + break; + } + case kListServicesResponse: { + delete message_response_.list_services_response_; + break; + } + case kErrorResponse: { + delete message_response_.error_response_; + break; + } + case MESSAGE_RESPONSE_NOT_SET: { + break; + } + } + _oneof_case_[0] = MESSAGE_RESPONSE_NOT_SET; +} + + +void ServerReflectionResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ServerReflectionResponse) + valid_host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (GetArenaNoVirtual() == NULL && original_request_ != NULL) delete original_request_; + original_request_ = NULL; + clear_message_response(); +} + +bool ServerReflectionResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ServerReflectionResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string valid_host = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_valid_host())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->valid_host().data(), this->valid_host().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServerReflectionResponse.valid_host")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_original_request; + break; + } + + // optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; + case 2: { + if (tag == 18) { + parse_original_request: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_original_request())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_file_descriptor_response; + break; + } + + // optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; + case 4: { + if (tag == 34) { + parse_file_descriptor_response: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_file_descriptor_response())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_all_extension_numbers_response; + break; + } + + // optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; + case 5: { + if (tag == 42) { + parse_all_extension_numbers_response: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_all_extension_numbers_response())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_list_services_response; + break; + } + + // optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; + case 6: { + if (tag == 50) { + parse_list_services_response: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_list_services_response())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_error_response; + break; + } + + // optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; + case 7: { + if (tag == 58) { + parse_error_response: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_error_response())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ServerReflectionResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ServerReflectionResponse) + return false; +#undef DO_ +} + +void ServerReflectionResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ServerReflectionResponse) + // optional string valid_host = 1; + if (this->valid_host().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->valid_host().data(), this->valid_host().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionResponse.valid_host"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->valid_host(), output); + } + + // optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; + if (this->has_original_request()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, *this->original_request_, output); + } + + // optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; + if (has_file_descriptor_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *message_response_.file_descriptor_response_, output); + } + + // optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; + if (has_all_extension_numbers_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, *message_response_.all_extension_numbers_response_, output); + } + + // optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; + if (has_list_services_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, *message_response_.list_services_response_, output); + } + + // optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; + if (has_error_response()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *message_response_.error_response_, output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ServerReflectionResponse) +} + +::google::protobuf::uint8* ServerReflectionResponse::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ServerReflectionResponse) + // optional string valid_host = 1; + if (this->valid_host().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->valid_host().data(), this->valid_host().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServerReflectionResponse.valid_host"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->valid_host(), target); + } + + // optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; + if (this->has_original_request()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, *this->original_request_, target); + } + + // optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; + if (has_file_descriptor_response()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, *message_response_.file_descriptor_response_, target); + } + + // optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; + if (has_all_extension_numbers_response()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, *message_response_.all_extension_numbers_response_, target); + } + + // optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; + if (has_list_services_response()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, *message_response_.list_services_response_, target); + } + + // optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; + if (has_error_response()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, *message_response_.error_response_, target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ServerReflectionResponse) + return target; +} + +int ServerReflectionResponse::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ServerReflectionResponse) + int total_size = 0; + + // optional string valid_host = 1; + if (this->valid_host().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->valid_host()); + } + + // optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; + if (this->has_original_request()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->original_request_); + } + + switch (message_response_case()) { + // optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; + case kFileDescriptorResponse: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *message_response_.file_descriptor_response_); + break; + } + // optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; + case kAllExtensionNumbersResponse: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *message_response_.all_extension_numbers_response_); + break; + } + // optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; + case kListServicesResponse: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *message_response_.list_services_response_); + break; + } + // optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; + case kErrorResponse: { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *message_response_.error_response_); + break; + } + case MESSAGE_RESPONSE_NOT_SET: { + break; + } + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ServerReflectionResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ServerReflectionResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ServerReflectionResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ServerReflectionResponse>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ServerReflectionResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ServerReflectionResponse) + MergeFrom(*source); + } +} + +void ServerReflectionResponse::MergeFrom(const ServerReflectionResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ServerReflectionResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + switch (from.message_response_case()) { + case kFileDescriptorResponse: { + mutable_file_descriptor_response()->::grpc::reflection::v1alpha::FileDescriptorResponse::MergeFrom(from.file_descriptor_response()); + break; + } + case kAllExtensionNumbersResponse: { + mutable_all_extension_numbers_response()->::grpc::reflection::v1alpha::ExtensionNumberResponse::MergeFrom(from.all_extension_numbers_response()); + break; + } + case kListServicesResponse: { + mutable_list_services_response()->::grpc::reflection::v1alpha::ListServiceResponse::MergeFrom(from.list_services_response()); + break; + } + case kErrorResponse: { + mutable_error_response()->::grpc::reflection::v1alpha::ErrorResponse::MergeFrom(from.error_response()); + break; + } + case MESSAGE_RESPONSE_NOT_SET: { + break; + } + } + if (from.valid_host().size() > 0) { + + valid_host_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.valid_host_); + } + if (from.has_original_request()) { + mutable_original_request()->::grpc::reflection::v1alpha::ServerReflectionRequest::MergeFrom(from.original_request()); + } +} + +void ServerReflectionResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ServerReflectionResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ServerReflectionResponse::CopyFrom(const ServerReflectionResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ServerReflectionResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ServerReflectionResponse::IsInitialized() const { + + return true; +} + +void ServerReflectionResponse::Swap(ServerReflectionResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ServerReflectionResponse::InternalSwap(ServerReflectionResponse* other) { + valid_host_.Swap(&other->valid_host_); + std::swap(original_request_, other->original_request_); + std::swap(message_response_, other->message_response_); + std::swap(_oneof_case_[0], other->_oneof_case_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ServerReflectionResponse::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ServerReflectionResponse_descriptor_; + metadata.reflection = ServerReflectionResponse_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ServerReflectionResponse + +// optional string valid_host = 1; +void ServerReflectionResponse::clear_valid_host() { + valid_host_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + const ::std::string& ServerReflectionResponse::valid_host() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) + return valid_host_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServerReflectionResponse::set_valid_host(const ::std::string& value) { + + valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} + void ServerReflectionResponse::set_valid_host(const char* value) { + + valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} + void ServerReflectionResponse::set_valid_host(const char* value, size_t size) { + + valid_host_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} + ::std::string* ServerReflectionResponse::mutable_valid_host() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) + return valid_host_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServerReflectionResponse::release_valid_host() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) + + return valid_host_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServerReflectionResponse::set_allocated_valid_host(::std::string* valid_host) { + if (valid_host != NULL) { + + } else { + + } + valid_host_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), valid_host); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.valid_host) +} + +// optional .grpc.reflection.v1alpha.ServerReflectionRequest original_request = 2; +bool ServerReflectionResponse::has_original_request() const { + return !_is_default_instance_ && original_request_ != NULL; +} +void ServerReflectionResponse::clear_original_request() { + if (GetArenaNoVirtual() == NULL && original_request_ != NULL) delete original_request_; + original_request_ = NULL; +} +const ::grpc::reflection::v1alpha::ServerReflectionRequest& ServerReflectionResponse::original_request() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) + return original_request_ != NULL ? *original_request_ : *default_instance_->original_request_; +} +::grpc::reflection::v1alpha::ServerReflectionRequest* ServerReflectionResponse::mutable_original_request() { + + if (original_request_ == NULL) { + original_request_ = new ::grpc::reflection::v1alpha::ServerReflectionRequest; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) + return original_request_; +} +::grpc::reflection::v1alpha::ServerReflectionRequest* ServerReflectionResponse::release_original_request() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) + + ::grpc::reflection::v1alpha::ServerReflectionRequest* temp = original_request_; + original_request_ = NULL; + return temp; +} +void ServerReflectionResponse::set_allocated_original_request(::grpc::reflection::v1alpha::ServerReflectionRequest* original_request) { + delete original_request_; + original_request_ = original_request; + if (original_request) { + + } else { + + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.original_request) +} + +// optional .grpc.reflection.v1alpha.FileDescriptorResponse file_descriptor_response = 4; +bool ServerReflectionResponse::has_file_descriptor_response() const { + return message_response_case() == kFileDescriptorResponse; +} +void ServerReflectionResponse::set_has_file_descriptor_response() { + _oneof_case_[0] = kFileDescriptorResponse; +} +void ServerReflectionResponse::clear_file_descriptor_response() { + if (has_file_descriptor_response()) { + delete message_response_.file_descriptor_response_; + clear_has_message_response(); + } +} + const ::grpc::reflection::v1alpha::FileDescriptorResponse& ServerReflectionResponse::file_descriptor_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) + return has_file_descriptor_response() + ? *message_response_.file_descriptor_response_ + : ::grpc::reflection::v1alpha::FileDescriptorResponse::default_instance(); +} +::grpc::reflection::v1alpha::FileDescriptorResponse* ServerReflectionResponse::mutable_file_descriptor_response() { + if (!has_file_descriptor_response()) { + clear_message_response(); + set_has_file_descriptor_response(); + message_response_.file_descriptor_response_ = new ::grpc::reflection::v1alpha::FileDescriptorResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) + return message_response_.file_descriptor_response_; +} +::grpc::reflection::v1alpha::FileDescriptorResponse* ServerReflectionResponse::release_file_descriptor_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) + if (has_file_descriptor_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::FileDescriptorResponse* temp = message_response_.file_descriptor_response_; + message_response_.file_descriptor_response_ = NULL; + return temp; + } else { + return NULL; + } +} +void ServerReflectionResponse::set_allocated_file_descriptor_response(::grpc::reflection::v1alpha::FileDescriptorResponse* file_descriptor_response) { + clear_message_response(); + if (file_descriptor_response) { + set_has_file_descriptor_response(); + message_response_.file_descriptor_response_ = file_descriptor_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.file_descriptor_response) +} + +// optional .grpc.reflection.v1alpha.ExtensionNumberResponse all_extension_numbers_response = 5; +bool ServerReflectionResponse::has_all_extension_numbers_response() const { + return message_response_case() == kAllExtensionNumbersResponse; +} +void ServerReflectionResponse::set_has_all_extension_numbers_response() { + _oneof_case_[0] = kAllExtensionNumbersResponse; +} +void ServerReflectionResponse::clear_all_extension_numbers_response() { + if (has_all_extension_numbers_response()) { + delete message_response_.all_extension_numbers_response_; + clear_has_message_response(); + } +} + const ::grpc::reflection::v1alpha::ExtensionNumberResponse& ServerReflectionResponse::all_extension_numbers_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) + return has_all_extension_numbers_response() + ? *message_response_.all_extension_numbers_response_ + : ::grpc::reflection::v1alpha::ExtensionNumberResponse::default_instance(); +} +::grpc::reflection::v1alpha::ExtensionNumberResponse* ServerReflectionResponse::mutable_all_extension_numbers_response() { + if (!has_all_extension_numbers_response()) { + clear_message_response(); + set_has_all_extension_numbers_response(); + message_response_.all_extension_numbers_response_ = new ::grpc::reflection::v1alpha::ExtensionNumberResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) + return message_response_.all_extension_numbers_response_; +} +::grpc::reflection::v1alpha::ExtensionNumberResponse* ServerReflectionResponse::release_all_extension_numbers_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) + if (has_all_extension_numbers_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::ExtensionNumberResponse* temp = message_response_.all_extension_numbers_response_; + message_response_.all_extension_numbers_response_ = NULL; + return temp; + } else { + return NULL; + } +} +void ServerReflectionResponse::set_allocated_all_extension_numbers_response(::grpc::reflection::v1alpha::ExtensionNumberResponse* all_extension_numbers_response) { + clear_message_response(); + if (all_extension_numbers_response) { + set_has_all_extension_numbers_response(); + message_response_.all_extension_numbers_response_ = all_extension_numbers_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.all_extension_numbers_response) +} + +// optional .grpc.reflection.v1alpha.ListServiceResponse list_services_response = 6; +bool ServerReflectionResponse::has_list_services_response() const { + return message_response_case() == kListServicesResponse; +} +void ServerReflectionResponse::set_has_list_services_response() { + _oneof_case_[0] = kListServicesResponse; +} +void ServerReflectionResponse::clear_list_services_response() { + if (has_list_services_response()) { + delete message_response_.list_services_response_; + clear_has_message_response(); + } +} + const ::grpc::reflection::v1alpha::ListServiceResponse& ServerReflectionResponse::list_services_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) + return has_list_services_response() + ? *message_response_.list_services_response_ + : ::grpc::reflection::v1alpha::ListServiceResponse::default_instance(); +} +::grpc::reflection::v1alpha::ListServiceResponse* ServerReflectionResponse::mutable_list_services_response() { + if (!has_list_services_response()) { + clear_message_response(); + set_has_list_services_response(); + message_response_.list_services_response_ = new ::grpc::reflection::v1alpha::ListServiceResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) + return message_response_.list_services_response_; +} +::grpc::reflection::v1alpha::ListServiceResponse* ServerReflectionResponse::release_list_services_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) + if (has_list_services_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::ListServiceResponse* temp = message_response_.list_services_response_; + message_response_.list_services_response_ = NULL; + return temp; + } else { + return NULL; + } +} +void ServerReflectionResponse::set_allocated_list_services_response(::grpc::reflection::v1alpha::ListServiceResponse* list_services_response) { + clear_message_response(); + if (list_services_response) { + set_has_list_services_response(); + message_response_.list_services_response_ = list_services_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.list_services_response) +} + +// optional .grpc.reflection.v1alpha.ErrorResponse error_response = 7; +bool ServerReflectionResponse::has_error_response() const { + return message_response_case() == kErrorResponse; +} +void ServerReflectionResponse::set_has_error_response() { + _oneof_case_[0] = kErrorResponse; +} +void ServerReflectionResponse::clear_error_response() { + if (has_error_response()) { + delete message_response_.error_response_; + clear_has_message_response(); + } +} + const ::grpc::reflection::v1alpha::ErrorResponse& ServerReflectionResponse::error_response() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) + return has_error_response() + ? *message_response_.error_response_ + : ::grpc::reflection::v1alpha::ErrorResponse::default_instance(); +} +::grpc::reflection::v1alpha::ErrorResponse* ServerReflectionResponse::mutable_error_response() { + if (!has_error_response()) { + clear_message_response(); + set_has_error_response(); + message_response_.error_response_ = new ::grpc::reflection::v1alpha::ErrorResponse; + } + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) + return message_response_.error_response_; +} +::grpc::reflection::v1alpha::ErrorResponse* ServerReflectionResponse::release_error_response() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) + if (has_error_response()) { + clear_has_message_response(); + ::grpc::reflection::v1alpha::ErrorResponse* temp = message_response_.error_response_; + message_response_.error_response_ = NULL; + return temp; + } else { + return NULL; + } +} +void ServerReflectionResponse::set_allocated_error_response(::grpc::reflection::v1alpha::ErrorResponse* error_response) { + clear_message_response(); + if (error_response) { + set_has_error_response(); + message_response_.error_response_ = error_response; + } + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServerReflectionResponse.error_response) +} + +bool ServerReflectionResponse::has_message_response() const { + return message_response_case() != MESSAGE_RESPONSE_NOT_SET; +} +void ServerReflectionResponse::clear_has_message_response() { + _oneof_case_[0] = MESSAGE_RESPONSE_NOT_SET; +} +ServerReflectionResponse::MessageResponseCase ServerReflectionResponse::message_response_case() const { + return ServerReflectionResponse::MessageResponseCase(_oneof_case_[0]); +} +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FileDescriptorResponse::kFileDescriptorProtoFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FileDescriptorResponse::FileDescriptorResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.FileDescriptorResponse) +} + +void FileDescriptorResponse::InitAsDefaultInstance() { + _is_default_instance_ = true; +} + +FileDescriptorResponse::FileDescriptorResponse(const FileDescriptorResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.FileDescriptorResponse) +} + +void FileDescriptorResponse::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; +} + +FileDescriptorResponse::~FileDescriptorResponse() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.FileDescriptorResponse) + SharedDtor(); +} + +void FileDescriptorResponse::SharedDtor() { + if (this != default_instance_) { + } +} + +void FileDescriptorResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FileDescriptorResponse::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FileDescriptorResponse_descriptor_; +} + +const FileDescriptorResponse& FileDescriptorResponse::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +FileDescriptorResponse* FileDescriptorResponse::default_instance_ = NULL; + +FileDescriptorResponse* FileDescriptorResponse::New(::google::protobuf::Arena* arena) const { + FileDescriptorResponse* n = new FileDescriptorResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FileDescriptorResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.FileDescriptorResponse) + file_descriptor_proto_.Clear(); +} + +bool FileDescriptorResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.FileDescriptorResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated bytes file_descriptor_proto = 1; + case 1: { + if (tag == 10) { + parse_file_descriptor_proto: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_file_descriptor_proto())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_file_descriptor_proto; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.FileDescriptorResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.FileDescriptorResponse) + return false; +#undef DO_ +} + +void FileDescriptorResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.FileDescriptorResponse) + // repeated bytes file_descriptor_proto = 1; + for (int i = 0; i < this->file_descriptor_proto_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 1, this->file_descriptor_proto(i), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.FileDescriptorResponse) +} + +::google::protobuf::uint8* FileDescriptorResponse::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.FileDescriptorResponse) + // repeated bytes file_descriptor_proto = 1; + for (int i = 0; i < this->file_descriptor_proto_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(1, this->file_descriptor_proto(i), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.FileDescriptorResponse) + return target; +} + +int FileDescriptorResponse::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.FileDescriptorResponse) + int total_size = 0; + + // repeated bytes file_descriptor_proto = 1; + total_size += 1 * this->file_descriptor_proto_size(); + for (int i = 0; i < this->file_descriptor_proto_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->file_descriptor_proto(i)); + } + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FileDescriptorResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.FileDescriptorResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FileDescriptorResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated<const FileDescriptorResponse>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.FileDescriptorResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.FileDescriptorResponse) + MergeFrom(*source); + } +} + +void FileDescriptorResponse::MergeFrom(const FileDescriptorResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.FileDescriptorResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + file_descriptor_proto_.MergeFrom(from.file_descriptor_proto_); +} + +void FileDescriptorResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.FileDescriptorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FileDescriptorResponse::CopyFrom(const FileDescriptorResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.FileDescriptorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FileDescriptorResponse::IsInitialized() const { + + return true; +} + +void FileDescriptorResponse::Swap(FileDescriptorResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void FileDescriptorResponse::InternalSwap(FileDescriptorResponse* other) { + file_descriptor_proto_.UnsafeArenaSwap(&other->file_descriptor_proto_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FileDescriptorResponse::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FileDescriptorResponse_descriptor_; + metadata.reflection = FileDescriptorResponse_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FileDescriptorResponse + +// repeated bytes file_descriptor_proto = 1; +int FileDescriptorResponse::file_descriptor_proto_size() const { + return file_descriptor_proto_.size(); +} +void FileDescriptorResponse::clear_file_descriptor_proto() { + file_descriptor_proto_.Clear(); +} + const ::std::string& FileDescriptorResponse::file_descriptor_proto(int index) const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_.Get(index); +} + ::std::string* FileDescriptorResponse::mutable_file_descriptor_proto(int index) { + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_.Mutable(index); +} + void FileDescriptorResponse::set_file_descriptor_proto(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + file_descriptor_proto_.Mutable(index)->assign(value); +} + void FileDescriptorResponse::set_file_descriptor_proto(int index, const char* value) { + file_descriptor_proto_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} + void FileDescriptorResponse::set_file_descriptor_proto(int index, const void* value, size_t size) { + file_descriptor_proto_.Mutable(index)->assign( + reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} + ::std::string* FileDescriptorResponse::add_file_descriptor_proto() { + // @@protoc_insertion_point(field_add_mutable:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_.Add(); +} + void FileDescriptorResponse::add_file_descriptor_proto(const ::std::string& value) { + file_descriptor_proto_.Add()->assign(value); + // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} + void FileDescriptorResponse::add_file_descriptor_proto(const char* value) { + file_descriptor_proto_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} + void FileDescriptorResponse::add_file_descriptor_proto(const void* value, size_t size) { + file_descriptor_proto_.Add()->assign(reinterpret_cast<const char*>(value), size); + // @@protoc_insertion_point(field_add_pointer:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +FileDescriptorResponse::file_descriptor_proto() const { + // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return file_descriptor_proto_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +FileDescriptorResponse::mutable_file_descriptor_proto() { + // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.FileDescriptorResponse.file_descriptor_proto) + return &file_descriptor_proto_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ExtensionNumberResponse::kBaseTypeNameFieldNumber; +const int ExtensionNumberResponse::kExtensionNumberFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ExtensionNumberResponse::ExtensionNumberResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ExtensionNumberResponse) +} + +void ExtensionNumberResponse::InitAsDefaultInstance() { + _is_default_instance_ = true; +} + +ExtensionNumberResponse::ExtensionNumberResponse(const ExtensionNumberResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ExtensionNumberResponse) +} + +void ExtensionNumberResponse::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + base_type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ExtensionNumberResponse::~ExtensionNumberResponse() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ExtensionNumberResponse) + SharedDtor(); +} + +void ExtensionNumberResponse::SharedDtor() { + base_type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void ExtensionNumberResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ExtensionNumberResponse::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ExtensionNumberResponse_descriptor_; +} + +const ExtensionNumberResponse& ExtensionNumberResponse::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ExtensionNumberResponse* ExtensionNumberResponse::default_instance_ = NULL; + +ExtensionNumberResponse* ExtensionNumberResponse::New(::google::protobuf::Arena* arena) const { + ExtensionNumberResponse* n = new ExtensionNumberResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ExtensionNumberResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + base_type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extension_number_.Clear(); +} + +bool ExtensionNumberResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string base_type_name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_base_type_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->base_type_name().data(), this->base_type_name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name")); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_extension_number; + break; + } + + // repeated int32 extension_number = 2; + case 2: { + if (tag == 18) { + parse_extension_number: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_extension_number()))); + } else if (tag == 16) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 18, input, this->mutable_extension_number()))); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ExtensionNumberResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ExtensionNumberResponse) + return false; +#undef DO_ +} + +void ExtensionNumberResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + // optional string base_type_name = 1; + if (this->base_type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->base_type_name().data(), this->base_type_name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->base_type_name(), output); + } + + // repeated int32 extension_number = 2; + if (this->extension_number_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_extension_number_cached_byte_size_); + } + for (int i = 0; i < this->extension_number_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->extension_number(i), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ExtensionNumberResponse) +} + +::google::protobuf::uint8* ExtensionNumberResponse::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + // optional string base_type_name = 1; + if (this->base_type_name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->base_type_name().data(), this->base_type_name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->base_type_name(), target); + } + + // repeated int32 extension_number = 2; + if (this->extension_number_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _extension_number_cached_byte_size_, target); + } + for (int i = 0; i < this->extension_number_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->extension_number(i), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ExtensionNumberResponse) + return target; +} + +int ExtensionNumberResponse::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + int total_size = 0; + + // optional string base_type_name = 1; + if (this->base_type_name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->base_type_name()); + } + + // repeated int32 extension_number = 2; + { + int data_size = 0; + for (int i = 0; i < this->extension_number_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->extension_number(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _extension_number_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ExtensionNumberResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ExtensionNumberResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ExtensionNumberResponse>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ExtensionNumberResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ExtensionNumberResponse) + MergeFrom(*source); + } +} + +void ExtensionNumberResponse::MergeFrom(const ExtensionNumberResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + extension_number_.MergeFrom(from.extension_number_); + if (from.base_type_name().size() > 0) { + + base_type_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.base_type_name_); + } +} + +void ExtensionNumberResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ExtensionNumberResponse::CopyFrom(const ExtensionNumberResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ExtensionNumberResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ExtensionNumberResponse::IsInitialized() const { + + return true; +} + +void ExtensionNumberResponse::Swap(ExtensionNumberResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ExtensionNumberResponse::InternalSwap(ExtensionNumberResponse* other) { + base_type_name_.Swap(&other->base_type_name_); + extension_number_.UnsafeArenaSwap(&other->extension_number_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ExtensionNumberResponse::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ExtensionNumberResponse_descriptor_; + metadata.reflection = ExtensionNumberResponse_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ExtensionNumberResponse + +// optional string base_type_name = 1; +void ExtensionNumberResponse::clear_base_type_name() { + base_type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + const ::std::string& ExtensionNumberResponse::base_type_name() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) + return base_type_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ExtensionNumberResponse::set_base_type_name(const ::std::string& value) { + + base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} + void ExtensionNumberResponse::set_base_type_name(const char* value) { + + base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} + void ExtensionNumberResponse::set_base_type_name(const char* value, size_t size) { + + base_type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} + ::std::string* ExtensionNumberResponse::mutable_base_type_name() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) + return base_type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ExtensionNumberResponse::release_base_type_name() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) + + return base_type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ExtensionNumberResponse::set_allocated_base_type_name(::std::string* base_type_name) { + if (base_type_name != NULL) { + + } else { + + } + base_type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), base_type_name); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ExtensionNumberResponse.base_type_name) +} + +// repeated int32 extension_number = 2; +int ExtensionNumberResponse::extension_number_size() const { + return extension_number_.size(); +} +void ExtensionNumberResponse::clear_extension_number() { + extension_number_.Clear(); +} + ::google::protobuf::int32 ExtensionNumberResponse::extension_number(int index) const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) + return extension_number_.Get(index); +} + void ExtensionNumberResponse::set_extension_number(int index, ::google::protobuf::int32 value) { + extension_number_.Set(index, value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) +} + void ExtensionNumberResponse::add_extension_number(::google::protobuf::int32 value) { + extension_number_.Add(value); + // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +ExtensionNumberResponse::extension_number() const { + // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) + return extension_number_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +ExtensionNumberResponse::mutable_extension_number() { + // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.ExtensionNumberResponse.extension_number) + return &extension_number_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ListServiceResponse::kServiceFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ListServiceResponse::ListServiceResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ListServiceResponse) +} + +void ListServiceResponse::InitAsDefaultInstance() { + _is_default_instance_ = true; +} + +ListServiceResponse::ListServiceResponse(const ListServiceResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ListServiceResponse) +} + +void ListServiceResponse::SharedCtor() { + _is_default_instance_ = false; + _cached_size_ = 0; +} + +ListServiceResponse::~ListServiceResponse() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ListServiceResponse) + SharedDtor(); +} + +void ListServiceResponse::SharedDtor() { + if (this != default_instance_) { + } +} + +void ListServiceResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ListServiceResponse::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ListServiceResponse_descriptor_; +} + +const ListServiceResponse& ListServiceResponse::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ListServiceResponse* ListServiceResponse::default_instance_ = NULL; + +ListServiceResponse* ListServiceResponse::New(::google::protobuf::Arena* arena) const { + ListServiceResponse* n = new ListServiceResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ListServiceResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ListServiceResponse) + service_.Clear(); +} + +bool ListServiceResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ListServiceResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_service: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_service())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_service; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ListServiceResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ListServiceResponse) + return false; +#undef DO_ +} + +void ListServiceResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ListServiceResponse) + // repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; + for (unsigned int i = 0, n = this->service_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->service(i), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ListServiceResponse) +} + +::google::protobuf::uint8* ListServiceResponse::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ListServiceResponse) + // repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; + for (unsigned int i = 0, n = this->service_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->service(i), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ListServiceResponse) + return target; +} + +int ListServiceResponse::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ListServiceResponse) + int total_size = 0; + + // repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; + total_size += 1 * this->service_size(); + for (int i = 0; i < this->service_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->service(i)); + } + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ListServiceResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ListServiceResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ListServiceResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ListServiceResponse>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ListServiceResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ListServiceResponse) + MergeFrom(*source); + } +} + +void ListServiceResponse::MergeFrom(const ListServiceResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ListServiceResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + service_.MergeFrom(from.service_); +} + +void ListServiceResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ListServiceResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ListServiceResponse::CopyFrom(const ListServiceResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ListServiceResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ListServiceResponse::IsInitialized() const { + + return true; +} + +void ListServiceResponse::Swap(ListServiceResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ListServiceResponse::InternalSwap(ListServiceResponse* other) { + service_.UnsafeArenaSwap(&other->service_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ListServiceResponse::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ListServiceResponse_descriptor_; + metadata.reflection = ListServiceResponse_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ListServiceResponse + +// repeated .grpc.reflection.v1alpha.ServiceResponse service = 1; +int ListServiceResponse::service_size() const { + return service_.size(); +} +void ListServiceResponse::clear_service() { + service_.Clear(); +} +const ::grpc::reflection::v1alpha::ServiceResponse& ListServiceResponse::service(int index) const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_.Get(index); +} +::grpc::reflection::v1alpha::ServiceResponse* ListServiceResponse::mutable_service(int index) { + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_.Mutable(index); +} +::grpc::reflection::v1alpha::ServiceResponse* ListServiceResponse::add_service() { + // @@protoc_insertion_point(field_add:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_.Add(); +} +::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >* +ListServiceResponse::mutable_service() { + // @@protoc_insertion_point(field_mutable_list:grpc.reflection.v1alpha.ListServiceResponse.service) + return &service_; +} +const ::google::protobuf::RepeatedPtrField< ::grpc::reflection::v1alpha::ServiceResponse >& +ListServiceResponse::service() const { + // @@protoc_insertion_point(field_list:grpc.reflection.v1alpha.ListServiceResponse.service) + return service_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ServiceResponse::kNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ServiceResponse::ServiceResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ServiceResponse) +} + +void ServiceResponse::InitAsDefaultInstance() { + _is_default_instance_ = true; +} + +ServiceResponse::ServiceResponse(const ServiceResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ServiceResponse) +} + +void ServiceResponse::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ServiceResponse::~ServiceResponse() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ServiceResponse) + SharedDtor(); +} + +void ServiceResponse::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void ServiceResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ServiceResponse::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ServiceResponse_descriptor_; +} + +const ServiceResponse& ServiceResponse::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ServiceResponse* ServiceResponse::default_instance_ = NULL; + +ServiceResponse* ServiceResponse::New(::google::protobuf::Arena* arena) const { + ServiceResponse* n = new ServiceResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ServiceResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ServiceResponse) + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ServiceResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ServiceResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ServiceResponse.name")); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ServiceResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ServiceResponse) + return false; +#undef DO_ +} + +void ServiceResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ServiceResponse) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServiceResponse.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ServiceResponse) +} + +::google::protobuf::uint8* ServiceResponse::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ServiceResponse) + // optional string name = 1; + if (this->name().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ServiceResponse.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ServiceResponse) + return target; +} + +int ServiceResponse::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ServiceResponse) + int total_size = 0; + + // optional string name = 1; + if (this->name().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ServiceResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ServiceResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ServiceResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ServiceResponse>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ServiceResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ServiceResponse) + MergeFrom(*source); + } +} + +void ServiceResponse::MergeFrom(const ServiceResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ServiceResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from.name().size() > 0) { + + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } +} + +void ServiceResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ServiceResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ServiceResponse::CopyFrom(const ServiceResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ServiceResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ServiceResponse::IsInitialized() const { + + return true; +} + +void ServiceResponse::Swap(ServiceResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ServiceResponse::InternalSwap(ServiceResponse* other) { + name_.Swap(&other->name_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ServiceResponse::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ServiceResponse_descriptor_; + metadata.reflection = ServiceResponse_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ServiceResponse + +// optional string name = 1; +void ServiceResponse::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + const ::std::string& ServiceResponse::name() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ServiceResponse.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServiceResponse::set_name(const ::std::string& value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ServiceResponse.name) +} + void ServiceResponse::set_name(const char* value) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ServiceResponse.name) +} + void ServiceResponse::set_name(const char* value, size_t size) { + + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ServiceResponse.name) +} + ::std::string* ServiceResponse::mutable_name() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ServiceResponse.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServiceResponse::release_name() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ServiceResponse.name) + + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServiceResponse::set_allocated_name(::std::string* name) { + if (name != NULL) { + + } else { + + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ServiceResponse.name) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ErrorResponse::kErrorCodeFieldNumber; +const int ErrorResponse::kErrorMessageFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ErrorResponse::ErrorResponse() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:grpc.reflection.v1alpha.ErrorResponse) +} + +void ErrorResponse::InitAsDefaultInstance() { + _is_default_instance_ = true; +} + +ErrorResponse::ErrorResponse(const ErrorResponse& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:grpc.reflection.v1alpha.ErrorResponse) +} + +void ErrorResponse::SharedCtor() { + _is_default_instance_ = false; + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + error_code_ = 0; + error_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +ErrorResponse::~ErrorResponse() { + // @@protoc_insertion_point(destructor:grpc.reflection.v1alpha.ErrorResponse) + SharedDtor(); +} + +void ErrorResponse::SharedDtor() { + error_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void ErrorResponse::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ErrorResponse::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ErrorResponse_descriptor_; +} + +const ErrorResponse& ErrorResponse::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_reflection_2eproto(); + return *default_instance_; +} + +ErrorResponse* ErrorResponse::default_instance_ = NULL; + +ErrorResponse* ErrorResponse::New(::google::protobuf::Arena* arena) const { + ErrorResponse* n = new ErrorResponse; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ErrorResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:grpc.reflection.v1alpha.ErrorResponse) + error_code_ = 0; + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + +bool ErrorResponse::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:grpc.reflection.v1alpha.ErrorResponse) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 error_code = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &error_code_))); + + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_error_message; + break; + } + + // optional string error_message = 2; + case 2: { + if (tag == 18) { + parse_error_message: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_error_message())); + DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), this->error_message().length(), + ::google::protobuf::internal::WireFormatLite::PARSE, + "grpc.reflection.v1alpha.ErrorResponse.error_message")); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:grpc.reflection.v1alpha.ErrorResponse) + return true; +failure: + // @@protoc_insertion_point(parse_failure:grpc.reflection.v1alpha.ErrorResponse) + return false; +#undef DO_ +} + +void ErrorResponse::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:grpc.reflection.v1alpha.ErrorResponse) + // optional int32 error_code = 1; + if (this->error_code() != 0) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->error_code(), output); + } + + // optional string error_message = 2; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), this->error_message().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ErrorResponse.error_message"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->error_message(), output); + } + + // @@protoc_insertion_point(serialize_end:grpc.reflection.v1alpha.ErrorResponse) +} + +::google::protobuf::uint8* ErrorResponse::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:grpc.reflection.v1alpha.ErrorResponse) + // optional int32 error_code = 1; + if (this->error_code() != 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->error_code(), target); + } + + // optional string error_message = 2; + if (this->error_message().size() > 0) { + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + this->error_message().data(), this->error_message().length(), + ::google::protobuf::internal::WireFormatLite::SERIALIZE, + "grpc.reflection.v1alpha.ErrorResponse.error_message"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->error_message(), target); + } + + // @@protoc_insertion_point(serialize_to_array_end:grpc.reflection.v1alpha.ErrorResponse) + return target; +} + +int ErrorResponse::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:grpc.reflection.v1alpha.ErrorResponse) + int total_size = 0; + + // optional int32 error_code = 1; + if (this->error_code() != 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->error_code()); + } + + // optional string error_message = 2; + if (this->error_message().size() > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->error_message()); + } + + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ErrorResponse::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grpc.reflection.v1alpha.ErrorResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ErrorResponse* source = + ::google::protobuf::internal::DynamicCastToGenerated<const ErrorResponse>( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grpc.reflection.v1alpha.ErrorResponse) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grpc.reflection.v1alpha.ErrorResponse) + MergeFrom(*source); + } +} + +void ErrorResponse::MergeFrom(const ErrorResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grpc.reflection.v1alpha.ErrorResponse) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from.error_code() != 0) { + set_error_code(from.error_code()); + } + if (from.error_message().size() > 0) { + + error_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.error_message_); + } +} + +void ErrorResponse::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grpc.reflection.v1alpha.ErrorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ErrorResponse::CopyFrom(const ErrorResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grpc.reflection.v1alpha.ErrorResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ErrorResponse::IsInitialized() const { + + return true; +} + +void ErrorResponse::Swap(ErrorResponse* other) { + if (other == this) return; + InternalSwap(other); +} +void ErrorResponse::InternalSwap(ErrorResponse* other) { + std::swap(error_code_, other->error_code_); + error_message_.Swap(&other->error_message_); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ErrorResponse::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ErrorResponse_descriptor_; + metadata.reflection = ErrorResponse_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ErrorResponse + +// optional int32 error_code = 1; +void ErrorResponse::clear_error_code() { + error_code_ = 0; +} + ::google::protobuf::int32 ErrorResponse::error_code() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ErrorResponse.error_code) + return error_code_; +} + void ErrorResponse::set_error_code(::google::protobuf::int32 value) { + + error_code_ = value; + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ErrorResponse.error_code) +} + +// optional string error_message = 2; +void ErrorResponse::clear_error_message() { + error_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + const ::std::string& ErrorResponse::error_message() const { + // @@protoc_insertion_point(field_get:grpc.reflection.v1alpha.ErrorResponse.error_message) + return error_message_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ErrorResponse::set_error_message(const ::std::string& value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:grpc.reflection.v1alpha.ErrorResponse.error_message) +} + void ErrorResponse::set_error_message(const char* value) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:grpc.reflection.v1alpha.ErrorResponse.error_message) +} + void ErrorResponse::set_error_message(const char* value, size_t size) { + + error_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast<const char*>(value), size)); + // @@protoc_insertion_point(field_set_pointer:grpc.reflection.v1alpha.ErrorResponse.error_message) +} + ::std::string* ErrorResponse::mutable_error_message() { + + // @@protoc_insertion_point(field_mutable:grpc.reflection.v1alpha.ErrorResponse.error_message) + return error_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ErrorResponse::release_error_message() { + // @@protoc_insertion_point(field_release:grpc.reflection.v1alpha.ErrorResponse.error_message) + + return error_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ErrorResponse::set_allocated_error_message(::std::string* error_message) { + if (error_message != NULL) { + + } else { + + } + error_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), error_message); + // @@protoc_insertion_point(field_set_allocated:grpc.reflection.v1alpha.ErrorResponse.error_message) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace v1alpha +} // namespace reflection +} // namespace grpc + +// @@protoc_insertion_point(global_scope) diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index a8b7b5f00d..a796911b99 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -136,6 +136,8 @@ <Compile Include="Internal\ClientSideStatus.cs" /> <Compile Include="Internal\ClockType.cs" /> <Compile Include="Internal\CallError.cs" /> + <Compile Include="Logging\LogLevel.cs" /> + <Compile Include="Logging\LogLevelFilterLogger.cs" /> </ItemGroup> <ItemGroup> <None Include="Grpc.Core.nuspec" /> diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs index 0359d9092a..e9e4cb4cbb 100644 --- a/src/csharp/Grpc.Core/GrpcEnvironment.cs +++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs @@ -47,6 +47,7 @@ namespace Grpc.Core /// </summary> public class GrpcEnvironment { + const LogLevel DefaultLogLevel = LogLevel.Info; const int MinDefaultThreadPoolSize = 4; static object staticLock = new object(); @@ -57,7 +58,7 @@ namespace Grpc.Core static readonly HashSet<Channel> registeredChannels = new HashSet<Channel>(); static readonly HashSet<Server> registeredServers = new HashSet<Server>(); - static ILogger logger = new ConsoleLogger(); + static ILogger logger = new LogLevelFilterLogger(new ConsoleLogger(), DefaultLogLevel); readonly object myLock = new object(); readonly GrpcThreadPool threadPool; diff --git a/src/csharp/Grpc.Core/Logging/LogLevel.cs b/src/csharp/Grpc.Core/Logging/LogLevel.cs new file mode 100644 index 0000000000..d64e1f5fd0 --- /dev/null +++ b/src/csharp/Grpc.Core/Logging/LogLevel.cs @@ -0,0 +1,59 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using System.Collections.Generic; + +namespace Grpc.Core.Logging +{ + /// <summary>Standard logging levels.</summary> + public enum LogLevel + { + /// <summary> + /// Debug severity. + /// </summary> + Debug = 0, + /// <summary> + /// Info severity. + /// </summary> + Info, + /// <summary> + /// Warning severity. + /// </summary> + Warning, + /// <summary> + /// Error severity. + /// </summary> + Error + } +} diff --git a/src/csharp/Grpc.Core/Logging/LogLevelFilterLogger.cs b/src/csharp/Grpc.Core/Logging/LogLevelFilterLogger.cs new file mode 100644 index 0000000000..4eeb79c783 --- /dev/null +++ b/src/csharp/Grpc.Core/Logging/LogLevelFilterLogger.cs @@ -0,0 +1,160 @@ +#region Copyright notice and license + +// 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. + +#endregion + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using Grpc.Core.Utils; + +namespace Grpc.Core.Logging +{ + /// <summary>Logger that filters out messages below certain log level.</summary> + public class LogLevelFilterLogger : ILogger + { + readonly ILogger innerLogger; + readonly LogLevel logLevel; + + /// <summary> + /// Creates and instance of <c>LogLevelFilter.</c> + /// </summary> + public LogLevelFilterLogger(ILogger logger, LogLevel logLevel) + { + this.innerLogger = GrpcPreconditions.CheckNotNull(logger); + this.logLevel = logLevel; + } + + /// <summary> + /// Returns a logger associated with the specified type. + /// </summary> + public virtual ILogger ForType<T>() + { + var newInnerLogger = innerLogger.ForType<T>(); + if (object.ReferenceEquals(this.innerLogger, newInnerLogger)) + { + return this; + } + return new LogLevelFilterLogger(newInnerLogger, logLevel); + } + + /// <summary>Logs a message with severity Debug.</summary> + public void Debug(string message) + { + if (logLevel <= LogLevel.Debug) + { + innerLogger.Debug(message); + } + } + + /// <summary>Logs a formatted message with severity Debug.</summary> + public void Debug(string format, params object[] formatArgs) + { + if (logLevel <= LogLevel.Debug) + { + innerLogger.Debug(format, formatArgs); + } + } + + /// <summary>Logs a message with severity Info.</summary> + public void Info(string message) + { + if (logLevel <= LogLevel.Info) + { + innerLogger.Info(message); + } + } + + /// <summary>Logs a formatted message with severity Info.</summary> + public void Info(string format, params object[] formatArgs) + { + if (logLevel <= LogLevel.Info) + { + innerLogger.Info(format, formatArgs); + } + } + + /// <summary>Logs a message with severity Warning.</summary> + public void Warning(string message) + { + if (logLevel <= LogLevel.Warning) + { + innerLogger.Warning(message); + } + } + + /// <summary>Logs a formatted message with severity Warning.</summary> + public void Warning(string format, params object[] formatArgs) + { + if (logLevel <= LogLevel.Warning) + { + innerLogger.Warning(format, formatArgs); + } + } + + /// <summary>Logs a message and an associated exception with severity Warning.</summary> + public void Warning(Exception exception, string message) + { + if (logLevel <= LogLevel.Warning) + { + innerLogger.Warning(exception, message); + } + } + + /// <summary>Logs a message with severity Error.</summary> + public void Error(string message) + { + if (logLevel <= LogLevel.Error) + { + innerLogger.Error(message); + } + } + + /// <summary>Logs a formatted message with severity Error.</summary> + public void Error(string format, params object[] formatArgs) + { + if (logLevel <= LogLevel.Error) + { + innerLogger.Error(format, formatArgs); + } + } + + /// <summary>Logs a message and an associated exception with severity Error.</summary> + public void Error(Exception exception, string message) + { + if (logLevel <= LogLevel.Error) + { + innerLogger.Error(exception, message); + } + } + } +} diff --git a/src/php/lib/Grpc/AbstractCall.php b/src/php/lib/Grpc/AbstractCall.php index 712af91eb2..c86d298805 100644 --- a/src/php/lib/Grpc/AbstractCall.php +++ b/src/php/lib/Grpc/AbstractCall.php @@ -39,6 +39,7 @@ abstract class AbstractCall protected $call; protected $deserialize; protected $metadata; + protected $trailing_metadata; /** * Create a new Call wrapper object. @@ -66,6 +67,7 @@ abstract class AbstractCall $this->call = new Call($channel, $method, $deadline); $this->deserialize = $deserialize; $this->metadata = null; + $this->trailing_metadata = null; if (isset($options['call_credentials_callback']) && is_callable($call_credentials_callback = $options['call_credentials_callback'])) { @@ -84,6 +86,14 @@ abstract class AbstractCall } /** + * @return The trailing metadata sent by the server. + */ + public function getTrailingMetadata() + { + return $this->trailing_metadata; + } + + /** * @return string The URI of the endpoint. */ public function getPeer() diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index 2de1b337e5..70644fac87 100755 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -52,8 +52,9 @@ class BaseStub * - 'update_metadata': (optional) a callback function which takes in a * metadata array, and returns an updated metadata array * - 'grpc.primary_user_agent': (optional) a user-agent string + * @param $channel Channel An already created Channel object */ - public function __construct($hostname, $opts) + public function __construct($hostname, $opts, $channel = null) { $this->hostname = $hostname; $this->update_metadata = null; @@ -77,7 +78,15 @@ class BaseStub 'required. Please see one of the '. 'ChannelCredentials::create methods'); } - $this->channel = new Channel($hostname, $opts); + if ($channel) { + if (!is_a($channel, 'Channel')) { + throw new \Exception("The channel argument is not a". + "Channel object"); + } + $this->channel = $channel; + } else { + $this->channel = new Channel($hostname, $opts); + } } /** diff --git a/src/php/lib/Grpc/BidiStreamingCall.php b/src/php/lib/Grpc/BidiStreamingCall.php index bf813c12e7..95e51c5088 100644 --- a/src/php/lib/Grpc/BidiStreamingCall.php +++ b/src/php/lib/Grpc/BidiStreamingCall.php @@ -112,6 +112,7 @@ class BidiStreamingCall extends AbstractCall OP_RECV_STATUS_ON_CLIENT => true, ]); + $this->trailing_metadata = $status_event->status->metadata; return $status_event->status; } } diff --git a/src/php/lib/Grpc/ClientStreamingCall.php b/src/php/lib/Grpc/ClientStreamingCall.php index 500cfe0d7a..315a406735 100644 --- a/src/php/lib/Grpc/ClientStreamingCall.php +++ b/src/php/lib/Grpc/ClientStreamingCall.php @@ -86,6 +86,8 @@ class ClientStreamingCall extends AbstractCall ]); $this->metadata = $event->metadata; - return [$this->deserializeResponse($event->message), $event->status]; + $status = $event->status; + $this->trailing_metadata = $status->metadata; + return [$this->deserializeResponse($event->message), $status]; } } diff --git a/src/php/lib/Grpc/ServerStreamingCall.php b/src/php/lib/Grpc/ServerStreamingCall.php index da48523717..53599fe4ae 100644 --- a/src/php/lib/Grpc/ServerStreamingCall.php +++ b/src/php/lib/Grpc/ServerStreamingCall.php @@ -91,6 +91,7 @@ class ServerStreamingCall extends AbstractCall OP_RECV_STATUS_ON_CLIENT => true, ]); + $this->trailing_metadata = $status_event->status->metadata; return $status_event->status; } } diff --git a/src/php/lib/Grpc/UnaryCall.php b/src/php/lib/Grpc/UnaryCall.php index b57903d6d0..b114b771b8 100644 --- a/src/php/lib/Grpc/UnaryCall.php +++ b/src/php/lib/Grpc/UnaryCall.php @@ -75,6 +75,8 @@ class UnaryCall extends AbstractCall OP_RECV_STATUS_ON_CLIENT => true, ]); - return [$this->deserializeResponse($event->message), $event->status]; + $status = $event->status; + $this->trailing_metadata = $status->metadata; + return [$this->deserializeResponse($event->message), $status]; } } diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py index 5ba5a4e1fd..2fbb9f45e6 100644 --- a/src/python/grpcio/grpc/__init__.py +++ b/src/python/grpcio/grpc/__init__.py @@ -900,6 +900,102 @@ class Server(six.with_metaclass(abc.ABCMeta)): ################################# Functions ################################ +def unary_unary_rpc_method_handler( + behavior, request_deserializer=None, response_serializer=None): + """Creates an RpcMethodHandler for a unary-unary RPC method. + + Args: + behavior: The implementation of an RPC method as a callable behavior taking + a single request value and returning a single response value. + request_deserializer: An optional request deserialization behavior. + response_serializer: An optional response serialization behavior. + + Returns: + An RpcMethodHandler for a unary-unary RPC method constructed from the given + parameters. + """ + from grpc import _utilities + return _utilities.RpcMethodHandler( + False, False, request_deserializer, response_serializer, behavior, None, + None, None) + + +def unary_stream_rpc_method_handler( + behavior, request_deserializer=None, response_serializer=None): + """Creates an RpcMethodHandler for a unary-stream RPC method. + + Args: + behavior: The implementation of an RPC method as a callable behavior taking + a single request value and returning an iterator of response values. + request_deserializer: An optional request deserialization behavior. + response_serializer: An optional response serialization behavior. + + Returns: + An RpcMethodHandler for a unary-stream RPC method constructed from the + given parameters. + """ + from grpc import _utilities + return _utilities.RpcMethodHandler( + False, True, request_deserializer, response_serializer, None, behavior, + None, None) + + +def stream_unary_rpc_method_handler( + behavior, request_deserializer=None, response_serializer=None): + """Creates an RpcMethodHandler for a stream-unary RPC method. + + Args: + behavior: The implementation of an RPC method as a callable behavior taking + an iterator of request values and returning a single response value. + request_deserializer: An optional request deserialization behavior. + response_serializer: An optional response serialization behavior. + + Returns: + An RpcMethodHandler for a stream-unary RPC method constructed from the + given parameters. + """ + from grpc import _utilities + return _utilities.RpcMethodHandler( + True, False, request_deserializer, response_serializer, None, None, + behavior, None) + + +def stream_stream_rpc_method_handler( + behavior, request_deserializer=None, response_serializer=None): + """Creates an RpcMethodHandler for a stream-stream RPC method. + + Args: + behavior: The implementation of an RPC method as a callable behavior taking + an iterator of request values and returning an iterator of response + values. + request_deserializer: An optional request deserialization behavior. + response_serializer: An optional response serialization behavior. + + Returns: + An RpcMethodHandler for a stream-stream RPC method constructed from the + given parameters. + """ + from grpc import _utilities + return _utilities.RpcMethodHandler( + True, True, request_deserializer, response_serializer, None, None, None, + behavior) + + +def method_handlers_generic_handler(service, method_handlers): + """Creates a grpc.GenericRpcHandler from RpcMethodHandlers. + + Args: + service: A service name to be used for the given method handlers. + method_handlers: A dictionary from method name to RpcMethodHandler + implementing the named method. + + Returns: + A GenericRpcHandler constructed from the given parameters. + """ + from grpc import _utilities + return _utilities.DictionaryGenericHandler(service, method_handlers) + + def ssl_channel_credentials( root_certificates=None, private_key=None, certificate_chain=None): """Creates a ChannelCredentials for use with an SSL-enabled Channel. @@ -1059,7 +1155,7 @@ def insecure_channel(target, options=None): A Channel to the target through which RPCs may be conducted. """ from grpc import _channel - return _channel.Channel(target, None, options) + return _channel.Channel(target, options, None) def secure_channel(target, credentials, options=None): @@ -1075,7 +1171,7 @@ def secure_channel(target, credentials, options=None): A Channel to the target through which RPCs may be conducted. """ from grpc import _channel - return _channel.Channel(target, credentials, options) + return _channel.Channel(target, options, credentials) def server(generic_rpc_handlers, thread_pool, options=None): diff --git a/src/python/grpcio/grpc/_common.py b/src/python/grpcio/grpc/_common.py index b8688a0149..1fd1704f18 100644 --- a/src/python/grpcio/grpc/_common.py +++ b/src/python/grpcio/grpc/_common.py @@ -30,6 +30,8 @@ """Shared implementation.""" import logging +import threading +import time import six @@ -110,3 +112,43 @@ def fully_qualified_method(group, method): group = _encode(group) method = _encode(method) return b'/' + group + b'/' + method + + +class CleanupThread(threading.Thread): + """A threading.Thread subclass supporting custom behavior on join(). + + On Python Interpreter exit, Python will attempt to join outstanding threads + prior to garbage collection. We may need to do additional cleanup, and + we accomplish this by overriding the join() method. + """ + + def __init__(self, behavior, group=None, target=None, name=None, + args=(), kwargs={}): + """Constructor. + + Args: + behavior (function): Function called on join() with a single + argument, timeout, indicating the maximum duration of + `behavior`, or None indicating `behavior` has no deadline. + `behavior` must be idempotent. + group (None): should be None. Reseved for future extensions + when ThreadGroup is implemented. + target (function): The function to invoke when this thread is + run. Defaults to None. + name (str): The name of this thread. Defaults to None. + args (tuple[object]): A tuple of arguments to pass to `target`. + kwargs (dict[str,object]): A dictionary of keyword arguments to + pass to `target`. + """ + super(CleanupThread, self).__init__(group=group, target=target, + name=name, args=args, kwargs=kwargs) + self._behavior = behavior + + def join(self, timeout=None): + start_time = time.time() + self._behavior(timeout) + end_time = time.time() + if timeout is not None: + timeout -= end_time - start_time + timeout = max(timeout, 0) + super(CleanupThread, self).join(timeout) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi index a67c963684..01089c3dc0 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pxd.pxi @@ -31,9 +31,6 @@ cdef class CompletionQueue: cdef grpc_completion_queue *c_completion_queue - cdef object pluck_condition - cdef int num_plucking - cdef int num_polling cdef bint is_shutting_down cdef bint is_shutdown diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi index cdae39d519..90266516fe 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi @@ -32,6 +32,8 @@ cimport cpython import threading import time +cdef int _INTERRUPT_CHECK_PERIOD_MS = 200 + cdef class CompletionQueue: @@ -40,9 +42,6 @@ cdef class CompletionQueue: self.c_completion_queue = grpc_completion_queue_create(NULL) self.is_shutting_down = False self.is_shutdown = False - self.pluck_condition = threading.Condition() - self.num_plucking = 0 - self.num_polling = 0 cdef _interpret_event(self, grpc_event event): cdef OperationTag tag = None @@ -83,45 +82,27 @@ cdef class CompletionQueue: def poll(self, Timespec deadline=None): # We name this 'poll' to avoid problems with CPython's expectations for # 'special' methods (like next and __next__). + cdef gpr_timespec c_increment + cdef gpr_timespec c_timeout cdef gpr_timespec c_deadline with nogil: + c_increment = gpr_time_from_millis(_INTERRUPT_CHECK_PERIOD_MS, GPR_TIMESPAN) c_deadline = gpr_inf_future(GPR_CLOCK_REALTIME) - if deadline is not None: - c_deadline = deadline.c_time - cdef grpc_event event - - # Poll within a critical section to detect contention - with self.pluck_condition: - assert self.num_plucking == 0, 'cannot simultaneously pluck and poll' - self.num_polling += 1 - with nogil: - event = grpc_completion_queue_next( - self.c_completion_queue, c_deadline, NULL) - with self.pluck_condition: - self.num_polling -= 1 - return self._interpret_event(event) - - def pluck(self, OperationTag tag, Timespec deadline=None): - # Plucking a 'None' tag is equivalent to passing control to GRPC core until - # the deadline. - cdef gpr_timespec c_deadline = gpr_inf_future( - GPR_CLOCK_REALTIME) - if deadline is not None: - c_deadline = deadline.c_time - cdef grpc_event event - - # Pluck within a critical section to detect contention - with self.pluck_condition: - assert self.num_polling == 0, 'cannot simultaneously pluck and poll' - assert self.num_plucking < GRPC_MAX_COMPLETION_QUEUE_PLUCKERS, ( - 'cannot pluck more than {} times simultaneously'.format( - GRPC_MAX_COMPLETION_QUEUE_PLUCKERS)) - self.num_plucking += 1 - with nogil: - event = grpc_completion_queue_pluck( - self.c_completion_queue, <cpython.PyObject *>tag, c_deadline, NULL) - with self.pluck_condition: - self.num_plucking -= 1 + if deadline is not None: + c_deadline = deadline.c_time + + while True: + c_timeout = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), c_increment) + if gpr_time_cmp(c_timeout, c_deadline) > 0: + c_timeout = c_deadline + event = grpc_completion_queue_next( + self.c_completion_queue, c_timeout, NULL) + if event.type != GRPC_QUEUE_TIMEOUT or gpr_time_cmp(c_timeout, c_deadline) == 0: + break; + + # Handle any signals + with gil: + cpython.PyErr_CheckSignals() return self._interpret_event(event) def shutdown(self): diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi index 05b8886df7..168b9751aa 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi @@ -80,6 +80,12 @@ cdef extern from "grpc/_cython/loader.h": gpr_timespec gpr_convert_clock_type(gpr_timespec t, gpr_clock_type target_clock) nogil + gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type type) nogil + + gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b) nogil + + int gpr_time_cmp(gpr_timespec a, gpr_timespec b) nogil + ctypedef enum grpc_status_code: GRPC_STATUS_OK GRPC_STATUS_CANCELLED diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi index c8a73e65d6..42afeb8498 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi @@ -99,7 +99,7 @@ cdef class Server: with nogil: grpc_server_start(self.c_server) # Ensure the core has gotten a chance to do the start-up work - self.backup_shutdown_queue.pluck(None, Timespec(None)) + self.backup_shutdown_queue.poll(Timespec(None)) def add_http2_port(self, address, ServerCredentials server_credentials=None): diff --git a/src/python/grpcio/grpc/_cython/imports.generated.h b/src/python/grpcio/grpc/_cython/imports.generated.h index a14f4f5183..d52e8591b3 100644 --- a/src/python/grpcio/grpc/_cython/imports.generated.h +++ b/src/python/grpcio/grpc/_cython/imports.generated.h @@ -482,7 +482,7 @@ extern grpc_byte_buffer_reader_readall_type grpc_byte_buffer_reader_readall_impo typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_from_reader_type)(grpc_byte_buffer_reader *reader); extern grpc_raw_byte_buffer_from_reader_type grpc_raw_byte_buffer_from_reader_import; #define grpc_raw_byte_buffer_from_reader grpc_raw_byte_buffer_from_reader_import -typedef void(*gpr_log_type)(const char *file, int line, gpr_log_severity severity, const char *format, ...); +typedef void(*gpr_log_type)(const char *file, int line, gpr_log_severity severity, const char *format, ...) GPRC_PRINT_FORMAT_CHECK(4, 5); extern gpr_log_type gpr_log_import; #define gpr_log gpr_log_import typedef void(*gpr_log_message_type)(const char *file, int line, gpr_log_severity severity, const char *message); @@ -827,7 +827,7 @@ extern gpr_format_message_type gpr_format_message_import; typedef char *(*gpr_strdup_type)(const char *src); extern gpr_strdup_type gpr_strdup_import; #define gpr_strdup gpr_strdup_import -typedef int(*gpr_asprintf_type)(char **strp, const char *format, ...); +typedef int(*gpr_asprintf_type)(char **strp, const char *format, ...) GPRC_PRINT_FORMAT_CHECK(2, 3); extern gpr_asprintf_type gpr_asprintf_import; #define gpr_asprintf gpr_asprintf_import typedef const char *(*gpr_subprocess_binary_extension_type)(); diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index f4f6720497..bf20f15f72 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -60,6 +60,8 @@ _CANCELLED = 'cancelled' _EMPTY_FLAGS = 0 _EMPTY_METADATA = cygrpc.Metadata(()) +_UNEXPECTED_EXIT_SERVER_GRACE = 1.0 + def _serialized_request(request_event): return request_event.batch_operations[0].received_message.bytes() @@ -254,7 +256,7 @@ class _Context(grpc.ServicerContext): else: if self._state.initial_metadata_allowed: operation = cygrpc.operation_send_initial_metadata( - cygrpc.Metadata(initial_metadata), _EMPTY_FLAGS) + _common.metadata(initial_metadata), _EMPTY_FLAGS) self._rpc_event.operation_call.start_batch( cygrpc.Operations((operation,)), _send_initial_metadata(self._state)) @@ -342,10 +344,9 @@ def _unary_request(rpc_event, state, request_deserializer): if state.client is _CLOSED: details = '"{}" requires exactly one request message.'.format( rpc_event.request_call_details.method) - # TODO(5992#issuecomment-220761992): really, what status code? _abort( state, rpc_event.operation_call, - cygrpc.StatusCode.unavailable, details) + cygrpc.StatusCode.unimplemented, details) return None elif state.client is _CANCELLED: return None @@ -670,17 +671,6 @@ def _serve(state): return -def _start(state): - with state.lock: - if state.stage is not _ServerStage.STOPPED: - raise ValueError('Cannot start already-started server!') - state.server.start() - state.stage = _ServerStage.STARTED - _request_call(state) - thread = threading.Thread(target=_serve, args=(state,)) - thread.start() - - def _stop(state, grace): with state.lock: if state.stage is _ServerStage.STOPPED: @@ -719,6 +709,24 @@ def _stop(state, grace): return shutdown_event +def _start(state): + with state.lock: + if state.stage is not _ServerStage.STOPPED: + raise ValueError('Cannot start already-started server!') + state.server.start() + state.stage = _ServerStage.STARTED + _request_call(state) + def cleanup_server(timeout): + if timeout is None: + _stop(state, _UNEXPECTED_EXIT_SERVER_GRACE).wait() + else: + _stop(state, timeout).wait() + + thread = _common.CleanupThread( + cleanup_server, target=_serve, args=(state,)) + thread.start() + + class Server(grpc.Server): def __init__(self, generic_handlers, thread_pool): diff --git a/src/python/grpcio/grpc/_utilities.py b/src/python/grpcio/grpc/_utilities.py index a4ca9b7282..4850967fbc 100644 --- a/src/python/grpcio/grpc/_utilities.py +++ b/src/python/grpcio/grpc/_utilities.py @@ -29,16 +29,41 @@ """Internal utilities for gRPC Python.""" +import collections import threading import time +import six + import grpc +from grpc import _common from grpc.framework.foundation import callable_util _DONE_CALLBACK_EXCEPTION_LOG_MESSAGE = ( 'Exception calling connectivity future "done" callback!') +class RpcMethodHandler( + collections.namedtuple( + '_RpcMethodHandler', + ('request_streaming', 'response_streaming', 'request_deserializer', + 'response_serializer', 'unary_unary', 'unary_stream', 'stream_unary', + 'stream_stream',)), + grpc.RpcMethodHandler): + pass + + +class DictionaryGenericHandler(grpc.GenericRpcHandler): + + def __init__(self, service, method_handlers): + self._method_handlers = { + _common.fully_qualified_method(service, method): method_handler + for method, method_handler in six.iteritems(method_handlers)} + + def service(self, handler_call_details): + return self._method_handlers.get(handler_call_details.method) + + class _ChannelReadyFuture(grpc.Future): def __init__(self, channel): @@ -144,4 +169,3 @@ def channel_ready_future(channel): ready_future = _ChannelReadyFuture(channel) ready_future.start() return ready_future - diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 0f9212f6a0..839c555f05 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -162,6 +162,7 @@ CORE_SOURCE_FILES = [ 'src/core/lib/transport/transport.c', 'src/core/lib/transport/transport_op_string.c', 'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c', + 'src/core/ext/transport/chttp2/transport/bin_decoder.c', 'src/core/ext/transport/chttp2/transport/bin_encoder.c', 'src/core/ext/transport/chttp2/transport/chttp2_plugin.c', 'src/core/ext/transport/chttp2/transport/chttp2_transport.c', diff --git a/src/python/grpcio/tests/protoc_plugin/_python_plugin_test.py b/src/python/grpcio/tests/protoc_plugin/_python_plugin_test.py new file mode 100644 index 0000000000..1c9cbb0d0c --- /dev/null +++ b/src/python/grpcio/tests/protoc_plugin/_python_plugin_test.py @@ -0,0 +1,583 @@ +# 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. + +import collections +from concurrent import futures +import contextlib +import distutils.spawn +import errno +import os +import shutil +import subprocess +import sys +import tempfile +import threading +import unittest + +from six import moves + +import grpc +from tests.unit.framework.common import test_constants + +# Identifiers of entities we expect to find in the generated module. +STUB_IDENTIFIER = 'TestServiceStub' +SERVICER_IDENTIFIER = 'TestServiceServicer' +ADD_SERVICER_TO_SERVER_IDENTIFIER = 'add_TestServiceServicer_to_server' + + +class _ServicerMethods(object): + + def __init__(self, response_pb2, payload_pb2): + self._condition = threading.Condition() + self._paused = False + self._fail = False + self._response_pb2 = response_pb2 + self._payload_pb2 = payload_pb2 + + @contextlib.contextmanager + def pause(self): # pylint: disable=invalid-name + with self._condition: + self._paused = True + yield + with self._condition: + self._paused = False + self._condition.notify_all() + + @contextlib.contextmanager + def fail(self): # pylint: disable=invalid-name + with self._condition: + self._fail = True + yield + with self._condition: + self._fail = False + + def _control(self): # pylint: disable=invalid-name + with self._condition: + if self._fail: + raise ValueError() + while self._paused: + self._condition.wait() + + def UnaryCall(self, request, unused_rpc_context): + response = self._response_pb2.SimpleResponse() + response.payload.payload_type = self._payload_pb2.COMPRESSABLE + response.payload.payload_compressable = 'a' * request.response_size + self._control() + return response + + def StreamingOutputCall(self, request, unused_rpc_context): + for parameter in request.response_parameters: + response = self._response_pb2.StreamingOutputCallResponse() + response.payload.payload_type = self._payload_pb2.COMPRESSABLE + response.payload.payload_compressable = 'a' * parameter.size + self._control() + yield response + + def StreamingInputCall(self, request_iter, unused_rpc_context): + response = self._response_pb2.StreamingInputCallResponse() + aggregated_payload_size = 0 + for request in request_iter: + aggregated_payload_size += len(request.payload.payload_compressable) + response.aggregated_payload_size = aggregated_payload_size + self._control() + return response + + def FullDuplexCall(self, request_iter, unused_rpc_context): + for request in request_iter: + for parameter in request.response_parameters: + response = self._response_pb2.StreamingOutputCallResponse() + response.payload.payload_type = self._payload_pb2.COMPRESSABLE + response.payload.payload_compressable = 'a' * parameter.size + self._control() + yield response + + def HalfDuplexCall(self, request_iter, unused_rpc_context): + responses = [] + for request in request_iter: + for parameter in request.response_parameters: + response = self._response_pb2.StreamingOutputCallResponse() + response.payload.payload_type = self._payload_pb2.COMPRESSABLE + response.payload.payload_compressable = 'a' * parameter.size + self._control() + responses.append(response) + for response in responses: + yield response + + +class _Service( + collections.namedtuple( + '_Service', ('servicer_methods', 'server', 'stub',))): + """A live and running service. + + Attributes: + servicer_methods: The _ServicerMethods servicing RPCs. + server: The grpc.Server servicing RPCs. + stub: A stub on which to invoke RPCs. + """ + + +def _CreateService(service_pb2, response_pb2, payload_pb2): + """Provides a servicer backend and a stub. + + Args: + service_pb2: The service_pb2 module generated by this test. + response_pb2: The response_pb2 module generated by this test. + payload_pb2: The payload_pb2 module generated by this test. + + Returns: + A _Service with which to test RPCs. + """ + servicer_methods = _ServicerMethods(response_pb2, payload_pb2) + + class Servicer(getattr(service_pb2, SERVICER_IDENTIFIER)): + + def UnaryCall(self, request, context): + return servicer_methods.UnaryCall(request, context) + + def StreamingOutputCall(self, request, context): + return servicer_methods.StreamingOutputCall(request, context) + + def StreamingInputCall(self, request_iter, context): + return servicer_methods.StreamingInputCall(request_iter, context) + + def FullDuplexCall(self, request_iter, context): + return servicer_methods.FullDuplexCall(request_iter, context) + + def HalfDuplexCall(self, request_iter, context): + return servicer_methods.HalfDuplexCall(request_iter, context) + + server = grpc.server( + (), futures.ThreadPoolExecutor(max_workers=test_constants.POOL_SIZE)) + getattr(service_pb2, ADD_SERVICER_TO_SERVER_IDENTIFIER)(Servicer(), server) + port = server.add_insecure_port('[::]:0') + server.start() + channel = grpc.insecure_channel('localhost:{}'.format(port)) + stub = getattr(service_pb2, STUB_IDENTIFIER)(channel) + return _Service(servicer_methods, server, stub) + + +def _CreateIncompleteService(service_pb2): + """Provides a servicer backend that fails to implement methods and its stub. + + Args: + service_pb2: The service_pb2 module generated by this test. + + Returns: + A _Service with which to test RPCs. The returned _Service's + servicer_methods implements none of the methods required of it. + """ + + class Servicer(getattr(service_pb2, SERVICER_IDENTIFIER)): + pass + + server = grpc.server( + (), futures.ThreadPoolExecutor(max_workers=test_constants.POOL_SIZE)) + getattr(service_pb2, ADD_SERVICER_TO_SERVER_IDENTIFIER)(Servicer(), server) + port = server.add_insecure_port('[::]:0') + server.start() + channel = grpc.insecure_channel('localhost:{}'.format(port)) + stub = getattr(service_pb2, STUB_IDENTIFIER)(channel) + return _Service(None, server, stub) + + +def _streaming_input_request_iterator(request_pb2, payload_pb2): + for _ in range(3): + request = request_pb2.StreamingInputCallRequest() + request.payload.payload_type = payload_pb2.COMPRESSABLE + request.payload.payload_compressable = 'a' + yield request + + +def _streaming_output_request(request_pb2): + request = request_pb2.StreamingOutputCallRequest() + sizes = [1, 2, 3] + request.response_parameters.add(size=sizes[0], interval_us=0) + request.response_parameters.add(size=sizes[1], interval_us=0) + request.response_parameters.add(size=sizes[2], interval_us=0) + return request + + +def _full_duplex_request_iterator(request_pb2): + request = request_pb2.StreamingOutputCallRequest() + request.response_parameters.add(size=1, interval_us=0) + yield request + request = request_pb2.StreamingOutputCallRequest() + request.response_parameters.add(size=2, interval_us=0) + request.response_parameters.add(size=3, interval_us=0) + yield request + + +class PythonPluginTest(unittest.TestCase): + """Test case for the gRPC Python protoc-plugin. + + While reading these tests, remember that the futures API + (`stub.method.future()`) only gives futures for the *response-unary* + methods and does not exist for response-streaming methods. + """ + + def setUp(self): + # Assume that the appropriate protoc and grpc_python_plugins are on the + # path. + protoc_command = 'protoc' + protoc_plugin_filename = distutils.spawn.find_executable( + 'grpc_python_plugin') + if not os.path.isfile(protoc_command): + # Assume that if we haven't built protoc that it's on the system. + protoc_command = 'protoc' + + # Ensure that the output directory exists. + self.outdir = tempfile.mkdtemp() + + # Find all proto files + paths = [] + root_dir = os.path.dirname(os.path.realpath(__file__)) + proto_dir = os.path.join(root_dir, 'protos') + for walk_root, _, filenames in os.walk(proto_dir): + for filename in filenames: + if filename.endswith('.proto'): + path = os.path.join(walk_root, filename) + paths.append(path) + + # Invoke protoc with the plugin. + cmd = [ + protoc_command, + '--plugin=protoc-gen-python-grpc=%s' % protoc_plugin_filename, + '-I %s' % root_dir, + '--python_out=%s' % self.outdir, + '--python-grpc_out=%s' % self.outdir + ] + paths + subprocess.check_call(' '.join(cmd), shell=True, env=os.environ, + cwd=os.path.dirname(os.path.realpath(__file__))) + + # Generated proto directories dont include __init__.py, but + # these are needed for python package resolution + for walk_root, _, _ in os.walk(os.path.join(self.outdir, 'protos')): + path = os.path.join(walk_root, '__init__.py') + open(path, 'a').close() + + sys.path.insert(0, self.outdir) + + import protos.payload.test_payload_pb2 as payload_pb2 + import protos.requests.r.test_requests_pb2 as request_pb2 + import protos.responses.test_responses_pb2 as response_pb2 + import protos.service.test_service_pb2 as service_pb2 + self._payload_pb2 = payload_pb2 + self._request_pb2 = request_pb2 + self._response_pb2 = response_pb2 + self._service_pb2 = service_pb2 + + def tearDown(self): + try: + shutil.rmtree(self.outdir) + except OSError as exc: + if exc.errno != errno.ENOENT: + raise + sys.path.remove(self.outdir) + + def testImportAttributes(self): + # check that we can access the generated module and its members. + self.assertIsNotNone( + getattr(self._service_pb2, STUB_IDENTIFIER, None)) + self.assertIsNotNone( + getattr(self._service_pb2, SERVICER_IDENTIFIER, None)) + self.assertIsNotNone( + getattr(self._service_pb2, ADD_SERVICER_TO_SERVER_IDENTIFIER, None)) + + def testUpDown(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + self.assertIsNotNone(service.servicer_methods) + self.assertIsNotNone(service.server) + self.assertIsNotNone(service.stub) + + def testIncompleteServicer(self): + service = _CreateIncompleteService(self._service_pb2) + request = self._request_pb2.SimpleRequest(response_size=13) + with self.assertRaises(grpc.RpcError) as exception_context: + service.stub.UnaryCall(request) + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.UNIMPLEMENTED) + + def testUnaryCall(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = self._request_pb2.SimpleRequest(response_size=13) + response = service.stub.UnaryCall(request) + expected_response = service.servicer_methods.UnaryCall( + request, 'not a real context!') + self.assertEqual(expected_response, response) + + def testUnaryCallFuture(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = self._request_pb2.SimpleRequest(response_size=13) + # Check that the call does not block waiting for the server to respond. + with service.servicer_methods.pause(): + response_future = service.stub.UnaryCall.future(request) + response = response_future.result() + expected_response = service.servicer_methods.UnaryCall( + request, 'not a real RpcContext!') + self.assertEqual(expected_response, response) + + def testUnaryCallFutureExpired(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = self._request_pb2.SimpleRequest(response_size=13) + with service.servicer_methods.pause(): + response_future = service.stub.UnaryCall.future( + request, timeout=test_constants.SHORT_TIMEOUT) + with self.assertRaises(grpc.RpcError) as exception_context: + response_future.result() + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.DEADLINE_EXCEEDED) + self.assertIs(response_future.code(), grpc.StatusCode.DEADLINE_EXCEEDED) + + def testUnaryCallFutureCancelled(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = self._request_pb2.SimpleRequest(response_size=13) + with service.servicer_methods.pause(): + response_future = service.stub.UnaryCall.future(request) + response_future.cancel() + self.assertTrue(response_future.cancelled()) + self.assertIs(response_future.code(), grpc.StatusCode.CANCELLED) + + def testUnaryCallFutureFailed(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = self._request_pb2.SimpleRequest(response_size=13) + with service.servicer_methods.fail(): + response_future = service.stub.UnaryCall.future(request) + self.assertIsNotNone(response_future.exception()) + self.assertIs(response_future.code(), grpc.StatusCode.UNKNOWN) + + def testStreamingOutputCall(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = _streaming_output_request(self._request_pb2) + responses = service.stub.StreamingOutputCall(request) + expected_responses = service.servicer_methods.StreamingOutputCall( + request, 'not a real RpcContext!') + for expected_response, response in moves.zip_longest( + expected_responses, responses): + self.assertEqual(expected_response, response) + + def testStreamingOutputCallExpired(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = _streaming_output_request(self._request_pb2) + with service.servicer_methods.pause(): + responses = service.stub.StreamingOutputCall( + request, timeout=test_constants.SHORT_TIMEOUT) + with self.assertRaises(grpc.RpcError) as exception_context: + list(responses) + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.DEADLINE_EXCEEDED) + + def testStreamingOutputCallCancelled(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = _streaming_output_request(self._request_pb2) + responses = service.stub.StreamingOutputCall(request) + next(responses) + responses.cancel() + with self.assertRaises(grpc.RpcError) as exception_context: + next(responses) + self.assertIs(responses.code(), grpc.StatusCode.CANCELLED) + + def testStreamingOutputCallFailed(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request = _streaming_output_request(self._request_pb2) + with service.servicer_methods.fail(): + responses = service.stub.StreamingOutputCall(request) + self.assertIsNotNone(responses) + with self.assertRaises(grpc.RpcError) as exception_context: + next(responses) + self.assertIs(exception_context.exception.code(), grpc.StatusCode.UNKNOWN) + + def testStreamingInputCall(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + response = service.stub.StreamingInputCall( + _streaming_input_request_iterator( + self._request_pb2, self._payload_pb2)) + expected_response = service.servicer_methods.StreamingInputCall( + _streaming_input_request_iterator(self._request_pb2, self._payload_pb2), + 'not a real RpcContext!') + self.assertEqual(expected_response, response) + + def testStreamingInputCallFuture(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with service.servicer_methods.pause(): + response_future = service.stub.StreamingInputCall.future( + _streaming_input_request_iterator( + self._request_pb2, self._payload_pb2)) + response = response_future.result() + expected_response = service.servicer_methods.StreamingInputCall( + _streaming_input_request_iterator(self._request_pb2, self._payload_pb2), + 'not a real RpcContext!') + self.assertEqual(expected_response, response) + + def testStreamingInputCallFutureExpired(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with service.servicer_methods.pause(): + response_future = service.stub.StreamingInputCall.future( + _streaming_input_request_iterator( + self._request_pb2, self._payload_pb2), + timeout=test_constants.SHORT_TIMEOUT) + with self.assertRaises(grpc.RpcError) as exception_context: + response_future.result() + self.assertIsInstance(response_future.exception(), grpc.RpcError) + self.assertIs( + response_future.exception().code(), grpc.StatusCode.DEADLINE_EXCEEDED) + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.DEADLINE_EXCEEDED) + + def testStreamingInputCallFutureCancelled(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with service.servicer_methods.pause(): + response_future = service.stub.StreamingInputCall.future( + _streaming_input_request_iterator( + self._request_pb2, self._payload_pb2)) + response_future.cancel() + self.assertTrue(response_future.cancelled()) + with self.assertRaises(grpc.FutureCancelledError): + response_future.result() + + def testStreamingInputCallFutureFailed(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with service.servicer_methods.fail(): + response_future = service.stub.StreamingInputCall.future( + _streaming_input_request_iterator( + self._request_pb2, self._payload_pb2)) + self.assertIsNotNone(response_future.exception()) + self.assertIs(response_future.code(), grpc.StatusCode.UNKNOWN) + + def testFullDuplexCall(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + responses = service.stub.FullDuplexCall( + _full_duplex_request_iterator(self._request_pb2)) + expected_responses = service.servicer_methods.FullDuplexCall( + _full_duplex_request_iterator(self._request_pb2), + 'not a real RpcContext!') + for expected_response, response in moves.zip_longest( + expected_responses, responses): + self.assertEqual(expected_response, response) + + def testFullDuplexCallExpired(self): + request_iterator = _full_duplex_request_iterator(self._request_pb2) + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with service.servicer_methods.pause(): + responses = service.stub.FullDuplexCall( + request_iterator, timeout=test_constants.SHORT_TIMEOUT) + with self.assertRaises(grpc.RpcError) as exception_context: + list(responses) + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.DEADLINE_EXCEEDED) + + def testFullDuplexCallCancelled(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + request_iterator = _full_duplex_request_iterator(self._request_pb2) + responses = service.stub.FullDuplexCall(request_iterator) + next(responses) + responses.cancel() + with self.assertRaises(grpc.RpcError) as exception_context: + next(responses) + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.CANCELLED) + + def testFullDuplexCallFailed(self): + request_iterator = _full_duplex_request_iterator(self._request_pb2) + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with service.servicer_methods.fail(): + responses = service.stub.FullDuplexCall(request_iterator) + with self.assertRaises(grpc.RpcError) as exception_context: + next(responses) + self.assertIs(exception_context.exception.code(), grpc.StatusCode.UNKNOWN) + + def testHalfDuplexCall(self): + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + def half_duplex_request_iterator(): + request = self._request_pb2.StreamingOutputCallRequest() + request.response_parameters.add(size=1, interval_us=0) + yield request + request = self._request_pb2.StreamingOutputCallRequest() + request.response_parameters.add(size=2, interval_us=0) + request.response_parameters.add(size=3, interval_us=0) + yield request + responses = service.stub.HalfDuplexCall(half_duplex_request_iterator()) + expected_responses = service.servicer_methods.HalfDuplexCall( + half_duplex_request_iterator(), 'not a real RpcContext!') + for expected_response, response in moves.zip_longest( + expected_responses, responses): + self.assertEqual(expected_response, response) + + def testHalfDuplexCallWedged(self): + condition = threading.Condition() + wait_cell = [False] + @contextlib.contextmanager + def wait(): # pylint: disable=invalid-name + # Where's Python 3's 'nonlocal' statement when you need it? + with condition: + wait_cell[0] = True + yield + with condition: + wait_cell[0] = False + condition.notify_all() + def half_duplex_request_iterator(): + request = self._request_pb2.StreamingOutputCallRequest() + request.response_parameters.add(size=1, interval_us=0) + yield request + with condition: + while wait_cell[0]: + condition.wait() + service = _CreateService( + self._service_pb2, self._response_pb2, self._payload_pb2) + with wait(): + responses = service.stub.HalfDuplexCall( + half_duplex_request_iterator(), timeout=test_constants.SHORT_TIMEOUT) + # half-duplex waits for the client to send all info + with self.assertRaises(grpc.RpcError) as exception_context: + next(responses) + self.assertIs( + exception_context.exception.code(), grpc.StatusCode.DEADLINE_EXCEEDED) + + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/src/python/grpcio/tests/tests.json b/src/python/grpcio/tests/tests.json index 53b2998b78..e64d2d04a7 100644 --- a/src/python/grpcio/tests/tests.json +++ b/src/python/grpcio/tests/tests.json @@ -49,10 +49,12 @@ "_low_test.HangingServerShutdown", "_low_test.InsecureServerInsecureClient", "_not_found_test.NotFoundTest", + "_python_plugin_test.PythonPluginTest", "_read_some_but_not_all_responses_test.ReadSomeButNotAllResponsesTest", "_rpc_test.RPCTest", "_sanity_test.Sanity", "_secure_interop_test.SecureInteropTest", + "_thread_cleanup_test.CleanupThreadTest", "_transmission_test.RoundTripTest", "_transmission_test.TransmissionTest", "_utilities_test.ChannelConnectivityTest", diff --git a/src/python/grpcio/tests/unit/_rpc_test.py b/src/python/grpcio/tests/unit/_rpc_test.py index b33bff490c..8407593c86 100644 --- a/src/python/grpcio/tests/unit/_rpc_test.py +++ b/src/python/grpcio/tests/unit/_rpc_test.py @@ -29,8 +29,6 @@ """Test of gRPC Python's application-layer API.""" -from __future__ import division - import itertools import threading import unittest @@ -193,13 +191,6 @@ class RPCTest(unittest.TestCase): self._channel = grpc.insecure_channel('localhost:%d' % port) - # TODO(nathaniel): Why is this necessary, and only in some development - # environments? - def tearDown(self): - del self._channel - del self._server - del self._server_pool - def testUnrecognizedMethod(self): request = b'abc' diff --git a/src/python/grpcio/tests/unit/_thread_cleanup_test.py b/src/python/grpcio/tests/unit/_thread_cleanup_test.py new file mode 100644 index 0000000000..3e4f317edc --- /dev/null +++ b/src/python/grpcio/tests/unit/_thread_cleanup_test.py @@ -0,0 +1,117 @@ +# Copyright 2016, 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. +"""Tests for CleanupThread.""" + +import threading +import time +import unittest + +from grpc import _common + +_SHORT_TIME = 0.5 +_LONG_TIME = 2.0 +_EPSILON = 0.1 + + +def cleanup(timeout): + if timeout is not None: + time.sleep(timeout) + else: + time.sleep(_LONG_TIME) + + +def slow_cleanup(timeout): + # Don't respect timeout + time.sleep(_LONG_TIME) + + +class CleanupThreadTest(unittest.TestCase): + + def testTargetInvocation(self): + event = threading.Event() + def target(arg1, arg2, arg3=None): + self.assertEqual('arg1', arg1) + self.assertEqual('arg2', arg2) + self.assertEqual('arg3', arg3) + event.set() + + cleanup_thread = _common.CleanupThread(behavior=lambda x: None, + target=target, name='test-name', + args=('arg1', 'arg2'), kwargs={'arg3': 'arg3'}) + cleanup_thread.start() + cleanup_thread.join() + self.assertEqual(cleanup_thread.name, 'test-name') + self.assertTrue(event.is_set()) + + def testJoinNoTimeout(self): + cleanup_thread = _common.CleanupThread(behavior=cleanup) + cleanup_thread.start() + start_time = time.time() + cleanup_thread.join() + end_time = time.time() + self.assertAlmostEqual(_LONG_TIME, end_time - start_time, delta=_EPSILON) + + def testJoinTimeout(self): + cleanup_thread = _common.CleanupThread(behavior=cleanup) + cleanup_thread.start() + start_time = time.time() + cleanup_thread.join(_SHORT_TIME) + end_time = time.time() + self.assertAlmostEqual(_SHORT_TIME, end_time - start_time, delta=_EPSILON) + + def testJoinTimeoutSlowBehavior(self): + cleanup_thread = _common.CleanupThread(behavior=slow_cleanup) + cleanup_thread.start() + start_time = time.time() + cleanup_thread.join(_SHORT_TIME) + end_time = time.time() + self.assertAlmostEqual(_LONG_TIME, end_time - start_time, delta=_EPSILON) + + def testJoinTimeoutSlowTarget(self): + event = threading.Event() + def target(): + event.wait(_LONG_TIME) + cleanup_thread = _common.CleanupThread(behavior=cleanup, target=target) + cleanup_thread.start() + start_time = time.time() + cleanup_thread.join(_SHORT_TIME) + end_time = time.time() + self.assertAlmostEqual(_SHORT_TIME, end_time - start_time, delta=_EPSILON) + event.set() + + def testJoinZeroTimeout(self): + cleanup_thread = _common.CleanupThread(behavior=cleanup) + cleanup_thread.start() + start_time = time.time() + cleanup_thread.join(0) + end_time = time.time() + self.assertAlmostEqual(0, end_time - start_time, delta=_EPSILON) + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/src/python/grpcio/tests/unit/beta/test_utilities.py b/src/python/grpcio/tests/unit/beta/test_utilities.py index 66b5f72897..e374b203ce 100644 --- a/src/python/grpcio/tests/unit/beta/test_utilities.py +++ b/src/python/grpcio/tests/unit/beta/test_utilities.py @@ -50,6 +50,6 @@ def not_really_secure_channel( """ target = '%s:%d' % (host, port) channel = grpc.secure_channel( - target, ((b'grpc.ssl_target_name_override', server_host_override,),), - channel_credentials._credentials) + target, channel_credentials._credentials, + ((b'grpc.ssl_target_name_override', server_host_override,),)) return implementations.Channel(channel) diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 90c2fd1e60..072e29c232 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -482,7 +482,7 @@ extern grpc_byte_buffer_reader_readall_type grpc_byte_buffer_reader_readall_impo typedef grpc_byte_buffer *(*grpc_raw_byte_buffer_from_reader_type)(grpc_byte_buffer_reader *reader); extern grpc_raw_byte_buffer_from_reader_type grpc_raw_byte_buffer_from_reader_import; #define grpc_raw_byte_buffer_from_reader grpc_raw_byte_buffer_from_reader_import -typedef void(*gpr_log_type)(const char *file, int line, gpr_log_severity severity, const char *format, ...); +typedef void(*gpr_log_type)(const char *file, int line, gpr_log_severity severity, const char *format, ...) GPRC_PRINT_FORMAT_CHECK(4, 5); extern gpr_log_type gpr_log_import; #define gpr_log gpr_log_import typedef void(*gpr_log_message_type)(const char *file, int line, gpr_log_severity severity, const char *message); @@ -827,7 +827,7 @@ extern gpr_format_message_type gpr_format_message_import; typedef char *(*gpr_strdup_type)(const char *src); extern gpr_strdup_type gpr_strdup_import; #define gpr_strdup gpr_strdup_import -typedef int(*gpr_asprintf_type)(char **strp, const char *format, ...); +typedef int(*gpr_asprintf_type)(char **strp, const char *format, ...) GPRC_PRINT_FORMAT_CHECK(2, 3); extern gpr_asprintf_type gpr_asprintf_import; #define gpr_asprintf gpr_asprintf_import typedef const char *(*gpr_subprocess_binary_extension_type)(); diff --git a/templates/composer.json.template b/templates/composer.json.template index 275b4655ce..7d2029c218 100644 --- a/templates/composer.json.template +++ b/templates/composer.json.template @@ -4,7 +4,6 @@ "name": "grpc/grpc", "type": "library", "description": "gRPC library for PHP", - "version": "${settings.php_version.php()}", "keywords": ["rpc"], "homepage": "http://grpc.io", "license": "BSD-3-Clause", diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index 1534360dea..3160312db6 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -135,7 +135,7 @@ static void drain_cq(grpc_completion_queue *cq) { } static void kill_server(const servers_fixture *f, size_t i) { - gpr_log(GPR_INFO, "KILLING SERVER %d", i); + gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i); GPR_ASSERT(f->servers[i] != NULL); grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); GPR_ASSERT( @@ -157,7 +157,7 @@ typedef struct request_data { static void revive_server(const servers_fixture *f, request_data *rdata, size_t i) { int got_port; - gpr_log(GPR_INFO, "RAISE AGAIN SERVER %d", i); + gpr_log(GPR_INFO, "RAISE AGAIN SERVER %" PRIuPTR, i); GPR_ASSERT(f->servers[i] == NULL); gpr_log(GPR_DEBUG, "revive: %s", f->servers_hostports[i]); @@ -311,7 +311,7 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, .type != GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(intptr_t)ev.tag); - gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d", + gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%" PRIuPTR, ev.success, ev.type, read_tag, iter_num); if (ev.success && read_tag >= 1000) { GPR_ASSERT(s_idx == -1); /* only one server must reply */ @@ -643,7 +643,8 @@ static void print_failed_expectations(const int *expected_connection_sequence, const size_t num_iters) { size_t i; for (i = 0; i < num_iters; i++) { - gpr_log(GPR_ERROR, "FAILURE: Iter (expected, actual): %d (%d, %d)", i, + gpr_log(GPR_ERROR, + "FAILURE: Iter (expected, actual): %" PRIuPTR " (%d, %d)", i, expected_connection_sequence[i % expected_seq_length], actual_connection_sequence[i]); } @@ -726,8 +727,8 @@ static void verify_total_carnage_round_robin( const int actual = actual_connection_sequence[i]; const int expected = -1; if (actual != expected) { - gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %d", expected, - actual, i); + gpr_log(GPR_ERROR, "FAILURE: expected %d, actual %d at iter %" PRIuPTR, + expected, actual, i); abort(); } } diff --git a/test/core/client_config/set_initial_connect_string_test.c b/test/core/client_config/set_initial_connect_string_test.c index 0a0da92ce2..1b51424f7e 100644 --- a/test/core/client_config/set_initial_connect_string_test.c +++ b/test/core/client_config/set_initial_connect_string_test.c @@ -69,7 +69,7 @@ static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { GPR_ASSERT(error == GRPC_ERROR_NONE); gpr_slice_buffer_move_into(&state.temp_incoming_buffer, &state.incoming_buffer); - gpr_log(GPR_DEBUG, "got %d bytes, magic is %d bytes", + gpr_log(GPR_DEBUG, "got %" PRIuPTR " bytes, magic is %" PRIuPTR " bytes", state.incoming_buffer.length, strlen(magic_connect_string)); if (state.incoming_buffer.length > strlen(magic_connect_string)) { gpr_atm_rel_store(&state.done_atm, 1); @@ -173,8 +173,8 @@ static void actually_poll_server(void *arg) { bool done = gpr_atm_acq_load(&state.done_atm) != 0; gpr_timespec time_left = gpr_time_sub(deadline, gpr_now(GPR_CLOCK_REALTIME)); - gpr_log(GPR_DEBUG, "done=%d, time_left=%d.%09d", done, time_left.tv_sec, - time_left.tv_nsec); + gpr_log(GPR_DEBUG, "done=%d, time_left=%" PRId64 ".%09" PRId32, done, + time_left.tv_sec, time_left.tv_nsec); if (done || gpr_time_cmp(time_left, gpr_time_0(GPR_TIMESPAN)) < 0) { break; } diff --git a/test/core/compression/message_compress_test.c b/test/core/compression/message_compress_test.c index 1a93903346..47ecf72e08 100644 --- a/test/core/compression/message_compress_test.c +++ b/test/core/compression/message_compress_test.c @@ -66,13 +66,14 @@ static void assert_passthrough(gpr_slice value, char *algorithm_name; GPR_ASSERT(grpc_compression_algorithm_name(algorithm, &algorithm_name) != 0); - gpr_log(GPR_INFO, - "assert_passthrough: value_length=%d value_hash=0x%08x " - "algorithm='%s' uncompressed_split='%s' compressed_split='%s'", - GPR_SLICE_LENGTH(value), gpr_murmur_hash3(GPR_SLICE_START_PTR(value), - GPR_SLICE_LENGTH(value), 0), - algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode), - grpc_slice_split_mode_name(compressed_split_mode)); + gpr_log( + GPR_INFO, "assert_passthrough: value_length=%" PRIuPTR + " value_hash=0x%08x " + "algorithm='%s' uncompressed_split='%s' compressed_split='%s'", + GPR_SLICE_LENGTH(value), + gpr_murmur_hash3(GPR_SLICE_START_PTR(value), GPR_SLICE_LENGTH(value), 0), + algorithm_name, grpc_slice_split_mode_name(uncompressed_split_mode), + grpc_slice_split_mode_name(compressed_split_mode)); gpr_slice_buffer_init(&input); gpr_slice_buffer_init(&compressed_raw); diff --git a/test/core/end2end/tests/cancel_with_status.c b/test/core/end2end/tests/cancel_with_status.c index 83629a9a02..673c7051ad 100644 --- a/test/core/end2end/tests/cancel_with_status.c +++ b/test/core/end2end/tests/cancel_with_status.c @@ -112,7 +112,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { char *details = NULL; size_t details_capacity = 0; - gpr_log(GPR_DEBUG, "test with %d ops", num_ops); + gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr:1234", deadline, diff --git a/test/core/end2end/tests/negative_deadline.c b/test/core/end2end/tests/negative_deadline.c index fd56c8b4ff..dff7992f63 100644 --- a/test/core/end2end/tests/negative_deadline.c +++ b/test/core/end2end/tests/negative_deadline.c @@ -112,7 +112,7 @@ static void simple_request_body(grpc_end2end_test_fixture f, size_t num_ops) { char *details = NULL; size_t details_capacity = 0; - gpr_log(GPR_DEBUG, "test with %d ops", num_ops); + gpr_log(GPR_DEBUG, "test with %" PRIuPTR " ops", num_ops); c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, "/foo", "foo.test.google.fr:1234", deadline, diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c index 55e79189cb..40807242db 100644 --- a/test/core/iomgr/endpoint_tests.c +++ b/test/core/iomgr/endpoint_tests.c @@ -189,13 +189,15 @@ static void read_and_write_test(grpc_endpoint_test_config config, grpc_endpoint_test_fixture f = begin_test(config, "read_and_write_test", slice_size); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_DEBUG, "num_bytes=%d write_size=%d slice_size=%d shutdown=%d", + gpr_log(GPR_DEBUG, "num_bytes=%" PRIuPTR " write_size=%" PRIuPTR + " slice_size=%" PRIuPTR " shutdown=%d", num_bytes, write_size, slice_size, shutdown); if (shutdown) { gpr_log(GPR_INFO, "Start read and write shutdown test"); } else { - gpr_log(GPR_INFO, "Start read and write test with %d bytes, slice size %d", + gpr_log(GPR_INFO, "Start read and write test with %" PRIuPTR + " bytes, slice size %" PRIuPTR, num_bytes, slice_size); } @@ -254,11 +256,52 @@ static void read_and_write_test(grpc_endpoint_test_config config, grpc_exec_ctx_finish(&exec_ctx); } +static void inc_on_failure(grpc_exec_ctx *exec_ctx, void *arg, + grpc_error *error) { + *(int *)arg += (error != GRPC_ERROR_NONE); +} + +static void multiple_shutdown_test(grpc_endpoint_test_config config) { + grpc_endpoint_test_fixture f = + begin_test(config, "multiple_shutdown_test", 128); + int fail_count = 0; + + gpr_slice_buffer slice_buffer; + gpr_slice_buffer_init(&slice_buffer); + + grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer, + grpc_closure_create(inc_on_failure, &fail_count)); + grpc_exec_ctx_flush(&exec_ctx); + GPR_ASSERT(fail_count == 0); + grpc_endpoint_shutdown(&exec_ctx, f.client_ep); + grpc_exec_ctx_flush(&exec_ctx); + GPR_ASSERT(fail_count == 1); + grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer, + grpc_closure_create(inc_on_failure, &fail_count)); + grpc_exec_ctx_flush(&exec_ctx); + GPR_ASSERT(fail_count == 2); + grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer, + grpc_closure_create(inc_on_failure, &fail_count)); + grpc_exec_ctx_flush(&exec_ctx); + GPR_ASSERT(fail_count == 3); + grpc_endpoint_shutdown(&exec_ctx, f.client_ep); + grpc_exec_ctx_flush(&exec_ctx); + GPR_ASSERT(fail_count == 3); + + gpr_slice_buffer_destroy(&slice_buffer); + + grpc_endpoint_destroy(&exec_ctx, f.client_ep); + grpc_endpoint_destroy(&exec_ctx, f.server_ep); + grpc_exec_ctx_finish(&exec_ctx); +} + void grpc_endpoint_tests(grpc_endpoint_test_config config, grpc_pollset *pollset, gpr_mu *mu) { size_t i; g_pollset = pollset; g_mu = mu; + multiple_shutdown_test(config); read_and_write_test(config, 10000000, 100000, 8192, false); read_and_write_test(config, 1000000, 100000, 1, false); read_and_write_test(config, 100000000, 100000, 1, true); diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c index 7bb80f3050..62dc24d85a 100644 --- a/test/core/iomgr/fd_posix_test.c +++ b/test/core/iomgr/fd_posix_test.c @@ -404,7 +404,7 @@ static void test_grpc_fd(void) { client_wait_and_shutdown(&cl); server_wait_and_shutdown(&sv); GPR_ASSERT(sv.read_bytes_total == cl.write_bytes_total); - gpr_log(GPR_INFO, "Total read bytes %d", sv.read_bytes_total); + gpr_log(GPR_INFO, "Total read bytes %" PRIdPTR, sv.read_bytes_total); } typedef struct fd_change_data { diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 0a351f7422..42614567ca 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -152,7 +152,7 @@ static void read_cb(grpc_exec_ctx *exec_ctx, void *user_data, read_bytes = count_slices(state->incoming.slices, state->incoming.count, ¤t_data); state->read_bytes += read_bytes; - gpr_log(GPR_INFO, "Read %d bytes of %d", read_bytes, + gpr_log(GPR_INFO, "Read %" PRIuPTR " bytes of %" PRIuPTR, read_bytes, state->target_read_bytes); if (state->read_bytes >= state->target_read_bytes) { gpr_mu_unlock(g_mu); @@ -171,8 +171,8 @@ static void read_test(size_t num_bytes, size_t slice_size) { gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_INFO, "Read test of size %d, slice size %d", num_bytes, - slice_size); + gpr_log(GPR_INFO, "Read test of size %" PRIuPTR ", slice size %" PRIuPTR, + num_bytes, slice_size); create_sockets(sv); @@ -180,7 +180,7 @@ static void read_test(size_t num_bytes, size_t slice_size) { grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); written_bytes = fill_socket_partial(sv[0], num_bytes); - gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); + gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes); state.ep = ep; state.read_bytes = 0; @@ -219,7 +219,7 @@ static void large_read_test(size_t slice_size) { gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_INFO, "Start large read test, slice size %d", slice_size); + gpr_log(GPR_INFO, "Start large read test, slice size %" PRIuPTR, slice_size); create_sockets(sv); @@ -228,7 +228,7 @@ static void large_read_test(size_t slice_size) { grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); written_bytes = fill_socket(sv[0]); - gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); + gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes); state.ep = ep; state.read_bytes = 0; @@ -353,8 +353,9 @@ static void write_test(size_t num_bytes, size_t slice_size) { gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(20); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - gpr_log(GPR_INFO, "Start write test with %d bytes, slice size %d", num_bytes, - slice_size); + gpr_log(GPR_INFO, + "Start write test with %" PRIuPTR " bytes, slice size %" PRIuPTR, + num_bytes, slice_size); create_sockets(sv); @@ -416,8 +417,9 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { int fd_released_done = 0; grpc_closure_init(&fd_released_cb, &on_fd_released, &fd_released_done); - gpr_log(GPR_INFO, "Release fd read_test of size %d, slice size %d", num_bytes, - slice_size); + gpr_log(GPR_INFO, + "Release fd read_test of size %" PRIuPTR ", slice size %" PRIuPTR, + num_bytes, slice_size); create_sockets(sv); @@ -426,7 +428,7 @@ static void release_fd_test(size_t num_bytes, size_t slice_size) { grpc_endpoint_add_to_pollset(&exec_ctx, ep, g_pollset); written_bytes = fill_socket_partial(sv[0], num_bytes); - gpr_log(GPR_INFO, "Wrote %d bytes", written_bytes); + gpr_log(GPR_INFO, "Wrote %" PRIuPTR " bytes", written_bytes); state.ep = ep; state.read_bytes = 0; @@ -532,8 +534,8 @@ int main(int argc, char **argv) { grpc_init(); g_pollset = gpr_malloc(grpc_pollset_size()); grpc_pollset_init(g_pollset, &g_mu); - run_tests(); grpc_endpoint_tests(configs[0], g_pollset, g_mu); + run_tests(); grpc_closure_init(&destroyed, destroy_pollset, g_pollset); grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed); grpc_exec_ctx_finish(&exec_ctx); diff --git a/test/core/support/slice_test.c b/test/core/support/slice_test.c index 2df38376a9..0da483a321 100644 --- a/test/core/support/slice_test.c +++ b/test/core/support/slice_test.c @@ -164,7 +164,7 @@ static void test_slice_split_head_works(size_t length) { size_t i; LOG_TEST_NAME("test_slice_split_head_works"); - gpr_log(GPR_INFO, "length=%d", length); + gpr_log(GPR_INFO, "length=%" PRIuPTR, length); /* Create a slice in which each byte is equal to the distance from it to the beginning of the slice. */ @@ -192,7 +192,7 @@ static void test_slice_split_tail_works(size_t length) { size_t i; LOG_TEST_NAME("test_slice_split_tail_works"); - gpr_log(GPR_INFO, "length=%d", length); + gpr_log(GPR_INFO, "length=%" PRIuPTR, length); /* Create a slice in which each byte is equal to the distance from it to the beginning of the slice. */ diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c index d5f8107f21..553a824b3f 100644 --- a/test/core/support/string_test.c +++ b/test/core/support/string_test.c @@ -156,7 +156,7 @@ static void test_asprintf(void) { LOG_TEST_NAME("test_asprintf"); /* Print an empty string. */ - GPR_ASSERT(gpr_asprintf(&buf, "") == 0); + GPR_ASSERT(gpr_asprintf(&buf, "%s", "") == 0); GPR_ASSERT(buf[0] == '\0'); gpr_free(buf); @@ -334,6 +334,38 @@ static void test_int64toa() { GPR_ASSERT(0 == strcmp("-9223372036854775808", buf)); } +static void test_leftpad() { + char *padded; + + padded = gpr_leftpad("foo", ' ', 5); + GPR_ASSERT(0 == strcmp(" foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 4); + GPR_ASSERT(0 == strcmp(" foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 3); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 2); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 1); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", ' ', 0); + GPR_ASSERT(0 == strcmp("foo", padded)); + gpr_free(padded); + + padded = gpr_leftpad("foo", '0', 5); + GPR_ASSERT(0 == strcmp("00foo", padded)); + gpr_free(padded); +} + int main(int argc, char **argv) { grpc_test_init(argc, argv); test_strdup(); @@ -346,5 +378,6 @@ int main(int argc, char **argv) { test_strsplit(); test_ltoa(); test_int64toa(); + test_leftpad(); return 0; } diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index ab74c65b9e..1486d2508f 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -349,8 +349,8 @@ static void test_threading(size_t producers, size_t consumers) { size_t total_consumed = 0; static int optid = 101; - gpr_log(GPR_INFO, "%s: %d producers, %d consumers", "test_threading", - producers, consumers); + gpr_log(GPR_INFO, "%s: %" PRIuPTR " producers, %" PRIuPTR " consumers", + "test_threading", producers, consumers); /* start all threads: they will wait for phase1 */ for (i = 0; i < producers + consumers; i++) { diff --git a/test/core/transport/chttp2/bin_decoder_test.c b/test/core/transport/chttp2/bin_decoder_test.c new file mode 100644 index 0000000000..c4e6cd332f --- /dev/null +++ b/test/core/transport/chttp2/bin_decoder_test.c @@ -0,0 +1,144 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/ext/transport/chttp2/transport/bin_decoder.h" + +#include <string.h> + +#include <grpc/support/alloc.h> +#include <grpc/support/log.h> +#include "src/core/ext/transport/chttp2/transport/bin_encoder.h" +#include "src/core/lib/support/string.h" + +static int all_ok = 1; + +static void expect_slice_eq(gpr_slice expected, gpr_slice slice, char *debug, + int line) { + if (0 != gpr_slice_cmp(slice, expected)) { + char *hs = gpr_dump_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII); + char *he = gpr_dump_slice(expected, GPR_DUMP_HEX | GPR_DUMP_ASCII); + gpr_log(GPR_ERROR, "FAILED:%d: %s\ngot: %s\nwant: %s", line, debug, hs, + he); + gpr_free(hs); + gpr_free(he); + all_ok = 0; + } + gpr_slice_unref(expected); + gpr_slice_unref(slice); +} + +static gpr_slice base64_encode(const char *s) { + gpr_slice ss = gpr_slice_from_copied_string(s); + gpr_slice out = grpc_chttp2_base64_encode(ss); + gpr_slice_unref(ss); + return out; +} + +static gpr_slice base64_decode(const char *s) { + gpr_slice ss = gpr_slice_from_copied_string(s); + gpr_slice out = grpc_chttp2_base64_decode(ss); + gpr_slice_unref(ss); + return out; +} + +static gpr_slice base64_decode_with_length(const char *s, + size_t output_length) { + gpr_slice ss = gpr_slice_from_copied_string(s); + gpr_slice out = grpc_chttp2_base64_decode_with_length(ss, output_length); + gpr_slice_unref(ss); + return out; +} + +#define EXPECT_SLICE_EQ(expected, slice) \ + expect_slice_eq( \ + gpr_slice_from_copied_buffer(expected, sizeof(expected) - 1), slice, \ + #slice, __LINE__); + +#define ENCODE_AND_DECODE(s) \ + EXPECT_SLICE_EQ( \ + s, grpc_chttp2_base64_decode_with_length(base64_encode(s), strlen(s))); + +int main(int argc, char **argv) { + /* ENCODE_AND_DECODE tests grpc_chttp2_base64_decode_with_length(), which + takes encoded base64 strings without pad chars, but output length is + required. */ + /* Base64 test vectors from RFC 4648 */ + ENCODE_AND_DECODE(""); + ENCODE_AND_DECODE("f"); + ENCODE_AND_DECODE("foo"); + ENCODE_AND_DECODE("fo"); + ENCODE_AND_DECODE("foob"); + ENCODE_AND_DECODE("fooba"); + ENCODE_AND_DECODE("foobar"); + + ENCODE_AND_DECODE("\xc0\xc1\xc2\xc3\xc4\xc5"); + + /* Base64 test vectors from RFC 4648, with pad chars */ + /* BASE64("") = "" */ + EXPECT_SLICE_EQ("", base64_decode("")); + /* BASE64("f") = "Zg==" */ + EXPECT_SLICE_EQ("f", base64_decode("Zg==")); + /* BASE64("fo") = "Zm8=" */ + EXPECT_SLICE_EQ("fo", base64_decode("Zm8=")); + /* BASE64("foo") = "Zm9v" */ + EXPECT_SLICE_EQ("foo", base64_decode("Zm9v")); + /* BASE64("foob") = "Zm9vYg==" */ + EXPECT_SLICE_EQ("foob", base64_decode("Zm9vYg==")); + /* BASE64("fooba") = "Zm9vYmE=" */ + EXPECT_SLICE_EQ("fooba", base64_decode("Zm9vYmE=")); + /* BASE64("foobar") = "Zm9vYmFy" */ + EXPECT_SLICE_EQ("foobar", base64_decode("Zm9vYmFy")); + + EXPECT_SLICE_EQ("\xc0\xc1\xc2\xc3\xc4\xc5", base64_decode("wMHCw8TF")); + + // Test illegal input length in grpc_chttp2_base64_decode + EXPECT_SLICE_EQ("", base64_decode("a")); + EXPECT_SLICE_EQ("", base64_decode("ab")); + EXPECT_SLICE_EQ("", base64_decode("abc")); + + // Test illegal charactors in grpc_chttp2_base64_decode + EXPECT_SLICE_EQ("", base64_decode("Zm:v")); + EXPECT_SLICE_EQ("", base64_decode("Zm=v")); + + // Test output_length longer than max possible output length in + // grpc_chttp2_base64_decode_with_length + EXPECT_SLICE_EQ("", base64_decode_with_length("Zg", 2)); + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm8", 3)); + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm9v", 4)); + + // Test illegal charactors in grpc_chttp2_base64_decode_with_length + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm:v", 3)); + EXPECT_SLICE_EQ("", base64_decode_with_length("Zm=v", 3)); + + return all_ok ? 0 : 1; +} diff --git a/test/core/transport/chttp2/bin_encoder_test.c b/test/core/transport/chttp2/bin_encoder_test.c index 095861e974..08d10735a5 100644 --- a/test/core/transport/chttp2/bin_encoder_test.c +++ b/test/core/transport/chttp2/bin_encoder_test.c @@ -88,7 +88,8 @@ static void expect_combined_equiv(const char *s, size_t len, int line) { char *t = gpr_dump_slice(input, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *e = gpr_dump_slice(expect, GPR_DUMP_HEX | GPR_DUMP_ASCII); char *g = gpr_dump_slice(got, GPR_DUMP_HEX | GPR_DUMP_ASCII); - gpr_log(GPR_ERROR, "FAILED:%d:\ntest: %s\ngot: %s\nwant: %s", t, g, e); + gpr_log(GPR_ERROR, "FAILED:%d:\ntest: %s\ngot: %s\nwant: %s", line, t, g, + e); gpr_free(t); gpr_free(e); gpr_free(g); diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c index a4e9694a93..007892930c 100644 --- a/test/core/transport/metadata_test.c +++ b/test/core/transport/metadata_test.c @@ -166,7 +166,7 @@ static void test_things_stick_around(void) { grpc_init(); for (i = 0; i < nstrs; i++) { - gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%dx", i); + gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x", i); strs[i] = grpc_mdstr_from_string(buffer); shuf[i] = i; gpr_free(buffer); @@ -188,7 +188,8 @@ static void test_things_stick_around(void) { for (i = 0; i < nstrs; i++) { GRPC_MDSTR_UNREF(strs[shuf[i]]); for (j = i + 1; j < nstrs; j++) { - gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%dx", shuf[j]); + gpr_asprintf(&buffer, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%" PRIuPTR "x", + shuf[j]); test = grpc_mdstr_from_string(buffer); GPR_ASSERT(test == strs[shuf[j]]); GRPC_MDSTR_UNREF(test); diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index b839801500..8229bda6bf 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -229,9 +229,10 @@ class TestScenario { credentials_type(creds_type), message_content(content) {} void Log() const { - gpr_log(GPR_INFO, - "Scenario: disable_blocking %d, credentials %s, message size %d", - disable_blocking, credentials_type.c_str(), message_content.size()); + gpr_log( + GPR_INFO, + "Scenario: disable_blocking %d, credentials %s, message size %" PRIuPTR, + disable_blocking, credentials_type.c_str(), message_content.size()); } bool disable_blocking; const grpc::string credentials_type; diff --git a/test/cpp/end2end/proto_server_reflection_test.cc b/test/cpp/end2end/proto_server_reflection_test.cc new file mode 100644 index 0000000000..f8fc39b553 --- /dev/null +++ b/test/cpp/end2end/proto_server_reflection_test.cc @@ -0,0 +1,166 @@ +/* + * + * Copyright 2016, 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 <google/protobuf/descriptor.h> +#include <grpc++/channel.h> +#include <grpc++/client_context.h> +#include <grpc++/create_channel.h> +#include <grpc++/ext/proto_server_reflection_plugin.h> +#include <grpc++/security/credentials.h> +#include <grpc++/security/server_credentials.h> +#include <grpc++/server.h> +#include <grpc++/server_builder.h> +#include <grpc++/server_context.h> +#include <grpc/grpc.h> +#include <gtest/gtest.h> + +#include "src/proto/grpc/testing/echo.grpc.pb.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" +#include "test/cpp/end2end/test_service_impl.h" +#include "test/cpp/util/proto_reflection_descriptor_database.h" + +namespace grpc { +namespace testing { + +class ProtoServerReflectionTest : public ::testing::Test { + public: + ProtoServerReflectionTest() {} + + void SetUp() GRPC_OVERRIDE { + port_ = grpc_pick_unused_port_or_die(); + ref_desc_pool_ = google::protobuf::DescriptorPool::generated_pool(); + + ServerBuilder builder; + grpc::string server_address = "localhost:" + to_string(port_); + builder.AddListeningPort(server_address, InsecureServerCredentials()); + server_ = builder.BuildAndStart(); + } + + void ResetStub() { + string target = "dns:localhost:" + to_string(port_); + std::shared_ptr<Channel> channel = + CreateChannel(target, InsecureChannelCredentials()); + stub_ = grpc::testing::EchoTestService::NewStub(channel); + desc_db_.reset(new ProtoReflectionDescriptorDatabase(channel)); + desc_pool_.reset(new google::protobuf::DescriptorPool(desc_db_.get())); + } + + string to_string(const int number) { + std::stringstream strs; + strs << number; + return strs.str(); + } + + void CompareService(const grpc::string& service) { + const google::protobuf::ServiceDescriptor* service_desc = + desc_pool_->FindServiceByName(service); + const google::protobuf::ServiceDescriptor* ref_service_desc = + ref_desc_pool_->FindServiceByName(service); + EXPECT_TRUE(service_desc != nullptr); + EXPECT_TRUE(ref_service_desc != nullptr); + EXPECT_EQ(service_desc->DebugString(), ref_service_desc->DebugString()); + + const google::protobuf::FileDescriptor* file_desc = service_desc->file(); + if (known_files_.find(file_desc->package() + "/" + file_desc->name()) != + known_files_.end()) { + EXPECT_EQ(file_desc->DebugString(), + ref_service_desc->file()->DebugString()); + known_files_.insert(file_desc->package() + "/" + file_desc->name()); + } + + for (int i = 0; i < service_desc->method_count(); ++i) { + CompareMethod(service_desc->method(i)->full_name()); + } + } + + void CompareMethod(const grpc::string& method) { + const google::protobuf::MethodDescriptor* method_desc = + desc_pool_->FindMethodByName(method); + const google::protobuf::MethodDescriptor* ref_method_desc = + ref_desc_pool_->FindMethodByName(method); + EXPECT_TRUE(method_desc != nullptr); + EXPECT_TRUE(ref_method_desc != nullptr); + EXPECT_EQ(method_desc->DebugString(), ref_method_desc->DebugString()); + + CompareType(method_desc->input_type()->full_name()); + CompareType(method_desc->output_type()->full_name()); + } + + void CompareType(const grpc::string& type) { + if (known_types_.find(type) != known_types_.end()) { + return; + } + + const google::protobuf::Descriptor* desc = + desc_pool_->FindMessageTypeByName(type); + const google::protobuf::Descriptor* ref_desc = + ref_desc_pool_->FindMessageTypeByName(type); + EXPECT_TRUE(desc != nullptr); + EXPECT_TRUE(ref_desc != nullptr); + EXPECT_EQ(desc->DebugString(), ref_desc->DebugString()); + } + + protected: + std::unique_ptr<Server> server_; + std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_; + std::unique_ptr<ProtoReflectionDescriptorDatabase> desc_db_; + std::unique_ptr<google::protobuf::DescriptorPool> desc_pool_; + std::unordered_set<string> known_files_; + std::unordered_set<string> known_types_; + const google::protobuf::DescriptorPool* ref_desc_pool_; + int port_; + reflection::ProtoServerReflectionPlugin plugin_; +}; + +TEST_F(ProtoServerReflectionTest, CheckResponseWithLocalDescriptorPool) { + ResetStub(); + + std::vector<std::string> services; + desc_db_->GetServices(&services); + // The service list has at least one service (reflection servcie). + EXPECT_TRUE(services.size() > 0); + + for (auto it = services.begin(); it != services.end(); ++it) { + CompareService(*it); + } +} + +} // namespace testing +} // namespace grpc + +int main(int argc, char** argv) { + grpc_test_init(argc, argv); + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/test/cpp/end2end/zookeeper_test.cc b/test/cpp/end2end/zookeeper_test.cc index 12853a1b98..fdc500e535 100644 --- a/test/cpp/end2end/zookeeper_test.cc +++ b/test/cpp/end2end/zookeeper_test.cc @@ -101,7 +101,7 @@ class ZookeeperTest : public ::testing::Test { zookeeper_address_ = addr_str; gpr_free(addr); } - gpr_log(GPR_DEBUG, zookeeper_address_.c_str()); + gpr_log(GPR_DEBUG, "%s", zookeeper_address_.c_str()); // Connects to zookeeper server zoo_set_debug_level(ZOO_LOG_LEVEL_WARN); diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 7727824979..addaf174f2 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -171,8 +171,9 @@ int main(int argc, char** argv) { "large_unary|large_compressed_unary|client_streaming|server_streaming|" "server_compressed_streaming|half_duplex|ping_pong|cancel_after_begin|" "cancel_after_first_response|timeout_on_sleeping_server|empty_stream|" - "compute_engine_creds|jwt_token_creds|oauth2_auth_token|per_rpc_creds", - "status_code_and_message|custom_metadata", FLAGS_test_case.c_str()); + "compute_engine_creds|jwt_token_creds|oauth2_auth_token|per_rpc_creds|" + "status_code_and_message|custom_metadata", + FLAGS_test_case.c_str()); ret = 1; } diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index a0479e8f68..0bf1fd6f73 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -433,7 +433,7 @@ bool InteropClient::DoResponseStreaming() { // most likely due to connection failure. gpr_log(GPR_ERROR, "DoResponseStreaming(): Read fewer streams (%d) than " - "response_stream_sizes.size() (%d)", + "response_stream_sizes.size() (%" PRIuPTR ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } @@ -517,9 +517,11 @@ bool InteropClient::DoResponseCompressedStreaming() { // stream->Read() failed before reading all the expected messages. This // is most likely due to a connection failure. gpr_log(GPR_ERROR, - "DoResponseCompressedStreaming(): Responses read (k=%d) is " + "DoResponseCompressedStreaming(): Responses read (k=%" PRIuPTR + ") is " "less than the expected messages (i.e " - "response_stream_sizes.size() (%d)). (i=%d, j=%d)", + "response_stream_sizes.size() (%" PRIuPTR ")). (i=%" PRIuPTR + ", j=%" PRIuPTR ")", k, response_stream_sizes.size(), i, j); return TransientFailureOrAbort(); } @@ -608,7 +610,7 @@ bool InteropClient::DoHalfDuplex() { // most likely due to a connection failure gpr_log(GPR_ERROR, "DoHalfDuplex(): Responses read (i=%d) are less than the expected " - "number of messages response_stream_sizes.size() (%d)", + "number of messages response_stream_sizes.size() (%" PRIuPTR ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } diff --git a/test/cpp/interop/metrics_client.cc b/test/cpp/interop/metrics_client.cc index c8c2215fab..7a0cb994df 100644 --- a/test/cpp/interop/metrics_client.cc +++ b/test/cpp/interop/metrics_client.cc @@ -76,7 +76,7 @@ bool PrintMetrics(std::unique_ptr<MetricsService::Stub> stub, bool total_only, while (reader->Read(&gauge_response)) { if (gauge_response.value_case() == GaugeResponse::kLongValue) { if (!total_only) { - gpr_log(GPR_INFO, "%s: %ld", gauge_response.name().c_str(), + gpr_log(GPR_INFO, "%s: %lld", gauge_response.name().c_str(), gauge_response.long_value()); } overall_qps += gauge_response.long_value(); diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 57d8c22a95..83dbdc3e59 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -244,8 +244,8 @@ std::unique_ptr<ScenarioResult> RunScenario( // where class contained in std::vector must have a copy constructor auto* servers = new ServerData[num_servers]; for (size_t i = 0; i < num_servers; i++) { - gpr_log(GPR_INFO, "Starting server on %s (worker #%d)", workers[i].c_str(), - i); + gpr_log(GPR_INFO, "Starting server on %s (worker #%" PRIuPTR ")", + workers[i].c_str(), i); servers[i].stub = WorkerService::NewStub( CreateChannel(workers[i], InsecureChannelCredentials())); @@ -307,8 +307,8 @@ std::unique_ptr<ScenarioResult> RunScenario( auto* clients = new ClientData[num_clients]; for (size_t i = 0; i < num_clients; i++) { const auto& worker = workers[i + num_servers]; - gpr_log(GPR_INFO, "Starting client on %s (worker #%d)", worker.c_str(), - i + num_servers); + gpr_log(GPR_INFO, "Starting client on %s (worker #%" PRIuPTR ")", + worker.c_str(), i + num_servers); clients[i].stub = WorkerService::NewStub( CreateChannel(worker, InsecureChannelCredentials())); ClientConfig per_client_config = client_config; diff --git a/test/cpp/qps/parse_json.cc b/test/cpp/qps/parse_json.cc index be804281f8..e4fc35fa41 100644 --- a/test/cpp/qps/parse_json.cc +++ b/test/cpp/qps/parse_json.cc @@ -55,7 +55,7 @@ void ParseJson(const grpc::string& json, const grpc::string& type, grpc::string errmsg(status.error_message()); gpr_log(GPR_ERROR, "Failed to convert json to binary: errcode=%d msg=%s", status.error_code(), errmsg.c_str()); - gpr_log(GPR_ERROR, "JSON: ", json.c_str()); + gpr_log(GPR_ERROR, "JSON: %s", json.c_str()); abort(); } GPR_ASSERT(msg->ParseFromString(binary)); diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc new file mode 100644 index 0000000000..6907d97bd5 --- /dev/null +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -0,0 +1,316 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/cpp/util/proto_reflection_descriptor_database.h" + +#include <vector> + +#include <grpc/support/log.h> + +using grpc::reflection::v1alpha::ServerReflection; +using grpc::reflection::v1alpha::ServerReflectionRequest; +using grpc::reflection::v1alpha::ServerReflectionResponse; +using grpc::reflection::v1alpha::ListServiceResponse; +using grpc::reflection::v1alpha::ErrorResponse; + +namespace grpc { + +ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase( + std::unique_ptr<ServerReflection::Stub> stub) + : stub_(std::move(stub)) {} + +ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase( + std::shared_ptr<grpc::Channel> channel) + : stub_(ServerReflection::NewStub(channel)) {} + +ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {} + +bool ProtoReflectionDescriptorDatabase::FindFileByName( + const string& filename, google::protobuf::FileDescriptorProto* output) { + if (cached_db_.FindFileByName(filename, output)) { + return true; + } + + if (known_files_.find(filename) != known_files_.end()) { + return false; + } + + ServerReflectionRequest request; + request.set_file_by_filename(filename); + ServerReflectionResponse response; + + DoOneRequest(request, response); + + if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse) { + AddFileFromResponse(response.file_descriptor_response()); + } else if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kErrorResponse) { + const ErrorResponse error = response.error_response(); + if (error.error_code() == StatusCode::NOT_FOUND) { + gpr_log(GPR_INFO, "NOT_FOUND from server for FindFileByName(%s)", + filename.c_str()); + } else { + gpr_log(GPR_INFO, + "Error on FindFileByName(%s)\n\tError code: %d\n" + "\tError Message: %s", + filename.c_str(), error.error_code(), + error.error_message().c_str()); + } + } else { + gpr_log( + GPR_INFO, + "Error on FindFileByName(%s) response type\n" + "\tExpecting: %d\n\tReceived: %d", + filename.c_str(), + ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse, + response.message_response_case()); + } + + return cached_db_.FindFileByName(filename, output); +} + +bool ProtoReflectionDescriptorDatabase::FindFileContainingSymbol( + const string& symbol_name, google::protobuf::FileDescriptorProto* output) { + if (cached_db_.FindFileContainingSymbol(symbol_name, output)) { + return true; + } + + if (missing_symbols_.find(symbol_name) != missing_symbols_.end()) { + return false; + } + + ServerReflectionRequest request; + request.set_file_containing_symbol(symbol_name); + ServerReflectionResponse response; + + DoOneRequest(request, response); + + if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse) { + AddFileFromResponse(response.file_descriptor_response()); + } else if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kErrorResponse) { + const ErrorResponse error = response.error_response(); + if (error.error_code() == StatusCode::NOT_FOUND) { + missing_symbols_.insert(symbol_name); + gpr_log(GPR_INFO, + "NOT_FOUND from server for FindFileContainingSymbol(%s)", + symbol_name.c_str()); + } else { + gpr_log(GPR_INFO, + "Error on FindFileContainingSymbol(%s)\n" + "\tError code: %d\n\tError Message: %s", + symbol_name.c_str(), error.error_code(), + error.error_message().c_str()); + } + } else { + gpr_log( + GPR_INFO, + "Error on FindFileContainingSymbol(%s) response type\n" + "\tExpecting: %d\n\tReceived: %d", + symbol_name.c_str(), + ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse, + response.message_response_case()); + } + return cached_db_.FindFileContainingSymbol(symbol_name, output); +} + +bool ProtoReflectionDescriptorDatabase::FindFileContainingExtension( + const string& containing_type, int field_number, + google::protobuf::FileDescriptorProto* output) { + if (cached_db_.FindFileContainingExtension(containing_type, field_number, + output)) { + return true; + } + + if (missing_extensions_.find(containing_type) != missing_extensions_.end() && + missing_extensions_[containing_type].find(field_number) != + missing_extensions_[containing_type].end()) { + gpr_log(GPR_INFO, "nested map."); + return false; + } + + ServerReflectionRequest request; + request.mutable_file_containing_extension()->set_containing_type( + containing_type); + request.mutable_file_containing_extension()->set_extension_number( + field_number); + ServerReflectionResponse response; + + DoOneRequest(request, response); + + if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse) { + AddFileFromResponse(response.file_descriptor_response()); + } else if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kErrorResponse) { + const ErrorResponse error = response.error_response(); + if (error.error_code() == StatusCode::NOT_FOUND) { + if (missing_extensions_.find(containing_type) == + missing_extensions_.end()) { + missing_extensions_[containing_type] = {}; + } + missing_extensions_[containing_type].insert(field_number); + gpr_log(GPR_INFO, + "NOT_FOUND from server for FindFileContainingExtension(%s, %d)", + containing_type.c_str(), field_number); + } else { + gpr_log(GPR_INFO, + "Error on FindFileContainingExtension(%s, %d)\n" + "\tError code: %d\n\tError Message: %s", + containing_type.c_str(), field_number, error.error_code(), + error.error_message().c_str()); + } + } else { + gpr_log( + GPR_INFO, + "Error on FindFileContainingExtension(%s, %d) response type\n" + "\tExpecting: %d\n\tReceived: %d", + containing_type.c_str(), field_number, + ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse, + response.message_response_case()); + } + + return cached_db_.FindFileContainingExtension(containing_type, field_number, + output); +} + +bool ProtoReflectionDescriptorDatabase::FindAllExtensionNumbers( + const string& extendee_type, std::vector<int>* output) { + if (cached_extension_numbers_.find(extendee_type) != + cached_extension_numbers_.end()) { + *output = cached_extension_numbers_[extendee_type]; + return true; + } + + ServerReflectionRequest request; + request.set_all_extension_numbers_of_type(extendee_type); + ServerReflectionResponse response; + + DoOneRequest(request, response); + + if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase:: + kAllExtensionNumbersResponse) { + auto number = response.all_extension_numbers_response().extension_number(); + *output = std::vector<int>(number.begin(), number.end()); + cached_extension_numbers_[extendee_type] = *output; + return true; + } else if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kErrorResponse) { + const ErrorResponse error = response.error_response(); + if (error.error_code() == StatusCode::NOT_FOUND) { + gpr_log(GPR_INFO, "NOT_FOUND from server for FindAllExtensionNumbers(%s)", + extendee_type.c_str()); + } else { + gpr_log(GPR_INFO, + "Error on FindAllExtensionNumbersExtension(%s)\n" + "\tError code: %d\n\tError Message: %s", + extendee_type.c_str(), error.error_code(), + error.error_message().c_str()); + } + } + return false; +} + +bool ProtoReflectionDescriptorDatabase::GetServices( + std::vector<std::string>* output) { + ServerReflectionRequest request; + request.set_list_services(""); + ServerReflectionResponse response; + + DoOneRequest(request, response); + + if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kListServicesResponse) { + const ListServiceResponse ls_response = response.list_services_response(); + for (int i = 0; i < ls_response.service_size(); ++i) { + (*output).push_back(ls_response.service(i).name()); + } + return true; + } else if (response.message_response_case() == + ServerReflectionResponse::MessageResponseCase::kErrorResponse) { + const ErrorResponse error = response.error_response(); + gpr_log(GPR_INFO, + "Error on GetServices()\n\tError code: %d\n" + "\tError Message: %s", + error.error_code(), error.error_message().c_str()); + } else { + gpr_log( + GPR_INFO, + "Error on GetServices() response type\n\tExpecting: %d\n\tReceived: %d", + ServerReflectionResponse::MessageResponseCase::kListServicesResponse, + response.message_response_case()); + } + return false; +} + +const google::protobuf::FileDescriptorProto +ProtoReflectionDescriptorDatabase::ParseFileDescriptorProtoResponse( + const std::string& byte_fd_proto) { + google::protobuf::FileDescriptorProto file_desc_proto; + file_desc_proto.ParseFromString(byte_fd_proto); + return file_desc_proto; +} + +void ProtoReflectionDescriptorDatabase::AddFileFromResponse( + const grpc::reflection::v1alpha::FileDescriptorResponse& response) { + for (int i = 0; i < response.file_descriptor_proto_size(); ++i) { + const google::protobuf::FileDescriptorProto file_proto = + ParseFileDescriptorProtoResponse(response.file_descriptor_proto(i)); + if (known_files_.find(file_proto.name()) == known_files_.end()) { + known_files_.insert(file_proto.name()); + cached_db_.Add(file_proto); + } + } +} + +const std::shared_ptr<ProtoReflectionDescriptorDatabase::ClientStream> +ProtoReflectionDescriptorDatabase::GetStream() { + if (stream_ == nullptr) { + stream_ = stub_->ServerReflectionInfo(&ctx_); + } + return stream_; +} + +void ProtoReflectionDescriptorDatabase::DoOneRequest( + const ServerReflectionRequest& request, + ServerReflectionResponse& response) { + stream_mutex_.lock(); + GetStream()->Write(request); + GetStream()->Read(&response); + stream_mutex_.unlock(); +} + +} // namespace grpc diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h new file mode 100644 index 0000000000..99c00675bb --- /dev/null +++ b/test/cpp/util/proto_reflection_descriptor_database.h @@ -0,0 +1,131 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#ifndef GRPC_TEST_CPP_PROTO_SERVER_REFLECTION_DATABSE_H +#define GRPC_TEST_CPP_PROTO_SERVER_REFLECTION_DATABSE_H + +#include <mutex> +#include <unordered_map> +#include <unordered_set> +#include <vector> + +#include <google/protobuf/descriptor.h> +#include <google/protobuf/descriptor.pb.h> +#include <google/protobuf/descriptor_database.h> +#include <grpc++/ext/reflection.grpc.pb.h> +#include <grpc++/grpc++.h> + +namespace grpc { + +// ProtoReflectionDescriptorDatabase takes a stub of ServerReflection and +// provides the methods defined by DescriptorDatabase interfaces. It can be used +// to feed a DescriptorPool instance. +class ProtoReflectionDescriptorDatabase + : public google::protobuf::DescriptorDatabase { + public: + explicit ProtoReflectionDescriptorDatabase( + std::unique_ptr<reflection::v1alpha::ServerReflection::Stub> stub); + + explicit ProtoReflectionDescriptorDatabase( + std::shared_ptr<grpc::Channel> channel); + + virtual ~ProtoReflectionDescriptorDatabase(); + + // The following four methods implement DescriptorDatabase interfaces. + // + // Find a file by file name. Fills in in *output and returns true if found. + // Otherwise, returns false, leaving the contents of *output undefined. + bool FindFileByName(const string& filename, + google::protobuf::FileDescriptorProto* output) + GRPC_OVERRIDE; + + // Find the file that declares the given fully-qualified symbol name. + // If found, fills in *output and returns true, otherwise returns false + // and leaves *output undefined. + bool FindFileContainingSymbol(const string& symbol_name, + google::protobuf::FileDescriptorProto* output) + GRPC_OVERRIDE; + + // Find the file which defines an extension extending the given message type + // with the given field number. If found, fills in *output and returns true, + // otherwise returns false and leaves *output undefined. containing_type + // must be a fully-qualified type name. + bool FindFileContainingExtension( + const string& containing_type, int field_number, + google::protobuf::FileDescriptorProto* output) GRPC_OVERRIDE; + + // Finds the tag numbers used by all known extensions of + // extendee_type, and appends them to output in an undefined + // order. This method is best-effort: it's not guaranteed that the + // database will find all extensions, and it's not guaranteed that + // FindFileContainingExtension will return true on all of the found + // numbers. Returns true if the search was successful, otherwise + // returns false and leaves output unchanged. + bool FindAllExtensionNumbers(const string& extendee_type, + std::vector<int>* output) GRPC_OVERRIDE; + + // Provide a list of full names of registered services + bool GetServices(std::vector<std::string>* output); + + private: + typedef ClientReaderWriter< + grpc::reflection::v1alpha::ServerReflectionRequest, + grpc::reflection::v1alpha::ServerReflectionResponse> + ClientStream; + + const google::protobuf::FileDescriptorProto ParseFileDescriptorProtoResponse( + const std::string& byte_fd_proto); + + void AddFileFromResponse( + const grpc::reflection::v1alpha::FileDescriptorResponse& response); + + const std::shared_ptr<ClientStream> GetStream(); + + void DoOneRequest( + const grpc::reflection::v1alpha::ServerReflectionRequest& request, + grpc::reflection::v1alpha::ServerReflectionResponse& response); + + std::shared_ptr<ClientStream> stream_; + grpc::ClientContext ctx_; + std::unique_ptr<grpc::reflection::v1alpha::ServerReflection::Stub> stub_; + std::unordered_set<string> known_files_; + std::unordered_set<string> missing_symbols_; + std::unordered_map<string, std::unordered_set<int>> missing_extensions_; + std::unordered_map<string, std::vector<int>> cached_extension_numbers_; + std::mutex stream_mutex_; + + google::protobuf::SimpleDescriptorDatabase cached_db_; +}; + +} // namespace grpc + +#endif // GRPC_TEST_CPP_METRICS_SERVER_H diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh new file mode 100755 index 0000000000..bc84b84b8f --- /dev/null +++ b/test/distrib/cpp/run_distrib_test.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +git clone --recursive $EXTERNAL_GIT_ROOT +cd grpc + +cd third_party/protobuf && ./autogen.sh && \ +./configure && make -j4 && make check && make install && ldconfig + +cd ../.. && make -j4 && make install + +cd examples/cpp/helloworld + +make + +make clean + +cd ../../../examples/cpp/route_guide + +make + +make clean + diff --git a/tools/codegen/extensions/gen_reflection_proto.sh b/tools/codegen/extensions/gen_reflection_proto.sh new file mode 100755 index 0000000000..45a1a9f4ec --- /dev/null +++ b/tools/codegen/extensions/gen_reflection_proto.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Copyright 2016, 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. + +PROTO_DIR="src/proto/grpc/reflection/v1alpha" +PROTO_FILE="reflection" +HEADER_DIR="include/grpc++/ext" +SRC_DIR="src/cpp/ext" +INCLUDE_DIR="grpc++/ext" +TMP_DIR="tmp" +GRPC_PLUGIN="bins/opt/grpc_cpp_plugin" +PROTOC=third_party/protobuf/src/protoc + +set -e + +TMP_DIR=${TMP_DIR}_${PROTO_FILE} + +cd $(dirname $0)/../../.. + +[ ! -d $HEADER_DIR ] && mkdir -p $HEADER_DIR || : +[ ! -d $SRC_DIR ] && mkdir -p $SRC_DIR || : +[ ! -d $TMP_DIR ] && mkdir -p $TMP_DIR || : + +$PROTOC -I$PROTO_DIR --cpp_out=$TMP_DIR ${PROTO_DIR}/${PROTO_FILE}.proto +$PROTOC -I$PROTO_DIR --grpc_out=$TMP_DIR --plugin=protoc-gen-grpc=${GRPC_PLUGIN} ${PROTO_DIR}/${PROTO_FILE}.proto + +sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.pb.cc +sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.h +sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc +sed -i "s/\"${PROTO_FILE}.grpc.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.grpc.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc + +/bin/cp LICENSE ${TMP_DIR}/TMP_LICENSE +sed -i -e "s/./ &/" -e "s/.*/ \*&/" ${TMP_DIR}/TMP_LICENSE +sed -i -r "\$a\ *\n *\/\n\n" ${TMP_DIR}/TMP_LICENSE + +sed -i -e "1s/^/ *\n/" -e "1s/^/\/*\n/" ${TMP_DIR}/*.pb.h +sed -i -e "1s/^/ *\n/" -e "1s/^/\/*\n/" ${TMP_DIR}/*.pb.cc + +sed -i "2r ${TMP_DIR}/TMP_LICENSE" ${TMP_DIR}/*.pb.h +sed -i "2r ${TMP_DIR}/TMP_LICENSE" ${TMP_DIR}/*.pb.cc + +/bin/mv ${TMP_DIR}/${PROTO_FILE}.pb.h ${HEADER_DIR} +/bin/mv ${TMP_DIR}/${PROTO_FILE}.grpc.pb.h ${HEADER_DIR} +/bin/mv ${TMP_DIR}/${PROTO_FILE}.pb.cc ${SRC_DIR} +/bin/mv ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc ${SRC_DIR} +/bin/rm -r $TMP_DIR diff --git a/tools/distrib/check_generated_pb_files.sh b/tools/distrib/check_generated_pb_files.sh new file mode 100755 index 0000000000..557067883c --- /dev/null +++ b/tools/distrib/check_generated_pb_files.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -ex + +# change to root directory +cd $(dirname $0)/../.. + +# build grpc_check_generated_pb_files docker image +docker build -t grpc_check_generated_pb_files tools/dockerfile/grpc_check_generated_pb_files + +# run check_pb_files against the checked out codebase +docker run -e TEST=$TEST --rm=true -v ${HOST_GIT_ROOT:-`pwd`}:/var/local/jenkins/grpc -t grpc_check_generated_pb_files /var/local/jenkins/grpc/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh diff --git a/tools/distrib/check_include_guards.py b/tools/distrib/check_include_guards.py index ef770b30b4..56b2924a1a 100755 --- a/tools/distrib/check_include_guards.py +++ b/tools/distrib/check_include_guards.py @@ -172,6 +172,8 @@ args = argp.parse_args() KNOWN_BAD = set([ 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', + 'include/grpc++/ext/reflection.grpc.pb.h', + 'include/grpc++/ext/reflection.pb.h', ]) diff --git a/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile new file mode 100644 index 0000000000..c24b1c451d --- /dev/null +++ b/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile @@ -0,0 +1,45 @@ +# Copyright 2016, 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. + +FROM debian:jessie + +# Install packages needed for gRPC and protobuf +RUN apt-get update && apt-get install -y \ + autoconf \ + automake \ + build-essential \ + curl \ + git \ + g++ \ + libtool \ + make \ + pkg-config \ + unzip && apt-get clean + +CMD ["bash"] diff --git a/tools/dockerfile/grpc_check_generated_pb_files/Dockerfile b/tools/dockerfile/grpc_check_generated_pb_files/Dockerfile new file mode 100644 index 0000000000..7658991462 --- /dev/null +++ b/tools/dockerfile/grpc_check_generated_pb_files/Dockerfile @@ -0,0 +1,78 @@ +# 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. + +FROM debian:jessie + +# Install Git and basic packages. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + golang \ + gyp \ + lcov \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + perl \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +#================ +# Build profiling +RUN apt-get update && apt-get install -y time && apt-get clean + +#================= +# C++ dependencies +RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean + +#====================== +# Zookeeper dependencies +# TODO(jtattermusch): is zookeeper still needed? +RUN apt-get install -y libzookeeper-mt-dev + +RUN mkdir /var/local/jenkins + +# Define the default command. +CMD ["bash"] diff --git a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh new file mode 100755 index 0000000000..62e41755ec --- /dev/null +++ b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -e + +mkdir -p /var/local/git +git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc + +cd /var/local/git/grpc + +# build grpc cpp plugin for generating grpc pb files +make grpc_cpp_plugin + +# generate pb files +tools/codegen/extensions/gen_reflection_proto.sh + +# check if the pb files in the checked out codebase are identical with the newly +# generated ones +git diff --exit-code diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh index 6f4155944c..eab7611b3f 100755 --- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh +++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh @@ -44,7 +44,7 @@ for dir in $DIRS do for glob in $GLOB do - files="$files `find /local-code/$dir -name $glob -and -not -name *.generated.* -and -not -name *.pb.h -and -not -name *.pb.c`" + files="$files `find /local-code/$dir -name $glob -and -not -name *.generated.* -and -not -name *.pb.h -and -not -name *.pb.c -and -not -name *.pb.cc`" done done diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index f13e840c20..e1555930e9 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -867,6 +867,7 @@ src/core/lib/transport/metadata_batch.h \ src/core/lib/transport/static_metadata.h \ src/core/lib/transport/transport.h \ src/core/lib/transport/transport_impl.h \ +src/core/ext/transport/chttp2/transport/bin_decoder.h \ src/core/ext/transport/chttp2/transport/bin_encoder.h \ src/core/ext/transport/chttp2/transport/chttp2_transport.h \ src/core/ext/transport/chttp2/transport/frame.h \ @@ -1030,6 +1031,7 @@ src/core/lib/transport/static_metadata.c \ src/core/lib/transport/transport.c \ src/core/lib/transport/transport_op_string.c \ src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c \ +src/core/ext/transport/chttp2/transport/bin_decoder.c \ src/core/ext/transport/chttp2/transport/bin_encoder.c \ src/core/ext/transport/chttp2/transport/chttp2_plugin.c \ src/core/ext/transport/chttp2/transport/chttp2_transport.c \ diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py index ae918be21d..1a7aa0bfc8 100644 --- a/tools/run_tests/distribtest_targets.py +++ b/tools/run_tests/distribtest_targets.py @@ -238,9 +238,37 @@ class PHPDistribTest(object): return self.name +class CppDistribTest(object): + """Tests Cpp make intall by building examples.""" + + def __init__(self, platform, arch, docker_suffix=None): + self.name = 'cpp_%s_%s_%s' % (platform, arch, docker_suffix) + self.platform = platform + self.arch = arch + self.docker_suffix = docker_suffix + self.labels = ['distribtest', 'cpp', platform, arch, docker_suffix] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if self.platform == 'linux': + return create_docker_jobspec(self.name, + 'tools/dockerfile/distribtest/cpp_%s_%s' % ( + self.docker_suffix, + self.arch), + 'test/distrib/cpp/run_distrib_test.sh') + else: + raise Exception("Not supported yet.") + + def __str__(self): + return self.name + + def targets(): """Gets list of supported targets""" - return [CSharpDistribTest('linux', 'x64', 'wheezy'), + return [CppDistribTest('linux', 'x64', 'jessie'), + CSharpDistribTest('linux', 'x64', 'wheezy'), CSharpDistribTest('linux', 'x64', 'jessie'), CSharpDistribTest('linux', 'x86', 'jessie'), CSharpDistribTest('linux', 'x64', 'centos7'), diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml index c5945c602f..e699c5194d 100644 --- a/tools/run_tests/sanity/sanity_tests.yaml +++ b/tools/run_tests/sanity/sanity_tests.yaml @@ -11,3 +11,4 @@ - script: tools/distrib/check_nanopb_output.sh - script: tools/distrib/check_include_guards.py - script: tools/distrib/python/check_grpcio_tools.py +- script: tools/distrib/check_generated_pb_files.sh diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 1a0bc49638..57e3bd63f4 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -86,6 +86,20 @@ ], "headers": [], "language": "c", + "name": "bin_decoder_test", + "src": [ + "test/core/transport/chttp2/bin_decoder_test.c" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", "name": "bin_encoder_test", "src": [ "test/core/transport/chttp2/bin_encoder_test.c" @@ -2371,6 +2385,29 @@ "gpr_test_util", "grpc", "grpc++", + "grpc++_reflection", + "grpc++_test_util", + "grpc_test_util" + ], + "headers": [ + "test/cpp/util/proto_reflection_descriptor_database.h" + ], + "language": "c++", + "name": "proto_server_reflection_test", + "src": [ + "test/cpp/end2end/proto_server_reflection_test.cc", + "test/cpp/util/proto_reflection_descriptor_database.cc", + "test/cpp/util/proto_reflection_descriptor_database.h" + ], + "third_party": false, + "type": "target" + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", "grpc++_test_util", "grpc_test_util", "qps" @@ -4326,6 +4363,32 @@ "type": "lib" }, { + "deps": [ + "grpc++", + "grpc++_codegen_proto" + ], + "headers": [ + "include/grpc++/ext/proto_server_reflection_plugin.h", + "include/grpc++/ext/reflection.grpc.pb.h", + "include/grpc++/ext/reflection.pb.h", + "src/cpp/ext/proto_server_reflection.h" + ], + "language": "c++", + "name": "grpc++_reflection", + "src": [ + "include/grpc++/ext/proto_server_reflection_plugin.h", + "include/grpc++/ext/reflection.grpc.pb.h", + "include/grpc++/ext/reflection.pb.h", + "src/cpp/ext/proto_server_reflection.cc", + "src/cpp/ext/proto_server_reflection.h", + "src/cpp/ext/proto_server_reflection_plugin.cc", + "src/cpp/ext/reflection.grpc.pb.cc", + "src/cpp/ext/reflection.pb.cc" + ], + "third_party": false, + "type": "lib" + }, + { "deps": [], "headers": [ "test/cpp/util/test_config.h" @@ -6226,6 +6289,7 @@ "grpc_transport_chttp2_alpn" ], "headers": [ + "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_transport.h", "src/core/ext/transport/chttp2/transport/frame.h", @@ -6250,6 +6314,8 @@ "language": "c", "name": "grpc_transport_chttp2", "src": [ + "src/core/ext/transport/chttp2/transport/bin_decoder.c", + "src/core/ext/transport/chttp2/transport/bin_decoder.h", "src/core/ext/transport/chttp2/transport/bin_encoder.c", "src/core/ext/transport/chttp2/transport/bin_encoder.h", "src/core/ext/transport/chttp2/transport/chttp2_plugin.c", diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 114e0850f4..d4ca98a3c5 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -98,6 +98,27 @@ "flaky": false, "gtest": false, "language": "c", + "name": "bin_decoder_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "gtest": false, + "language": "c", "name": "bin_encoder_test", "platforms": [ "linux", @@ -2339,6 +2360,27 @@ "ci_platforms": [ "linux", "mac", + "posix", + "windows" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "gtest": true, + "language": "c++", + "name": "proto_server_reflection_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, + { + "args": [], + "ci_platforms": [ + "linux", + "mac", "posix" ], "cpu_cost": 0.5, diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index 3288a74b88..a847add773 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -68,6 +68,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "badreq_bad_client_test", "v {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bin_decoder_test", "vcxproj\test\bin_decoder_test\bin_decoder_test.vcxproj", "{6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}" + ProjectSection(myProperties) = preProject + lib = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bin_encoder_test", "vcxproj\test\bin_encoder_test\bin_encoder_test.vcxproj", "{D5C70922-D68E-0E9D-9988-995E0F9A79AE}" ProjectSection(myProperties) = preProject lib = "False" @@ -1531,6 +1540,22 @@ Global {8A811C28-E04E-A444-E4C1-7588DF5B90AE}.Release-DLL|Win32.Build.0 = Release|Win32 {8A811C28-E04E-A444-E4C1-7588DF5B90AE}.Release-DLL|x64.ActiveCfg = Release|x64 {8A811C28-E04E-A444-E4C1-7588DF5B90AE}.Release-DLL|x64.Build.0 = Release|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug|Win32.ActiveCfg = Debug|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug|x64.ActiveCfg = Debug|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release|Win32.ActiveCfg = Release|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release|x64.ActiveCfg = Release|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug|Win32.Build.0 = Debug|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug|x64.Build.0 = Debug|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release|Win32.Build.0 = Release|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release|x64.Build.0 = Release|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Debug-DLL|x64.Build.0 = Debug|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release-DLL|Win32.Build.0 = Release|Win32 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release-DLL|x64.ActiveCfg = Release|x64 + {6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}.Release-DLL|x64.Build.0 = Release|x64 {D5C70922-D68E-0E9D-9988-995E0F9A79AE}.Debug|Win32.ActiveCfg = Debug|Win32 {D5C70922-D68E-0E9D-9988-995E0F9A79AE}.Debug|x64.ActiveCfg = Debug|x64 {D5C70922-D68E-0E9D-9988-995E0F9A79AE}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/grpc.sln b/vsprojects/grpc.sln index 8aac97295c..a43daaf294 100644 --- a/vsprojects/grpc.sln +++ b/vsprojects/grpc.sln @@ -51,6 +51,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++", "vcxproj\.\grpc++\ {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++_reflection", "vcxproj\.\grpc++_reflection\grpc++_reflection.vcxproj", "{5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}" + ProjectSection(myProperties) = preProject + lib = "True" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} = {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++_unsecure", "vcxproj\.\grpc++_unsecure\grpc++_unsecure.vcxproj", "{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}" ProjectSection(myProperties) = preProject lib = "True" @@ -295,6 +303,22 @@ Global {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|x64.Build.0 = Release-DLL|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug|Win32.ActiveCfg = Debug|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug|x64.ActiveCfg = Debug|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release|Win32.ActiveCfg = Release|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release|x64.ActiveCfg = Release|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug|Win32.Build.0 = Debug|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug|x64.Build.0 = Debug|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release|Win32.Build.0 = Release|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release|x64.Build.0 = Release|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Debug-DLL|x64.Build.0 = Debug|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release-DLL|Win32.Build.0 = Release|Win32 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release-DLL|x64.ActiveCfg = Release|x64 + {5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}.Release-DLL|x64.Build.0 = Release|x64 {6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Debug|Win32.ActiveCfg = Debug|Win32 {6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Debug|x64.ActiveCfg = Debug|x64 {6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj new file mode 100644 index 0000000000..7c3e63b208 --- /dev/null +++ b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj @@ -0,0 +1,234 @@ +<?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="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}</ProjectGuid> + <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> + <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> + <PlatformToolset>v100</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(SolutionDir)\..\vsprojects\global.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\winsock.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)'=='Debug'"> + <TargetName>grpc++_reflection</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'"> + <TargetName>grpc++_reflection</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + + <ItemGroup> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\proto_server_reflection_plugin.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.grpc.pb.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.pb.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\proto_utils.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_stream.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_unary_call.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call_hook.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\channel_interface.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_context.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_unary_call.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue_tag.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_service_method.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\security\auth_context.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\serialization_traits.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_context.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_interface.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\service_type.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status_code_enum.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\string_ref.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\stub_options.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_cxx11.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_no_cxx11.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_stream.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\time.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer_reader.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\compression_types.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\connectivity_state.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\grpc_types.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\propagation_bits.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\status.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\alloc.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_atomic.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_sync.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_windows.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\log.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\port_platform.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice_buffer.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_generic.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_posix.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_windows.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\time.h" /> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config_protobuf.h" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.cc"> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection_plugin.cc"> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.grpc.pb.cc"> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.pb.cc"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> + <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + </Target> +</Project> + diff --git a/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters new file mode 100644 index 0000000000..d9cd49cc30 --- /dev/null +++ b/vsprojects/vcxproj/grpc++_reflection/grpc++_reflection.vcxproj.filters @@ -0,0 +1,232 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.cc"> + <Filter>src\cpp\ext</Filter> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection_plugin.cc"> + <Filter>src\cpp\ext</Filter> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.grpc.pb.cc"> + <Filter>src\cpp\ext</Filter> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.pb.cc"> + <Filter>src\cpp\ext</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\proto_server_reflection_plugin.h"> + <Filter>include\grpc++\ext</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.grpc.pb.h"> + <Filter>include\grpc++\ext</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.pb.h"> + <Filter>include\grpc++\ext</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\proto_utils.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_stream.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_unary_call.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call_hook.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\channel_interface.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_context.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_unary_call.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue_tag.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_service_method.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\security\auth_context.h"> + <Filter>include\grpc++\impl\codegen\security</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\serialization_traits.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_context.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_interface.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\service_type.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status_code_enum.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\string_ref.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\stub_options.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_cxx11.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_no_cxx11.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_stream.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\time.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer_reader.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\compression_types.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\connectivity_state.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\grpc_types.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\propagation_bits.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\status.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\alloc.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_atomic.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_sync.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_windows.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\log.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\port_platform.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice_buffer.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_generic.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_posix.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_windows.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\time.h"> + <Filter>include\grpc\impl\codegen</Filter> + </ClInclude> + <ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config_protobuf.h"> + <Filter>include\grpc++\impl\codegen</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.h"> + <Filter>src\cpp\ext</Filter> + </ClInclude> + </ItemGroup> + + <ItemGroup> + <Filter Include="include"> + <UniqueIdentifier>{e9441021-f78a-ec84-7efd-1883975feddb}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc"> + <UniqueIdentifier>{3b19b259-3bf4-c0fa-8e20-ed79acd63ac3}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++"> + <UniqueIdentifier>{c66e66b4-a64e-79bf-40e8-1a1bac124a3d}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++\ext"> + <UniqueIdentifier>{8d96203b-d3ce-2164-74a6-06e0ff2b09af}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++\impl"> + <UniqueIdentifier>{4e57d72c-762f-20b1-bdb9-bc7088ca6fda}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++\impl\codegen"> + <UniqueIdentifier>{0f0f3943-7a9d-2b03-7eb1-2fbad4199428}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc++\impl\codegen\security"> + <UniqueIdentifier>{e1b8bc6d-2cd2-1283-868a-dfd64c3dbab8}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc\impl"> + <UniqueIdentifier>{7bccc379-84fb-c1aa-19aa-a0cc09ac59ac}</UniqueIdentifier> + </Filter> + <Filter Include="include\grpc\impl\codegen"> + <UniqueIdentifier>{a1f1904b-e820-dd3c-b4b0-14a6e0ff9d19}</UniqueIdentifier> + </Filter> + <Filter Include="src"> + <UniqueIdentifier>{5ec5476e-3d72-e3f9-4f05-3f7c31c13651}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp"> + <UniqueIdentifier>{a642ac8e-cec2-35d3-9a8a-78313d03b440}</UniqueIdentifier> + </Filter> + <Filter Include="src\cpp\ext"> + <UniqueIdentifier>{d0204618-0f6a-dbc6-cf41-ffc04e76075a}</UniqueIdentifier> + </Filter> + </ItemGroup> +</Project> + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 136bc6f5c9..84e03f7056 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -376,6 +376,7 @@ <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\static_metadata.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport_impl.h" /> + <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\chttp2_transport.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\frame.h" /> @@ -628,6 +629,8 @@ </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\server\secure\server_secure_chttp2.c"> </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.c"> + </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.c"> </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\chttp2_plugin.c"> diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 539025ce1e..0f817e0562 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -262,6 +262,9 @@ <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\server\secure\server_secure_chttp2.c"> <Filter>src\core\ext\transport\chttp2\server\secure</Filter> </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.c"> + <Filter>src\core\ext\transport\chttp2\transport</Filter> + </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.c"> <Filter>src\core\ext\transport\chttp2\transport</Filter> </ClCompile> @@ -875,6 +878,9 @@ <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport_impl.h"> <Filter>src\core\lib\transport</Filter> </ClInclude> + <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.h"> + <Filter>src\core\ext\transport\chttp2\transport</Filter> + </ClInclude> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.h"> <Filter>src\core\ext\transport\chttp2\transport</Filter> </ClInclude> diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index b304737ad6..ac9bb186b7 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -365,6 +365,7 @@ <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\static_metadata.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport_impl.h" /> + <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\chttp2_transport.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\frame.h" /> @@ -597,6 +598,8 @@ </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\server\insecure\server_chttp2_posix.c"> </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.c"> + </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.c"> </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\chttp2_plugin.c"> diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 4f4a29ff8c..1341474142 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -268,6 +268,9 @@ <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\server\insecure\server_chttp2_posix.c"> <Filter>src\core\ext\transport\chttp2\server\insecure</Filter> </ClCompile> + <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.c"> + <Filter>src\core\ext\transport\chttp2\transport</Filter> + </ClCompile> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.c"> <Filter>src\core\ext\transport\chttp2\transport</Filter> </ClCompile> @@ -782,6 +785,9 @@ <ClInclude Include="$(SolutionDir)\..\src\core\lib\transport\transport_impl.h"> <Filter>src\core\lib\transport</Filter> </ClInclude> + <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_decoder.h"> + <Filter>src\core\ext\transport\chttp2\transport</Filter> + </ClInclude> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\bin_encoder.h"> <Filter>src\core\ext\transport\chttp2\transport</Filter> </ClInclude> diff --git a/vsprojects/vcxproj/test/bin_decoder_test/bin_decoder_test.vcxproj b/vsprojects/vcxproj/test/bin_decoder_test/bin_decoder_test.vcxproj new file mode 100644 index 0000000000..b0c878f5dd --- /dev/null +++ b/vsprojects/vcxproj/test/bin_decoder_test/bin_decoder_test.vcxproj @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" /> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{6BFAC6BA-3B9D-E8F5-BE35-91E8EFB9E25B}</ProjectGuid> + <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> + <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> + <PlatformToolset>v100</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(SolutionDir)\..\vsprojects\global.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\openssl.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\winsock.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\zlib.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)'=='Debug'"> + <TargetName>bin_decoder_test</TargetName> + <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> + <Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> + <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> + <Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'"> + <TargetName>bin_decoder_test</TargetName> + <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> + <Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib> + <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> + <Configuration-grpc_dependencies_openssl>Release</Configuration-grpc_dependencies_openssl> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + + <ItemGroup> + <ClCompile Include="$(SolutionDir)\..\test\core\transport\chttp2\bin_decoder_test.c"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj"> + <Project>{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> + </ImportGroup> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" /> + </Target> +</Project> + diff --git a/vsprojects/vcxproj/test/bin_decoder_test/bin_decoder_test.vcxproj.filters b/vsprojects/vcxproj/test/bin_decoder_test/bin_decoder_test.vcxproj.filters new file mode 100644 index 0000000000..f6044656fa --- /dev/null +++ b/vsprojects/vcxproj/test/bin_decoder_test/bin_decoder_test.vcxproj.filters @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClCompile Include="$(SolutionDir)\..\test\core\transport\chttp2\bin_decoder_test.c"> + <Filter>test\core\transport\chttp2</Filter> + </ClCompile> + </ItemGroup> + + <ItemGroup> + <Filter Include="test"> + <UniqueIdentifier>{6865d212-f7ee-5eb1-aa2e-c8ce3dd9f834}</UniqueIdentifier> + </Filter> + <Filter Include="test\core"> + <UniqueIdentifier>{79be26a4-2e58-2868-d847-e692e13ed37a}</UniqueIdentifier> + </Filter> + <Filter Include="test\core\transport"> + <UniqueIdentifier>{2b861a75-ca04-d422-f519-5b6d3c81e6e4}</UniqueIdentifier> + </Filter> + <Filter Include="test\core\transport\chttp2"> + <UniqueIdentifier>{9725ed79-ddf1-6ffe-21e1-14fef9d481a6}</UniqueIdentifier> + </Filter> + </ItemGroup> +</Project> + diff --git a/vsprojects/vcxproj/test/proto_server_reflection_test/proto_server_reflection_test.vcxproj b/vsprojects/vcxproj/test/proto_server_reflection_test/proto_server_reflection_test.vcxproj new file mode 100644 index 0000000000..27fc168946 --- /dev/null +++ b/vsprojects/vcxproj/test/proto_server_reflection_test/proto_server_reflection_test.vcxproj @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" /> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{1881E6A1-EAD4-A68C-9727-FF1956B66185}</ProjectGuid> + <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> + <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> + <PlatformToolset>v100</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> + <PlatformToolset>v120</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(SolutionDir)\..\vsprojects\cpptest.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\global.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\openssl.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\protobuf.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\winsock.props" /> + <Import Project="$(SolutionDir)\..\vsprojects\zlib.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)'=='Debug'"> + <TargetName>proto_server_reflection_test</TargetName> + <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> + <Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> + <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> + <Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'"> + <TargetName>proto_server_reflection_test</TargetName> + <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> + <Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib> + <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> + <Configuration-grpc_dependencies_openssl>Release</Configuration-grpc_dependencies_openssl> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <TreatWarningAsError>true</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + + <ItemGroup> + <ClInclude Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="$(SolutionDir)\..\test\cpp\end2end\proto_server_reflection_test.cc"> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.cc"> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_reflection\grpc++_reflection.vcxproj"> + <Project>{5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_test_util\grpc++_test_util.vcxproj"> + <Project>{0BE77741-552A-929B-A497-4EF7ECE17A64}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj"> + <Project>{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> + <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> + <Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr_test_util\gpr_test_util.vcxproj"> + <Project>{EAB0A629-17A9-44DB-B5FF-E91A721FE037}</Project> + </ProjectReference> + <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj"> + <Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> + <Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> + </ImportGroup> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" /> + <Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" /> + </Target> +</Project> + diff --git a/vsprojects/vcxproj/test/proto_server_reflection_test/proto_server_reflection_test.vcxproj.filters b/vsprojects/vcxproj/test/proto_server_reflection_test/proto_server_reflection_test.vcxproj.filters new file mode 100644 index 0000000000..6d6e5c1f32 --- /dev/null +++ b/vsprojects/vcxproj/test/proto_server_reflection_test/proto_server_reflection_test.vcxproj.filters @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ClCompile Include="$(SolutionDir)\..\test\cpp\end2end\proto_server_reflection_test.cc"> + <Filter>test\cpp\end2end</Filter> + </ClCompile> + <ClCompile Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.cc"> + <Filter>test\cpp\util</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.h"> + <Filter>test\cpp\util</Filter> + </ClInclude> + </ItemGroup> + + <ItemGroup> + <Filter Include="test"> + <UniqueIdentifier>{354831a1-52fb-6364-b568-c8c49bfb8d29}</UniqueIdentifier> + </Filter> + <Filter Include="test\cpp"> + <UniqueIdentifier>{b4d957ef-f9fd-2a14-078c-b72f80096f70}</UniqueIdentifier> + </Filter> + <Filter Include="test\cpp\end2end"> + <UniqueIdentifier>{130f224c-89a5-54ea-7045-b54b4188c52b}</UniqueIdentifier> + </Filter> + <Filter Include="test\cpp\util"> + <UniqueIdentifier>{aae81aad-5563-fceb-1461-10fdec84c5b0}</UniqueIdentifier> + </Filter> + </ItemGroup> +</Project> + |