Merge github.com:grpc/grpc into accounting

pull/5699/head
Craig Tiller 9 years ago
commit ef37d7cd4e
  1. 40
      BUILD
  2. 68
      Makefile
  3. 8
      binding.gyp
  4. 26
      build.yaml
  5. 10
      config.m4
  6. 20
      gRPC.podspec
  7. 14
      grpc.gemspec
  8. 14
      package.json
  9. 14
      package.xml
  10. 7
      src/compiler/python_generator.cc
  11. 16
      src/core/http/format_request.c
  12. 8
      src/core/http/format_request.h
  13. 27
      src/core/http/httpcli.c
  14. 39
      src/core/http/httpcli.h
  15. 2
      src/core/http/httpcli_security_connector.c
  16. 313
      src/core/http/parser.c
  17. 116
      src/core/http/parser.h
  18. 211
      src/core/httpcli/parser.c
  19. 64
      src/core/httpcli/parser.h
  20. 25
      src/core/security/credentials.c
  21. 7
      src/core/security/credentials.h
  22. 9
      src/core/security/google_default_credentials.c
  23. 20
      src/core/security/jwt_verifier.c
  24. 2
      src/core/transport/chttp2/timeout_encoding.c
  25. 19
      src/proto/grpc/testing/metrics.proto
  26. 8
      src/python/grpcio/grpc_core_dependencies.py
  27. 36
      test/core/http/format_request_test.c
  28. 8
      test/core/http/httpcli_test.c
  29. 8
      test/core/http/httpscli_test.c
  30. 135
      test/core/http/parser_test.c
  31. 2
      test/core/http/test_server.py
  32. 25
      test/core/security/credentials_test.c
  33. 10
      test/core/security/jwt_verifier_test.c
  34. 11
      test/core/transport/chttp2/timeout_encoding_test.c
  35. 1
      test/core/util/port_posix.c
  36. 8
      test/core/util/port_server_client.c
  37. 1
      test/core/util/port_windows.c
  38. 14
      tools/doxygen/Doxyfile.core.internal
  39. 50
      tools/run_tests/sources_and_headers.json
  40. 25
      tools/run_tests/stress_test/STRESS_CLIENT_SPEC.md
  41. 4
      tools/run_tests/tests.json
  42. 36
      vsprojects/buildtests_c.sln
  43. 14
      vsprojects/vcxproj/grpc/grpc.vcxproj
  44. 32
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  45. 12
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  46. 28
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
  47. 8
      vsprojects/vcxproj/test/http_parser_test/http_parser_test.vcxproj
  48. 12
      vsprojects/vcxproj/test/http_parser_test/http_parser_test.vcxproj.filters
  49. 2
      vsprojects/vcxproj/test/httpcli_format_request_test/httpcli_format_request_test.vcxproj
  50. 8
      vsprojects/vcxproj/test/httpcli_format_request_test/httpcli_format_request_test.vcxproj.filters

40
BUILD

@ -190,9 +190,9 @@ cc_library(
"src/core/compression/algorithm_metadata.h", "src/core/compression/algorithm_metadata.h",
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h", "src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h", "src/core/iomgr/endpoint_pair.h",
@ -332,9 +332,9 @@ cc_library(
"src/core/compression/compression_algorithm.c", "src/core/compression/compression_algorithm.c",
"src/core/compression/message_compress.c", "src/core/compression/message_compress.c",
"src/core/debug/trace.c", "src/core/debug/trace.c",
"src/core/httpcli/format_request.c", "src/core/http/format_request.c",
"src/core/httpcli/httpcli.c", "src/core/http/httpcli.c",
"src/core/httpcli/parser.c", "src/core/http/parser.c",
"src/core/iomgr/closure.c", "src/core/iomgr/closure.c",
"src/core/iomgr/endpoint.c", "src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c", "src/core/iomgr/endpoint_pair_posix.c",
@ -432,7 +432,7 @@ cc_library(
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/httpcli/httpcli_security_connector.c", "src/core/http/httpcli_security_connector.c",
"src/core/security/b64.c", "src/core/security/b64.c",
"src/core/security/client_auth_filter.c", "src/core/security/client_auth_filter.c",
"src/core/security/credentials.c", "src/core/security/credentials.c",
@ -565,9 +565,9 @@ cc_library(
"src/core/compression/algorithm_metadata.h", "src/core/compression/algorithm_metadata.h",
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h", "src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h", "src/core/iomgr/endpoint_pair.h",
@ -694,9 +694,9 @@ cc_library(
"src/core/compression/compression_algorithm.c", "src/core/compression/compression_algorithm.c",
"src/core/compression/message_compress.c", "src/core/compression/message_compress.c",
"src/core/debug/trace.c", "src/core/debug/trace.c",
"src/core/httpcli/format_request.c", "src/core/http/format_request.c",
"src/core/httpcli/httpcli.c", "src/core/http/httpcli.c",
"src/core/httpcli/parser.c", "src/core/http/parser.c",
"src/core/iomgr/closure.c", "src/core/iomgr/closure.c",
"src/core/iomgr/endpoint.c", "src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c", "src/core/iomgr/endpoint_pair_posix.c",
@ -1396,9 +1396,9 @@ objc_library(
"src/core/compression/compression_algorithm.c", "src/core/compression/compression_algorithm.c",
"src/core/compression/message_compress.c", "src/core/compression/message_compress.c",
"src/core/debug/trace.c", "src/core/debug/trace.c",
"src/core/httpcli/format_request.c", "src/core/http/format_request.c",
"src/core/httpcli/httpcli.c", "src/core/http/httpcli.c",
"src/core/httpcli/parser.c", "src/core/http/parser.c",
"src/core/iomgr/closure.c", "src/core/iomgr/closure.c",
"src/core/iomgr/endpoint.c", "src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c", "src/core/iomgr/endpoint_pair_posix.c",
@ -1496,7 +1496,7 @@ objc_library(
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/httpcli/httpcli_security_connector.c", "src/core/http/httpcli_security_connector.c",
"src/core/security/b64.c", "src/core/security/b64.c",
"src/core/security/client_auth_filter.c", "src/core/security/client_auth_filter.c",
"src/core/security/credentials.c", "src/core/security/credentials.c",
@ -1574,9 +1574,9 @@ objc_library(
"src/core/compression/algorithm_metadata.h", "src/core/compression/algorithm_metadata.h",
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h", "src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h", "src/core/iomgr/endpoint_pair.h",

@ -927,8 +927,8 @@ grpc_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_security_connector_test
grpc_verify_jwt: $(BINDIR)/$(CONFIG)/grpc_verify_jwt grpc_verify_jwt: $(BINDIR)/$(CONFIG)/grpc_verify_jwt
hpack_parser_test: $(BINDIR)/$(CONFIG)/hpack_parser_test hpack_parser_test: $(BINDIR)/$(CONFIG)/hpack_parser_test
hpack_table_test: $(BINDIR)/$(CONFIG)/hpack_table_test hpack_table_test: $(BINDIR)/$(CONFIG)/hpack_table_test
http_parser_test: $(BINDIR)/$(CONFIG)/http_parser_test
httpcli_format_request_test: $(BINDIR)/$(CONFIG)/httpcli_format_request_test httpcli_format_request_test: $(BINDIR)/$(CONFIG)/httpcli_format_request_test
httpcli_parser_test: $(BINDIR)/$(CONFIG)/httpcli_parser_test
httpcli_test: $(BINDIR)/$(CONFIG)/httpcli_test httpcli_test: $(BINDIR)/$(CONFIG)/httpcli_test
httpscli_test: $(BINDIR)/$(CONFIG)/httpscli_test httpscli_test: $(BINDIR)/$(CONFIG)/httpscli_test
init_test: $(BINDIR)/$(CONFIG)/init_test init_test: $(BINDIR)/$(CONFIG)/init_test
@ -1236,8 +1236,8 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/grpc_security_connector_test \ $(BINDIR)/$(CONFIG)/grpc_security_connector_test \
$(BINDIR)/$(CONFIG)/hpack_parser_test \ $(BINDIR)/$(CONFIG)/hpack_parser_test \
$(BINDIR)/$(CONFIG)/hpack_table_test \ $(BINDIR)/$(CONFIG)/hpack_table_test \
$(BINDIR)/$(CONFIG)/http_parser_test \
$(BINDIR)/$(CONFIG)/httpcli_format_request_test \ $(BINDIR)/$(CONFIG)/httpcli_format_request_test \
$(BINDIR)/$(CONFIG)/httpcli_parser_test \
$(BINDIR)/$(CONFIG)/httpcli_test \ $(BINDIR)/$(CONFIG)/httpcli_test \
$(BINDIR)/$(CONFIG)/httpscli_test \ $(BINDIR)/$(CONFIG)/httpscli_test \
$(BINDIR)/$(CONFIG)/init_test \ $(BINDIR)/$(CONFIG)/init_test \
@ -1522,10 +1522,10 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/hpack_parser_test || ( echo test hpack_parser_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/hpack_parser_test || ( echo test hpack_parser_test failed ; exit 1 )
$(E) "[RUN] Testing hpack_table_test" $(E) "[RUN] Testing hpack_table_test"
$(Q) $(BINDIR)/$(CONFIG)/hpack_table_test || ( echo test hpack_table_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/hpack_table_test || ( echo test hpack_table_test failed ; exit 1 )
$(E) "[RUN] Testing http_parser_test"
$(Q) $(BINDIR)/$(CONFIG)/http_parser_test || ( echo test http_parser_test failed ; exit 1 )
$(E) "[RUN] Testing httpcli_format_request_test" $(E) "[RUN] Testing httpcli_format_request_test"
$(Q) $(BINDIR)/$(CONFIG)/httpcli_format_request_test || ( echo test httpcli_format_request_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/httpcli_format_request_test || ( echo test httpcli_format_request_test failed ; exit 1 )
$(E) "[RUN] Testing httpcli_parser_test"
$(Q) $(BINDIR)/$(CONFIG)/httpcli_parser_test || ( echo test httpcli_parser_test failed ; exit 1 )
$(E) "[RUN] Testing httpcli_test" $(E) "[RUN] Testing httpcli_test"
$(Q) $(BINDIR)/$(CONFIG)/httpcli_test || ( echo test httpcli_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/httpcli_test || ( echo test httpcli_test failed ; exit 1 )
$(E) "[RUN] Testing httpscli_test" $(E) "[RUN] Testing httpscli_test"
@ -2437,9 +2437,9 @@ LIBGRPC_SRC = \
src/core/compression/compression_algorithm.c \ src/core/compression/compression_algorithm.c \
src/core/compression/message_compress.c \ src/core/compression/message_compress.c \
src/core/debug/trace.c \ src/core/debug/trace.c \
src/core/httpcli/format_request.c \ src/core/http/format_request.c \
src/core/httpcli/httpcli.c \ src/core/http/httpcli.c \
src/core/httpcli/parser.c \ src/core/http/parser.c \
src/core/iomgr/closure.c \ src/core/iomgr/closure.c \
src/core/iomgr/endpoint.c \ src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \ src/core/iomgr/endpoint_pair_posix.c \
@ -2537,7 +2537,7 @@ LIBGRPC_SRC = \
src/core/transport/static_metadata.c \ src/core/transport/static_metadata.c \
src/core/transport/transport.c \ src/core/transport/transport.c \
src/core/transport/transport_op_string.c \ src/core/transport/transport_op_string.c \
src/core/httpcli/httpcli_security_connector.c \ src/core/http/httpcli_security_connector.c \
src/core/security/b64.c \ src/core/security/b64.c \
src/core/security/client_auth_filter.c \ src/core/security/client_auth_filter.c \
src/core/security/credentials.c \ src/core/security/credentials.c \
@ -2799,9 +2799,9 @@ LIBGRPC_UNSECURE_SRC = \
src/core/compression/compression_algorithm.c \ src/core/compression/compression_algorithm.c \
src/core/compression/message_compress.c \ src/core/compression/message_compress.c \
src/core/debug/trace.c \ src/core/debug/trace.c \
src/core/httpcli/format_request.c \ src/core/http/format_request.c \
src/core/httpcli/httpcli.c \ src/core/http/httpcli.c \
src/core/httpcli/parser.c \ src/core/http/parser.c \
src/core/iomgr/closure.c \ src/core/iomgr/closure.c \
src/core/iomgr/endpoint.c \ src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \ src/core/iomgr/endpoint_pair_posix.c \
@ -7761,72 +7761,72 @@ endif
endif endif
HTTPCLI_FORMAT_REQUEST_TEST_SRC = \ HTTP_PARSER_TEST_SRC = \
test/core/httpcli/format_request_test.c \ test/core/http/parser_test.c \
HTTPCLI_FORMAT_REQUEST_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_FORMAT_REQUEST_TEST_SRC)))) HTTP_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTP_PARSER_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL. # You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/httpcli_format_request_test: openssl_dep_error $(BINDIR)/$(CONFIG)/http_parser_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/httpcli_format_request_test: $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(BINDIR)/$(CONFIG)/http_parser_test: $(HTTP_PARSER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/httpcli_format_request_test $(Q) $(LD) $(LDFLAGS) $(HTTP_PARSER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/http_parser_test
endif endif
$(OBJDIR)/$(CONFIG)/test/core/httpcli/format_request_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/http/parser_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_httpcli_format_request_test: $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS:.o=.dep) deps_http_parser_test: $(HTTP_PARSER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true) ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true) ifneq ($(NO_DEPS),true)
-include $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS:.o=.dep) -include $(HTTP_PARSER_TEST_OBJS:.o=.dep)
endif endif
endif endif
HTTPCLI_PARSER_TEST_SRC = \ HTTPCLI_FORMAT_REQUEST_TEST_SRC = \
test/core/httpcli/parser_test.c \ test/core/http/format_request_test.c \
HTTPCLI_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_PARSER_TEST_SRC)))) HTTPCLI_FORMAT_REQUEST_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_FORMAT_REQUEST_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL. # You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/httpcli_parser_test: openssl_dep_error $(BINDIR)/$(CONFIG)/httpcli_format_request_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/httpcli_parser_test: $(HTTPCLI_PARSER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(BINDIR)/$(CONFIG)/httpcli_format_request_test: $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(HTTPCLI_PARSER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/httpcli_parser_test $(Q) $(LD) $(LDFLAGS) $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/httpcli_format_request_test
endif endif
$(OBJDIR)/$(CONFIG)/test/core/httpcli/parser_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/http/format_request_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_httpcli_parser_test: $(HTTPCLI_PARSER_TEST_OBJS:.o=.dep) deps_httpcli_format_request_test: $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true) ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true) ifneq ($(NO_DEPS),true)
-include $(HTTPCLI_PARSER_TEST_OBJS:.o=.dep) -include $(HTTPCLI_FORMAT_REQUEST_TEST_OBJS:.o=.dep)
endif endif
endif endif
HTTPCLI_TEST_SRC = \ HTTPCLI_TEST_SRC = \
test/core/httpcli/httpcli_test.c \ test/core/http/httpcli_test.c \
HTTPCLI_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_TEST_SRC)))) HTTPCLI_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -7846,7 +7846,7 @@ $(BINDIR)/$(CONFIG)/httpcli_test: $(HTTPCLI_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgr
endif endif
$(OBJDIR)/$(CONFIG)/test/core/httpcli/httpcli_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/http/httpcli_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_httpcli_test: $(HTTPCLI_TEST_OBJS:.o=.dep) deps_httpcli_test: $(HTTPCLI_TEST_OBJS:.o=.dep)
@ -7858,7 +7858,7 @@ endif
HTTPSCLI_TEST_SRC = \ HTTPSCLI_TEST_SRC = \
test/core/httpcli/httpscli_test.c \ test/core/http/httpscli_test.c \
HTTPSCLI_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPSCLI_TEST_SRC)))) HTTPSCLI_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPSCLI_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -7878,7 +7878,7 @@ $(BINDIR)/$(CONFIG)/httpscli_test: $(HTTPSCLI_TEST_OBJS) $(LIBDIR)/$(CONFIG)/lib
endif endif
$(OBJDIR)/$(CONFIG)/test/core/httpcli/httpscli_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/http/httpscli_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_httpscli_test: $(HTTPSCLI_TEST_OBJS:.o=.dep) deps_httpscli_test: $(HTTPSCLI_TEST_OBJS:.o=.dep)
@ -13382,7 +13382,7 @@ ifneq ($(OPENSSL_DEP),)
# This is to ensure the embedded OpenSSL is built beforehand, properly # This is to ensure the embedded OpenSSL is built beforehand, properly
# installing headers to their final destination on the drive. We need this # installing headers to their final destination on the drive. We need this
# otherwise parallel compilation will fail if a source is compiled first. # otherwise parallel compilation will fail if a source is compiled first.
src/core/httpcli/httpcli_security_connector.c: $(OPENSSL_DEP) src/core/http/httpcli_security_connector.c: $(OPENSSL_DEP)
src/core/security/b64.c: $(OPENSSL_DEP) src/core/security/b64.c: $(OPENSSL_DEP)
src/core/security/client_auth_filter.c: $(OPENSSL_DEP) src/core/security/client_auth_filter.c: $(OPENSSL_DEP)
src/core/security/credentials.c: $(OPENSSL_DEP) src/core/security/credentials.c: $(OPENSSL_DEP)

@ -592,9 +592,9 @@
'src/core/compression/compression_algorithm.c', 'src/core/compression/compression_algorithm.c',
'src/core/compression/message_compress.c', 'src/core/compression/message_compress.c',
'src/core/debug/trace.c', 'src/core/debug/trace.c',
'src/core/httpcli/format_request.c', 'src/core/http/format_request.c',
'src/core/httpcli/httpcli.c', 'src/core/http/httpcli.c',
'src/core/httpcli/parser.c', 'src/core/http/parser.c',
'src/core/iomgr/closure.c', 'src/core/iomgr/closure.c',
'src/core/iomgr/endpoint.c', 'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c', 'src/core/iomgr/endpoint_pair_posix.c',
@ -692,7 +692,7 @@
'src/core/transport/static_metadata.c', 'src/core/transport/static_metadata.c',
'src/core/transport/transport.c', 'src/core/transport/transport.c',
'src/core/transport/transport_op_string.c', 'src/core/transport/transport_op_string.c',
'src/core/httpcli/httpcli_security_connector.c', 'src/core/http/httpcli_security_connector.c',
'src/core/security/b64.c', 'src/core/security/b64.c',
'src/core/security/client_auth_filter.c', 'src/core/security/client_auth_filter.c',
'src/core/security/credentials.c', 'src/core/security/credentials.c',

@ -280,9 +280,9 @@ filegroups:
- src/core/compression/algorithm_metadata.h - src/core/compression/algorithm_metadata.h
- src/core/compression/message_compress.h - src/core/compression/message_compress.h
- src/core/debug/trace.h - src/core/debug/trace.h
- src/core/httpcli/format_request.h - src/core/http/format_request.h
- src/core/httpcli/httpcli.h - src/core/http/httpcli.h
- src/core/httpcli/parser.h - src/core/http/parser.h
- src/core/iomgr/closure.h - src/core/iomgr/closure.h
- src/core/iomgr/endpoint.h - src/core/iomgr/endpoint.h
- src/core/iomgr/endpoint_pair.h - src/core/iomgr/endpoint_pair.h
@ -402,9 +402,9 @@ filegroups:
- src/core/compression/compression_algorithm.c - src/core/compression/compression_algorithm.c
- src/core/compression/message_compress.c - src/core/compression/message_compress.c
- src/core/debug/trace.c - src/core/debug/trace.c
- src/core/httpcli/format_request.c - src/core/http/format_request.c
- src/core/httpcli/httpcli.c - src/core/http/httpcli.c
- src/core/httpcli/parser.c - src/core/http/parser.c
- src/core/iomgr/closure.c - src/core/iomgr/closure.c
- src/core/iomgr/endpoint.c - src/core/iomgr/endpoint.c
- src/core/iomgr/endpoint_pair_posix.c - src/core/iomgr/endpoint_pair_posix.c
@ -527,7 +527,7 @@ filegroups:
- src/core/tsi/transport_security.h - src/core/tsi/transport_security.h
- src/core/tsi/transport_security_interface.h - src/core/tsi/transport_security_interface.h
src: src:
- src/core/httpcli/httpcli_security_connector.c - src/core/http/httpcli_security_connector.c
- src/core/security/b64.c - src/core/security/b64.c
- src/core/security/client_auth_filter.c - src/core/security/client_auth_filter.c
- src/core/security/credentials.c - src/core/security/credentials.c
@ -1563,21 +1563,21 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: httpcli_format_request_test - name: http_parser_test
build: test build: test
language: c language: c
src: src:
- test/core/httpcli/format_request_test.c - test/core/http/parser_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: httpcli_parser_test - name: httpcli_format_request_test
build: test build: test
language: c language: c
src: src:
- test/core/httpcli/parser_test.c - test/core/http/format_request_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -1588,7 +1588,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/httpcli/httpcli_test.c - test/core/http/httpcli_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -1603,7 +1603,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/httpcli/httpscli_test.c - test/core/http/httpscli_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc

@ -114,9 +114,9 @@ if test "$PHP_GRPC" != "no"; then
src/core/compression/compression_algorithm.c \ src/core/compression/compression_algorithm.c \
src/core/compression/message_compress.c \ src/core/compression/message_compress.c \
src/core/debug/trace.c \ src/core/debug/trace.c \
src/core/httpcli/format_request.c \ src/core/http/format_request.c \
src/core/httpcli/httpcli.c \ src/core/http/httpcli.c \
src/core/httpcli/parser.c \ src/core/http/parser.c \
src/core/iomgr/closure.c \ src/core/iomgr/closure.c \
src/core/iomgr/endpoint.c \ src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \ src/core/iomgr/endpoint_pair_posix.c \
@ -214,7 +214,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/transport/static_metadata.c \ src/core/transport/static_metadata.c \
src/core/transport/transport.c \ src/core/transport/transport.c \
src/core/transport/transport_op_string.c \ src/core/transport/transport_op_string.c \
src/core/httpcli/httpcli_security_connector.c \ src/core/http/httpcli_security_connector.c \
src/core/security/b64.c \ src/core/security/b64.c \
src/core/security/client_auth_filter.c \ src/core/security/client_auth_filter.c \
src/core/security/credentials.c \ src/core/security/credentials.c \
@ -553,7 +553,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config/resolvers) PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config/resolvers)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/compression) PHP_ADD_BUILD_DIR($ext_builddir/src/core/compression)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/debug) PHP_ADD_BUILD_DIR($ext_builddir/src/core/debug)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/httpcli) PHP_ADD_BUILD_DIR($ext_builddir/src/core/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/iomgr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/iomgr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/json) PHP_ADD_BUILD_DIR($ext_builddir/src/core/json)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/profiling) PHP_ADD_BUILD_DIR($ext_builddir/src/core/profiling)

@ -194,9 +194,9 @@ Pod::Spec.new do |s|
'src/core/compression/algorithm_metadata.h', 'src/core/compression/algorithm_metadata.h',
'src/core/compression/message_compress.h', 'src/core/compression/message_compress.h',
'src/core/debug/trace.h', 'src/core/debug/trace.h',
'src/core/httpcli/format_request.h', 'src/core/http/format_request.h',
'src/core/httpcli/httpcli.h', 'src/core/http/httpcli.h',
'src/core/httpcli/parser.h', 'src/core/http/parser.h',
'src/core/iomgr/closure.h', 'src/core/iomgr/closure.h',
'src/core/iomgr/endpoint.h', 'src/core/iomgr/endpoint.h',
'src/core/iomgr/endpoint_pair.h', 'src/core/iomgr/endpoint_pair.h',
@ -349,9 +349,9 @@ Pod::Spec.new do |s|
'src/core/compression/compression_algorithm.c', 'src/core/compression/compression_algorithm.c',
'src/core/compression/message_compress.c', 'src/core/compression/message_compress.c',
'src/core/debug/trace.c', 'src/core/debug/trace.c',
'src/core/httpcli/format_request.c', 'src/core/http/format_request.c',
'src/core/httpcli/httpcli.c', 'src/core/http/httpcli.c',
'src/core/httpcli/parser.c', 'src/core/http/parser.c',
'src/core/iomgr/closure.c', 'src/core/iomgr/closure.c',
'src/core/iomgr/endpoint.c', 'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c', 'src/core/iomgr/endpoint_pair_posix.c',
@ -449,7 +449,7 @@ Pod::Spec.new do |s|
'src/core/transport/static_metadata.c', 'src/core/transport/static_metadata.c',
'src/core/transport/transport.c', 'src/core/transport/transport.c',
'src/core/transport/transport_op_string.c', 'src/core/transport/transport_op_string.c',
'src/core/httpcli/httpcli_security_connector.c', 'src/core/http/httpcli_security_connector.c',
'src/core/security/b64.c', 'src/core/security/b64.c',
'src/core/security/client_auth_filter.c', 'src/core/security/client_auth_filter.c',
'src/core/security/credentials.c', 'src/core/security/credentials.c',
@ -525,9 +525,9 @@ Pod::Spec.new do |s|
'src/core/compression/algorithm_metadata.h', 'src/core/compression/algorithm_metadata.h',
'src/core/compression/message_compress.h', 'src/core/compression/message_compress.h',
'src/core/debug/trace.h', 'src/core/debug/trace.h',
'src/core/httpcli/format_request.h', 'src/core/http/format_request.h',
'src/core/httpcli/httpcli.h', 'src/core/http/httpcli.h',
'src/core/httpcli/parser.h', 'src/core/http/parser.h',
'src/core/iomgr/closure.h', 'src/core/iomgr/closure.h',
'src/core/iomgr/endpoint.h', 'src/core/iomgr/endpoint.h',
'src/core/iomgr/endpoint_pair.h', 'src/core/iomgr/endpoint_pair.h',

@ -190,9 +190,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/compression/algorithm_metadata.h ) s.files += %w( src/core/compression/algorithm_metadata.h )
s.files += %w( src/core/compression/message_compress.h ) s.files += %w( src/core/compression/message_compress.h )
s.files += %w( src/core/debug/trace.h ) s.files += %w( src/core/debug/trace.h )
s.files += %w( src/core/httpcli/format_request.h ) s.files += %w( src/core/http/format_request.h )
s.files += %w( src/core/httpcli/httpcli.h ) s.files += %w( src/core/http/httpcli.h )
s.files += %w( src/core/httpcli/parser.h ) s.files += %w( src/core/http/parser.h )
s.files += %w( src/core/iomgr/closure.h ) s.files += %w( src/core/iomgr/closure.h )
s.files += %w( src/core/iomgr/endpoint.h ) s.files += %w( src/core/iomgr/endpoint.h )
s.files += %w( src/core/iomgr/endpoint_pair.h ) s.files += %w( src/core/iomgr/endpoint_pair.h )
@ -332,9 +332,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/compression/compression_algorithm.c ) s.files += %w( src/core/compression/compression_algorithm.c )
s.files += %w( src/core/compression/message_compress.c ) s.files += %w( src/core/compression/message_compress.c )
s.files += %w( src/core/debug/trace.c ) s.files += %w( src/core/debug/trace.c )
s.files += %w( src/core/httpcli/format_request.c ) s.files += %w( src/core/http/format_request.c )
s.files += %w( src/core/httpcli/httpcli.c ) s.files += %w( src/core/http/httpcli.c )
s.files += %w( src/core/httpcli/parser.c ) s.files += %w( src/core/http/parser.c )
s.files += %w( src/core/iomgr/closure.c ) s.files += %w( src/core/iomgr/closure.c )
s.files += %w( src/core/iomgr/endpoint.c ) s.files += %w( src/core/iomgr/endpoint.c )
s.files += %w( src/core/iomgr/endpoint_pair_posix.c ) s.files += %w( src/core/iomgr/endpoint_pair_posix.c )
@ -432,7 +432,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/transport/static_metadata.c ) s.files += %w( src/core/transport/static_metadata.c )
s.files += %w( src/core/transport/transport.c ) s.files += %w( src/core/transport/transport.c )
s.files += %w( src/core/transport/transport_op_string.c ) s.files += %w( src/core/transport/transport_op_string.c )
s.files += %w( src/core/httpcli/httpcli_security_connector.c ) s.files += %w( src/core/http/httpcli_security_connector.c )
s.files += %w( src/core/security/b64.c ) s.files += %w( src/core/security/b64.c )
s.files += %w( src/core/security/client_auth_filter.c ) s.files += %w( src/core/security/client_auth_filter.c )
s.files += %w( src/core/security/credentials.c ) s.files += %w( src/core/security/credentials.c )

@ -132,9 +132,9 @@
"src/core/compression/algorithm_metadata.h", "src/core/compression/algorithm_metadata.h",
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h", "src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h", "src/core/iomgr/endpoint_pair.h",
@ -274,9 +274,9 @@
"src/core/compression/compression_algorithm.c", "src/core/compression/compression_algorithm.c",
"src/core/compression/message_compress.c", "src/core/compression/message_compress.c",
"src/core/debug/trace.c", "src/core/debug/trace.c",
"src/core/httpcli/format_request.c", "src/core/http/format_request.c",
"src/core/httpcli/httpcli.c", "src/core/http/httpcli.c",
"src/core/httpcli/parser.c", "src/core/http/parser.c",
"src/core/iomgr/closure.c", "src/core/iomgr/closure.c",
"src/core/iomgr/endpoint.c", "src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c", "src/core/iomgr/endpoint_pair_posix.c",
@ -374,7 +374,7 @@
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/httpcli/httpcli_security_connector.c", "src/core/http/httpcli_security_connector.c",
"src/core/security/b64.c", "src/core/security/b64.c",
"src/core/security/client_auth_filter.c", "src/core/security/client_auth_filter.c",
"src/core/security/credentials.c", "src/core/security/credentials.c",

@ -194,9 +194,9 @@
<file baseinstalldir="/" name="src/core/compression/algorithm_metadata.h" role="src" /> <file baseinstalldir="/" name="src/core/compression/algorithm_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/compression/message_compress.h" role="src" /> <file baseinstalldir="/" name="src/core/compression/message_compress.h" role="src" />
<file baseinstalldir="/" name="src/core/debug/trace.h" role="src" /> <file baseinstalldir="/" name="src/core/debug/trace.h" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/format_request.h" role="src" /> <file baseinstalldir="/" name="src/core/http/format_request.h" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/httpcli.h" role="src" /> <file baseinstalldir="/" name="src/core/http/httpcli.h" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/parser.h" role="src" /> <file baseinstalldir="/" name="src/core/http/parser.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/closure.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/closure.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/endpoint.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/endpoint.h" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/endpoint_pair.h" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/endpoint_pair.h" role="src" />
@ -336,9 +336,9 @@
<file baseinstalldir="/" name="src/core/compression/compression_algorithm.c" role="src" /> <file baseinstalldir="/" name="src/core/compression/compression_algorithm.c" role="src" />
<file baseinstalldir="/" name="src/core/compression/message_compress.c" role="src" /> <file baseinstalldir="/" name="src/core/compression/message_compress.c" role="src" />
<file baseinstalldir="/" name="src/core/debug/trace.c" role="src" /> <file baseinstalldir="/" name="src/core/debug/trace.c" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/format_request.c" role="src" /> <file baseinstalldir="/" name="src/core/http/format_request.c" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/httpcli.c" role="src" /> <file baseinstalldir="/" name="src/core/http/httpcli.c" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/parser.c" role="src" /> <file baseinstalldir="/" name="src/core/http/parser.c" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/closure.c" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/closure.c" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/endpoint.c" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/endpoint.c" role="src" />
<file baseinstalldir="/" name="src/core/iomgr/endpoint_pair_posix.c" role="src" /> <file baseinstalldir="/" name="src/core/iomgr/endpoint_pair_posix.c" role="src" />
@ -436,7 +436,7 @@
<file baseinstalldir="/" name="src/core/transport/static_metadata.c" role="src" /> <file baseinstalldir="/" name="src/core/transport/static_metadata.c" role="src" />
<file baseinstalldir="/" name="src/core/transport/transport.c" role="src" /> <file baseinstalldir="/" name="src/core/transport/transport.c" role="src" />
<file baseinstalldir="/" name="src/core/transport/transport_op_string.c" role="src" /> <file baseinstalldir="/" name="src/core/transport/transport_op_string.c" role="src" />
<file baseinstalldir="/" name="src/core/httpcli/httpcli_security_connector.c" role="src" /> <file baseinstalldir="/" name="src/core/http/httpcli_security_connector.c" role="src" />
<file baseinstalldir="/" name="src/core/security/b64.c" role="src" /> <file baseinstalldir="/" name="src/core/security/b64.c" role="src" />
<file baseinstalldir="/" name="src/core/security/client_auth_filter.c" role="src" /> <file baseinstalldir="/" name="src/core/security/client_auth_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/security/credentials.c" role="src" /> <file baseinstalldir="/" name="src/core/security/credentials.c" role="src" />

