diff options
| author | robot-piglet <[email protected]> | 2025-09-26 17:14:09 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-09-26 17:24:44 +0300 |
| commit | e9929fbc0b127e4072d15c208caba036ea9c11ec (patch) | |
| tree | 5f9587a4d11ad0a6313522da564fab1114a1fba1 /library/cpp | |
| parent | 4b3125be6ece2645680f74d02e362b285729d9ad (diff) | |
Intermediate changes
commit_hash:89ed730ecacf618d740c13539529091af81397b8
Diffstat (limited to 'library/cpp')
| -rw-r--r-- | library/cpp/neh/http2.cpp | 6 | ||||
| -rw-r--r-- | library/cpp/neh/http2.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/library/cpp/neh/http2.cpp b/library/cpp/neh/http2.cpp index daf73ba0d1f..d16a2619e08 100644 --- a/library/cpp/neh/http2.cpp +++ b/library/cpp/neh/http2.cpp @@ -126,6 +126,10 @@ bool THttp2Options::Set(TStringBuf name, TStringBuf value) { namespace NNeh { const NDns::TResolvedHost* Resolve(const TStringBuf host, ui16 port, NHttp::EResolverType resolverType); + + bool IsNotError(unsigned httpCode) { + return (httpCode >= 200u && httpCode < (!THttp2Options::RedirectionNotError ? 300u : 400u)) || THttp2Options::AnyResponseIsNotError; + } } namespace { @@ -1229,7 +1233,7 @@ namespace { void THttpRequest::OnResponse(TAutoPtr<THttpParser>& rsp) { DBGOUT("THttpRequest::OnResponse()"); ReleaseConn(); - if (Y_LIKELY(((rsp->RetCode() >= 200u && rsp->RetCode() < (!THttp2Options::RedirectionNotError ? 300u : 400u)) || THttp2Options::AnyResponseIsNotError))) { + if (Y_LIKELY(IsNotError(rsp->RetCode()))) { NotifyResponse(rsp->DecodedContent(), rsp->FirstLine(), rsp->Headers()); } else { TString message; diff --git a/library/cpp/neh/http2.h b/library/cpp/neh/http2.h index cb691e22cd2..65c1dd9c786 100644 --- a/library/cpp/neh/http2.h +++ b/library/cpp/neh/http2.h @@ -119,4 +119,6 @@ namespace NNeh { /// - min, if reached hard limit /// - approx. linear changed[max..min], while conn. count in range [soft..hard] void SetHttp2InputConnectionsTimeouts(unsigned minSeconds, unsigned maxSeconds); + + bool IsNotError(unsigned httpCode); } |
