Go to the documentation of this file.Go to the SVN repository for this file.
43 #include "../../util/random_gen.cpp"
45 #include "../../util/checksum.cpp"
46 #include "../../util/md5.cpp"
47 #include "../../connect/services/netservice_protocol_parser.cpp"
48 #define NO_COMPOUND_ID_SUPPORT
49 #include "../../connect/services/netcache_key.cpp"
50 #undef HAVE_SQLITE3ASYNC_H
51 #undef HAVE_SQLITE3_UNLOCK_NOTIFY
52 #include "../../db/sqlite/sqlitewrapp.cpp"
53 #undef NCBI_USE_ERRCODE_X
72 unsigned underscore_count = 1;
73 const char* underscore = strchr(
str.c_str(),
'_');
74 while (underscore !=
NULL) {
76 underscore = strchr(underscore + 1,
'_');
78 return underscore_count;
85 bool internal = headers.
find(
"CAF-INTERNAL") != headers.
end();
86 bool external = headers.
find(
"CAF-EXTERNAL") != headers.
end();
88 if (
internal || !external ) {
89 if (headers.
find(
"CLIENT-HOST") != headers.
end()) {
90 client = headers.at(
"CLIENT-HOST");
94 for(
const auto& h : {
"CAF-PROXIED-HOST",
"X-FORWARDED-FOR",
"PROXIED-IP",
"X-FWD-IP-ADDR",
"X-REAL-IP"}) {
95 if (headers.
find(h) != headers.
end()) {
const_iterator end() const
const_iterator find(const key_type &key) const
static const char * str(char *buf, int n)
TErrCode GetErrCode(void) const
Get error code.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual const char * GetErrCodeString(void) const override
Get error code interpreted as text.
string g_GetClientIP(const map< string, string > &headers)
unsigned g_NumberOfUnderscoresPlusOne(const string &str)
static CNamedPipeClient * client