@ -190,11 +190,10 @@ bool PrintBetaServicer(const ServiceDescriptor* service,
"Documentation", doc, "Documentation", doc,
}); });
out->Print("\n"); out->Print("\n");
out->Print(dict, "class Beta$Service$Servicer(object):\n"); out->Print(dict, "class Beta$Service$Servicer(six.with_metaclass(abc.ABCMeta, object)):\n");
{ {
IndentScope raii_class_indent(out); IndentScope raii_class_indent(out);
out->Print(dict, "\"\"\"$Documentation$\"\"\"\n"); out->Print(dict, "\"\"\"$Documentation$\"\"\"\n");
out->Print("__metaclass__ = abc.ABCMeta\n");
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
auto meth = service->method(i); auto meth = service->method(i);
grpc::string arg_name = meth->client_streaming() ? grpc::string arg_name = meth->client_streaming() ?
@ -219,11 +218,10 @@ bool PrintBetaStub(const ServiceDescriptor* service,
"Documentation", doc, "Documentation", doc,
}); });
out->Print("\n"); out->Print("\n");
out->Print(dict, "class Beta$Service$Stub(object):\n"); out->Print(dict, "class Beta$Service$Stub(six.with_metaclass(abc.ABCMeta, object)):\n");
{ {
IndentScope raii_class_indent(out); IndentScope raii_class_indent(out);
out->Print(dict, "\"\"\"$Documentation$\"\"\"\n"); out->Print(dict, "\"\"\"$Documentation$\"\"\"\n");
out->Print("__metaclass__ = abc.ABCMeta\n");
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
const MethodDescriptor* meth = service->method(i); const MethodDescriptor* meth = service->method(i);
grpc::string arg_name = meth->client_streaming() ? grpc::string arg_name = meth->client_streaming() ?
@ -449,6 +447,7 @@ bool PrintBetaStubFactory(const grpc::string& package_qualified_service_name,
bool PrintPreamble(const FileDescriptor* file, bool PrintPreamble(const FileDescriptor* file,
const GeneratorConfiguration& config, Printer* out) { const GeneratorConfiguration& config, Printer* out) {
out->Print("import abc\n"); out->Print("import abc\n");
out->Print("import six\n");
out->Print("from $Package$ import implementations as beta_implementations\n", out->Print("from $Package$ import implementations as beta_implementations\n",
"Package", config.beta_package_root); "Package", config.beta_package_root);
out->Print("from grpc.framework.common import cardinality\n"); out->Print("from grpc.framework.common import cardinality\n");

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/format_request.h" #include "src/core/http/format_request.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -46,7 +46,7 @@
static void fill_common_header(const grpc_httpcli_request *request, static void fill_common_header(const grpc_httpcli_request *request,
gpr_strvec *buf) { gpr_strvec *buf) {
size_t i; size_t i;
gpr_strvec_add(buf, gpr_strdup(request->path)); gpr_strvec_add(buf, gpr_strdup(request->http.path));
gpr_strvec_add(buf, gpr_strdup(" HTTP/1.0\r\n")); gpr_strvec_add(buf, gpr_strdup(" HTTP/1.0\r\n"));
/* just in case some crazy server really expects HTTP/1.1 */ /* just in case some crazy server really expects HTTP/1.1 */
gpr_strvec_add(buf, gpr_strdup("Host: ")); gpr_strvec_add(buf, gpr_strdup("Host: "));
@ -56,10 +56,10 @@ static void fill_common_header(const grpc_httpcli_request *request,
gpr_strvec_add(buf, gpr_strvec_add(buf,
gpr_strdup("User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n")); gpr_strdup("User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n"));
/* user supplied headers */ /* user supplied headers */
for (i = 0; i < request->hdr_count; i++) { for (i = 0; i < request->http.hdr_count; i++) {
gpr_strvec_add(buf, gpr_strdup(request->hdrs[i].key)); gpr_strvec_add(buf, gpr_strdup(request->http.hdrs[i].key));
gpr_strvec_add(buf, gpr_strdup(": ")); gpr_strvec_add(buf, gpr_strdup(": "));
gpr_strvec_add(buf, gpr_strdup(request->hdrs[i].value)); gpr_strvec_add(buf, gpr_strdup(request->http.hdrs[i].value));
gpr_strvec_add(buf, gpr_strdup("\r\n")); gpr_strvec_add(buf, gpr_strdup("\r\n"));
} }
} }
@ -94,8 +94,8 @@ gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
fill_common_header(request, &out); fill_common_header(request, &out);
if (body_bytes) { if (body_bytes) {
uint8_t has_content_type = 0; uint8_t has_content_type = 0;
for (i = 0; i < request->hdr_count; i++) { for (i = 0; i < request->http.hdr_count; i++) {
if (strcmp(request->hdrs[i].key, "Content-Type") == 0) { if (strcmp(request->http.hdrs[i].key, "Content-Type") == 0) {
has_content_type = 1; has_content_type = 1;
break; break;
} }

@ -31,10 +31,10 @@
* *
*/ */
#ifndef GRPC_CORE_HTTPCLI_FORMAT_REQUEST_H #ifndef GRPC_CORE_HTTP_FORMAT_REQUEST_H
#define GRPC_CORE_HTTPCLI_FORMAT_REQUEST_H #define GRPC_CORE_HTTP_FORMAT_REQUEST_H
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include <grpc/support/slice.h> #include <grpc/support/slice.h>
gpr_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request); gpr_slice grpc_httpcli_format_get_request(const grpc_httpcli_request *request);
@ -42,4 +42,4 @@ gpr_slice grpc_httpcli_format_post_request(const grpc_httpcli_request *request,
const char *body_bytes, const char *body_bytes,
size_t body_size); size_t body_size);
#endif /* GRPC_CORE_HTTPCLI_FORMAT_REQUEST_H */ #endif /* GRPC_CORE_HTTP_FORMAT_REQUEST_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include "src/core/iomgr/sockaddr.h" #include "src/core/iomgr/sockaddr.h"
#include <string.h> #include <string.h>
@ -40,8 +40,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/httpcli/format_request.h" #include "src/core/http/format_request.h"
#include "src/core/httpcli/parser.h" #include "src/core/http/parser.h"
#include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/endpoint.h"
#include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/resolve_address.h" #include "src/core/iomgr/resolve_address.h"
@ -50,7 +50,7 @@
typedef struct { typedef struct {
gpr_slice request_text; gpr_slice request_text;
grpc_httpcli_parser parser; grpc_http_parser parser;
grpc_resolved_addresses *addresses; grpc_resolved_addresses *addresses;
size_t next_address; size_t next_address;
grpc_endpoint *ep; grpc_endpoint *ep;
@ -99,8 +99,9 @@ static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
int success) { int success) {
grpc_pollset_set_del_pollset(exec_ctx, req->context->pollset_set, grpc_pollset_set_del_pollset(exec_ctx, req->context->pollset_set,
req->pollset); req->pollset);
req->on_response(exec_ctx, req->user_data, success ? &req->parser.r : NULL); req->on_response(exec_ctx, req->user_data,
grpc_httpcli_parser_destroy(&req->parser); success ? &req->parser.http.response : NULL);
grpc_http_parser_destroy(&req->parser);
if (req->addresses != NULL) { if (req->addresses != NULL) {
grpc_resolved_addresses_destroy(req->addresses); grpc_resolved_addresses_destroy(req->addresses);
} }
@ -129,7 +130,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data, bool success) {
for (i = 0; i < req->incoming.count; i++) { for (i = 0; i < req->incoming.count; i++) {
if (GPR_SLICE_LENGTH(req->incoming.slices[i])) { if (GPR_SLICE_LENGTH(req->incoming.slices[i])) {
req->have_read_byte = 1; req->have_read_byte = 1;
if (!grpc_httpcli_parser_parse(&req->parser, req->incoming.slices[i])) { if (!grpc_http_parser_parse(&req->parser, req->incoming.slices[i])) {
finish(exec_ctx, req, 0); finish(exec_ctx, req, 0);
return; return;
} }
@ -141,7 +142,11 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data, bool success) {
} else if (!req->have_read_byte) { } else if (!req->have_read_byte) {
next_address(exec_ctx, req); next_address(exec_ctx, req);
} else { } else {
finish(exec_ctx, req, grpc_httpcli_parser_eof(&req->parser)); int parse_success = grpc_http_parser_eof(&req->parser);
if (parse_success && (req->parser.type != GRPC_HTTP_RESPONSE)) {
parse_success = 0;
}
finish(exec_ctx, req, parse_success);
} }
} }
@ -223,7 +228,7 @@ static void internal_request_begin(
internal_request *req = gpr_malloc(sizeof(internal_request)); internal_request *req = gpr_malloc(sizeof(internal_request));
memset(req, 0, sizeof(*req)); memset(req, 0, sizeof(*req));
req->request_text = request_text; req->request_text = request_text;
grpc_httpcli_parser_init(&req->parser); grpc_http_parser_init(&req->parser);
req->on_response = on_response; req->on_response = on_response;
req->user_data = user_data; req->user_data = user_data;
req->deadline = deadline; req->deadline = deadline;
@ -255,7 +260,7 @@ void grpc_httpcli_get(grpc_exec_ctx *exec_ctx, grpc_httpcli_context *context,
g_get_override(exec_ctx, request, deadline, on_response, user_data)) { g_get_override(exec_ctx, request, deadline, on_response, user_data)) {
return; return;
} }
gpr_asprintf(&name, "HTTP:GET:%s:%s", request->host, request->path); gpr_asprintf(&name, "HTTP:GET:%s:%s", request->host, request->http.path);
internal_request_begin(exec_ctx, context, pollset, request, deadline, internal_request_begin(exec_ctx, context, pollset, request, deadline,
on_response, user_data, name, on_response, user_data, name,
grpc_httpcli_format_get_request(request)); grpc_httpcli_format_get_request(request));
@ -274,7 +279,7 @@ void grpc_httpcli_post(grpc_exec_ctx *exec_ctx, grpc_httpcli_context *context,
on_response, user_data)) { on_response, user_data)) {
return; return;
} }
gpr_asprintf(&name, "HTTP:POST:%s:%s", request->host, request->path); gpr_asprintf(&name, "HTTP:POST:%s:%s", request->host, request->http.path);
internal_request_begin( internal_request_begin(
exec_ctx, context, pollset, request, deadline, on_response, user_data, exec_ctx, context, pollset, request, deadline, on_response, user_data,
name, grpc_httpcli_format_post_request(request, body_bytes, body_size)); name, grpc_httpcli_format_post_request(request, body_bytes, body_size));

@ -31,27 +31,20 @@
* *
*/ */
#ifndef GRPC_CORE_HTTPCLI_HTTPCLI_H #ifndef GRPC_CORE_HTTP_HTTPCLI_H
#define GRPC_CORE_HTTPCLI_HTTPCLI_H #define GRPC_CORE_HTTP_HTTPCLI_H
#include <stddef.h> #include <stddef.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/http/parser.h"
#include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/endpoint.h"
#include "src/core/iomgr/iomgr_internal.h" #include "src/core/iomgr/iomgr_internal.h"
#include "src/core/iomgr/pollset_set.h" #include "src/core/iomgr/pollset_set.h"
/* User agent this library reports */ /* User agent this library reports */
#define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0" #define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0"
/* Maximum length of a header string of the form 'Key: Value\r\n' */
#define GRPC_HTTPCLI_MAX_HEADER_LENGTH 4096
/* A single header to be passed in a request */
typedef struct grpc_httpcli_header {
char *key;
char *value;
} grpc_httpcli_header;
/* Tracks in-progress http requests /* Tracks in-progress http requests
TODO(ctiller): allow caching and capturing multiple requests for the TODO(ctiller): allow caching and capturing multiple requests for the
@ -77,33 +70,21 @@ typedef struct grpc_httpcli_request {
char *host; char *host;
/* The host to verify in the SSL handshake (or NULL) */ /* The host to verify in the SSL handshake (or NULL) */
char *ssl_host_override; char *ssl_host_override;
/* The path of the resource to fetch */ /* The main part of the request
char *path; The following headers are supplied automatically and MUST NOT be set here:
/* Additional headers: count and key/values; the following are supplied
automatically and MUST NOT be set here:
Host, Connection, User-Agent */ Host, Connection, User-Agent */
size_t hdr_count; grpc_http_request http;
grpc_httpcli_header *hdrs;
/* handshaker to use ssl for the request */ /* handshaker to use ssl for the request */
const grpc_httpcli_handshaker *handshaker; const grpc_httpcli_handshaker *handshaker;
} grpc_httpcli_request; } grpc_httpcli_request;
/* A response */ /* Expose the parser response type as a httpcli response too */
typedef struct grpc_httpcli_response { typedef struct grpc_http_response grpc_httpcli_response;
/* HTTP status code */
int status;
/* Headers: count and key/values */
size_t hdr_count;
grpc_httpcli_header *hdrs;
/* Body: length and contents; contents are NOT null-terminated */
size_t body_length;
char *body;
} grpc_httpcli_response;
/* Callback for grpc_httpcli_get and grpc_httpcli_post. */ /* Callback for grpc_httpcli_get and grpc_httpcli_post. */
typedef void (*grpc_httpcli_response_cb)(grpc_exec_ctx *exec_ctx, typedef void (*grpc_httpcli_response_cb)(grpc_exec_ctx *exec_ctx,
void *user_data, void *user_data,
const grpc_httpcli_response *response); const grpc_http_response *response);
void grpc_httpcli_context_init(grpc_httpcli_context *context); void grpc_httpcli_context_init(grpc_httpcli_context *context);
void grpc_httpcli_context_destroy(grpc_httpcli_context *context); void grpc_httpcli_context_destroy(grpc_httpcli_context *context);
@ -160,4 +141,4 @@ typedef int (*grpc_httpcli_post_override)(
void grpc_httpcli_set_override(grpc_httpcli_get_override get, void grpc_httpcli_set_override(grpc_httpcli_get_override get,
grpc_httpcli_post_override post); grpc_httpcli_post_override post);
#endif /* GRPC_CORE_HTTPCLI_HTTPCLI_H */ #endif /* GRPC_CORE_HTTP_HTTPCLI_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include <string.h> #include <string.h>

@ -0,0 +1,313 @@
/*
*
* Copyright 2015-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/http/parser.h"
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
static char *buf2str(void *buffer, size_t length) {
char *out = gpr_malloc(length + 1);
memcpy(out, buffer, length);
out[length] = 0;
return out;
}
static int handle_response_line(grpc_http_parser *parser) {
uint8_t *beg = parser->cur_line;
uint8_t *cur = beg;
uint8_t *end = beg + parser->cur_line_length;
if (cur == end || *cur++ != 'H') goto error;
if (cur == end || *cur++ != 'T') goto error;
if (cur == end || *cur++ != 'T') goto error;
if (cur == end || *cur++ != 'P') goto error;
if (cur == end || *cur++ != '/') goto error;
if (cur == end || *cur++ != '1') goto error;
if (cur == end || *cur++ != '.') goto error;
if (cur == end || *cur < '0' || *cur++ > '1') goto error;
if (cur == end || *cur++ != ' ') goto error;
if (cur == end || *cur < '1' || *cur++ > '9') goto error;
if (cur == end || *cur < '0' || *cur++ > '9') goto error;
if (cur == end || *cur < '0' || *cur++ > '9') goto error;
parser->http.response.status =
(cur[-3] - '0') * 100 + (cur[-2] - '0') * 10 + (cur[-1] - '0');
if (cur == end || *cur++ != ' ') goto error;
/* we don't really care about the status code message */
return 1;
error:
gpr_log(GPR_ERROR, "Failed parsing response line");
return 0;
}
static int handle_request_line(grpc_http_parser *parser) {
uint8_t *beg = parser->cur_line;
uint8_t *cur = beg;
uint8_t *end = beg + parser->cur_line_length;
uint8_t vers_major = 0;
uint8_t vers_minor = 0;
while (cur != end && *cur++ != ' ')
;
if (cur == end) goto error;
parser->http.request.method = buf2str(beg, (size_t)(cur - beg - 1));
beg = cur;
while (cur != end && *cur++ != ' ')
;
if (cur == end) goto error;
parser->http.request.path = buf2str(beg, (size_t)(cur - beg - 1));
if (cur == end || *cur++ != 'H') goto error;
if (cur == end || *cur++ != 'T') goto error;
if (cur == end || *cur++ != 'T') goto error;
if (cur == end || *cur++ != 'P') goto error;
if (cur == end || *cur++ != '/') goto error;
vers_major = (uint8_t)(*cur++ - '1' + 1);
++cur;
if (cur == end) goto error;
vers_minor = (uint8_t)(*cur++ - '1' + 1);
if (vers_major == 1) {
if (vers_minor == 0) {
parser->http.request.version = GRPC_HTTP_HTTP10;
} else if (vers_minor == 1) {
parser->http.request.version = GRPC_HTTP_HTTP11;
} else {
goto error;
}
} else if (vers_major == 2) {
if (vers_minor == 0) {
parser->http.request.version = GRPC_HTTP_HTTP20;
} else {
goto error;
}
} else {
goto error;
}
return 1;
error:
gpr_log(GPR_ERROR, "Failed parsing request line");
return 0;
}
static int handle_first_line(grpc_http_parser *parser) {
if (parser->cur_line[0] == 'H') {
parser->type = GRPC_HTTP_RESPONSE;
return handle_response_line(parser);
} else {
parser->type = GRPC_HTTP_REQUEST;
return handle_request_line(parser);
}
}
static int add_header(grpc_http_parser *parser) {
uint8_t *beg = parser->cur_line;
uint8_t *cur = beg;
uint8_t *end = beg + parser->cur_line_length;
size_t *hdr_count = NULL;
grpc_http_header **hdrs = NULL;
grpc_http_header hdr = {NULL, NULL};
GPR_ASSERT(cur != end);
if (*cur == ' ' || *cur == '\t') {
gpr_log(GPR_ERROR, "Continued header lines not supported yet");
goto error;
}
while (cur != end && *cur != ':') {
cur++;
}
if (cur == end) {
gpr_log(GPR_ERROR, "Didn't find ':' in header string");
goto error;
}
GPR_ASSERT(cur >= beg);
hdr.key = buf2str(beg, (size_t)(cur - beg));
cur++; /* skip : */
while (cur != end && (*cur == ' ' || *cur == '\t')) {
cur++;
}
GPR_ASSERT(end - cur >= 2);
hdr.value = buf2str(cur, (size_t)(end - cur) - 2);
if (parser->type == GRPC_HTTP_RESPONSE) {
hdr_count = &parser->http.response.hdr_count;
hdrs = &parser->http.response.hdrs;
} else if (parser->type == GRPC_HTTP_REQUEST) {
hdr_count = &parser->http.request.hdr_count;
hdrs = &parser->http.request.hdrs;
} else {
return 0;
}
if (*hdr_count == parser->hdr_capacity) {
parser->hdr_capacity =
GPR_MAX(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
*hdrs = gpr_realloc(*hdrs, parser->hdr_capacity * sizeof(**hdrs));
}
(*hdrs)[(*hdr_count)++] = hdr;
return 1;
error:
gpr_free(hdr.key);
gpr_free(hdr.value);
return 0;
}
static int finish_line(grpc_http_parser *parser) {
switch (parser->state) {
case GRPC_HTTP_FIRST_LINE:
if (!handle_first_line(parser)) {
return 0;
}
parser->state = GRPC_HTTP_HEADERS;
break;
case GRPC_HTTP_HEADERS:
if (parser->cur_line_length == 2) {
parser->state = GRPC_HTTP_BODY;
break;
}
if (!add_header(parser)) {
return 0;
}
break;
case GRPC_HTTP_BODY:
GPR_UNREACHABLE_CODE(return 0);
}
parser->cur_line_length = 0;
return 1;
}
static int addbyte_body(grpc_http_parser *parser, uint8_t byte) {
size_t *body_length = NULL;
char **body = NULL;
if (parser->type == GRPC_HTTP_RESPONSE) {
body_length = &parser->http.response.body_length;
body = &parser->http.response.body;
} else if (parser->type == GRPC_HTTP_REQUEST) {
body_length = &parser->http.request.body_length;
body = &parser->http.request.body;
} else {
return 0;
}
if (*body_length == parser->body_capacity) {
parser->body_capacity = GPR_MAX(8, parser->body_capacity * 3 / 2);
*body = gpr_realloc((void *)*body, parser->body_capacity);
}
(*body)[*body_length] = (char)byte;
(*body_length)++;
return 1;
}
static int addbyte(grpc_http_parser *parser, uint8_t byte) {
switch (parser->state) {
case GRPC_HTTP_FIRST_LINE:
case GRPC_HTTP_HEADERS:
if (parser->cur_line_length >= GRPC_HTTP_PARSER_MAX_HEADER_LENGTH) {
gpr_log(GPR_ERROR, "HTTP client max line length (%d) exceeded",
GRPC_HTTP_PARSER_MAX_HEADER_LENGTH);
return 0;
}
parser->cur_line[parser->cur_line_length] = byte;
parser->cur_line_length++;
if (parser->cur_line_length >= 2 &&
parser->cur_line[parser->cur_line_length - 2] == '\r' &&
parser->cur_line[parser->cur_line_length - 1] == '\n') {
return finish_line(parser);
} else {
return 1;
}
GPR_UNREACHABLE_CODE(return 0);
case GRPC_HTTP_BODY:
return addbyte_body(parser, byte);
}
GPR_UNREACHABLE_CODE(return 0);
}
void grpc_http_parser_init(grpc_http_parser *parser) {
memset(parser, 0, sizeof(*parser));
parser->state = GRPC_HTTP_FIRST_LINE;
parser->type = GRPC_HTTP_UNKNOWN;
}
void grpc_http_parser_destroy(grpc_http_parser *parser) {
size_t i;
if (parser->type == GRPC_HTTP_RESPONSE) {
gpr_free(parser->http.response.body);
for (i = 0; i < parser->http.response.hdr_count; i++) {
gpr_free(parser->http.response.hdrs[i].key);
gpr_free(parser->http.response.hdrs[i].value);
}
gpr_free(parser->http.response.hdrs);
} else if (parser->type == GRPC_HTTP_REQUEST) {
gpr_free(parser->http.request.body);
for (i = 0; i < parser->http.request.hdr_count; i++) {
gpr_free(parser->http.request.hdrs[i].key);
gpr_free(parser->http.request.hdrs[i].value);
}
gpr_free(parser->http.request.hdrs);
gpr_free(parser->http.request.method);
gpr_free(parser->http.request.path);
}
}
int grpc_http_parser_parse(grpc_http_parser *parser, gpr_slice slice) {
size_t i;
for (i = 0; i < GPR_SLICE_LENGTH(slice); i++) {
if (!addbyte(parser, GPR_SLICE_START_PTR(slice)[i])) {
return 0;
}
}
return 1;
}
int grpc_http_parser_eof(grpc_http_parser *parser) {
return parser->state == GRPC_HTTP_BODY;
}

@ -0,0 +1,116 @@
/*
*
* Copyright 2015-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_HTTP_PARSER_H
#define GRPC_CORE_HTTP_PARSER_H
#include <grpc/support/port_platform.h>
#include <grpc/support/slice.h>
/* Maximum length of a header string of the form 'Key: Value\r\n' */
#define GRPC_HTTP_PARSER_MAX_HEADER_LENGTH 4096
/* A single header to be passed in a request */
typedef struct grpc_http_header {
char *key;
char *value;
} grpc_http_header;
typedef enum {
GRPC_HTTP_FIRST_LINE,
GRPC_HTTP_HEADERS,
GRPC_HTTP_BODY
} grpc_http_parser_state;
typedef enum {
GRPC_HTTP_HTTP10,
GRPC_HTTP_HTTP11,
GRPC_HTTP_HTTP20,
} grpc_http_version;
typedef enum {
GRPC_HTTP_RESPONSE,
GRPC_HTTP_REQUEST,
GRPC_HTTP_UNKNOWN
} grpc_http_type;
/* A request */
typedef struct grpc_http_request {
/* Method of the request (e.g. GET, POST) */
char *method;
/* The path of the resource to fetch */
char *path;
/* HTTP version to use */
grpc_http_version version;
/* Headers attached to the request */
size_t hdr_count;
grpc_http_header *hdrs;
/* Body: length and contents; contents are NOT null-terminated */
size_t body_length;
char *body;
} grpc_http_request;
/* A response */
typedef struct grpc_http_response {
/* HTTP status code */
int status;
/* Headers: count and key/values */
size_t hdr_count;
grpc_http_header *hdrs;
/* Body: length and contents; contents are NOT null-terminated */
size_t body_length;
char *body;
} grpc_http_response;
typedef struct {
grpc_http_parser_state state;
grpc_http_type type;
union {
grpc_http_response response;
grpc_http_request request;
} http;
size_t body_capacity;
size_t hdr_capacity;
uint8_t cur_line[GRPC_HTTP_PARSER_MAX_HEADER_LENGTH];
size_t cur_line_length;
} grpc_http_parser;
void grpc_http_parser_init(grpc_http_parser *parser);
void grpc_http_parser_destroy(grpc_http_parser *parser);
int grpc_http_parser_parse(grpc_http_parser *parser, gpr_slice slice);
int grpc_http_parser_eof(grpc_http_parser *parser);
#endif /* GRPC_CORE_HTTP_PARSER_H */

@ -1,211 +0,0 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/httpcli/parser.h"
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/useful.h>
static int handle_response_line(grpc_httpcli_parser *parser) {
uint8_t *beg = parser->cur_line;
uint8_t *cur = beg;
uint8_t *end = beg + parser->cur_line_length;
if (cur == end || *cur++ != 'H') goto error;
if (cur == end || *cur++ != 'T') goto error;
if (cur == end || *cur++ != 'T') goto error;
if (cur == end || *cur++ != 'P') goto error;
if (cur == end || *cur++ != '/') goto error;
if (cur == end || *cur++ != '1') goto error;
if (cur == end || *cur++ != '.') goto error;
if (cur == end || *cur < '0' || *cur++ > '1') goto error;
if (cur == end || *cur++ != ' ') goto error;
if (cur == end || *cur < '1' || *cur++ > '9') goto error;
if (cur == end || *cur < '0' || *cur++ > '9') goto error;
if (cur == end || *cur < '0' || *cur++ > '9') goto error;
parser->r.status =
(cur[-3] - '0') * 100 + (cur[-2] - '0') * 10 + (cur[-1] - '0');
if (cur == end || *cur++ != ' ') goto error;
/* we don't really care about the status code message */
return 1;
error:
gpr_log(GPR_ERROR, "Failed parsing response line");
return 0;
}
static char *buf2str(void *buffer, size_t length) {
char *out = gpr_malloc(length + 1);
memcpy(out, buffer, length);
out[length] = 0;
return out;
}
static int add_header(grpc_httpcli_parser *parser) {
uint8_t *beg = parser->cur_line;
uint8_t *cur = beg;
uint8_t *end = beg + parser->cur_line_length;
grpc_httpcli_header hdr = {NULL, NULL};
GPR_ASSERT(cur != end);
if (*cur == ' ' || *cur == '\t') {
gpr_log(GPR_ERROR, "Continued header lines not supported yet");
goto error;
}
while (cur != end && *cur != ':') {
cur++;
}
if (cur == end) {
gpr_log(GPR_ERROR, "Didn't find ':' in header string");
goto error;
}
GPR_ASSERT(cur >= beg);
hdr.key = buf2str(beg, (size_t)(cur - beg));
cur++; /* skip : */
while (cur != end && (*cur == ' ' || *cur == '\t')) {
cur++;
}
GPR_ASSERT(end - cur >= 2);
hdr.value = buf2str(cur, (size_t)(end - cur) - 2);
if (parser->r.hdr_count == parser->hdr_capacity) {
parser->hdr_capacity =
GPR_MAX(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
parser->r.hdrs = gpr_realloc(
parser->r.hdrs, parser->hdr_capacity * sizeof(*parser->r.hdrs));
}
parser->r.hdrs[parser->r.hdr_count++] = hdr;
return 1;
error:
gpr_free(hdr.key);
gpr_free(hdr.value);
return 0;
}
static int finish_line(grpc_httpcli_parser *parser) {
switch (parser->state) {
case GRPC_HTTPCLI_INITIAL_RESPONSE:
if (!handle_response_line(parser)) {
return 0;
}
parser->state = GRPC_HTTPCLI_HEADERS;
break;
case GRPC_HTTPCLI_HEADERS:
if (parser->cur_line_length == 2) {
parser->state = GRPC_HTTPCLI_BODY;
break;
}
if (!add_header(parser)) {
return 0;
}
break;
case GRPC_HTTPCLI_BODY:
GPR_UNREACHABLE_CODE(return 0);
}
parser->cur_line_length = 0;
return 1;
}
static int addbyte(grpc_httpcli_parser *parser, uint8_t byte) {
switch (parser->state) {
case GRPC_HTTPCLI_INITIAL_RESPONSE:
case GRPC_HTTPCLI_HEADERS:
if (parser->cur_line_length >= GRPC_HTTPCLI_MAX_HEADER_LENGTH) {
gpr_log(GPR_ERROR, "HTTP client max line length (%d) exceeded",
GRPC_HTTPCLI_MAX_HEADER_LENGTH);
return 0;
}
parser->cur_line[parser->cur_line_length] = byte;
parser->cur_line_length++;
if (parser->cur_line_length >= 2 &&
parser->cur_line[parser->cur_line_length - 2] == '\r' &&
parser->cur_line[parser->cur_line_length - 1] == '\n') {
return finish_line(parser);
} else {
return 1;
}
GPR_UNREACHABLE_CODE(return 0);
case GRPC_HTTPCLI_BODY:
if (parser->r.body_length == parser->body_capacity) {
parser->body_capacity = GPR_MAX(8, parser->body_capacity * 3 / 2);
parser->r.body =
gpr_realloc((void *)parser->r.body, parser->body_capacity);
}
parser->r.body[parser->r.body_length] = (char)byte;
parser->r.body_length++;
return 1;
}
GPR_UNREACHABLE_CODE(return 0);
}
void grpc_httpcli_parser_init(grpc_httpcli_parser *parser) {
memset(parser, 0, sizeof(*parser));
parser->state = GRPC_HTTPCLI_INITIAL_RESPONSE;
parser->r.status = 500;
}
void grpc_httpcli_parser_destroy(grpc_httpcli_parser *parser) {
size_t i;
gpr_free(parser->r.body);
for (i = 0; i < parser->r.hdr_count; i++) {
gpr_free(parser->r.hdrs[i].key);
gpr_free(parser->r.hdrs[i].value);
}
gpr_free(parser->r.hdrs);
}
int grpc_httpcli_parser_parse(grpc_httpcli_parser *parser, gpr_slice slice) {
size_t i;
for (i = 0; i < GPR_SLICE_LENGTH(slice); i++) {
if (!addbyte(parser, GPR_SLICE_START_PTR(slice)[i])) {
return 0;
}
}
return 1;
}
int grpc_httpcli_parser_eof(grpc_httpcli_parser *parser) {
return parser->state == GRPC_HTTPCLI_BODY;
}

@ -1,64 +0,0 @@
/*
*
* Copyright 2015-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_HTTPCLI_PARSER_H
#define GRPC_CORE_HTTPCLI_PARSER_H
#include "src/core/httpcli/httpcli.h"
#include <grpc/support/port_platform.h>
#include <grpc/support/slice.h>
typedef enum {
GRPC_HTTPCLI_INITIAL_RESPONSE,
GRPC_HTTPCLI_HEADERS,
GRPC_HTTPCLI_BODY
} grpc_httpcli_parser_state;
typedef struct {
grpc_httpcli_parser_state state;
grpc_httpcli_response r;
size_t body_capacity;
size_t hdr_capacity;
uint8_t cur_line[GRPC_HTTPCLI_MAX_HEADER_LENGTH];
size_t cur_line_length;
} grpc_httpcli_parser;
void grpc_httpcli_parser_init(grpc_httpcli_parser* parser);
void grpc_httpcli_parser_destroy(grpc_httpcli_parser* parser);
int grpc_httpcli_parser_parse(grpc_httpcli_parser* parser, gpr_slice slice);
int grpc_httpcli_parser_eof(grpc_httpcli_parser* parser);
#endif /* GRPC_CORE_HTTPCLI_PARSER_H */

@ -38,7 +38,8 @@
#include "src/core/channel/channel_args.h" #include "src/core/channel/channel_args.h"
#include "src/core/channel/http_client_filter.h" #include "src/core/channel/http_client_filter.h"
#include "src/core/httpcli/httpcli.h" #include "src/core/http/parser.h"
#include "src/core/http/httpcli.h"
#include "src/core/iomgr/executor.h" #include "src/core/iomgr/executor.h"
#include "src/core/json/json.h" #include "src/core/json/json.h"
#include "src/core/support/string.h" #include "src/core/support/string.h"
@ -539,7 +540,7 @@ static void oauth2_token_fetcher_destruct(grpc_call_credentials *creds) {
grpc_credentials_status grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response( grpc_oauth2_token_fetcher_credentials_parse_server_response(
const grpc_httpcli_response *response, grpc_credentials_md_store **token_md, const grpc_http_response *response, grpc_credentials_md_store **token_md,
gpr_timespec *token_lifetime) { gpr_timespec *token_lifetime) {
char *null_terminated_body = NULL; char *null_terminated_body = NULL;
char *new_access_token = NULL; char *new_access_token = NULL;
@ -629,7 +630,7 @@ end:
static void on_oauth2_token_fetcher_http_response( static void on_oauth2_token_fetcher_http_response(
grpc_exec_ctx *exec_ctx, void *user_data, grpc_exec_ctx *exec_ctx, void *user_data,
const grpc_httpcli_response *response) { const grpc_http_response *response) {
grpc_credentials_metadata_request *r = grpc_credentials_metadata_request *r =
(grpc_credentials_metadata_request *)user_data; (grpc_credentials_metadata_request *)user_data;
grpc_oauth2_token_fetcher_credentials *c = grpc_oauth2_token_fetcher_credentials *c =
@ -706,13 +707,13 @@ static void compute_engine_fetch_oauth2(
grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req, grpc_exec_ctx *exec_ctx, grpc_credentials_metadata_request *metadata_req,
grpc_httpcli_context *httpcli_context, grpc_pollset *pollset, grpc_httpcli_context *httpcli_context, grpc_pollset *pollset,
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) { grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_httpcli_header header = {"Metadata-Flavor", "Google"}; grpc_http_header header = {"Metadata-Flavor", "Google"};
grpc_httpcli_request request; grpc_httpcli_request request;
memset(&request, 0, sizeof(grpc_httpcli_request)); memset(&request, 0, sizeof(grpc_httpcli_request));
request.host = GRPC_COMPUTE_ENGINE_METADATA_HOST; request.host = GRPC_COMPUTE_ENGINE_METADATA_HOST;
request.path = GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH; request.http.path = GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH;
request.hdr_count = 1; request.http.hdr_count = 1;
request.hdrs = &header; request.http.hdrs = &header;
grpc_httpcli_get(exec_ctx, httpcli_context, pollset, &request, deadline, grpc_httpcli_get(exec_ctx, httpcli_context, pollset, &request, deadline,
response_cb, metadata_req); response_cb, metadata_req);
} }
@ -747,8 +748,8 @@ static void refresh_token_fetch_oauth2(
grpc_httpcli_response_cb response_cb, gpr_timespec deadline) { grpc_httpcli_response_cb response_cb, gpr_timespec deadline) {
grpc_google_refresh_token_credentials *c = grpc_google_refresh_token_credentials *c =
(grpc_google_refresh_token_credentials *)metadata_req->creds; (grpc_google_refresh_token_credentials *)metadata_req->creds;
grpc_httpcli_header header = {"Content-Type", grpc_http_header header = {"Content-Type",
"application/x-www-form-urlencoded"}; "application/x-www-form-urlencoded"};
grpc_httpcli_request request; grpc_httpcli_request request;
char *body = NULL; char *body = NULL;
gpr_asprintf(&body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING, gpr_asprintf(&body, GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING,
@ -756,9 +757,9 @@ static void refresh_token_fetch_oauth2(
c->refresh_token.refresh_token); c->refresh_token.refresh_token);
memset(&request, 0, sizeof(grpc_httpcli_request)); memset(&request, 0, sizeof(grpc_httpcli_request));
request.host = GRPC_GOOGLE_OAUTH2_SERVICE_HOST; request.host = GRPC_GOOGLE_OAUTH2_SERVICE_HOST;
request.path = GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH; request.http.path = GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH;
request.hdr_count = 1; request.http.hdr_count = 1;
request.hdrs = &header; request.http.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl; request.handshaker = &grpc_httpcli_ssl;
grpc_httpcli_post(exec_ctx, httpcli_context, pollset, &request, body, grpc_httpcli_post(exec_ctx, httpcli_context, pollset, &request, body,
strlen(body), deadline, response_cb, metadata_req); strlen(body), deadline, response_cb, metadata_req);

@ -39,11 +39,12 @@
#include <grpc/grpc_security.h> #include <grpc/grpc_security.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include "src/core/http/parser.h"
#include "src/core/security/json_token.h" #include "src/core/security/json_token.h"
#include "src/core/security/security_connector.h" #include "src/core/security/security_connector.h"
struct grpc_httpcli_response; struct grpc_http_response;
/* --- Constants. --- */ /* --- Constants. --- */
@ -207,7 +208,7 @@ grpc_call_credentials *grpc_credentials_contains_type(
/* Exposed for testing only. */ /* Exposed for testing only. */
grpc_credentials_status grpc_credentials_status
grpc_oauth2_token_fetcher_credentials_parse_server_response( grpc_oauth2_token_fetcher_credentials_parse_server_response(
const struct grpc_httpcli_response *response, const struct grpc_http_response *response,
grpc_credentials_md_store **token_md, gpr_timespec *token_lifetime); grpc_credentials_md_store **token_md, gpr_timespec *token_lifetime);
void grpc_flush_cached_google_default_credentials(void); void grpc_flush_cached_google_default_credentials(void);

@ -39,7 +39,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include "src/core/http/parser.h"
#include "src/core/support/env.h" #include "src/core/support/env.h"
#include "src/core/support/load_file.h" #include "src/core/support/load_file.h"
#include "src/core/surface/api_trace.h" #include "src/core/surface/api_trace.h"
@ -66,14 +67,14 @@ typedef struct {
static void on_compute_engine_detection_http_response( static void on_compute_engine_detection_http_response(
grpc_exec_ctx *exec_ctx, void *user_data, grpc_exec_ctx *exec_ctx, void *user_data,
const grpc_httpcli_response *response) { const grpc_http_response *response) {
compute_engine_detector *detector = (compute_engine_detector *)user_data; compute_engine_detector *detector = (compute_engine_detector *)user_data;
if (response != NULL && response->status == 200 && response->hdr_count > 0) { if (response != NULL && response->status == 200 && response->hdr_count > 0) {
/* Internet providers can return a generic response to all requests, so /* Internet providers can return a generic response to all requests, so
it is necessary to check that metadata header is present also. */ it is necessary to check that metadata header is present also. */
size_t i; size_t i;
for (i = 0; i < response->hdr_count; i++) { for (i = 0; i < response->hdr_count; i++) {
grpc_httpcli_header *header = &response->hdrs[i]; grpc_http_header *header = &response->hdrs[i];
if (strcmp(header->key, "Metadata-Flavor") == 0 && if (strcmp(header->key, "Metadata-Flavor") == 0 &&
strcmp(header->value, "Google") == 0) { strcmp(header->value, "Google") == 0) {
detector->success = 1; detector->success = 1;
@ -109,7 +110,7 @@ static int is_stack_running_on_compute_engine(void) {
memset(&request, 0, sizeof(grpc_httpcli_request)); memset(&request, 0, sizeof(grpc_httpcli_request));
request.host = GRPC_COMPUTE_ENGINE_DETECTION_HOST; request.host = GRPC_COMPUTE_ENGINE_DETECTION_HOST;
request.path = "/"; request.http.path = "/";
grpc_httpcli_context_init(&context); grpc_httpcli_context_init(&context);

@ -36,7 +36,7 @@
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include "src/core/security/b64.h" #include "src/core/security/b64.h"
#include "src/core/tsi/ssl_types.h" #include "src/core/tsi/ssl_types.h"
@ -635,11 +635,11 @@ static void on_openid_config_retrieved(grpc_exec_ctx *exec_ctx, void *user_data,
jwks_uri += 8; jwks_uri += 8;
req.handshaker = &grpc_httpcli_ssl; req.handshaker = &grpc_httpcli_ssl;
req.host = gpr_strdup(jwks_uri); req.host = gpr_strdup(jwks_uri);
req.path = strchr(jwks_uri, '/'); req.http.path = strchr(jwks_uri, '/');
if (req.path == NULL) { if (req.http.path == NULL) {
req.path = ""; req.http.path = "";
} else { } else {
*(req.host + (req.path - jwks_uri)) = '\0'; *(req.host + (req.http.path - jwks_uri)) = '\0';
} }
grpc_httpcli_get( grpc_httpcli_get(
exec_ctx, &ctx->verifier->http_ctx, ctx->pollset, &req, exec_ctx, &ctx->verifier->http_ctx, ctx->pollset, &req,
@ -725,20 +725,20 @@ static void retrieve_key_and_verify(grpc_exec_ctx *exec_ctx,
req.host = gpr_strdup(mapping->key_url_prefix); req.host = gpr_strdup(mapping->key_url_prefix);
path_prefix = strchr(req.host, '/'); path_prefix = strchr(req.host, '/');
if (path_prefix == NULL) { if (path_prefix == NULL) {
gpr_asprintf(&req.path, "/%s", iss); gpr_asprintf(&req.http.path, "/%s", iss);
} else { } else {
*(path_prefix++) = '\0'; *(path_prefix++) = '\0';
gpr_asprintf(&req.path, "/%s/%s", path_prefix, iss); gpr_asprintf(&req.http.path, "/%s/%s", path_prefix, iss);
} }
http_cb = on_keys_retrieved; http_cb = on_keys_retrieved;
} else { } else {
req.host = gpr_strdup(strstr(iss, "https://") == iss ? iss + 8 : iss); req.host = gpr_strdup(strstr(iss, "https://") == iss ? iss + 8 : iss);
path_prefix = strchr(req.host, '/'); path_prefix = strchr(req.host, '/');
if (path_prefix == NULL) { if (path_prefix == NULL) {
req.path = gpr_strdup(GRPC_OPENID_CONFIG_URL_SUFFIX); req.http.path = gpr_strdup(GRPC_OPENID_CONFIG_URL_SUFFIX);
} else { } else {
*(path_prefix++) = 0; *(path_prefix++) = 0;
gpr_asprintf(&req.path, "/%s%s", path_prefix, gpr_asprintf(&req.http.path, "/%s%s", path_prefix,
GRPC_OPENID_CONFIG_URL_SUFFIX); GRPC_OPENID_CONFIG_URL_SUFFIX);
} }
http_cb = on_openid_config_retrieved; http_cb = on_openid_config_retrieved;
@ -749,7 +749,7 @@ static void retrieve_key_and_verify(grpc_exec_ctx *exec_ctx,
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay),
http_cb, ctx); http_cb, ctx);
gpr_free(req.host); gpr_free(req.host);
gpr_free(req.path); gpr_free(req.http.path);
return; return;
error: error:

@ -150,7 +150,7 @@ int grpc_chttp2_decode_timeout(const char *buffer, gpr_timespec *timeout) {
/* spec allows max. 8 digits, but we allow values up to 1,000,000,000 */ /* spec allows max. 8 digits, but we allow values up to 1,000,000,000 */
if (x >= (100 * 1000 * 1000)) { if (x >= (100 * 1000 * 1000)) {
if (x != (100 * 1000 * 1000) || digit != 0) { if (x != (100 * 1000 * 1000) || digit != 0) {
*timeout = gpr_inf_future(GPR_CLOCK_REALTIME); *timeout = gpr_inf_future(GPR_TIMESPAN);
return 1; return 1;
} }
} }

@ -1,4 +1,3 @@
// Copyright 2015, Google Inc. // Copyright 2015, Google Inc.
// All rights reserved. // All rights reserved.
// //
@ -28,12 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// An integration test service that covers all the method signature permutations // Contains the definitions for a metrics service and the type of metrics
// of unary/streaming requests/responses. // exposed by the service.
//
// Currently, 'Gauge' (i.e a metric that represents the measured value of
// something at an instant of time) is the only metric type supported by the
// service.
syntax = "proto3"; syntax = "proto3";
package grpc.testing; package grpc.testing;
// Reponse message containing the gauge name and value
message GaugeResponse { message GaugeResponse {
string name = 1; string name = 1;
oneof value { oneof value {
@ -43,11 +47,18 @@ message GaugeResponse {
} }
} }
message GaugeRequest { string name = 1; } // Request message containing the gauge name
message GaugeRequest {
string name = 1;
}
message EmptyMessage {} message EmptyMessage {}
service MetricsService { service MetricsService {
// Returns the values of all the gauges that are currently being maintained by
// the service
rpc GetAllGauges(EmptyMessage) returns (stream GaugeResponse); rpc GetAllGauges(EmptyMessage) returns (stream GaugeResponse);
// Returns the value of one gauge
rpc GetGauge(GaugeRequest) returns (GaugeResponse); rpc GetGauge(GaugeRequest) returns (GaugeResponse);
} }

@ -108,9 +108,9 @@ CORE_SOURCE_FILES = [
'src/core/compression/compression_algorithm.c', 'src/core/compression/compression_algorithm.c',
'src/core/compression/message_compress.c', 'src/core/compression/message_compress.c',
'src/core/debug/trace.c', 'src/core/debug/trace.c',
'src/core/httpcli/format_request.c', 'src/core/http/format_request.c',
'src/core/httpcli/httpcli.c', 'src/core/http/httpcli.c',
'src/core/httpcli/parser.c', 'src/core/http/parser.c',
'src/core/iomgr/closure.c', 'src/core/iomgr/closure.c',
'src/core/iomgr/endpoint.c', 'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c', 'src/core/iomgr/endpoint_pair_posix.c',
@ -208,7 +208,7 @@ CORE_SOURCE_FILES = [
'src/core/transport/static_metadata.c', 'src/core/transport/static_metadata.c',
'src/core/transport/transport.c', 'src/core/transport/transport.c',
'src/core/transport/transport_op_string.c', 'src/core/transport/transport_op_string.c',
'src/core/httpcli/httpcli_security_connector.c', 'src/core/http/httpcli_security_connector.c',
'src/core/security/b64.c', 'src/core/security/b64.c',
'src/core/security/client_auth_filter.c', 'src/core/security/client_auth_filter.c',
'src/core/security/credentials.c', 'src/core/security/credentials.c',

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/format_request.h" #include "src/core/http/format_request.h"
#include <string.h> #include <string.h>
@ -39,15 +39,15 @@
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static void test_format_get_request(void) { static void test_format_get_request(void) {
grpc_httpcli_header hdr = {"x-yz", "abc"}; grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req; grpc_httpcli_request req;
gpr_slice slice; gpr_slice slice;
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = "example.com"; req.host = "example.com";
req.path = "/index.html"; req.http.path = "/index.html";
req.hdr_count = 1; req.http.hdr_count = 1;
req.hdrs = &hdr; req.http.hdrs = &hdr;
slice = grpc_httpcli_format_get_request(&req); slice = grpc_httpcli_format_get_request(&req);
@ -64,7 +64,7 @@ static void test_format_get_request(void) {
} }
static void test_format_post_request(void) { static void test_format_post_request(void) {
grpc_httpcli_header hdr = {"x-yz", "abc"}; grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req; grpc_httpcli_request req;
gpr_slice slice; gpr_slice slice;
char body_bytes[] = "fake body"; char body_bytes[] = "fake body";
@ -72,9 +72,9 @@ static void test_format_post_request(void) {
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = "example.com"; req.host = "example.com";
req.path = "/index.html"; req.http.path = "/index.html";
req.hdr_count = 1; req.http.hdr_count = 1;
req.hdrs = &hdr; req.http.hdrs = &hdr;
slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len); slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);
@ -94,15 +94,15 @@ static void test_format_post_request(void) {
} }
static void test_format_post_request_no_body(void) { static void test_format_post_request_no_body(void) {
grpc_httpcli_header hdr = {"x-yz", "abc"}; grpc_http_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req; grpc_httpcli_request req;
gpr_slice slice; gpr_slice slice;
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = "example.com"; req.host = "example.com";
req.path = "/index.html"; req.http.path = "/index.html";
req.hdr_count = 1; req.http.hdr_count = 1;
req.hdrs = &hdr; req.http.hdrs = &hdr;
slice = grpc_httpcli_format_post_request(&req, NULL, 0); slice = grpc_httpcli_format_post_request(&req, NULL, 0);
@ -119,7 +119,7 @@ static void test_format_post_request_no_body(void) {
} }
static void test_format_post_request_content_type_override(void) { static void test_format_post_request_content_type_override(void) {
grpc_httpcli_header hdrs[2]; grpc_http_header hdrs[2];
grpc_httpcli_request req; grpc_httpcli_request req;
gpr_slice slice; gpr_slice slice;
char body_bytes[] = "fake%20body"; char body_bytes[] = "fake%20body";
@ -131,9 +131,9 @@ static void test_format_post_request_content_type_override(void) {
hdrs[1].value = "application/x-www-form-urlencoded"; hdrs[1].value = "application/x-www-form-urlencoded";
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = "example.com"; req.host = "example.com";
req.path = "/index.html"; req.http.path = "/index.html";
req.hdr_count = 2; req.http.hdr_count = 2;
req.hdrs = hdrs; req.http.hdrs = hdrs;
slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len); slice = grpc_httpcli_format_post_request(&req, body_bytes, body_len);

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include <string.h> #include <string.h>
@ -83,7 +83,7 @@ static void test_get(int port) {
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = host; req.host = host;
req.path = "/get"; req.http.path = "/get";
req.handshaker = &grpc_httpcli_plaintext; req.handshaker = &grpc_httpcli_plaintext;
grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15), grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15),
@ -114,7 +114,7 @@ static void test_post(int port) {
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = host; req.host = host;
req.path = "/post"; req.http.path = "/post";
req.handshaker = &grpc_httpcli_plaintext; req.handshaker = &grpc_httpcli_plaintext;
grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5, grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5,
@ -161,7 +161,7 @@ int main(int argc, char **argv) {
} else { } else {
arg_shift = 1; arg_shift = 1;
gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root); gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
gpr_asprintf(&args[1], "%s/../../test/core/httpcli/test_server.py", root); gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
} }
/* start the server */ /* start the server */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include <string.h> #include <string.h>
@ -84,7 +84,7 @@ static void test_get(int port) {
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = host; req.host = host;
req.ssl_host_override = "foo.test.google.fr"; req.ssl_host_override = "foo.test.google.fr";
req.path = "/get"; req.http.path = "/get";
req.handshaker = &grpc_httpcli_ssl; req.handshaker = &grpc_httpcli_ssl;
grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15), grpc_httpcli_get(&exec_ctx, &g_context, g_pollset, &req, n_seconds_time(15),
@ -116,7 +116,7 @@ static void test_post(int port) {
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.host = host; req.host = host;
req.ssl_host_override = "foo.test.google.fr"; req.ssl_host_override = "foo.test.google.fr";
req.path = "/post"; req.http.path = "/post";
req.handshaker = &grpc_httpcli_ssl; req.handshaker = &grpc_httpcli_ssl;
grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5, grpc_httpcli_post(&exec_ctx, &g_context, g_pollset, &req, "hello", 5,
@ -163,7 +163,7 @@ int main(int argc, char **argv) {
} else { } else {
arg_shift = 1; arg_shift = 1;
gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root); gpr_asprintf(&args[0], "%s/../../tools/distrib/python_wrapper.sh", root);
gpr_asprintf(&args[1], "%s/../../test/core/httpcli/test_server.py", root); gpr_asprintf(&args[1], "%s/../../test/core/http/test_server.py", root);
} }
/* start the server */ /* start the server */

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/httpcli/parser.h" #include "src/core/http/parser.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
@ -43,9 +43,65 @@
#include "test/core/util/slice_splitter.h" #include "test/core/util/slice_splitter.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static void test_request_succeeds(grpc_slice_split_mode split_mode,
char *request, char *expect_method,
grpc_http_version expect_version,
char *expect_path, char *expect_body, ...) {
grpc_http_parser parser;
gpr_slice input_slice = gpr_slice_from_copied_string(request);
size_t num_slices;
size_t i;
gpr_slice *slices;
va_list args;
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
gpr_slice_unref(input_slice);
grpc_http_parser_init(&parser);
for (i = 0; i < num_slices; i++) {
GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]));
gpr_slice_unref(slices[i]);
}
GPR_ASSERT(grpc_http_parser_eof(&parser));
GPR_ASSERT(GRPC_HTTP_REQUEST == parser.type);
GPR_ASSERT(0 == strcmp(expect_method, parser.http.request.method));
GPR_ASSERT(0 == strcmp(expect_path, parser.http.request.path));
GPR_ASSERT(expect_version == parser.http.request.version);
if (expect_body != NULL) {
GPR_ASSERT(strlen(expect_body) == parser.http.request.body_length);
GPR_ASSERT(0 == memcmp(expect_body, parser.http.request.body,
parser.http.request.body_length));
} else {
GPR_ASSERT(parser.http.request.body_length == 0);
}
va_start(args, expect_body);
i = 0;
for (;;) {
char *expect_key;
char *expect_value;
expect_key = va_arg(args, char *);
if (!expect_key) break;
GPR_ASSERT(i < parser.http.request.hdr_count);
expect_value = va_arg(args, char *);
GPR_ASSERT(expect_value);
GPR_ASSERT(0 == strcmp(expect_key, parser.http.request.hdrs[i].key));
GPR_ASSERT(0 == strcmp(expect_value, parser.http.request.hdrs[i].value));
i++;
}
va_end(args);
GPR_ASSERT(i == parser.http.request.hdr_count);
grpc_http_parser_destroy(&parser);
gpr_free(slices);
}
static void test_succeeds(grpc_slice_split_mode split_mode, char *response, static void test_succeeds(grpc_slice_split_mode split_mode, char *response,
int expect_status, char *expect_body, ...) { int expect_status, char *expect_body, ...) {
grpc_httpcli_parser parser; grpc_http_parser parser;
gpr_slice input_slice = gpr_slice_from_copied_string(response); gpr_slice input_slice = gpr_slice_from_copied_string(response);
size_t num_slices; size_t num_slices;
size_t i; size_t i;
@ -55,20 +111,22 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response,
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
gpr_slice_unref(input_slice); gpr_slice_unref(input_slice);
grpc_httpcli_parser_init(&parser); grpc_http_parser_init(&parser);
for (i = 0; i < num_slices; i++) { for (i = 0; i < num_slices; i++) {
GPR_ASSERT(grpc_httpcli_parser_parse(&parser, slices[i])); GPR_ASSERT(grpc_http_parser_parse(&parser, slices[i]));
gpr_slice_unref(slices[i]); gpr_slice_unref(slices[i]);
} }
GPR_ASSERT(grpc_httpcli_parser_eof(&parser)); GPR_ASSERT(grpc_http_parser_eof(&parser));
GPR_ASSERT(expect_status == parser.r.status); GPR_ASSERT(GRPC_HTTP_RESPONSE == parser.type);
GPR_ASSERT(expect_status == parser.http.response.status);
if (expect_body != NULL) { if (expect_body != NULL) {
GPR_ASSERT(strlen(expect_body) == parser.r.body_length); GPR_ASSERT(strlen(expect_body) == parser.http.response.body_length);
GPR_ASSERT(0 == memcmp(expect_body, parser.r.body, parser.r.body_length)); GPR_ASSERT(0 == memcmp(expect_body, parser.http.response.body,
parser.http.response.body_length));
} else { } else {
GPR_ASSERT(parser.r.body_length == 0); GPR_ASSERT(parser.http.response.body_length == 0);
} }
va_start(args, expect_body); va_start(args, expect_body);
@ -78,22 +136,22 @@ static void test_succeeds(grpc_slice_split_mode split_mode, char *response,
char *expect_value; char *expect_value;
expect_key = va_arg(args, char *); expect_key = va_arg(args, char *);
if (!expect_key) break; if (!expect_key) break;
GPR_ASSERT(i < parser.r.hdr_count); GPR_ASSERT(i < parser.http.response.hdr_count);
expect_value = va_arg(args, char *); expect_value = va_arg(args, char *);
GPR_ASSERT(expect_value); GPR_ASSERT(expect_value);
GPR_ASSERT(0 == strcmp(expect_key, parser.r.hdrs[i].key)); GPR_ASSERT(0 == strcmp(expect_key, parser.http.response.hdrs[i].key));
GPR_ASSERT(0 == strcmp(expect_value, parser.r.hdrs[i].value)); GPR_ASSERT(0 == strcmp(expect_value, parser.http.response.hdrs[i].value));
i++; i++;
} }
va_end(args); va_end(args);
GPR_ASSERT(i == parser.r.hdr_count); GPR_ASSERT(i == parser.http.response.hdr_count);
grpc_httpcli_parser_destroy(&parser); grpc_http_parser_destroy(&parser);
gpr_free(slices); gpr_free(slices);
} }
static void test_fails(grpc_slice_split_mode split_mode, char *response) { static void test_fails(grpc_slice_split_mode split_mode, char *response) {
grpc_httpcli_parser parser; grpc_http_parser parser;
gpr_slice input_slice = gpr_slice_from_copied_string(response); gpr_slice input_slice = gpr_slice_from_copied_string(response);
size_t num_slices; size_t num_slices;
size_t i; size_t i;
@ -103,20 +161,20 @@ static void test_fails(grpc_slice_split_mode split_mode, char *response) {
grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices); grpc_split_slices(split_mode, &input_slice, 1, &slices, &num_slices);
gpr_slice_unref(input_slice); gpr_slice_unref(input_slice);
grpc_httpcli_parser_init(&parser); grpc_http_parser_init(&parser);
for (i = 0; i < num_slices; i++) { for (i = 0; i < num_slices; i++) {
if (!done && !grpc_httpcli_parser_parse(&parser, slices[i])) { if (!done && !grpc_http_parser_parse(&parser, slices[i])) {
done = 1; done = 1;
} }
gpr_slice_unref(slices[i]); gpr_slice_unref(slices[i]);
} }
if (!done && !grpc_httpcli_parser_eof(&parser)) { if (!done && !grpc_http_parser_eof(&parser)) {
done = 1; done = 1;
} }
GPR_ASSERT(done); GPR_ASSERT(done);
grpc_httpcli_parser_destroy(&parser); grpc_http_parser_destroy(&parser);
gpr_free(slices); gpr_free(slices);
} }
@ -145,6 +203,32 @@ int main(int argc, char **argv) {
"\r\n" "\r\n"
"hello world!", "hello world!",
200, "hello world!", "xyz", "abc", NULL); 200, "hello world!", "xyz", "abc", NULL);
test_request_succeeds(split_modes[i],
"GET / HTTP/1.0\r\n"
"\r\n",
"GET", GRPC_HTTP_HTTP10, "/", NULL, NULL);
test_request_succeeds(split_modes[i],
"GET / HTTP/1.0\r\n"
"\r\n"
"xyz",
"GET", GRPC_HTTP_HTTP10, "/", "xyz", NULL);
test_request_succeeds(split_modes[i],
"GET / HTTP/1.1\r\n"
"\r\n"
"xyz",
"GET", GRPC_HTTP_HTTP11, "/", "xyz", NULL);
test_request_succeeds(split_modes[i],
"GET / HTTP/2.0\r\n"
"\r\n"
"xyz",
"GET", GRPC_HTTP_HTTP20, "/", "xyz", NULL);
test_request_succeeds(split_modes[i],
"GET / HTTP/1.0\r\n"
"xyz: abc\r\n"
"\r\n"
"xyz",
"GET", GRPC_HTTP_HTTP10, "/", "xyz", "xyz", "abc",
NULL);
test_fails(split_modes[i], "HTTP/1.0\r\n"); test_fails(split_modes[i], "HTTP/1.0\r\n");
test_fails(split_modes[i], "HTTP/1.2\r\n"); test_fails(split_modes[i], "HTTP/1.2\r\n");
test_fails(split_modes[i], "HTTP/1.0 000 XYX\r\n"); test_fails(split_modes[i], "HTTP/1.0 000 XYX\r\n");
@ -157,10 +241,15 @@ int main(int argc, char **argv) {
" def\r\n" " def\r\n"
"\r\n" "\r\n"
"hello world!"); "hello world!");
test_fails(split_modes[i], "GET\r\n");
test_fails(split_modes[i], "GET /\r\n");
test_fails(split_modes[i], "GET / HTTP/0.0\r\n");
test_fails(split_modes[i], "GET / ____/1.0\r\n");
test_fails(split_modes[i], "GET / HTTP/1.2\r\n");
tmp1 = gpr_malloc(2 * GRPC_HTTPCLI_MAX_HEADER_LENGTH); tmp1 = gpr_malloc(2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH);
memset(tmp1, 'a', 2 * GRPC_HTTPCLI_MAX_HEADER_LENGTH - 1); memset(tmp1, 'a', 2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1);
tmp1[2 * GRPC_HTTPCLI_MAX_HEADER_LENGTH - 1] = 0; tmp1[2 * GRPC_HTTP_PARSER_MAX_HEADER_LENGTH - 1] = 0;
gpr_asprintf(&tmp2, "HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1); gpr_asprintf(&tmp2, "HTTP/1.0 200 OK\r\nxyz: %s\r\n\r\n", tmp1);
test_fails(split_modes[i], tmp2); test_fails(split_modes[i], tmp2);
gpr_free(tmp1); gpr_free(tmp1);

@ -1,5 +1,5 @@
#!/usr/bin/env python2.7 #!/usr/bin/env python2.7
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without

@ -44,7 +44,7 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include "src/core/security/json_token.h" #include "src/core/security/json_token.h"
#include "src/core/support/env.h" #include "src/core/support/env.h"
#include "src/core/support/tmpfile.h" #include "src/core/support/tmpfile.h"
@ -536,12 +536,12 @@ static void validate_compute_engine_http_request(
GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "metadata") == 0); GPR_ASSERT(strcmp(request->host, "metadata") == 0);
GPR_ASSERT( GPR_ASSERT(
strcmp(request->path, strcmp(request->http.path,
"/computeMetadata/v1/instance/service-accounts/default/token") == "/computeMetadata/v1/instance/service-accounts/default/token") ==
0); 0);
GPR_ASSERT(request->hdr_count == 1); GPR_ASSERT(request->http.hdr_count == 1);
GPR_ASSERT(strcmp(request->hdrs[0].key, "Metadata-Flavor") == 0); GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Metadata-Flavor") == 0);
GPR_ASSERT(strcmp(request->hdrs[0].value, "Google") == 0); GPR_ASSERT(strcmp(request->http.hdrs[0].value, "Google") == 0);
} }
static int compute_engine_httpcli_get_success_override( static int compute_engine_httpcli_get_success_override(
@ -639,11 +639,12 @@ static void validate_refresh_token_http_request(
gpr_free(expected_body); gpr_free(expected_body);
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0); GPR_ASSERT(strcmp(request->host, GRPC_GOOGLE_OAUTH2_SERVICE_HOST) == 0);
GPR_ASSERT(strcmp(request->path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
GPR_ASSERT(request->hdr_count == 1);
GPR_ASSERT(strcmp(request->hdrs[0].key, "Content-Type") == 0);
GPR_ASSERT( GPR_ASSERT(
strcmp(request->hdrs[0].value, "application/x-www-form-urlencoded") == 0); strcmp(request->http.path, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH) == 0);
GPR_ASSERT(request->http.hdr_count == 1);
GPR_ASSERT(strcmp(request->http.hdrs[0].key, "Content-Type") == 0);
GPR_ASSERT(strcmp(request->http.hdrs[0].value,
"application/x-www-form-urlencoded") == 0);
} }
static int refresh_token_httpcli_post_success( static int refresh_token_httpcli_post_success(
@ -898,12 +899,12 @@ static int default_creds_gce_detection_httpcli_get_success_override(
gpr_timespec deadline, grpc_httpcli_response_cb on_response, gpr_timespec deadline, grpc_httpcli_response_cb on_response,
void *user_data) { void *user_data) {
grpc_httpcli_response response = http_response(200, ""); grpc_httpcli_response response = http_response(200, "");
grpc_httpcli_header header; grpc_http_header header;
header.key = "Metadata-Flavor"; header.key = "Metadata-Flavor";
header.value = "Google"; header.value = "Google";
response.hdr_count = 1; response.hdr_count = 1;
response.hdrs = &header; response.hdrs = &header;
GPR_ASSERT(strcmp(request->path, "/") == 0); GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
on_response(exec_ctx, user_data, &response); on_response(exec_ctx, user_data, &response);
return 1; return 1;
@ -961,7 +962,7 @@ static int default_creds_gce_detection_httpcli_get_failure_override(
void *user_data) { void *user_data) {
/* No magic header. */ /* No magic header. */
grpc_httpcli_response response = http_response(200, ""); grpc_httpcli_response response = http_response(200, "");
GPR_ASSERT(strcmp(request->path, "/") == 0); GPR_ASSERT(strcmp(request->http.path, "/") == 0);
GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
on_response(exec_ctx, user_data, &response); on_response(exec_ctx, user_data, &response);
return 1; return 1;

@ -35,7 +35,7 @@
#include <string.h> #include <string.h>
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
#include "src/core/security/b64.h" #include "src/core/security/b64.h"
#include "src/core/security/json_token.h" #include "src/core/security/json_token.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
@ -288,7 +288,7 @@ static int httpcli_get_google_keys_for_email(
grpc_httpcli_response response = http_response(200, good_google_email_keys()); grpc_httpcli_response response = http_response(200, good_google_email_keys());
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0); GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
GPR_ASSERT(strcmp(request->path, GPR_ASSERT(strcmp(request->http.path,
"/robot/v1/metadata/x509/" "/robot/v1/metadata/x509/"
"777-abaslkan11hlb6nmim3bpspl31ud@developer." "777-abaslkan11hlb6nmim3bpspl31ud@developer."
"gserviceaccount.com") == 0); "gserviceaccount.com") == 0);
@ -336,7 +336,7 @@ static int httpcli_get_custom_keys_for_email(
grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set)); grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0); GPR_ASSERT(strcmp(request->host, "keys.bar.com") == 0);
GPR_ASSERT(strcmp(request->path, "/jwk/foo@bar.com") == 0); GPR_ASSERT(strcmp(request->http.path, "/jwk/foo@bar.com") == 0);
on_response(exec_ctx, user_data, &response); on_response(exec_ctx, user_data, &response);
gpr_free(response.body); gpr_free(response.body);
return 1; return 1;
@ -372,7 +372,7 @@ static int httpcli_get_jwk_set(grpc_exec_ctx *exec_ctx,
grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set)); grpc_httpcli_response response = http_response(200, gpr_strdup(good_jwk_set));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0); GPR_ASSERT(strcmp(request->host, "www.googleapis.com") == 0);
GPR_ASSERT(strcmp(request->path, "/oauth2/v3/certs") == 0); GPR_ASSERT(strcmp(request->http.path, "/oauth2/v3/certs") == 0);
on_response(exec_ctx, user_data, &response); on_response(exec_ctx, user_data, &response);
gpr_free(response.body); gpr_free(response.body);
return 1; return 1;
@ -387,7 +387,7 @@ static int httpcli_get_openid_config(grpc_exec_ctx *exec_ctx,
http_response(200, gpr_strdup(good_openid_config)); http_response(200, gpr_strdup(good_openid_config));
GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker == &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0); GPR_ASSERT(strcmp(request->host, "accounts.google.com") == 0);
GPR_ASSERT(strcmp(request->path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0); GPR_ASSERT(strcmp(request->http.path, GRPC_OPENID_CONFIG_URL_SUFFIX) == 0);
grpc_httpcli_set_override(httpcli_get_jwk_set, grpc_httpcli_set_override(httpcli_get_jwk_set,
httpcli_post_should_not_be_called); httpcli_post_should_not_be_called);
on_response(exec_ctx, user_data, &response); on_response(exec_ctx, user_data, &response);

@ -36,11 +36,11 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "src/core/support/string.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/support/string.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
@ -128,11 +128,10 @@ void test_decoding(void) {
decode_suite('H', gpr_time_from_hours); decode_suite('H', gpr_time_from_hours);
assert_decodes_as("1000000000S", assert_decodes_as("1000000000S",
gpr_time_from_seconds(1000 * 1000 * 1000, GPR_TIMESPAN)); gpr_time_from_seconds(1000 * 1000 * 1000, GPR_TIMESPAN));
assert_decodes_as("1000000000000000000000u", assert_decodes_as("1000000000000000000000u", gpr_inf_future(GPR_TIMESPAN));
gpr_inf_future(GPR_CLOCK_REALTIME)); assert_decodes_as("1000000001S", gpr_inf_future(GPR_TIMESPAN));
assert_decodes_as("1000000001S", gpr_inf_future(GPR_CLOCK_REALTIME)); assert_decodes_as("2000000001S", gpr_inf_future(GPR_TIMESPAN));
assert_decodes_as("2000000001S", gpr_inf_future(GPR_CLOCK_REALTIME)); assert_decodes_as("9999999999S", gpr_inf_future(GPR_TIMESPAN));
assert_decodes_as("9999999999S", gpr_inf_future(GPR_CLOCK_REALTIME));
} }
void test_decoding_fails(void) { void test_decoding_fails(void) {

@ -49,6 +49,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/http/httpcli.h"
#include "src/core/support/env.h" #include "src/core/support/env.h"
#include "test/core/util/port_server_client.h" #include "test/core/util/port_server_client.h"

@ -47,7 +47,7 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/httpcli/httpcli.h" #include "src/core/http/httpcli.h"
typedef struct freereq { typedef struct freereq {
gpr_mu *mu; gpr_mu *mu;
@ -91,7 +91,7 @@ void grpc_free_port_using_server(char *server, int port) {
req.host = server; req.host = server;
gpr_asprintf(&path, "/drop/%d", port); gpr_asprintf(&path, "/drop/%d", port);
req.path = path; req.http.path = path;
grpc_httpcli_context_init(&context); grpc_httpcli_context_init(&context);
grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req, grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req,
@ -150,7 +150,7 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg,
GPR_TIMESPAN))); GPR_TIMESPAN)));
pr->retries++; pr->retries++;
req.host = pr->server; req.host = pr->server;
req.path = "/get"; req.http.path = "/get";
grpc_httpcli_get(exec_ctx, pr->ctx, pr->pollset, &req, grpc_httpcli_get(exec_ctx, pr->ctx, pr->pollset, &req,
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server,
pr); pr);
@ -189,7 +189,7 @@ int grpc_pick_port_using_server(char *server) {
pr.ctx = &context; pr.ctx = &context;
req.host = server; req.host = server;
req.path = "/get"; req.http.path = "/get";
grpc_httpcli_context_init(&context); grpc_httpcli_context_init(&context);
grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req, grpc_httpcli_get(&exec_ctx, &context, pr.pollset, &req,

@ -47,6 +47,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/support/env.h" #include "src/core/support/env.h"
#include "src/core/http/httpcli.h"
#include "src/core/iomgr/sockaddr_utils.h" #include "src/core/iomgr/sockaddr_utils.h"
#include "test/core/util/port_server_client.h" #include "test/core/util/port_server_client.h"

@ -806,9 +806,9 @@ src/core/client_config/uri_parser.h \
src/core/compression/algorithm_metadata.h \ src/core/compression/algorithm_metadata.h \
src/core/compression/message_compress.h \ src/core/compression/message_compress.h \
src/core/debug/trace.h \ src/core/debug/trace.h \
src/core/httpcli/format_request.h \ src/core/http/format_request.h \
src/core/httpcli/httpcli.h \ src/core/http/httpcli.h \
src/core/httpcli/parser.h \ src/core/http/parser.h \
src/core/iomgr/closure.h \ src/core/iomgr/closure.h \
src/core/iomgr/endpoint.h \ src/core/iomgr/endpoint.h \
src/core/iomgr/endpoint_pair.h \ src/core/iomgr/endpoint_pair.h \
@ -948,9 +948,9 @@ src/core/client_config/uri_parser.c \
src/core/compression/compression_algorithm.c \ src/core/compression/compression_algorithm.c \
src/core/compression/message_compress.c \ src/core/compression/message_compress.c \
src/core/debug/trace.c \ src/core/debug/trace.c \
src/core/httpcli/format_request.c \ src/core/http/format_request.c \
src/core/httpcli/httpcli.c \ src/core/http/httpcli.c \
src/core/httpcli/parser.c \ src/core/http/parser.c \
src/core/iomgr/closure.c \ src/core/iomgr/closure.c \
src/core/iomgr/endpoint.c \ src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \ src/core/iomgr/endpoint_pair_posix.c \
@ -1048,7 +1048,7 @@ src/core/transport/metadata_batch.c \
src/core/transport/static_metadata.c \ src/core/transport/static_metadata.c \
src/core/transport/transport.c \ src/core/transport/transport.c \
src/core/transport/transport_op_string.c \ src/core/transport/transport_op_string.c \
src/core/httpcli/httpcli_security_connector.c \ src/core/http/httpcli_security_connector.c \
src/core/security/b64.c \ src/core/security/b64.c \
src/core/security/client_auth_filter.c \ src/core/security/client_auth_filter.c \
src/core/security/credentials.c \ src/core/security/credentials.c \

@ -923,9 +923,9 @@
], ],
"headers": [], "headers": [],
"language": "c", "language": "c",
"name": "httpcli_format_request_test", "name": "http_parser_test",
"src": [ "src": [
"test/core/httpcli/format_request_test.c" "test/core/http/parser_test.c"
], ],
"third_party": false, "third_party": false,
"type": "target" "type": "target"
@ -939,9 +939,9 @@
], ],
"headers": [], "headers": [],
"language": "c", "language": "c",
"name": "httpcli_parser_test", "name": "httpcli_format_request_test",
"src": [ "src": [
"test/core/httpcli/parser_test.c" "test/core/http/format_request_test.c"
], ],
"third_party": false, "third_party": false,
"type": "target" "type": "target"
@ -957,7 +957,7 @@
"language": "c", "language": "c",
"name": "httpcli_test", "name": "httpcli_test",
"src": [ "src": [
"test/core/httpcli/httpcli_test.c" "test/core/http/httpcli_test.c"
], ],
"third_party": false, "third_party": false,
"type": "target" "type": "target"
@ -973,7 +973,7 @@
"language": "c", "language": "c",
"name": "httpscli_test", "name": "httpscli_test",
"src": [ "src": [
"test/core/httpcli/httpscli_test.c" "test/core/http/httpscli_test.c"
], ],
"third_party": false, "third_party": false,
"type": "target" "type": "target"
@ -3960,9 +3960,9 @@
"src/core/compression/algorithm_metadata.h", "src/core/compression/algorithm_metadata.h",
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h", "src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h", "src/core/iomgr/endpoint_pair.h",
@ -4158,13 +4158,13 @@
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.c", "src/core/debug/trace.c",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.c", "src/core/http/format_request.c",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.c", "src/core/http/httpcli.c",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/httpcli_security_connector.c", "src/core/http/httpcli_security_connector.c",
"src/core/httpcli/parser.c", "src/core/http/parser.c",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.c", "src/core/iomgr/closure.c",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.c", "src/core/iomgr/endpoint.c",
@ -4588,9 +4588,9 @@
"src/core/compression/algorithm_metadata.h", "src/core/compression/algorithm_metadata.h",
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.h", "src/core/iomgr/endpoint.h",
"src/core/iomgr/endpoint_pair.h", "src/core/iomgr/endpoint_pair.h",
@ -4771,12 +4771,12 @@
"src/core/compression/message_compress.h", "src/core/compression/message_compress.h",
"src/core/debug/trace.c", "src/core/debug/trace.c",
"src/core/debug/trace.h", "src/core/debug/trace.h",
"src/core/httpcli/format_request.c", "src/core/http/format_request.c",
"src/core/httpcli/format_request.h", "src/core/http/format_request.h",
"src/core/httpcli/httpcli.c", "src/core/http/httpcli.c",
"src/core/httpcli/httpcli.h", "src/core/http/httpcli.h",
"src/core/httpcli/parser.c", "src/core/http/parser.c",
"src/core/httpcli/parser.h", "src/core/http/parser.h",
"src/core/iomgr/closure.c", "src/core/iomgr/closure.c",
"src/core/iomgr/closure.h", "src/core/iomgr/closure.h",
"src/core/iomgr/endpoint.c", "src/core/iomgr/endpoint.c",

@ -0,0 +1,25 @@
Stress Test client Specification
=========================
This document specifies the features a stress test client should implement in order to work with the stress testing framework. The stress test clients are executed against the existing interop test servers.
**Requirements**
--------------
**1.** A stress test client should be able to repeatedly execute one or more of the existing 'interop test cases'. It may just be a wrapper around the existing interop test client. The exact command line arguments the client should support are listed in _Table 1_ below.
**2.** The stress test client must implement a metrics server defined by _[metrics.proto](https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/metrics.proto)_ and must expose _qps_ as a long-valued Gauge. The client can track the overall _qps_ in one Gauge or in multiple Gagues (for example: One per Channel or Stub).
The framework periodically queries the _qps_ by calling the `GetAllGauges()` method (the framework assumes that all the returned Gauges are _qps_ Gauges) and uses this to determine if the stress test client is running or crashed or stalled.
> *Note:* In this context, the term _**qps**_ means _interop test cases per second_ (not _messages per second_ or _rpc calls per second_)
**Table 1:** Command line arguments that should be supported by the stress test client.
>_**Note** The current C++ [stress client](https://github.com/grpc/grpc/blob/master/test/cpp/interop/stress_test.cc) supports more flags than those listed here but those flags will soon be deprecated_|
Parameter | Description
----------------------|---------------------------------
`--server_address` | The stress client should accept a list of server addresses in the following format:<br> ```<name_1>:<port_1>,<name_2>:<port_2>..<name_N>:<port_N>``` <br> _Note:_ `<name>` can be either server name or IP address.<br><br>_Type:_ string <br>_default:_ ```localhost:8080``` <br>_Example:_ ``foo.foobar.com:8080,bar.foobar.com:8080`` <br><br> Currently, the stress test framework only passes one server address to the client.
`--test_cases` | List of test cases along with the relative weights in the following format:<br> `<testcase_1:w_1>,<testcase_2:w_2>...<testcase_n:w_n>`. <br> The test cases names are the same as those currently used by the interop clients<br><br>_Type:_ string <br>_Example:_ `empty_unary:20,large_unary:10,empty_stream:70` <br>(The stress client would then make `empty_unary` calls 20% of the time, `large_unary` calls 10% of the time and `empty_stream` calls 70% of the time.) <br>_Note:_ The weights need not add up to 100.
`--test_duration-secs` | The test duration in seconds. A value of -1 means that the test should run forever until forcefully terminated. <br>_Type:_ int <br>_default:_ -1
`--num_channels_per_server` | Number of channels (i.e connections) to each server. <br> _Type:_ int <br> _default:_ 1 <br><br> _Note:_ Unfortunately, the term `channel` is used differently in `grpc-java` and `C based grpc`. In this context, this really means "number of connections to the server"
`--num_stubs_per_channel ` | Number of client stubs per each connection to server.<br>_Type:_ int <br>_default:_ 1
`--metrics_port` | The port at which the stress client exposes [QPS metrics](https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/metrics.proto). <br>_Type:_ int <br>_default:_ 8081

@ -1094,7 +1094,7 @@
"flaky": false, "flaky": false,
"gtest": false, "gtest": false,
"language": "c", "language": "c",
"name": "httpcli_format_request_test", "name": "http_parser_test",
"platforms": [ "platforms": [
"linux", "linux",
"mac", "mac",
@ -1115,7 +1115,7 @@
"flaky": false, "flaky": false,
"gtest": false, "gtest": false,
"language": "c", "language": "c",
"name": "httpcli_parser_test", "name": "httpcli_format_request_test",
"platforms": [ "platforms": [
"linux", "linux",
"mac", "mac",

@ -663,7 +663,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hpack_table_test", "vcxproj
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "httpcli_format_request_test", "vcxproj\test\httpcli_format_request_test\httpcli_format_request_test.vcxproj", "{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "http_parser_test", "vcxproj\test\http_parser_test\http_parser_test.vcxproj", "{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}"
ProjectSection(myProperties) = preProject ProjectSection(myProperties) = preProject
lib = "False" lib = "False"
EndProjectSection EndProjectSection
@ -674,7 +674,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "httpcli_format_request_test
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "httpcli_parser_test", "vcxproj\test\httpcli_parser_test\httpcli_parser_test.vcxproj", "{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "httpcli_format_request_test", "vcxproj\test\httpcli_format_request_test\httpcli_format_request_test.vcxproj", "{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}"
ProjectSection(myProperties) = preProject ProjectSection(myProperties) = preProject
lib = "False" lib = "False"
EndProjectSection EndProjectSection
@ -2405,6 +2405,22 @@ Global
{FF2CEE6D-850F-E22C-53A0-8C5912B14B20}.Release-DLL|Win32.Build.0 = Release|Win32 {FF2CEE6D-850F-E22C-53A0-8C5912B14B20}.Release-DLL|Win32.Build.0 = Release|Win32
{FF2CEE6D-850F-E22C-53A0-8C5912B14B20}.Release-DLL|x64.ActiveCfg = Release|x64 {FF2CEE6D-850F-E22C-53A0-8C5912B14B20}.Release-DLL|x64.ActiveCfg = Release|x64
{FF2CEE6D-850F-E22C-53A0-8C5912B14B20}.Release-DLL|x64.Build.0 = Release|x64 {FF2CEE6D-850F-E22C-53A0-8C5912B14B20}.Release-DLL|x64.Build.0 = Release|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug|Win32.ActiveCfg = Debug|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug|x64.ActiveCfg = Debug|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release|Win32.ActiveCfg = Release|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release|x64.ActiveCfg = Release|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug|Win32.Build.0 = Debug|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug|x64.Build.0 = Debug|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release|Win32.Build.0 = Release|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release|x64.Build.0 = Release|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug-DLL|Win32.Build.0 = Debug|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug-DLL|x64.ActiveCfg = Debug|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Debug-DLL|x64.Build.0 = Debug|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release-DLL|Win32.ActiveCfg = Release|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release-DLL|Win32.Build.0 = Release|Win32
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release-DLL|x64.ActiveCfg = Release|x64
{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}.Release-DLL|x64.Build.0 = Release|x64
{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Debug|Win32.ActiveCfg = Debug|Win32 {A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Debug|Win32.ActiveCfg = Debug|Win32
{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Debug|x64.ActiveCfg = Debug|x64 {A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Debug|x64.ActiveCfg = Debug|x64
{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release|Win32.ActiveCfg = Release|Win32 {A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release|Win32.ActiveCfg = Release|Win32
@ -2421,22 +2437,6 @@ Global
{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release-DLL|Win32.Build.0 = Release|Win32 {A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release-DLL|Win32.Build.0 = Release|Win32
{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release-DLL|x64.ActiveCfg = Release|x64 {A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release-DLL|x64.ActiveCfg = Release|x64
{A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release-DLL|x64.Build.0 = Release|x64 {A43C3292-CAE7-1B8C-A5FD-52D9E3DCFD82}.Release-DLL|x64.Build.0 = Release|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug|Win32.ActiveCfg = Debug|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug|x64.ActiveCfg = Debug|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release|Win32.ActiveCfg = Release|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release|x64.ActiveCfg = Release|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug|Win32.Build.0 = Debug|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug|x64.Build.0 = Debug|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release|Win32.Build.0 = Release|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release|x64.Build.0 = Release|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug-DLL|Win32.Build.0 = Debug|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug-DLL|x64.ActiveCfg = Debug|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Debug-DLL|x64.Build.0 = Debug|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release-DLL|Win32.ActiveCfg = Release|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release-DLL|Win32.Build.0 = Release|Win32
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release-DLL|x64.ActiveCfg = Release|x64
{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}.Release-DLL|x64.Build.0 = Release|x64
{117CA7AD-C42B-9217-6C95-42A801777BC5}.Debug|Win32.ActiveCfg = Debug|Win32 {117CA7AD-C42B-9217-6C95-42A801777BC5}.Debug|Win32.ActiveCfg = Debug|Win32
{117CA7AD-C42B-9217-6C95-42A801777BC5}.Debug|x64.ActiveCfg = Debug|x64 {117CA7AD-C42B-9217-6C95-42A801777BC5}.Debug|x64.ActiveCfg = Debug|x64
{117CA7AD-C42B-9217-6C95-42A801777BC5}.Release|Win32.ActiveCfg = Release|Win32 {117CA7AD-C42B-9217-6C95-42A801777BC5}.Release|Win32.ActiveCfg = Release|Win32

@ -315,9 +315,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\compression\algorithm_metadata.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\compression\algorithm_metadata.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\compression\message_compress.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\compression\message_compress.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\format_request.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\http\format_request.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\httpcli.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\http\httpcli.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\parser.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\http\parser.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h" />
@ -493,11 +493,11 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c"> <ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\format_request.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\format_request.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\httpcli.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\httpcli.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\parser.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\parser.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c"> <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c">
</ClCompile> </ClCompile>
@ -693,7 +693,7 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\transport\transport_op_string.c"> <ClCompile Include="$(SolutionDir)\..\src\core\transport\transport_op_string.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\httpcli_security_connector.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\httpcli_security_connector.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\security\b64.c"> <ClCompile Include="$(SolutionDir)\..\src\core\security\b64.c">
</ClCompile> </ClCompile>

@ -103,14 +103,14 @@
<ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c"> <ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c">
<Filter>src\core\debug</Filter> <Filter>src\core\debug</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\format_request.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\format_request.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\httpcli.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\httpcli.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\parser.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\parser.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c"> <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
@ -403,8 +403,8 @@
<ClCompile Include="$(SolutionDir)\..\src\core\transport\transport_op_string.c"> <ClCompile Include="$(SolutionDir)\..\src\core\transport\transport_op_string.c">
<Filter>src\core\transport</Filter> <Filter>src\core\transport</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\httpcli_security_connector.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\httpcli_security_connector.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\security\b64.c"> <ClCompile Include="$(SolutionDir)\..\src\core\security\b64.c">
<Filter>src\core\security</Filter> <Filter>src\core\security</Filter>
@ -635,14 +635,14 @@
<ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h"> <ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h">
<Filter>src\core\debug</Filter> <Filter>src\core\debug</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\format_request.h"> <ClInclude Include="$(SolutionDir)\..\src\core\http\format_request.h">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\httpcli.h"> <ClInclude Include="$(SolutionDir)\..\src\core\http\httpcli.h">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\parser.h"> <ClInclude Include="$(SolutionDir)\..\src\core\http\parser.h">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h"> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
@ -1001,8 +1001,8 @@
<Filter Include="src\core\debug"> <Filter Include="src\core\debug">
<UniqueIdentifier>{1da7ef8a-a06d-5499-b3de-19fee4a4214d}</UniqueIdentifier> <UniqueIdentifier>{1da7ef8a-a06d-5499-b3de-19fee4a4214d}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="src\core\httpcli"> <Filter Include="src\core\http">
<UniqueIdentifier>{a9bc00ad-835f-c625-c6d9-6a1324f98b9f}</UniqueIdentifier> <UniqueIdentifier>{404fdb9e-a69c-81d4-035b-465c826115a9}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="src\core\iomgr"> <Filter Include="src\core\iomgr">
<UniqueIdentifier>{1baf3894-af37-e647-bdbc-95dc17ed0073}</UniqueIdentifier> <UniqueIdentifier>{1baf3894-af37-e647-bdbc-95dc17ed0073}</UniqueIdentifier>

@ -305,9 +305,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\compression\algorithm_metadata.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\compression\algorithm_metadata.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\compression\message_compress.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\compression\message_compress.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\format_request.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\http\format_request.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\httpcli.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\http\httpcli.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\parser.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\http\parser.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\endpoint_pair.h" />
@ -471,11 +471,11 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c"> <ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\format_request.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\format_request.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\httpcli.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\httpcli.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\parser.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\parser.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c"> <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c">
</ClCompile> </ClCompile>

@ -106,14 +106,14 @@
<ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c"> <ClCompile Include="$(SolutionDir)\..\src\core\debug\trace.c">
<Filter>src\core\debug</Filter> <Filter>src\core\debug</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\format_request.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\format_request.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\httpcli.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\httpcli.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\httpcli\parser.c"> <ClCompile Include="$(SolutionDir)\..\src\core\http\parser.c">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c"> <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\closure.c">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
@ -572,14 +572,14 @@
<ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h"> <ClInclude Include="$(SolutionDir)\..\src\core\debug\trace.h">
<Filter>src\core\debug</Filter> <Filter>src\core\debug</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\format_request.h"> <ClInclude Include="$(SolutionDir)\..\src\core\http\format_request.h">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\httpcli.h"> <ClInclude Include="$(SolutionDir)\..\src\core\http\httpcli.h">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\httpcli\parser.h"> <ClInclude Include="$(SolutionDir)\..\src\core\http\parser.h">
<Filter>src\core\httpcli</Filter> <Filter>src\core\http</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h"> <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\closure.h">
<Filter>src\core\iomgr</Filter> <Filter>src\core\iomgr</Filter>
@ -896,8 +896,8 @@
<Filter Include="src\core\debug"> <Filter Include="src\core\debug">
<UniqueIdentifier>{6d8d5774-7291-554d-fafa-583463cd3fd9}</UniqueIdentifier> <UniqueIdentifier>{6d8d5774-7291-554d-fafa-583463cd3fd9}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="src\core\httpcli"> <Filter Include="src\core\http">
<UniqueIdentifier>{1ba3a245-47e7-89b5-b0c9-aca758bd0277}</UniqueIdentifier> <UniqueIdentifier>{46faed8e-5cd4-98b0-05ed-ff2ac7bc2d46}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="src\core\iomgr"> <Filter Include="src\core\iomgr">
<UniqueIdentifier>{a9df8b24-ecea-ff6d-8999-d8fa54cd70bf}</UniqueIdentifier> <UniqueIdentifier>{a9df8b24-ecea-ff6d-8999-d8fa54cd70bf}</UniqueIdentifier>

@ -20,7 +20,7 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{B6F60D1C-D4F3-0F1A-4A2F-9134629B7848}</ProjectGuid> <ProjectGuid>{49D7E690-BDA1-5236-1ABF-3D81C1559DF7}</ProjectGuid>
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected>
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
@ -60,14 +60,14 @@
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> <PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>httpcli_parser_test</TargetName> <TargetName>http_parser_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> <Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> <Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'"> <PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>httpcli_parser_test</TargetName> <TargetName>http_parser_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib> <Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
@ -158,7 +158,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\httpcli\parser_test.c"> <ClCompile Include="$(SolutionDir)\..\test\core\http\parser_test.c">
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\httpcli\parser_test.c"> <ClCompile Include="$(SolutionDir)\..\test\core\http\parser_test.c">
<Filter>test\core\httpcli</Filter> <Filter>test\core\http</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="test"> <Filter Include="test">
<UniqueIdentifier>{f3562e8b-3020-c79a-4e3b-c895f9e49f44}</UniqueIdentifier> <UniqueIdentifier>{1d07f09d-a0ec-d684-3589-bff02afbe830}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core"> <Filter Include="test\core">
<UniqueIdentifier>{db527686-b5c7-68df-a106-bd919f60742a}</UniqueIdentifier> <UniqueIdentifier>{eedab59d-9f19-9172-cf0e-83a839217afc}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core\httpcli"> <Filter Include="test\core\http">
<UniqueIdentifier>{8e60d460-93de-c6e1-b67b-bfae71bd9bca}</UniqueIdentifier> <UniqueIdentifier>{1fcac48f-3718-00ea-6c0c-aafa1a4de528}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -158,7 +158,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\httpcli\format_request_test.c"> <ClCompile Include="$(SolutionDir)\..\test\core\http\format_request_test.c">
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\httpcli\format_request_test.c"> <ClCompile Include="$(SolutionDir)\..\test\core\http\format_request_test.c">
<Filter>test\core\httpcli</Filter> <Filter>test\core\http</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
@ -13,8 +13,8 @@
<Filter Include="test\core"> <Filter Include="test\core">
<UniqueIdentifier>{f033cf49-b830-5698-3989-6ec75817333b}</UniqueIdentifier> <UniqueIdentifier>{f033cf49-b830-5698-3989-6ec75817333b}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core\httpcli"> <Filter Include="test\core\http">
<UniqueIdentifier>{75330e6a-521e-5f90-defd-652a4591dbe9}</UniqueIdentifier> <UniqueIdentifier>{51615bc9-b61d-8d7d-9abb-5409276c04ec}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>

Loading…
Cancel
Save