aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/http/http_client.cpp
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-11-20 17:37:57 +0000
committerGitHub <noreply@github.com>2024-11-20 17:37:57 +0000
commitf76323e9b295c15751e51e3443aa47a36bee8023 (patch)
tree4113c8cad473a33e0f746966e0cf087252fa1d7a /yt/cpp/mapreduce/http/http_client.cpp
parent753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff)
parenta7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff)
downloadydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yt/cpp/mapreduce/http/http_client.cpp')
-rw-r--r--yt/cpp/mapreduce/http/http_client.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/yt/cpp/mapreduce/http/http_client.cpp b/yt/cpp/mapreduce/http/http_client.cpp
index 305d95b06c..7e9d761c3c 100644
--- a/yt/cpp/mapreduce/http/http_client.cpp
+++ b/yt/cpp/mapreduce/http/http_client.cpp
@@ -167,23 +167,23 @@ class TDefaultHttpClient
public:
IHttpResponsePtr Request(const TString& url, const TString& requestId, const THttpConfig& config, const THttpHeader& header, TMaybe<TStringBuf> body) override
{
- auto request = std::make_unique<THttpRequest>(requestId);
-
auto urlRef = NHttp::ParseUrl(url);
+ auto host = CreateHost(urlRef.Host, urlRef.PortStr);
+
+ auto request = std::make_unique<THttpRequest>(requestId, host, header, config.SocketTimeout);
- request->Connect(CreateHost(urlRef.Host, urlRef.PortStr), config.SocketTimeout);
- request->SmallRequest(header, body);
+ request->SmallRequest(body);
return std::make_unique<TDefaultHttpResponse>(std::move(request));
}
IHttpRequestPtr StartRequest(const TString& url, const TString& requestId, const THttpConfig& config, const THttpHeader& header) override
{
- auto request = std::make_unique<THttpRequest>(requestId);
-
auto urlRef = NHttp::ParseUrl(url);
+ auto host = CreateHost(urlRef.Host, urlRef.PortStr);
+
+ auto request = std::make_unique<THttpRequest>(requestId, host, header, config.SocketTimeout);
- request->Connect(CreateHost(urlRef.Host, urlRef.PortStr), config.SocketTimeout);
- auto stream = request->StartRequest(header);
+ auto stream = request->StartRequest();
return std::make_unique<TDefaultHttpRequest>(std::move(request), stream);
}
};