| 1943 | } |
| 1944 | |
| 1945 | TDuration GetKeepAliveTimeout() const noexcept { |
| 1946 | size_t cc = HttpInConnCounter()->Val(); |
| 1947 | TFdLimits lim(*HttpInConnLimits()); |
| 1948 | |
| 1949 | if (!TFdLimits::ExceedLimit(cc, lim.Soft())) { |
| 1950 | return THttp2Options::ServerInputDeadlineKeepAliveMax; |
| 1951 | } |
| 1952 | |
| 1953 | if (cc > lim.Hard()) { |
| 1954 | cc = lim.Hard(); |
| 1955 | } |
| 1956 | TDuration::TValue softTuneRange = THttp2Options::ServerInputDeadlineKeepAliveMax.Seconds() - THttp2Options::ServerInputDeadlineKeepAliveMin.Seconds(); |
| 1957 | |
| 1958 | return TDuration::Seconds((softTuneRange * (cc - lim.Soft())) / (lim.Hard() - lim.Soft() + 1)) + THttp2Options::ServerInputDeadlineKeepAliveMin; |
| 1959 | } |
| 1960 | |
| 1961 | private: |
| 1962 | void StartAccept(TTcpAcceptor* a) { |
no test coverage detected