本文整理汇总了C++中Ptr::AddParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::AddParameter方法的具体用法?C++ Ptr::AddParameter怎么用?C++ Ptr::AddParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ptr
的用法示例。
在下文中一共展示了Ptr::AddParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
#else
struct timespec delay = { (time_t)dbgPause, 0 };
nanosleep(&delay, NULL);
#endif
}
#endif
// Parse inputs GET/POST
char* query = getenv(MapAgentStrings::QueryString);
char* requestMethod = getenv(MapAgentStrings::RequestMethod);
if (NULL != requestMethod && NULL != strstr(requestMethod, "POST"))
{
// Must be a POST request
postParser.Parse(params);
}
else if (NULL != query && strlen(query) > 0)
{
DumpMessage2("Query string present");
DumpMessage2(query);
// If we have a QUERY_STRING then we are a GET request
MapAgentGetParser::Parse(query, params);
}
// check for CLIENTIP, if it's not there (and it shouldn't be),
// add it in using httpClientIp. httpXFF or remoteAddr
STRING clientIp = L"";
if (!params->ContainsParameter(L"CLIENTIP")) // NOXLATE
{
if (NULL != httpClientIp && strlen(httpClientIp) > 0
&& _stricmp(httpClientIp, MapAgentStrings::Unknown) != 0)
{
clientIp = MgUtil::MultiByteToWideChar(httpClientIp);
params->AddParameter(L"CLIENTIP", clientIp); // NOXLATE
}
else if (NULL != httpXFF && strlen(httpXFF) > 0
&& _stricmp(httpXFF, MapAgentStrings::Unknown) != 0)
{
clientIp = MgUtil::MultiByteToWideChar(httpXFF);
params->AddParameter(L"CLIENTIP", clientIp); // NOXLATE
}
else if (NULL != remoteAddr && strlen(remoteAddr) > 0)
{
clientIp = MgUtil::MultiByteToWideChar(remoteAddr);
params->AddParameter(L"CLIENTIP", clientIp); // NOXLATE
}
}
// Check for HTTP Basic Auth header
char* auth = getenv(MapAgentStrings::HttpAuth);
bool gotAuth = ParseAuth(auth, params);
if (!gotAuth)
{
// And check for a REMOTE_USER remapped header
auth = getenv(MapAgentStrings::HttpRemoteUser);
gotAuth = ParseAuth(auth, params);
}
// Log request information
string postData = "";
if (requestMethod && _stricmp(requestMethod, "POST") == 0) // NOXLATE
{
// Get the post xml data
postData = params->GetXmlPostData();
}