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


C++ FilterPtr::getFilterId方法代码示例

本文整理汇总了C++中FilterPtr::getFilterId方法的典型用法代码示例。如果您正苦于以下问题:C++ FilterPtr::getFilterId方法的具体用法?C++ FilterPtr::getFilterId怎么用?C++ FilterPtr::getFilterId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FilterPtr的用法示例。


在下文中一共展示了FilterPtr::getFilterId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readLock

    // remotely accessible
    boost::int32_t FilterService::RequestTransportFilters(const std::vector<boost::int32_t> &filterIds)
    {
        RCF_LOG_3()(filterIds) << "FilterService::RequestTransportFilters() - entry";

        RcfSession & session = getCurrentRcfSession();
        RcfServer & server = session.getRcfServer();

        boost::shared_ptr< std::vector<FilterPtr> > filters(
            new std::vector<FilterPtr>());

        ReadLock readLock(mFilterFactoryMapMutex);
        for (unsigned int i=0; i<filterIds.size(); ++i)
        {
            int filterId = filterIds[i];

            if (filterId == RcfFilter_SspiSchannel || filterId == RcfFilter_OpenSsl)
            {               
                if (server.getSslImplementation() == RCF::Si_Schannel)
                {
                    filterId = RcfFilter_SspiSchannel;
                }
                else
                {
                    filterId = RcfFilter_OpenSsl;
                }
            }

            if (mFilterFactoryMap.find(filterId) == mFilterFactoryMap.end())
            {
                RCF_LOG_3()(filterId) << "FilterService::RequestTransportFilters() - filter not supported.";
                return RcfError_UnknownFilter;
            }

            FilterFactoryPtr filterFactoryPtr = mFilterFactoryMap[filterId];
            FilterPtr filterPtr( filterFactoryPtr->createFilter(server) );
            filters->push_back(filterPtr);
        }

        // Determine which protocol, if any, the filter sequence represents.
        
        session.mEnableCompression = false;

        FilterPtr filterPtr;
        if (filters->size() > 0)
        {
            if ( (*filters)[0]->getFilterId() == RcfFilter_ZlibCompressionStateful )
            {
                session.mEnableCompression = true;
                if (filters->size() > 1)
                {
                    filterPtr = (*filters)[1];
                }
            }
            else
            {
                if (filters->size() > 0)
                {
                    filterPtr = (*filters)[0];
                }
            }
        }

        TransportProtocol protocol = Tp_Unspecified;
        if (!filterPtr)
        {
            protocol = Tp_Clear;
        }
        else
        {
            int filterId = filterPtr->getFilterId();
            switch (filterId)
            {
            case RcfFilter_SspiNtlm:        protocol = Tp_Ntlm;         break;
            case RcfFilter_SspiKerberos:    protocol = Tp_Kerberos;     break;
            case RcfFilter_SspiNegotiate:   protocol = Tp_Negotiate;    break;
            case RcfFilter_SspiSchannel:    protocol = Tp_Ssl;          break;
            case RcfFilter_OpenSsl:         protocol = Tp_Ssl;          break;
            default:                        protocol = Tp_Unspecified;  break;
            }
        }

        // Check that the filter sequence is allowed.
        const std::vector<TransportProtocol> & protocols = server.getSupportedTransportProtocols();
        if (protocols.size() > 0)
        {
            if (std::find(protocols.begin(), protocols.end(), protocol) == protocols.end())
            {
                RCF_THROW( Exception(_RcfError_ProtocolNotSupported()) );
            }
        }

        if (protocol != Tp_Unspecified)
        {
            session.mTransportProtocol = protocol;
        }
        
        if (session.transportFiltersLocked())
        {
            RCF_LOG_3() << "FilterService::RequestTransportFilters() - filter sequence already locked.";
//.........这里部分代码省略.........
开发者ID:rajkosto,项目名称:deps-rcf,代码行数:101,代码来源:FilterService.cpp


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