From db2d775ffcb860956276b4db2e036632e108a0b0 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 29 May 2024 11:39:22 -0700 Subject: [PATCH] [reorg] move src/core/lib/http -> src/core/util/http_client (#36710) Closes #36710 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36710 from markdroth:reorg_httpcli 6c751e34b21b1a24bad260ff06493edac37b21f9 PiperOrigin-RevId: 638358691 --- 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 +-- .../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 +-- .../http_client}/format_request.cc | 7 +++-- .../http_client}/format_request.h | 11 ++++---- .../{lib/http => util/http_client}/httpcli.cc | 9 +++--- .../{lib/http => util/http_client}/httpcli.h | 11 ++++---- .../httpcli_security_connector.cc | 3 +- .../http_client}/httpcli_ssl_credentials.h | 9 +++--- .../{lib/http => util/http_client}/parser.cc | 5 ++-- .../{lib/http => util/http_client}/parser.h | 9 +++--- 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, 181 insertions(+), 173 deletions(-) rename src/core/{lib/http => util/http_client}/format_request.cc (97%) rename src/core/{lib/http => util/http_client}/format_request.h (86%) rename src/core/{lib/http => util/http_client}/httpcli.cc (99%) rename src/core/{lib/http => util/http_client}/httpcli.h (98%) rename src/core/{lib/http => util/http_client}/httpcli_security_connector.cc (99%) rename src/core/{lib/http => util/http_client}/httpcli_ssl_credentials.h (85%) rename src/core/{lib/http => util/http_client}/parser.cc (99%) rename src/core/{lib/http => util/http_client}/parser.h (96%) diff --git a/BUILD b/BUILD index 79ee22f7510..20b7ed8e86f 100644 --- a/BUILD +++ b/BUILD @@ -3915,14 +3915,14 @@ grpc_cc_library( grpc_cc_library( name = "httpcli", srcs = [ - "//src/core:lib/http/format_request.cc", - "//src/core:lib/http/httpcli.cc", - "//src/core:lib/http/parser.cc", + "//src/core:util/http_client/format_request.cc", + "//src/core:util/http_client/httpcli.cc", + "//src/core:util/http_client/parser.cc", ], hdrs = [ - "//src/core:lib/http/format_request.h", - "//src/core:lib/http/httpcli.h", - "//src/core:lib/http/parser.h", + "//src/core:util/http_client/format_request.h", + "//src/core:util/http_client/httpcli.h", + "//src/core:util/http_client/parser.h", ], external_deps = [ "absl/base:core_headers", diff --git a/CMakeLists.txt b/CMakeLists.txt index f2d496b08b4..3f5c39bfda8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2303,10 +2303,6 @@ 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 @@ -2596,6 +2592,10 @@ 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 @@ -3094,9 +3094,6 @@ 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 @@ -3314,6 +3311,9 @@ 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 5517ead7d7f..2171dd14b33 100644 --- a/Makefile +++ b/Makefile @@ -1162,10 +1162,6 @@ 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 \ @@ -1458,6 +1454,10 @@ 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 75efbc101c2..6f315ad9c90 100644 --- a/Package.swift +++ b/Package.swift @@ -1317,14 +1317,6 @@ 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", @@ -1917,6 +1909,14 @@ 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 5dea7e76ab5..b2a80770454 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -907,10 +907,6 @@ 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,6 +1202,10 @@ 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 @@ -1724,10 +1724,6 @@ 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 @@ -2017,6 +2013,10 @@ 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 @@ -2443,9 +2443,6 @@ 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 @@ -2677,6 +2674,9 @@ 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 @@ -2875,9 +2875,6 @@ 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 @@ -3095,6 +3092,9 @@ 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 ce630228f2f..bcb4312e054 100644 --- a/config.m4 +++ b/config.m4 @@ -537,10 +537,6 @@ 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 \ @@ -833,6 +829,10 @@ 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 \ @@ -1531,7 +1531,6 @@ 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) @@ -1602,6 +1601,7 @@ 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 12b8e9df346..08d8febee55 100644 --- a/config.w32 +++ b/config.w32 @@ -502,10 +502,6 @@ 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 " + @@ -798,6 +794,10 @@ 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 " + @@ -1668,7 +1668,6 @@ 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"); @@ -1742,6 +1741,7 @@ 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 6b74801bc8c..5865f399235 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -1005,10 +1005,6 @@ 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,6 +1301,10 @@ 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', @@ -2276,10 +2276,6 @@ 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', @@ -2576,6 +2572,10 @@ 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 e07e1a3dd80..032a6bb22ff 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1436,14 +1436,6 @@ 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', @@ -2032,6 +2024,14 @@ 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', @@ -3056,10 +3056,6 @@ 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', @@ -3356,6 +3352,10 @@ 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 a940ee87cae..5ce01c4fd1b 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -1323,14 +1323,6 @@ 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 ) @@ -1919,6 +1911,14 @@ 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 1cd837a3efe..23357d455f1 100644 --- a/package.xml +++ b/package.xml @@ -1305,14 +1305,6 @@ - - - - - - - - @@ -1901,6 +1893,14 @@ + + + + + + + + diff --git a/src/core/BUILD b/src/core/BUILD index b1f10e5fdd8..56aa4f03aa8 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -4420,10 +4420,10 @@ grpc_cc_library( grpc_cc_library( name = "httpcli_ssl_credentials", srcs = [ - "lib/http/httpcli_security_connector.cc", + "util/http_client/httpcli_security_connector.cc", ], hdrs = [ - "lib/http/httpcli_ssl_credentials.h", + "util/http_client/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 9e3f6931da5..395c1e6d995 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 118b1f99488..90cfdf3ad5e 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -82,7 +82,6 @@ #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" @@ -108,6 +107,7 @@ #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 32d218e06ea..30773fe99b4 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/lib/security/credentials/external/aws_external_account_credentials.cc b/src/core/lib/security/credentials/external/aws_external_account_credentials.cc index 06122b04a81..27d1b88ef1a 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 50e7d86b58b..c7dc1f166c3 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 f604d1e9815..f7fd5a805e1 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 c194fd60163..f0023ab878e 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 cf9d646e579..b2a5359c596 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 6a5f00cd23b..209e652a15c 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 86602f6c519..3e6b843b972 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,8 +49,6 @@ #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" @@ -70,6 +68,8 @@ #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 02a7c548e98..e88b909696f 100644 --- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc +++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc @@ -58,9 +58,6 @@ #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" @@ -71,6 +68,9 @@ #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 313485e53d6..834dae28305 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -51,7 +51,6 @@ #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" @@ -62,6 +61,7 @@ #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 5144905284b..199f35f33c8 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h @@ -37,8 +37,6 @@ #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" @@ -48,6 +46,8 @@ #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/core/lib/http/format_request.cc b/src/core/util/http_client/format_request.cc similarity index 97% rename from src/core/lib/http/format_request.cc rename to src/core/util/http_client/format_request.cc index d358a57f5bc..1d785835e2b 100644 --- a/src/core/lib/http/format_request.cc +++ b/src/core/util/http_client/format_request.cc @@ -16,7 +16,9 @@ // // -#include "src/core/lib/http/format_request.h" +#include + +#include "src/core/util/http_client/format_request.h" #include #include @@ -31,9 +33,8 @@ #include "absl/strings/string_view.h" #include -#include -#include "src/core/lib/http/httpcli.h" +#include "src/core/util/http_client/httpcli.h" static void fill_common_header(const grpc_http_request* request, const char* host, const char* path, diff --git a/src/core/lib/http/format_request.h b/src/core/util/http_client/format_request.h similarity index 86% rename from src/core/lib/http/format_request.h rename to src/core/util/http_client/format_request.h index a9e76643556..ab9d6a9d7d5 100644 --- a/src/core/lib/http/format_request.h +++ b/src/core/util/http_client/format_request.h @@ -16,13 +16,14 @@ // // -#ifndef GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H -#define GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H +#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H +#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H -#include #include -#include "src/core/lib/http/parser.h" +#include + +#include "src/core/util/http_client/parser.h" grpc_slice grpc_httpcli_format_get_request(const grpc_http_request* request, const char* host, const char* path); @@ -34,4 +35,4 @@ grpc_slice grpc_httpcli_format_connect_request(const grpc_http_request* request, const char* host, const char* path); -#endif // GRPC_SRC_CORE_LIB_HTTP_FORMAT_REQUEST_H +#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_FORMAT_REQUEST_H diff --git a/src/core/lib/http/httpcli.cc b/src/core/util/http_client/httpcli.cc similarity index 99% rename from src/core/lib/http/httpcli.cc rename to src/core/util/http_client/httpcli.cc index ee2a5ad528d..2771787dd00 100644 --- a/src/core/lib/http/httpcli.cc +++ b/src/core/util/http_client/httpcli.cc @@ -16,7 +16,9 @@ // // -#include "src/core/lib/http/httpcli.h" +#include + +#include "src/core/util/http_client/httpcli.h" #include @@ -32,7 +34,6 @@ #include #include #include -#include #include "src/core/handshaker/handshaker_registry.h" #include "src/core/handshaker/tcp_connect/tcp_connect_handshaker.h" @@ -41,8 +42,6 @@ #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" @@ -52,6 +51,8 @@ #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/lib/http/httpcli.h b/src/core/util/http_client/httpcli.h similarity index 98% rename from src/core/lib/http/httpcli.h rename to src/core/util/http_client/httpcli.h index 960b46d16c3..2ad2810f027 100644 --- a/src/core/lib/http/httpcli.h +++ b/src/core/util/http_client/httpcli.h @@ -16,8 +16,10 @@ // // -#ifndef GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H -#define GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H +#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H +#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H + +#include #include @@ -32,7 +34,6 @@ #include #include -#include #include "src/core/handshaker/handshaker.h" #include "src/core/lib/gprpp/debug_location.h" @@ -40,7 +41,6 @@ #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,6 +52,7 @@ #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" @@ -264,4 +265,4 @@ class HttpRequest : public InternallyRefCounted { } // namespace grpc_core -#endif // GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_H +#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_H diff --git a/src/core/lib/http/httpcli_security_connector.cc b/src/core/util/http_client/httpcli_security_connector.cc similarity index 99% rename from src/core/lib/http/httpcli_security_connector.cc rename to src/core/util/http_client/httpcli_security_connector.cc index 7db2021b71c..ac0c1adb257 100644 --- a/src/core/lib/http/httpcli_security_connector.cc +++ b/src/core/util/http_client/httpcli_security_connector.cc @@ -16,6 +16,8 @@ // // +#include + #include #include @@ -32,7 +34,6 @@ #include #include #include -#include #include #include "src/core/handshaker/handshaker.h" diff --git a/src/core/lib/http/httpcli_ssl_credentials.h b/src/core/util/http_client/httpcli_ssl_credentials.h similarity index 85% rename from src/core/lib/http/httpcli_ssl_credentials.h rename to src/core/util/http_client/httpcli_ssl_credentials.h index dc6182a0779..45364c64a46 100644 --- a/src/core/lib/http/httpcli_ssl_credentials.h +++ b/src/core/util/http_client/httpcli_ssl_credentials.h @@ -14,12 +14,13 @@ // limitations under the License. // -#ifndef GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H -#define GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H +#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H +#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H -#include #include +#include + #include "src/core/lib/gprpp/ref_counted_ptr.h" namespace grpc_core { @@ -35,4 +36,4 @@ RefCountedPtr CreateHttpRequestSSLCredentials(); } // namespace grpc_core -#endif // GRPC_SRC_CORE_LIB_HTTP_HTTPCLI_SSL_CREDENTIALS_H +#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_HTTPCLI_SSL_CREDENTIALS_H diff --git a/src/core/lib/http/parser.cc b/src/core/util/http_client/parser.cc similarity index 99% rename from src/core/lib/http/parser.cc rename to src/core/util/http_client/parser.cc index aad7963f1d7..c344f438cf3 100644 --- a/src/core/lib/http/parser.cc +++ b/src/core/util/http_client/parser.cc @@ -16,7 +16,9 @@ // // -#include "src/core/lib/http/parser.h" +#include + +#include "src/core/util/http_client/parser.h" #include @@ -27,7 +29,6 @@ #include #include -#include grpc_core::TraceFlag grpc_http1_trace(false, "http1"); diff --git a/src/core/lib/http/parser.h b/src/core/util/http_client/parser.h similarity index 96% rename from src/core/lib/http/parser.h rename to src/core/util/http_client/parser.h index e9a1088b85f..cfd1ed7ab3a 100644 --- a/src/core/lib/http/parser.h +++ b/src/core/util/http_client/parser.h @@ -16,14 +16,15 @@ // // -#ifndef GRPC_SRC_CORE_LIB_HTTP_PARSER_H -#define GRPC_SRC_CORE_LIB_HTTP_PARSER_H +#ifndef GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H +#define GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H + +#include #include #include #include -#include #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/error.h" @@ -126,4 +127,4 @@ void grpc_http_response_destroy(grpc_http_response* response); extern grpc_core::TraceFlag grpc_http1_trace; -#endif // GRPC_SRC_CORE_LIB_HTTP_PARSER_H +#endif // GRPC_SRC_CORE_UTIL_HTTP_CLIENT_PARSER_H diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index f38b2571f6d..39fb7a6487f 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -511,10 +511,6 @@ 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', @@ -807,6 +803,10 @@ 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 3eca777e098..ac9acc9ffb4 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.cc +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc @@ -51,7 +51,6 @@ #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" @@ -65,6 +64,7 @@ #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 f242221d971..31c73d88100 100644 --- a/test/core/http/format_request_test.cc +++ b/test/core/http/format_request_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/lib/http/format_request.h" +#include "src/core/util/http_client/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 773ee18ed08..e63cbfe4f22 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/lib/http/httpcli.h" +#include "src/core/util/http_client/httpcli.h" #include #include diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index 8bdf220bee2..4c15ea82dcf 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -47,9 +47,6 @@ #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" @@ -58,6 +55,9 @@ #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 183dc9eeae3..4e3f508338a 100644 --- a/test/core/http/parser_test.cc +++ b/test/core/http/parser_test.cc @@ -16,7 +16,7 @@ // // -#include "src/core/lib/http/parser.h" +#include "src/core/util/http_client/parser.h" #include #include diff --git a/test/core/http/request_fuzzer.cc b/test/core/http/request_fuzzer.cc index 2272d0427e3..7ca890c7e01 100644 --- a/test/core/http/request_fuzzer.cc +++ b/test/core/http/request_fuzzer.cc @@ -22,7 +22,7 @@ #include #include -#include "src/core/lib/http/parser.h" +#include "src/core/util/http_client/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 8310028c455..e2cadb79eb8 100644 --- a/test/core/http/response_fuzzer.cc +++ b/test/core/http/response_fuzzer.cc @@ -22,7 +22,7 @@ #include #include -#include "src/core/lib/http/parser.h" +#include "src/core/util/http_client/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 35e1aad2be8..241baff1d04 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -47,8 +47,6 @@ #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" @@ -69,6 +67,8 @@ #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 5387edf9451..792fbe670cf 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 cbd83fcb046..2f59e1c473b 100644 --- a/test/core/test_util/port_server_client.cc +++ b/test/core/test_util/port_server_client.cc @@ -44,8 +44,6 @@ #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" @@ -54,6 +52,8 @@ #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 319f45d8c2b..a65cdb9fc4f 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -2322,14 +2322,6 @@ 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 \ @@ -2918,6 +2910,14 @@ 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 28cfb2530bf..4a5484a7c0f 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -2095,14 +2095,6 @@ 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 \ @@ -2700,6 +2692,14 @@ 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 \