diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2023-05-05 17:59:15 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2023-05-05 17:59:15 +0300 |
commit | 64af0242391e232daff8da23ef1020a311d65ce5 (patch) | |
tree | c2ba5593606ab330ffc00a2e20e12c408d24e137 /library/cpp | |
parent | 54f6fdc6600fa679e1f643cd4bedc3e5f042e10e (diff) | |
download | ydb-64af0242391e232daff8da23ef1020a311d65ce5.tar.gz |
Intermediate changes
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/neh/http2.cpp | 6 | ||||
-rw-r--r-- | library/cpp/neh/http2.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/library/cpp/neh/http2.cpp b/library/cpp/neh/http2.cpp index 8cc693e9a38..d8db33e3690 100644 --- a/library/cpp/neh/http2.cpp +++ b/library/cpp/neh/http2.cpp @@ -106,6 +106,7 @@ bool THttp2Options::TcpKeepAlive = false; i32 THttp2Options::LimitRequestsPerConnection = -1; bool THttp2Options::QuickAck = false; bool THttp2Options::UseAsyncSendRequest = false; +bool THttp2Options::RespectHostInHttpServerNetworkAddress = false; bool THttp2Options::Set(TStringBuf name, TStringBuf value) { #define HTTP2_TRY_SET(optType, optName) \ @@ -1874,7 +1875,10 @@ namespace { , CB_(cb) , LimitRequestsPerConnection(THttp2Options::LimitRequestsPerConnection) { - TNetworkAddress addr(loc.GetPort()); + + TNetworkAddress addr = THttp2Options::RespectHostInHttpServerNetworkAddress ? + TNetworkAddress(TString(loc.Host), loc.GetPort()) + : TNetworkAddress(loc.GetPort()); for (TNetworkAddress::TIterator it = addr.Begin(); it != addr.End(); ++it) { TEndpoint ep(new NAddr::TAddrInfo(&*it)); diff --git a/library/cpp/neh/http2.h b/library/cpp/neh/http2.h index 7bc16affa01..cb691e22cd2 100644 --- a/library/cpp/neh/http2.h +++ b/library/cpp/neh/http2.h @@ -95,6 +95,9 @@ namespace NNeh { // enable write to socket via ScheduleOp static bool UseAsyncSendRequest; + // Respect host name/address in THttpServer initialization (pass it it getaddrinfo) + static bool RespectHostInHttpServerNetworkAddress; + //set option, - return false, if option name not recognized static bool Set(TStringBuf name, TStringBuf value); }; |