From fbd8ebe7cde8761ce88bf848642ee9d4f00cd3c8 Mon Sep 17 00:00:00 2001 From: gRPC Team Bot Date: Wed, 29 May 2024 16:06:17 -0700 Subject: [PATCH 1/3] Automated rollback of commit db2d775ffcb860956276b4db2e036632e108a0b0. PiperOrigin-RevId: 638442984 --- BUILD | 12 ++++---- CMakeLists.txt | 14 +++++----- Makefile | 8 +++--- Package.swift | 16 +++++------ build_autogenerated.yaml | 28 +++++++++---------- config.m4 | 10 +++---- config.w32 | 10 +++---- gRPC-C++.podspec | 16 +++++------ gRPC-Core.podspec | 24 ++++++++-------- grpc.gemspec | 16 +++++------ package.xml | 16 +++++------ src/core/BUILD | 4 +-- src/core/ext/gcp/metadata_query.h | 4 +-- .../chttp2/transport/chttp2_transport.cc | 2 +- .../http_connect/http_connect_handshaker.cc | 4 +-- .../http}/format_request.cc | 7 ++--- .../http_client => lib/http}/format_request.h | 11 ++++---- .../{util/http_client => lib/http}/httpcli.cc | 9 +++--- .../{util/http_client => lib/http}/httpcli.h | 11 ++++---- .../http}/httpcli_security_connector.cc | 3 +- .../http}/httpcli_ssl_credentials.h | 9 +++--- .../{util/http_client => lib/http}/parser.cc | 5 ++-- .../{util/http_client => lib/http}/parser.h | 9 +++--- .../aws_external_account_credentials.cc | 2 +- .../aws_external_account_credentials.h | 4 +-- .../external/external_account_credentials.cc | 4 +-- .../external/external_account_credentials.h | 4 +-- .../url_external_account_credentials.cc | 4 +-- .../url_external_account_credentials.h | 2 +- .../google_default_credentials.cc | 4 +-- .../security/credentials/jwt/jwt_verifier.cc | 6 ++-- .../credentials/oauth2/oauth2_credentials.cc | 2 +- .../credentials/oauth2/oauth2_credentials.h | 4 +-- src/python/grpcio/grpc_core_dependencies.py | 8 +++--- .../end2end/fixtures/http_proxy_fixture.cc | 2 +- test/core/http/format_request_test.cc | 4 +-- test/core/http/httpcli_test.cc | 2 +- test/core/http/httpscli_test.cc | 6 ++-- test/core/http/parser_test.cc | 2 +- test/core/http/request_fuzzer.cc | 2 +- test/core/http/response_fuzzer.cc | 2 +- test/core/security/credentials_test.cc | 4 +-- test/core/security/jwt_verifier_test.cc | 2 +- test/core/test_util/port_server_client.cc | 4 +-- tools/doxygen/Doxyfile.c++.internal | 16 +++++------ tools/doxygen/Doxyfile.core.internal | 16 +++++------ 46 files changed, 173 insertions(+), 181 deletions(-) rename src/core/{util/http_client => lib/http}/format_request.cc (97%) rename src/core/{util/http_client => lib/http}/format_request.h (86%) rename src/core/{util/http_client => lib/http}/httpcli.cc (99%) rename src/core/{util/http_client => lib/http}/httpcli.h (98%) rename src/core/{util/http_client => lib/http}/httpcli_security_connector.cc (99%) rename src/core/{util/http_client => lib/http}/httpcli_ssl_credentials.h (85%) rename src/core/{util/http_client => lib/http}/parser.cc (99%) rename src/core/{util/http_client => lib/http}/parser.h (96%) diff --git a/BUILD b/BUILD index f2caa63ed0d..91e125bac85 100644 --- a/BUILD +++ b/BUILD @@ -3916,14 +3916,14 @@ grpc_cc_library( grpc_cc_library( name = "httpcli", srcs = [ - "//src/core:util/http_client/format_request.cc", - "//src/core:util/http_client/httpcli.cc", - "//src/core:util/http_client/parser.cc", + "//src/core:lib/http/format_request.cc", + "//src/core:lib/http/httpcli.cc", + "//src/core:lib/http/parser.cc", ], hdrs = [ - "//src/core:util/http_client/format_request.h", - "//src/core:util/http_client/httpcli.h", - "//src/core:util/http_client/parser.h", + "//src/core:lib/http/format_request.h", + "//src/core:lib/http/httpcli.h", + "//src/core:lib/http/parser.h", ], external_deps = [ "absl/base:core_headers", diff --git a/CMakeLists.txt b/CMakeLists.txt index 64da739cd32..28872783538 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2315,6 +2315,10 @@ add_library(grpc src/core/lib/gprpp/validation_errors.cc src/core/lib/gprpp/windows/directory_reader.cc src/core/lib/gprpp/work_serializer.cc + src/core/lib/http/format_request.cc + src/core/lib/http/httpcli.cc + src/core/lib/http/httpcli_security_connector.cc + src/core/lib/http/parser.cc src/core/lib/iomgr/buffer_list.cc src/core/lib/iomgr/call_combiner.cc src/core/lib/iomgr/cfstream_handle.cc @@ -2604,10 +2608,6 @@ add_library(grpc src/core/tsi/ssl_transport_security_utils.cc src/core/tsi/transport_security.cc src/core/tsi/transport_security_grpc.cc - src/core/util/http_client/format_request.cc - src/core/util/http_client/httpcli.cc - src/core/util/http_client/httpcli_security_connector.cc - src/core/util/http_client/parser.cc src/core/util/json/json_object_loader.cc src/core/util/json/json_reader.cc src/core/util/json/json_util.cc @@ -3109,6 +3109,9 @@ add_library(grpc_unsecure src/core/lib/gprpp/uuid_v4.cc src/core/lib/gprpp/validation_errors.cc src/core/lib/gprpp/work_serializer.cc + src/core/lib/http/format_request.cc + src/core/lib/http/httpcli.cc + src/core/lib/http/parser.cc src/core/lib/iomgr/buffer_list.cc src/core/lib/iomgr/call_combiner.cc src/core/lib/iomgr/cfstream_handle.cc @@ -3326,9 +3329,6 @@ add_library(grpc_unsecure src/core/tsi/local_transport_security.cc src/core/tsi/transport_security.cc src/core/tsi/transport_security_grpc.cc - src/core/util/http_client/format_request.cc - src/core/util/http_client/httpcli.cc - src/core/util/http_client/parser.cc src/core/util/json/json_object_loader.cc src/core/util/json/json_reader.cc src/core/util/json/json_writer.cc diff --git a/Makefile b/Makefile index fc3701d0415..295a09561bc 100644 --- a/Makefile +++ b/Makefile @@ -1165,6 +1165,10 @@ LIBGRPC_SRC = \ src/core/lib/gprpp/windows/stat.cc \ src/core/lib/gprpp/windows/thd.cc \ src/core/lib/gprpp/work_serializer.cc \ + src/core/lib/http/format_request.cc \ + src/core/lib/http/httpcli.cc \ + src/core/lib/http/httpcli_security_connector.cc \ + src/core/lib/http/parser.cc \ src/core/lib/iomgr/buffer_list.cc \ src/core/lib/iomgr/call_combiner.cc \ src/core/lib/iomgr/cfstream_handle.cc \ @@ -1457,10 +1461,6 @@ LIBGRPC_SRC = \ src/core/util/alloc.cc \ src/core/util/android/log.cc \ src/core/util/atm.cc \ - src/core/util/http_client/format_request.cc \ - src/core/util/http_client/httpcli.cc \ - src/core/util/http_client/httpcli_security_connector.cc \ - src/core/util/http_client/parser.cc \ src/core/util/iphone/cpu.cc \ src/core/util/json/json_object_loader.cc \ src/core/util/json/json_reader.cc \ diff --git a/Package.swift b/Package.swift index 6b411d73c85..87ed22dd266 100644 --- a/Package.swift +++ b/Package.swift @@ -1323,6 +1323,14 @@ let package = Package( "src/core/lib/gprpp/work_serializer.cc", "src/core/lib/gprpp/work_serializer.h", "src/core/lib/gprpp/xxhash_inline.h", + "src/core/lib/http/format_request.cc", + "src/core/lib/http/format_request.h", + "src/core/lib/http/httpcli.cc", + "src/core/lib/http/httpcli.h", + "src/core/lib/http/httpcli_security_connector.cc", + "src/core/lib/http/httpcli_ssl_credentials.h", + "src/core/lib/http/parser.cc", + "src/core/lib/http/parser.h", "src/core/lib/iomgr/block_annotate.h", "src/core/lib/iomgr/buffer_list.cc", "src/core/lib/iomgr/buffer_list.h", @@ -1916,14 +1924,6 @@ let package = Package( "src/core/util/alloc.h", "src/core/util/android/log.cc", "src/core/util/atm.cc", - "src/core/util/http_client/format_request.cc", - "src/core/util/http_client/format_request.h", - "src/core/util/http_client/httpcli.cc", - "src/core/util/http_client/httpcli.h", - "src/core/util/http_client/httpcli_security_connector.cc", - "src/core/util/http_client/httpcli_ssl_credentials.h", - "src/core/util/http_client/parser.cc", - "src/core/util/http_client/parser.h", "src/core/util/iphone/cpu.cc", "src/core/util/json/json.h", "src/core/util/json/json_args.h", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 3adafd444e6..b2d77583ecf 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -910,6 +910,10 @@ libs: - src/core/lib/gprpp/validation_errors.h - src/core/lib/gprpp/work_serializer.h - src/core/lib/gprpp/xxhash_inline.h + - src/core/lib/http/format_request.h + - src/core/lib/http/httpcli.h + - src/core/lib/http/httpcli_ssl_credentials.h + - src/core/lib/http/parser.h - src/core/lib/iomgr/block_annotate.h - src/core/lib/iomgr/buffer_list.h - src/core/lib/iomgr/call_combiner.h @@ -1206,10 +1210,6 @@ libs: - src/core/tsi/transport_security.h - src/core/tsi/transport_security_grpc.h - src/core/tsi/transport_security_interface.h - - src/core/util/http_client/format_request.h - - src/core/util/http_client/httpcli.h - - src/core/util/http_client/httpcli_ssl_credentials.h - - src/core/util/http_client/parser.h - src/core/util/json/json.h - src/core/util/json/json_args.h - src/core/util/json/json_channel_args.h @@ -1731,6 +1731,10 @@ libs: - src/core/lib/gprpp/validation_errors.cc - src/core/lib/gprpp/windows/directory_reader.cc - src/core/lib/gprpp/work_serializer.cc + - src/core/lib/http/format_request.cc + - src/core/lib/http/httpcli.cc + - src/core/lib/http/httpcli_security_connector.cc + - src/core/lib/http/parser.cc - src/core/lib/iomgr/buffer_list.cc - src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc @@ -2020,10 +2024,6 @@ libs: - src/core/tsi/ssl_transport_security_utils.cc - src/core/tsi/transport_security.cc - src/core/tsi/transport_security_grpc.cc - - src/core/util/http_client/format_request.cc - - src/core/util/http_client/httpcli.cc - - src/core/util/http_client/httpcli_security_connector.cc - - src/core/util/http_client/parser.cc - src/core/util/json/json_object_loader.cc - src/core/util/json/json_reader.cc - src/core/util/json/json_util.cc @@ -2453,6 +2453,9 @@ libs: - src/core/lib/gprpp/uuid_v4.h - src/core/lib/gprpp/validation_errors.h - src/core/lib/gprpp/work_serializer.h + - src/core/lib/http/format_request.h + - src/core/lib/http/httpcli.h + - src/core/lib/http/parser.h - src/core/lib/iomgr/block_annotate.h - src/core/lib/iomgr/buffer_list.h - src/core/lib/iomgr/call_combiner.h @@ -2685,9 +2688,6 @@ libs: - src/core/tsi/transport_security.h - src/core/tsi/transport_security_grpc.h - src/core/tsi/transport_security_interface.h - - src/core/util/http_client/format_request.h - - src/core/util/http_client/httpcli.h - - src/core/util/http_client/parser.h - src/core/util/json/json.h - src/core/util/json/json_args.h - src/core/util/json/json_channel_args.h @@ -2889,6 +2889,9 @@ libs: - src/core/lib/gprpp/uuid_v4.cc - src/core/lib/gprpp/validation_errors.cc - src/core/lib/gprpp/work_serializer.cc + - src/core/lib/http/format_request.cc + - src/core/lib/http/httpcli.cc + - src/core/lib/http/parser.cc - src/core/lib/iomgr/buffer_list.cc - src/core/lib/iomgr/call_combiner.cc - src/core/lib/iomgr/cfstream_handle.cc @@ -3106,9 +3109,6 @@ libs: - src/core/tsi/local_transport_security.cc - src/core/tsi/transport_security.cc - src/core/tsi/transport_security_grpc.cc - - src/core/util/http_client/format_request.cc - - src/core/util/http_client/httpcli.cc - - src/core/util/http_client/parser.cc - src/core/util/json/json_object_loader.cc - src/core/util/json/json_reader.cc - src/core/util/json/json_writer.cc diff --git a/config.m4 b/config.m4 index 695063579c5..735a0535aa4 100644 --- a/config.m4 +++ b/config.m4 @@ -540,6 +540,10 @@ if test "$PHP_GRPC" != "no"; then src/core/lib/gprpp/windows/stat.cc \ src/core/lib/gprpp/windows/thd.cc \ src/core/lib/gprpp/work_serializer.cc \ + src/core/lib/http/format_request.cc \ + src/core/lib/http/httpcli.cc \ + src/core/lib/http/httpcli_security_connector.cc \ + src/core/lib/http/parser.cc \ src/core/lib/iomgr/buffer_list.cc \ src/core/lib/iomgr/call_combiner.cc \ src/core/lib/iomgr/cfstream_handle.cc \ @@ -832,10 +836,6 @@ if test "$PHP_GRPC" != "no"; then src/core/util/alloc.cc \ src/core/util/android/log.cc \ src/core/util/atm.cc \ - src/core/util/http_client/format_request.cc \ - src/core/util/http_client/httpcli.cc \ - src/core/util/http_client/httpcli_security_connector.cc \ - src/core/util/http_client/parser.cc \ src/core/util/iphone/cpu.cc \ src/core/util/json/json_object_loader.cc \ src/core/util/json/json_reader.cc \ @@ -1534,6 +1534,7 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/linux) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/posix) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/gprpp/windows) + PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr/event_engine_shims) PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/matchers) @@ -1604,7 +1605,6 @@ if test "$PHP_GRPC" != "no"; then PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi/ssl/session_cache) PHP_ADD_BUILD_DIR($ext_builddir/src/core/util) PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/android) - PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/http_client) PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/iphone) PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/json) PHP_ADD_BUILD_DIR($ext_builddir/src/core/util/linux) diff --git a/config.w32 b/config.w32 index 85a32dc6704..d77e8ab6972 100644 --- a/config.w32 +++ b/config.w32 @@ -505,6 +505,10 @@ if (PHP_GRPC != "no") { "src\\core\\lib\\gprpp\\windows\\stat.cc " + "src\\core\\lib\\gprpp\\windows\\thd.cc " + "src\\core\\lib\\gprpp\\work_serializer.cc " + + "src\\core\\lib\\http\\format_request.cc " + + "src\\core\\lib\\http\\httpcli.cc " + + "src\\core\\lib\\http\\httpcli_security_connector.cc " + + "src\\core\\lib\\http\\parser.cc " + "src\\core\\lib\\iomgr\\buffer_list.cc " + "src\\core\\lib\\iomgr\\call_combiner.cc " + "src\\core\\lib\\iomgr\\cfstream_handle.cc " + @@ -797,10 +801,6 @@ if (PHP_GRPC != "no") { "src\\core\\util\\alloc.cc " + "src\\core\\util\\android\\log.cc " + "src\\core\\util\\atm.cc " + - "src\\core\\util\\http_client\\format_request.cc " + - "src\\core\\util\\http_client\\httpcli.cc " + - "src\\core\\util\\http_client\\httpcli_security_connector.cc " + - "src\\core\\util\\http_client\\parser.cc " + "src\\core\\util\\iphone\\cpu.cc " + "src\\core\\util\\json\\json_object_loader.cc " + "src\\core\\util\\json\\json_reader.cc " + @@ -1671,6 +1671,7 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\linux"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\posix"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\gprpp\\windows"); + FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\http"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\iomgr\\event_engine_shims"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\lib\\matchers"); @@ -1744,7 +1745,6 @@ if (PHP_GRPC != "no") { FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\tsi\\ssl\\session_cache"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\android"); - FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\http_client"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\iphone"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\json"); FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\util\\linux"); diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 90a2f3849fc..c3ff293654b 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -1008,6 +1008,10 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/validation_errors.h', 'src/core/lib/gprpp/work_serializer.h', 'src/core/lib/gprpp/xxhash_inline.h', + 'src/core/lib/http/format_request.h', + 'src/core/lib/http/httpcli.h', + 'src/core/lib/http/httpcli_ssl_credentials.h', + 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/buffer_list.h', 'src/core/lib/iomgr/call_combiner.h', @@ -1305,10 +1309,6 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', 'src/core/util/alloc.h', - 'src/core/util/http_client/format_request.h', - 'src/core/util/http_client/httpcli.h', - 'src/core/util/http_client/httpcli_ssl_credentials.h', - 'src/core/util/http_client/parser.h', 'src/core/util/json/json.h', 'src/core/util/json/json_args.h', 'src/core/util/json/json_channel_args.h', @@ -2283,6 +2283,10 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/validation_errors.h', 'src/core/lib/gprpp/work_serializer.h', 'src/core/lib/gprpp/xxhash_inline.h', + 'src/core/lib/http/format_request.h', + 'src/core/lib/http/httpcli.h', + 'src/core/lib/http/httpcli_ssl_credentials.h', + 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/buffer_list.h', 'src/core/lib/iomgr/call_combiner.h', @@ -2580,10 +2584,6 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', 'src/core/util/alloc.h', - 'src/core/util/http_client/format_request.h', - 'src/core/util/http_client/httpcli.h', - 'src/core/util/http_client/httpcli_ssl_credentials.h', - 'src/core/util/http_client/parser.h', 'src/core/util/json/json.h', 'src/core/util/json/json_args.h', 'src/core/util/json/json_channel_args.h', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index a8cc8fdda1f..a3fa819e7cb 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1442,6 +1442,14 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/work_serializer.cc', 'src/core/lib/gprpp/work_serializer.h', 'src/core/lib/gprpp/xxhash_inline.h', + 'src/core/lib/http/format_request.cc', + 'src/core/lib/http/format_request.h', + 'src/core/lib/http/httpcli.cc', + 'src/core/lib/http/httpcli.h', + 'src/core/lib/http/httpcli_security_connector.cc', + 'src/core/lib/http/httpcli_ssl_credentials.h', + 'src/core/lib/http/parser.cc', + 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/buffer_list.cc', 'src/core/lib/iomgr/buffer_list.h', @@ -2031,14 +2039,6 @@ Pod::Spec.new do |s| 'src/core/util/alloc.h', 'src/core/util/android/log.cc', 'src/core/util/atm.cc', - 'src/core/util/http_client/format_request.cc', - 'src/core/util/http_client/format_request.h', - 'src/core/util/http_client/httpcli.cc', - 'src/core/util/http_client/httpcli.h', - 'src/core/util/http_client/httpcli_security_connector.cc', - 'src/core/util/http_client/httpcli_ssl_credentials.h', - 'src/core/util/http_client/parser.cc', - 'src/core/util/http_client/parser.h', 'src/core/util/iphone/cpu.cc', 'src/core/util/json/json.h', 'src/core/util/json/json_args.h', @@ -3066,6 +3066,10 @@ Pod::Spec.new do |s| 'src/core/lib/gprpp/validation_errors.h', 'src/core/lib/gprpp/work_serializer.h', 'src/core/lib/gprpp/xxhash_inline.h', + 'src/core/lib/http/format_request.h', + 'src/core/lib/http/httpcli.h', + 'src/core/lib/http/httpcli_ssl_credentials.h', + 'src/core/lib/http/parser.h', 'src/core/lib/iomgr/block_annotate.h', 'src/core/lib/iomgr/buffer_list.h', 'src/core/lib/iomgr/call_combiner.h', @@ -3363,10 +3367,6 @@ Pod::Spec.new do |s| 'src/core/tsi/transport_security_grpc.h', 'src/core/tsi/transport_security_interface.h', 'src/core/util/alloc.h', - 'src/core/util/http_client/format_request.h', - 'src/core/util/http_client/httpcli.h', - 'src/core/util/http_client/httpcli_ssl_credentials.h', - 'src/core/util/http_client/parser.h', 'src/core/util/json/json.h', 'src/core/util/json/json_args.h', 'src/core/util/json/json_channel_args.h', diff --git a/grpc.gemspec b/grpc.gemspec index 5b919662d11..aaaa9738475 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1329,6 +1329,14 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/gprpp/work_serializer.cc ) s.files += %w( src/core/lib/gprpp/work_serializer.h ) s.files += %w( src/core/lib/gprpp/xxhash_inline.h ) + s.files += %w( src/core/lib/http/format_request.cc ) + s.files += %w( src/core/lib/http/format_request.h ) + s.files += %w( src/core/lib/http/httpcli.cc ) + s.files += %w( src/core/lib/http/httpcli.h ) + s.files += %w( src/core/lib/http/httpcli_security_connector.cc ) + s.files += %w( src/core/lib/http/httpcli_ssl_credentials.h ) + s.files += %w( src/core/lib/http/parser.cc ) + s.files += %w( src/core/lib/http/parser.h ) s.files += %w( src/core/lib/iomgr/block_annotate.h ) s.files += %w( src/core/lib/iomgr/buffer_list.cc ) s.files += %w( src/core/lib/iomgr/buffer_list.h ) @@ -1918,14 +1926,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/util/alloc.h ) s.files += %w( src/core/util/android/log.cc ) s.files += %w( src/core/util/atm.cc ) - s.files += %w( src/core/util/http_client/format_request.cc ) - s.files += %w( src/core/util/http_client/format_request.h ) - s.files += %w( src/core/util/http_client/httpcli.cc ) - s.files += %w( src/core/util/http_client/httpcli.h ) - s.files += %w( src/core/util/http_client/httpcli_security_connector.cc ) - s.files += %w( src/core/util/http_client/httpcli_ssl_credentials.h ) - s.files += %w( src/core/util/http_client/parser.cc ) - s.files += %w( src/core/util/http_client/parser.h ) s.files += %w( src/core/util/iphone/cpu.cc ) s.files += %w( src/core/util/json/json.h ) s.files += %w( src/core/util/json/json_args.h ) diff --git a/package.xml b/package.xml index d1778bf0607..5dee87fa874 100644 --- a/package.xml +++ b/package.xml @@ -1311,6 +1311,14 @@ + + + + + + + + @@ -1900,14 +1908,6 @@ - - - - - - - - diff --git a/src/core/BUILD b/src/core/BUILD index 830376847ef..480e3f9431b 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -4420,10 +4420,10 @@ grpc_cc_library( grpc_cc_library( name = "httpcli_ssl_credentials", srcs = [ - "util/http_client/httpcli_security_connector.cc", + "lib/http/httpcli_security_connector.cc", ], hdrs = [ - "util/http_client/httpcli_ssl_credentials.h", + "lib/http/httpcli_ssl_credentials.h", ], external_deps = [ "absl/log:log", diff --git a/src/core/ext/gcp/metadata_query.h b/src/core/ext/gcp/metadata_query.h index 395c1e6d995..9e3f6931da5 100644 --- a/src/core/ext/gcp/metadata_query.h +++ b/src/core/ext/gcp/metadata_query.h @@ -26,11 +26,11 @@ #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/polling_entity.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/parser.h" namespace grpc_core { diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 90cfdf3ad5e..118b1f99488 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -82,6 +82,7 @@ #include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -107,7 +108,6 @@ #include "src/core/telemetry/stats.h" #include "src/core/telemetry/stats_data.h" #include "src/core/telemetry/tcp_tracer.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/string.h" #include "src/core/util/useful.h" diff --git a/src/core/handshaker/http_connect/http_connect_handshaker.cc b/src/core/handshaker/http_connect/http_connect_handshaker.cc index 30773fe99b4..32d218e06ea 100644 --- a/src/core/handshaker/http_connect/http_connect_handshaker.cc +++ b/src/core/handshaker/http_connect/http_connect_handshaker.cc @@ -44,14 +44,14 @@ #include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" +#include "src/core/lib/http/format_request.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/iomgr/tcp_server.h" -#include "src/core/util/http_client/format_request.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/string.h" namespace grpc_core { diff --git a/src/core/util/http_client/format_request.cc b/src/core/lib/http/format_request.cc similarity index 97% rename from src/core/util/http_client/format_request.cc rename to src/core/lib/http/format_request.cc index 1d785835e2b..d358a57f5bc 100644 --- a/src/core/util/http_client/format_request.cc +++ b/src/core/lib/http/format_request.cc @@ -16,9 +16,7 @@ // // -#include - -#include "src/core/util/http_client/format_request.h" +#include "src/core/lib/http/format_request.h" #include #include @@ -33,8 +31,9 @@ #include "absl/strings/string_view.h" #include +#include -#include "src/core/util/http_client/httpcli.h" +#include "src/core/lib/http/httpcli.h" static void fill_common_header(const grpc_http_request* request, const char* host, const char* path, diff --git a/src/core/util/http_client/format_request.h b/src/core/lib/http/format_request.h similarity index 86% rename from src/core/util/http_client/format_request.h rename to src/core/lib/http/format_request.h index ab9d6a9d7d5..a9e76643556 100644 --- a/src/core/util/http_client/format_request.h +++ b/src/core/lib/http/format_request.h @@ -16,14 +16,13 @@ // // -#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H -#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H - -#include +#ifndef GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H +#define GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H #include +#include -#include "src/core/util/http_client/parser.h" +#include "src/core/lib/http/parser.h" grpc_slice grpc_httpcli_format_get_request(const grpc_http_request* request, const char* host, const char* path); @@ -35,4 +34,4 @@ grpc_slice grpc_httpcli_format_connect_request(const grpc_http_request* request, const char* host, const char* path); -#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H +#endif // GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H diff --git a/src/core/util/http_client/httpcli.cc b/src/core/lib/http/httpcli.cc similarity index 99% rename from src/core/util/http_client/httpcli.cc rename to src/core/lib/http/httpcli.cc index 2771787dd00..ee2a5ad528d 100644 --- a/src/core/util/http_client/httpcli.cc +++ b/src/core/lib/http/httpcli.cc @@ -16,9 +16,7 @@ // // -#include - -#include "src/core/util/http_client/httpcli.h" +#include "src/core/lib/http/httpcli.h" #include @@ -34,6 +32,7 @@ #include #include #include +#include #include "src/core/handshaker/handshaker_registry.h" #include "src/core/handshaker/tcp_connect/tcp_connect_handshaker.h" @@ -42,6 +41,8 @@ #include "src/core/lib/channel/channel_args_preconditioning.h" #include "src/core/lib/config/core_configuration.h" #include "src/core/lib/gprpp/status_helper.h" +#include "src/core/lib/http/format_request.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/pollset_set.h" @@ -51,8 +52,6 @@ #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/error_utils.h" -#include "src/core/util/http_client/format_request.h" -#include "src/core/util/http_client/parser.h" namespace grpc_core { diff --git a/src/core/util/http_client/httpcli.h b/src/core/lib/http/httpcli.h similarity index 98% rename from src/core/util/http_client/httpcli.h rename to src/core/lib/http/httpcli.h index 2ad2810f027..960b46d16c3 100644 --- a/src/core/util/http_client/httpcli.h +++ b/src/core/lib/http/httpcli.h @@ -16,10 +16,8 @@ // // -#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H -#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H - -#include +#ifndef GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H +#define GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H #include @@ -34,6 +32,7 @@ #include #include +#include #include "src/core/handshaker/handshaker.h" #include "src/core/lib/gprpp/debug_location.h" @@ -41,6 +40,7 @@ #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/error.h" @@ -52,7 +52,6 @@ #include "src/core/lib/iomgr/resolved_address.h" #include "src/core/lib/resource_quota/resource_quota.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/parser.h" // User agent this library reports #define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0" @@ -265,4 +264,4 @@ class HttpRequest : public InternallyRefCounted { } // namespace grpc_core -#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H +#endif // GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H diff --git a/src/core/util/http_client/httpcli_security_connector.cc b/src/core/lib/http/httpcli_security_connector.cc similarity index 99% rename from src/core/util/http_client/httpcli_security_connector.cc rename to src/core/lib/http/httpcli_security_connector.cc index ac0c1adb257..7db2021b71c 100644 --- a/src/core/util/http_client/httpcli_security_connector.cc +++ b/src/core/lib/http/httpcli_security_connector.cc @@ -16,8 +16,6 @@ // // -#include - #include #include @@ -34,6 +32,7 @@ #include #include #include +#include #include #include "src/core/handshaker/handshaker.h" diff --git a/src/core/util/http_client/httpcli_ssl_credentials.h b/src/core/lib/http/httpcli_ssl_credentials.h similarity index 85% rename from src/core/util/http_client/httpcli_ssl_credentials.h rename to src/core/lib/http/httpcli_ssl_credentials.h index 45364c64a46..dc6182a0779 100644 --- a/src/core/util/http_client/httpcli_ssl_credentials.h +++ b/src/core/lib/http/httpcli_ssl_credentials.h @@ -14,12 +14,11 @@ // limitations under the License. // -#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H -#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H - -#include +#ifndef GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H +#define GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H #include +#include #include "src/core/lib/gprpp/ref_counted_ptr.h" @@ -36,4 +35,4 @@ RefCountedPtr CreateHttpRequestSSLCredentials(); } // namespace grpc_core -#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H +#endif // GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H diff --git a/src/core/util/http_client/parser.cc b/src/core/lib/http/parser.cc similarity index 99% rename from src/core/util/http_client/parser.cc rename to src/core/lib/http/parser.cc index c344f438cf3..aad7963f1d7 100644 --- a/src/core/util/http_client/parser.cc +++ b/src/core/lib/http/parser.cc @@ -16,9 +16,7 @@ // // -#include - -#include "src/core/util/http_client/parser.h" +#include "src/core/lib/http/parser.h" #include @@ -29,6 +27,7 @@ #include #include +#include grpc_core::TraceFlag grpc_http1_trace(false, "http1"); diff --git a/src/core/util/http_client/parser.h b/src/core/lib/http/parser.h similarity index 96% rename from src/core/util/http_client/parser.h rename to src/core/lib/http/parser.h index cfd1ed7ab3a..e9a1088b85f 100644 --- a/src/core/util/http_client/parser.h +++ b/src/core/lib/http/parser.h @@ -16,15 +16,14 @@ // // -#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H -#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H - -#include +#ifndef GRPC_SRC_CORE_LIB_HTTP_PARSER_H +#define GRPC_SRC_CORE_LIB_HTTP_PARSER_H #include #include #include +#include #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/error.h" @@ -127,4 +126,4 @@ void grpc_http_response_destroy(grpc_http_response* response); extern grpc_core::TraceFlag grpc_http1_trace; -#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H +#endif // GRPC_SRC_CORE_LIB_HTTP_PARSER_H diff --git a/src/core/lib/security/credentials/external/aws_external_account_credentials.cc b/src/core/lib/security/credentials/external/aws_external_account_credentials.cc index 27d1b88ef1a..06122b04a81 100644 --- a/src/core/lib/security/credentials/external/aws_external_account_credentials.cc +++ b/src/core/lib/security/credentials/external/aws_external_account_credentials.cc @@ -39,10 +39,10 @@ #include #include "src/core/lib/gprpp/env.h" +#include "src/core/lib/http/httpcli_ssl_credentials.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" #include "src/core/util/json/json.h" #include "src/core/util/json/json_reader.h" #include "src/core/util/json/json_writer.h" diff --git a/src/core/lib/security/credentials/external/aws_external_account_credentials.h b/src/core/lib/security/credentials/external/aws_external_account_credentials.h index c7dc1f166c3..50e7d86b58b 100644 --- a/src/core/lib/security/credentials/external/aws_external_account_credentials.h +++ b/src/core/lib/security/credentials/external/aws_external_account_credentials.h @@ -28,11 +28,11 @@ #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/security/credentials/external/aws_request_signer.h" #include "src/core/lib/security/credentials/external/external_account_credentials.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/parser.h" namespace grpc_core { diff --git a/src/core/lib/security/credentials/external/external_account_credentials.cc b/src/core/lib/security/credentials/external/external_account_credentials.cc index f7fd5a805e1..f604d1e9815 100644 --- a/src/core/lib/security/credentials/external/external_account_credentials.cc +++ b/src/core/lib/security/credentials/external/external_account_credentials.cc @@ -46,14 +46,14 @@ #include #include "src/core/lib/gprpp/status_helper.h" +#include "src/core/lib/http/httpcli_ssl_credentials.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/credentials/external/aws_external_account_credentials.h" #include "src/core/lib/security/credentials/external/file_external_account_credentials.h" #include "src/core/lib/security/credentials/external/url_external_account_credentials.h" #include "src/core/lib/security/util/json_util.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/json/json_reader.h" #include "src/core/util/json/json_writer.h" diff --git a/src/core/lib/security/credentials/external/external_account_credentials.h b/src/core/lib/security/credentials/external/external_account_credentials.h index f0023ab878e..c194fd60163 100644 --- a/src/core/lib/security/credentials/external/external_account_credentials.h +++ b/src/core/lib/security/credentials/external/external_account_credentials.h @@ -30,12 +30,12 @@ #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/json/json.h" namespace grpc_core { diff --git a/src/core/lib/security/credentials/external/url_external_account_credentials.cc b/src/core/lib/security/credentials/external/url_external_account_credentials.cc index b2a5359c596..cf9d646e579 100644 --- a/src/core/lib/security/credentials/external/url_external_account_credentials.cc +++ b/src/core/lib/security/credentials/external/url_external_account_credentials.cc @@ -37,11 +37,11 @@ #include #include +#include "src/core/lib/http/httpcli_ssl_credentials.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/transport/error_utils.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/json/json.h" #include "src/core/util/json/json_reader.h" diff --git a/src/core/lib/security/credentials/external/url_external_account_credentials.h b/src/core/lib/security/credentials/external/url_external_account_credentials.h index 209e652a15c..6a5f00cd23b 100644 --- a/src/core/lib/security/credentials/external/url_external_account_credentials.h +++ b/src/core/lib/security/credentials/external/url_external_account_credentials.h @@ -28,10 +28,10 @@ #include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" +#include "src/core/lib/http/httpcli.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/security/credentials/external/external_account_credentials.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli.h" namespace grpc_core { diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc index 3e6b843b972..86602f6c519 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc @@ -49,6 +49,8 @@ #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -68,8 +70,6 @@ #include "src/core/lib/uri/uri_parser.h" #include "src/core/load_balancing/grpclb/grpclb.h" #include "src/core/load_balancing/xds/xds_channel_args.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/json/json.h" #include "src/core/util/json/json_reader.h" diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/src/core/lib/security/credentials/jwt/jwt_verifier.cc index e88b909696f..02a7c548e98 100644 --- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc +++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc @@ -58,6 +58,9 @@ #include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/orphanable.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/httpcli_ssl_credentials.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -68,9 +71,6 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/uri/uri_parser.h" #include "src/core/tsi/ssl_types.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/json/json_reader.h" #include "src/core/util/string.h" diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index 834dae28305..313485e53d6 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -51,6 +51,7 @@ #include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/status_helper.h" +#include "src/core/lib/http/httpcli_ssl_credentials.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/promise/context.h" @@ -61,7 +62,6 @@ #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" #include "src/core/util/json/json.h" #include "src/core/util/json/json_reader.h" diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h index 199f35f33c8..5144905284b 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h @@ -37,6 +37,8 @@ #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/unique_type_name.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/polling_entity.h" @@ -46,8 +48,6 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/json/json.h" #include "src/core/util/useful.h" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 3ed50fe703b..d04415e7801 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -514,6 +514,10 @@ CORE_SOURCE_FILES = [ 'src/core/lib/gprpp/windows/stat.cc', 'src/core/lib/gprpp/windows/thd.cc', 'src/core/lib/gprpp/work_serializer.cc', + 'src/core/lib/http/format_request.cc', + 'src/core/lib/http/httpcli.cc', + 'src/core/lib/http/httpcli_security_connector.cc', + 'src/core/lib/http/parser.cc', 'src/core/lib/iomgr/buffer_list.cc', 'src/core/lib/iomgr/call_combiner.cc', 'src/core/lib/iomgr/cfstream_handle.cc', @@ -806,10 +810,6 @@ CORE_SOURCE_FILES = [ 'src/core/util/alloc.cc', 'src/core/util/android/log.cc', 'src/core/util/atm.cc', - 'src/core/util/http_client/format_request.cc', - 'src/core/util/http_client/httpcli.cc', - 'src/core/util/http_client/httpcli_security_connector.cc', - 'src/core/util/http_client/parser.cc', 'src/core/util/iphone/cpu.cc', 'src/core/util/json/json_object_loader.cc', 'src/core/util/json/json_reader.cc', diff --git a/test/core/end2end/fixtures/http_proxy_fixture.cc b/test/core/end2end/fixtures/http_proxy_fixture.cc index ac9acc9ffb4..3eca777e098 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.cc +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc @@ -51,6 +51,7 @@ #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/endpoint.h" @@ -64,7 +65,6 @@ #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/tcp_client.h" #include "src/core/lib/iomgr/tcp_server.h" -#include "src/core/util/http_client/parser.h" #include "test/core/test_util/port.h" struct grpc_end2end_http_proxy { diff --git a/test/core/http/format_request_test.cc b/test/core/http/format_request_test.cc index 31c73d88100..f242221d971 100644 --- a/test/core/http/format_request_test.cc +++ b/test/core/http/format_request_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/util/http_client/format_request.h" +#include "src/core/lib/http/format_request.h" #include @@ -24,8 +24,8 @@ #include "gtest/gtest.h" +#include "src/core/lib/http/httpcli.h" #include "src/core/lib/slice/slice_internal.h" -#include "src/core/util/http_client/httpcli.h" #include "test/core/test_util/test_config.h" TEST(FormatRequestTest, FormatGetRequest) { diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index e63cbfe4f22..773ee18ed08 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/util/http_client/httpcli.h" +#include "src/core/lib/http/httpcli.h" #include #include diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index 4c15ea82dcf..8bdf220bee2 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -47,6 +47,9 @@ #include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time_util.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/httpcli_ssl_credentials.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -55,9 +58,6 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/security/credentials/credentials.h" // IWYU pragma: keep #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" -#include "src/core/util/http_client/parser.h" #include "src/core/util/subprocess.h" #include "test/core/http/httpcli_test_util.h" #include "test/core/test_util/fake_udp_and_tcp_server.h" diff --git a/test/core/http/parser_test.cc b/test/core/http/parser_test.cc index 4e3f508338a..183dc9eeae3 100644 --- a/test/core/http/parser_test.cc +++ b/test/core/http/parser_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/util/http_client/parser.h" +#include "src/core/lib/http/parser.h" #include #include diff --git a/test/core/http/request_fuzzer.cc b/test/core/http/request_fuzzer.cc index 7ca890c7e01..2272d0427e3 100644 --- a/test/core/http/request_fuzzer.cc +++ b/test/core/http/request_fuzzer.cc @@ -22,7 +22,7 @@ #include #include -#include "src/core/util/http_client/parser.h" +#include "src/core/lib/http/parser.h" bool squelch = true; bool leak_check = true; diff --git a/test/core/http/response_fuzzer.cc b/test/core/http/response_fuzzer.cc index e2cadb79eb8..8310028c455 100644 --- a/test/core/http/response_fuzzer.cc +++ b/test/core/http/response_fuzzer.cc @@ -22,7 +22,7 @@ #include #include -#include "src/core/util/http_client/parser.h" +#include "src/core/lib/http/parser.h" bool squelch = true; bool leak_check = true; diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc index 241baff1d04..35e1aad2be8 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -47,6 +47,8 @@ #include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/unique_type_name.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/httpcli_ssl_credentials.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h" #include "src/core/lib/promise/promise.h" @@ -67,8 +69,6 @@ #include "src/core/lib/security/transport/auth_filters.h" #include "src/core/lib/transport/error_utils.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/httpcli_ssl_credentials.h" #include "src/core/util/json/json_reader.h" #include "src/core/util/string.h" #include "src/core/util/tmpfile.h" diff --git a/test/core/security/jwt_verifier_test.cc b/test/core/security/jwt_verifier_test.cc index 792fbe670cf..5387edf9451 100644 --- a/test/core/security/jwt_verifier_test.cc +++ b/test/core/security/jwt_verifier_test.cc @@ -31,8 +31,8 @@ #include #include "src/core/lib/gprpp/crash.h" +#include "src/core/lib/http/httpcli.h" #include "src/core/lib/security/credentials/jwt/json_token.h" -#include "src/core/util/http_client/httpcli.h" #include "src/core/util/json/json_reader.h" #include "test/core/test_util/test_config.h" diff --git a/test/core/test_util/port_server_client.cc b/test/core/test_util/port_server_client.cc index 2f59e1c473b..cbd83fcb046 100644 --- a/test/core/test_util/port_server_client.cc +++ b/test/core/test_util/port_server_client.cc @@ -44,6 +44,8 @@ #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/time.h" +#include "src/core/lib/http/httpcli.h" +#include "src/core/lib/http/parser.h" #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/exec_ctx.h" @@ -52,8 +54,6 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/uri/uri_parser.h" -#include "src/core/util/http_client/httpcli.h" -#include "src/core/util/http_client/parser.h" typedef struct freereq { gpr_mu* mu = nullptr; diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index c3428fdd3a1..1a40d6aa032 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2328,6 +2328,14 @@ src/core/lib/gprpp/windows/thd.cc \ src/core/lib/gprpp/work_serializer.cc \ src/core/lib/gprpp/work_serializer.h \ src/core/lib/gprpp/xxhash_inline.h \ +src/core/lib/http/format_request.cc \ +src/core/lib/http/format_request.h \ +src/core/lib/http/httpcli.cc \ +src/core/lib/http/httpcli.h \ +src/core/lib/http/httpcli_security_connector.cc \ +src/core/lib/http/httpcli_ssl_credentials.h \ +src/core/lib/http/parser.cc \ +src/core/lib/http/parser.h \ src/core/lib/iomgr/block_annotate.h \ src/core/lib/iomgr/buffer_list.cc \ src/core/lib/iomgr/buffer_list.h \ @@ -2917,14 +2925,6 @@ src/core/util/alloc.cc \ src/core/util/alloc.h \ src/core/util/android/log.cc \ src/core/util/atm.cc \ -src/core/util/http_client/format_request.cc \ -src/core/util/http_client/format_request.h \ -src/core/util/http_client/httpcli.cc \ -src/core/util/http_client/httpcli.h \ -src/core/util/http_client/httpcli_security_connector.cc \ -src/core/util/http_client/httpcli_ssl_credentials.h \ -src/core/util/http_client/parser.cc \ -src/core/util/http_client/parser.h \ src/core/util/iphone/cpu.cc \ src/core/util/json/json.h \ src/core/util/json/json_args.h \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 1439a0c8d46..96df93bf306 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -2101,6 +2101,14 @@ src/core/lib/gprpp/windows/thd.cc \ src/core/lib/gprpp/work_serializer.cc \ src/core/lib/gprpp/work_serializer.h \ src/core/lib/gprpp/xxhash_inline.h \ +src/core/lib/http/format_request.cc \ +src/core/lib/http/format_request.h \ +src/core/lib/http/httpcli.cc \ +src/core/lib/http/httpcli.h \ +src/core/lib/http/httpcli_security_connector.cc \ +src/core/lib/http/httpcli_ssl_credentials.h \ +src/core/lib/http/parser.cc \ +src/core/lib/http/parser.h \ src/core/lib/iomgr/README.md \ src/core/lib/iomgr/block_annotate.h \ src/core/lib/iomgr/buffer_list.cc \ @@ -2699,14 +2707,6 @@ src/core/util/alloc.cc \ src/core/util/alloc.h \ src/core/util/android/log.cc \ src/core/util/atm.cc \ -src/core/util/http_client/format_request.cc \ -src/core/util/http_client/format_request.h \ -src/core/util/http_client/httpcli.cc \ -src/core/util/http_client/httpcli.h \ -src/core/util/http_client/httpcli_security_connector.cc \ -src/core/util/http_client/httpcli_ssl_credentials.h \ -src/core/util/http_client/parser.cc \ -src/core/util/http_client/parser.h \ src/core/util/iphone/cpu.cc \ src/core/util/json/json.h \ src/core/util/json/json_args.h \ From 39afbf49f275a501753c2c81d90c8e759b0d1c0d Mon Sep 17 00:00:00 2001 From: Paulo Castello da Costa Date: Thu, 30 May 2024 09:17:48 -0700 Subject: [PATCH 2/3] [benchmark] Disable benchmarks for dotnet in CI. (#36759) Build is failing, so temporarily removing dotnet from benchmarks CI. Closes #36759 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36759 from paulosjca:dotnet 71337a07550b0a2dacd06c30f47a15adca28d330 PiperOrigin-RevId: 638676595 --- tools/internal_ci/linux/grpc_e2e_performance_gke.sh | 6 +++--- .../linux/grpc_e2e_performance_gke_experiment.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh index 15951cccc75..a8da8a9fae6 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke.sh @@ -131,9 +131,9 @@ configLangArgs32core+=( -l c++ ) runnerLangArgs+=( -l "cxx:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) # dotnet -configLangArgs8core+=( -l dotnet ) -configLangArgs32core+=( -l dotnet ) -runnerLangArgs+=( -l "dotnet:${GRPC_DOTNET_REPO}:${GRPC_DOTNET_COMMIT}" ) +# configLangArgs8core+=( -l dotnet ) +# configLangArgs32core+=( -l dotnet ) +# runnerLangArgs+=( -l "dotnet:${GRPC_DOTNET_REPO}:${GRPC_DOTNET_COMMIT}" ) # # go configLangArgs8core+=( -l go ) diff --git a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh index f62d9920b72..c3b99af80eb 100755 --- a/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh +++ b/tools/internal_ci/linux/grpc_e2e_performance_gke_experiment.sh @@ -125,9 +125,9 @@ configLangArgs32core+=( -l c++ ) runnerLangArgs+=( -l "cxx:${GRPC_CORE_REPO}:${GRPC_CORE_COMMIT}" ) # dotnet -configLangArgs8core+=( -l dotnet ) -configLangArgs32core+=( -l dotnet ) -runnerLangArgs+=( -l "dotnet:${GRPC_DOTNET_REPO}:${GRPC_DOTNET_COMMIT}" ) +# configLangArgs8core+=( -l dotnet ) +# configLangArgs32core+=( -l dotnet ) +# runnerLangArgs+=( -l "dotnet:${GRPC_DOTNET_REPO}:${GRPC_DOTNET_COMMIT}" ) # # go configLangArgs8core+=( -l go ) From 1a96ce76207f5a70f43842d554a07fc84f890536 Mon Sep 17 00:00:00 2001 From: Xuan Wang Date: Thu, 30 May 2024 09:34:07 -0700 Subject: [PATCH 3/3] [Python AIO] Return EOF from UnaryStreamCall.read() as documented (#36660) Fix: https://github.com/grpc/grpc/issues/36581 Based on our documentation, we should return `grpc.aio.EOF` to indicate the end of the stream: https://github.com/grpc/grpc/blob/fb6a57b153c1290c08028cd909d759fcd393ff22/src/python/grpcio/grpc/aio/_base_call.py#L166-L178 But if the call was intercepted, we're raising `StopAsyncIteration`, This Pr changes the return to match the documentation (Which is also the behavior for non-intercepted call). Closes #36660 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36660 from XuanWang-Amos:fix_aio_read_return 4b679ba4295fee549d9a81d66062636390cc9a02 PiperOrigin-RevId: 638681673 --- src/python/grpcio/grpc/aio/_call.py | 13 ++++- src/python/grpcio/grpc/aio/_interceptor.py | 12 +++-- .../client_unary_stream_interceptor_test.py | 48 +++++++++++++++++++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/python/grpcio/grpc/aio/_call.py b/src/python/grpcio/grpc/aio/_call.py index 82b0d3ce522..24f2090651a 100644 --- a/src/python/grpcio/grpc/aio/_call.py +++ b/src/python/grpcio/grpc/aio/_call.py @@ -19,7 +19,15 @@ from functools import partial import inspect import logging import traceback -from typing import Any, AsyncIterator, Generator, Generic, Optional, Tuple +from typing import ( + Any, + AsyncIterator, + Generator, + Generic, + Optional, + Tuple, + Union, +) import grpc from grpc import _common @@ -29,6 +37,7 @@ from . import _base_call from ._metadata import Metadata from ._typing import DeserializingFunction from ._typing import DoneCallbackType +from ._typing import EOFType from ._typing import MetadatumType from ._typing import RequestIterableType from ._typing import RequestType @@ -380,7 +389,7 @@ class _StreamResponseMixin(Call): raw_response, self._response_deserializer ) - async def read(self) -> ResponseType: + async def read(self) -> Union[EOFType, ResponseType]: if self.done(): await self._raise_for_status() return cygrpc.EOF diff --git a/src/python/grpcio/grpc/aio/_interceptor.py b/src/python/grpcio/grpc/aio/_interceptor.py index e7ceb00fbbf..1401a08ee4c 100644 --- a/src/python/grpcio/grpc/aio/_interceptor.py +++ b/src/python/grpcio/grpc/aio/_interceptor.py @@ -43,6 +43,7 @@ from ._call import _RPC_HALF_CLOSED_DETAILS from ._metadata import Metadata from ._typing import DeserializingFunction from ._typing import DoneCallbackType +from ._typing import EOFType from ._typing import RequestIterableType from ._typing import RequestType from ._typing import ResponseIterableType @@ -494,12 +495,15 @@ class _InterceptedStreamResponseMixin: ) return self._response_aiter - async def read(self) -> ResponseType: + async def read(self) -> Union[EOFType, ResponseType]: if self._response_aiter is None: self._response_aiter = ( self._wait_for_interceptor_task_response_iterator() ) - return await self._response_aiter.asend(None) + try: + return await self._response_aiter.asend(None) + except StopAsyncIteration: + return cygrpc.EOF class _InterceptedStreamRequestMixin: @@ -1141,7 +1145,7 @@ class UnaryStreamCallResponseIterator( ): """UnaryStreamCall class wich uses an alternative response iterator.""" - async def read(self) -> ResponseType: + async def read(self) -> Union[EOFType, ResponseType]: # Behind the scenes everyting goes through the # async iterator. So this path should not be reached. raise NotImplementedError() @@ -1152,7 +1156,7 @@ class StreamStreamCallResponseIterator( ): """StreamStreamCall class wich uses an alternative response iterator.""" - async def read(self) -> ResponseType: + async def read(self) -> Union[EOFType, ResponseType]: # Behind the scenes everyting goes through the # async iterator. So this path should not be reached. raise NotImplementedError() diff --git a/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py b/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py index c86cb36b02b..5f6bdd50f44 100644 --- a/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py @@ -223,6 +223,54 @@ class TestUnaryStreamClientInterceptor(AioTestBase): await channel.close() + async def test_too_many_reads(self): + for interceptor_class in ( + [_UnaryStreamInterceptorEmpty], + [_UnaryStreamInterceptorWithResponseIterator], + [], + ): + with self.subTest(name=interceptor_class): + if interceptor_class: + interceptor = interceptor_class[0]() + channel = aio.insecure_channel( + self._server_target, interceptors=[interceptor] + ) + else: + channel = aio.insecure_channel(self._server_target) + stub = test_pb2_grpc.TestServiceStub(channel) + + request = messages_pb2.StreamingOutputCallRequest() + request.response_parameters.extend( + [ + messages_pb2.ResponseParameters( + size=_RESPONSE_PAYLOAD_SIZE + ) + ] + * _NUM_STREAM_RESPONSES + ) + + call = stub.StreamingOutputCall(request) + + response_cnt = 0 + for response in range(_NUM_STREAM_RESPONSES): + response = await call.read() + response_cnt += 1 + self.assertIs( + type(response), messages_pb2.StreamingOutputCallResponse + ) + self.assertEqual( + _RESPONSE_PAYLOAD_SIZE, len(response.payload.body) + ) + + # Additional read() should return EOF + self.assertIs(await call.read(), aio.EOF) + + self.assertEqual(await call.code(), grpc.StatusCode.OK) + # After the RPC finished, the read should also produce EOF + self.assertIs(await call.read(), aio.EOF) + + await channel.close() + async def test_multiple_interceptors_response_iterator(self): for interceptor_class in ( _UnaryStreamInterceptorEmpty,