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


C++ PHTTP_BMO_REQ_OBJECT::GetClientPort方法代码示例

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


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

示例1: if

ANSC_HANDLE
WebVhoIdentifyGso
(
    ANSC_HANDLE                 hThisObject,
    ANSC_HANDLE                 hBmoReq
)
{
    ANSC_STATUS                     returnStatus   = ANSC_STATUS_SUCCESS;
    PWEB_VIRTUAL_HOST_OBJECT        pMyObject      = (PWEB_VIRTUAL_HOST_OBJECT   )hThisObject;
    PWEB_VIRTUAL_HOST_PROPERTY      pProperty      = (PWEB_VIRTUAL_HOST_PROPERTY )&pMyObject->Property;
    PHTTP_HFP_INTERFACE             pHfpIf         = (PHTTP_HFP_INTERFACE        )pMyObject->hHfpIf;
    PWEB_LSM_INTERFACE              pLsmIf         = (PWEB_LSM_INTERFACE         )pMyObject->hLsmIf;
    PHTTP_BMO_REQ_OBJECT            pBmoReq        = (PHTTP_BMO_REQ_OBJECT       )hBmoReq;
    PHTTP_HFO_COOKIE                pHttpHfoCookie = (PHTTP_HFO_COOKIE           )NULL;
    PHTTP_COOKIE_CONTENT            pCookieContent = (PHTTP_COOKIE_CONTENT       )NULL;
    PWEB_GENERAL_SESSION_OBJECT     pSession       = (PWEB_GENERAL_SESSION_OBJECT)NULL;
    ULONG                           ulSessionId    = (ULONG                      )0xFFFFFFFF;
    char*                           pLsmIdentifier = (char*                      )NULL;
    char                            pEmptyLsmId[]  = {0};
    BOOL                            bLsmIdAlloc    = (BOOL                       )FALSE;
    ULONG                           ulClientAddr   = (ULONG                      )AnscReadUlong(pBmoReq->GetClientAddr((ANSC_HANDLE)pBmoReq));
    USHORT                          usClientPort   = (USHORT                     )pBmoReq->GetClientPort((ANSC_HANDLE)pBmoReq);
    BOOL                            bGotSessionId  = (BOOL                       )FALSE;
    BOOL                            bGotLsmId      = (BOOL                       )FALSE;
    ULONG                           i              = 0;
    ULONG                           ulCookieIndex  = 0;

    if ( !pProperty->bEnableSessionTracking )
    {
        return  (ANSC_HANDLE)NULL;
    }

    pHttpHfoCookie =
        (PHTTP_HFO_COOKIE)pBmoReq->GetHeaderField2
        (
            (ANSC_HANDLE)pBmoReq,
            HTTP_HEADER_ID_COOKIE,
            ulCookieIndex ++
        );

    while ( pHttpHfoCookie )
    {
        for ( i = 0; i < pHttpHfoCookie->CookieCount; i++ )
        {
            pCookieContent = &pHttpHfoCookie->CookieArray[i];

            if ( !bGotSessionId     &&
                    AnscEqualString
                    (
                        pCookieContent->Name,
                        pProperty->VhoCookieName,
                        TRUE
                    ) )
            {
                PUCHAR              pCookieValue = pCookieContent->Value;

                /* Some clients will use double quote in cookie value
                 * although we don't specify in Set-Cookie.
                 */
                if ( pCookieValue[0] == '"' )
                {
                    pCookieValue ++;
                }

                ulSessionId = (ULONG)_ansc_atol(pCookieValue);
                bGotSessionId = TRUE;
            }
            else if ( !bGotLsmId      &&
                      AnscEqualString
                      (
                          pCookieContent->Name,
                          pProperty->LsmCookieName,
                          TRUE
                      ) )
            {
                bGotLsmId      = TRUE;
                pLsmIdentifier = pCookieContent->Value;

                /* Some clients will use double quote in cookie value
                 * although we don't specify in Set-Cookie. This may
                 * cause session match failure, and therefore authentication
                 * may fail.
                 */

                if ( pLsmIdentifier )
                {
                    ULONG           ulLen = (ULONG)AnscSizeOfString(pLsmIdentifier);

                    if ( ulLen == 2 && *pLsmIdentifier == '"' && *(pLsmIdentifier + 1) == '"' )
                    {
                        pLsmIdentifier = pEmptyLsmId;
                    }
                    else if ( ulLen > 2 && *pLsmIdentifier == '"' && *(pLsmIdentifier + ulLen - 1) == '"' )
                    {
                        pLsmIdentifier = AnscAllocateMemory(ulLen);
                        AnscCopyMemory(pLsmIdentifier, pCookieContent->Value + 1, ulLen - 2);
                        pLsmIdentifier[ulLen - 2] = 0;
                        bLsmIdAlloc = TRUE;
                    }
                }
//.........这里部分代码省略.........
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:101,代码来源:web_vho_management.c


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