diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
commit | 31773f157bf8164364649b5f470f52dece0a4317 (patch) | |
tree | 33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /yt/cpp/mapreduce/http/http_client.cpp | |
parent | 2c7938962d8689e175574fc1e817c05049f27905 (diff) | |
parent | eff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff) | |
download | ydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz |
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yt/cpp/mapreduce/http/http_client.cpp')
-rw-r--r-- | yt/cpp/mapreduce/http/http_client.cpp | 16 |
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); } }; |