diff options
| author | YDBot <[email protected]> | 2026-07-02 18:29:58 +0000 |
|---|---|---|
| committer | YDBot <[email protected]> | 2026-07-02 18:29:58 +0000 |
| commit | a52ffb856a584a5099e37b9c060da3ba4a3db5fb (patch) | |
| tree | 59c7f09bdc9e52d11ce6ddf8b6fabdfe1e73a8d6 /library/cpp/http/server/http.cpp | |
| parent | 6faa15e1fbe202f0fddb7c1ffe9886dc81a0425f (diff) | |
| parent | d5cfc51dd97284c59104c50bb156d1a8d9a09dac (diff) | |
Merge pull request #45225 from ydb-platform/merge-rightlib-260701-1735
Diffstat (limited to 'library/cpp/http/server/http.cpp')
| -rw-r--r-- | library/cpp/http/server/http.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index 13088f5e442..79a1194c770 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -725,6 +725,10 @@ void TClientRequest::ResetConnection() { } } +THolder<THttpServerConn> TClientRequest::CreateHttpConnection(const TSocket& s, size_t outputBufferSize) { + return MakeHolder<THttpServerConn>(s, outputBufferSize); +} + void TClientRequest::Process(void* ThreadSpecificResource) { THolder<TClientRequest> this_(this); @@ -733,11 +737,7 @@ void TClientRequest::Process(void* ThreadSpecificResource) { try { if (!HttpConn_) { const size_t outputBufferSize = HttpServ()->Options().OutputBufferSize; - if (outputBufferSize) { - HttpConn_.Reset(new THttpServerConn(Socket(), outputBufferSize)); - } else { - HttpConn_.Reset(new THttpServerConn(Socket())); - } + HttpConn_ = CreateHttpConnection(Socket(), outputBufferSize ? outputBufferSize : Socket().MaximumTransferUnit()); auto maxRequestsPerConnection = HttpServ()->Options().MaxRequestsPerConnection; HttpConn_->Output()->EnableKeepAlive(HttpServ()->Options().KeepAliveEnabled && (!maxRequestsPerConnection || Conn_->ReceivedRequests < maxRequestsPerConnection)); |
