当前位置: 首页>>代码示例>>C++>>正文


C++ Listener::GetSecureMode方法代码示例

本文整理汇总了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;
}
开发者ID:edwig,项目名称:Marlin,代码行数:63,代码来源:UrlGroup.cpp


注:本文中的Listener::GetSecureMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。