本文整理汇总了C++中Listener::GetSecureMode方法的典型用法代码示例。如果您正苦于以下问题:C++ Listener::GetSecureMode方法的具体用法?C++ Listener::GetSecureMode怎么用?C++ Listener::GetSecureMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Listener
的用法示例。
在下文中一共展示了Listener::GetSecureMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lock
// Adding an URL to the Url-Group and registering its context pointer/number
// URL Must be registered in the MS-Windows registry (services\http\parameters)
// Optionally start a listener for the portnumber if not already started
ULONG
UrlGroup::AddUrlPrefix(CString pFullyQualifiedUrl,HTTP_URL_CONTEXT UrlContext)
{
AutoCritSec lock(&m_lock);
// Check if registered with "netsh" command
if(!UrlIsRegistered(pFullyQualifiedUrl))
{
return ERROR_INVALID_PARAMETER;
}
URL url;
ULONG result = SplitURLPrefix(pFullyQualifiedUrl, &url);
if(result == NO_ERROR)
{
// Record the context
url.m_context = UrlContext;
url.m_urlGroup = this;
// Find the SSL/TLS settings from the registry
if(url.m_secure && !GetURLSettings(url))
{
return ERROR_INVALID_PARAMETER;
}
// Getting the parameters
CString name = url.m_abspath;
USHORT port = url.m_port;
// See if registered before
pFullyQualifiedUrl.MakeLower();
URLNames::iterator it = m_urls.find(pFullyQualifiedUrl);
if(it != m_urls.end())
{
return ERROR_ALREADY_EXISTS;
}
// Find if listener already exists and is contradictory to our URL
// Beware: if it exists and is secure, first registered Certificate will be used!
Listener* listener = m_queue->FindListener(port);
if(listener && (listener->GetSecureMode() != url.m_secure))
{
return ERROR_ALREADY_EXISTS;
}
// Keep URL in our mapping
m_urls.insert(std::make_pair(pFullyQualifiedUrl,url));
// Listener already exists. Do NOT make a new one
if(listener)
{
return NO_ERROR;
}
// Add listener to the request queue
// Use the settings from this particular URL (but does not retain the URL)
// And use the drain-entity body as the main timeout for the listener worker threads
return m_queue->StartListener(port,&url,m_timeoutDrainEntityBody);
}
return result;
}