MCPcopy Create free account
hub / github.com/catboost/catboost / GetKeepAliveTimeout

Method GetKeepAliveTimeout

library/cpp/neh/http2.cpp:1945–1959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers 1

OnReadSomeMethod · 0.80

Calls 7

HttpInConnCounterFunction · 0.85
HttpInConnLimitsFunction · 0.85
SoftMethod · 0.80
HardMethod · 0.80
SecondsFunction · 0.50
ValMethod · 0.45
SecondsMethod · 0.45

Tested by

no test coverage detected