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


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

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


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

示例1: if

ANSC_STATUS
HttpBmoSaveFormAsFile
    (
        ANSC_HANDLE                 hThisObject,
        char*                       param_name,
        char*                       file_name,
        BOOL                        bFlushBody
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PHTTP_BASIC_MESSAGE_OBJECT      pMyObject    = (PHTTP_BASIC_MESSAGE_OBJECT)hThisObject;
    PHTTP_BMO_REQ_OBJECT            pBmoReq      = (PHTTP_BMO_REQ_OBJECT      )pMyObject;
    PHTTP_HFP_INTERFACE             pHfpIf       = (PHTTP_HFP_INTERFACE       )pMyObject->hHfpIf;
    PHTTP_TMH_INTERFACE             pTmhIf       = (PHTTP_TMH_INTERFACE       )pMyObject->hTmhIf;
    PHTTP_BCC_INTERFACE             pBccIf       = (PHTTP_BCC_INTERFACE       )pMyObject->hBccIf;
    PHTTP_RCP_INTERFACE             pRcpIf       = (PHTTP_RCP_INTERFACE          )pBmoReq->hRcpIf;
    PHTTP_FUM_INTERFACE             pFumIf       = (PHTTP_FUM_INTERFACE       )pMyObject->hFumIf;
    PHTTP_MDH_INTERFACE             pMdhIf       = (PHTTP_MDH_INTERFACE       )NULL;
    PHTTP_MESSAGE_BODY_OBJECT       pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT )pMyObject->hMessageBody;
    char*                           pBoundaryStr = NULL;
    ULONG                           ulEncType    = HTTP_HFP_FORM_ENCTYPE_URLENCODED;
    ULONG                           ulMediaType  = IANA_MEDIA_TYPE_CODE_APPLICATION;
    ULONG                           ulSubType    = IANA_MT_AP_STYPE_CODE_X_FORM_URLENCODED;
    char*                           pReqUri      = pRcpIf->GetPathInfo(pRcpIf->hOwnerContext, (ANSC_HANDLE)pMyObject);

    pMdhIf = (PHTTP_MDH_INTERFACE)pFumIf->GetMdhIf(pFumIf->hOwnerContext, pReqUri);

    if ( pMdhIf )
    {
        return
            pMdhIf->SaveFileAs
                (
                    pMdhIf->hOwnerContext,
                    pBmoReq->GetWebSessionId((ANSC_HANDLE)pBmoReq),
                    pReqUri,
                    param_name,
                    file_name
                );
    }

    if ( !pMessageBody || (pMyObject->Oid != HTTP_BMO_REQ_OID) )
    {
        return  ANSC_STATUS_UNAPPLICABLE;
    }
    else if ( pBmoReq->GetMethod((ANSC_HANDLE)pBmoReq) != HTTP_METHOD_CODE_POST )
    {
        return  ANSC_STATUS_UNAPPLICABLE;
    }

    if ( TRUE )
    {
        returnStatus =
        	HttpBmoReqCgiGetContentType
                (
                    (ANSC_HANDLE)pBmoReq,
                    &ulMediaType,
                    &ulSubType
                );

        if ( (ulMediaType == IANA_MEDIA_TYPE_CODE_APPLICATION       ) &&
             (ulSubType   == IANA_MT_AP_STYPE_CODE_X_FORM_URLENCODED) )
        {
            ulEncType = HTTP_HFP_FORM_ENCTYPE_URLENCODED;
        }
        else if ( (ulMediaType == IANA_MEDIA_TYPE_CODE_MULTIPART ) &&
                  (ulSubType   == IANA_MT_MP_STYPE_CODE_FORM_DATA) )
        {
            ulEncType    = HTTP_HFP_FORM_ENCTYPE_MULTIPART;
            pBoundaryStr = HttpBmoReqCgiGetBoundaryDelimiter((ANSC_HANDLE)pBmoReq);

            if ( !pBoundaryStr )
            {
                return  ANSC_STATUS_UNAPPLICABLE;
            }
        }
        else
        {
            return  ANSC_STATUS_UNAPPLICABLE;
        }
    }

    returnStatus =
        pHfpIf->SaveFormPartAsFile
            (
                pHfpIf->hOwnerContext,
                param_name,
                file_name,
                ulEncType,
                pBoundaryStr,
                (ANSC_HANDLE)pMessageBody,
                bFlushBody
            );

    if ( pBoundaryStr )
    {
        AnscFreeMemory(pBoundaryStr);
    }

    return  returnStatus;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:100,代码来源:http_bmo_body.c


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