diff options
| author | YDBot <[email protected]> | 2026-07-01 17:37:36 +0000 |
|---|---|---|
| committer | YDBot <[email protected]> | 2026-07-01 17:37:36 +0000 |
| commit | 79326b472a691c316ca5236986326f59ab1692d9 (patch) | |
| tree | c2aacbdc3666feb502799aa3794a93233a46bee8 /library/cpp/http/server/http.cpp | |
| parent | a0da3e07c0d50500ad4ba1b095f4633629b52d7c (diff) | |
| parent | a4fe0181b137330b9dd03651c173b9d7afc2a5b2 (diff) | |
Sync branches 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)); |
