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

Method RemoteAddr

library/cpp/http/misc/httpreqdata.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42TStringBuf TBaseServerRequestData::RemoteAddr() const {
43 if (!Addr_) {
44 auto& addr = Addr_.ConstructInPlace();
45 addr.ReserveAndResize(INET6_ADDRSTRLEN);
46 if (GetRemoteAddr(Socket_, addr.begin(), addr.size())) {
47 if (auto pos = addr.find('\0'); pos != TString::npos) {
48 addr.resize(pos);
49 }
50 } else {
51 addr.clear();
52 }
53 }
54
55 return *Addr_;
56 }
57
58const TString* TBaseServerRequestData::HeaderIn(TStringBuf key) const {
59 return HeadersIn_.FindPtr(key);

Callers 1

Y_UNIT_TESTFunction · 0.80

Calls 6

GetRemoteAddrFunction · 0.85
beginMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected