本文整理汇总了C++中PHTTP_BMO_REQ_OBJECT::GetClientAddr方法的典型用法代码示例。如果您正苦于以下问题:C++ PHTTP_BMO_REQ_OBJECT::GetClientAddr方法的具体用法?C++ PHTTP_BMO_REQ_OBJECT::GetClientAddr怎么用?C++ PHTTP_BMO_REQ_OBJECT::GetClientAddr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHTTP_BMO_REQ_OBJECT
的用法示例。
在下文中一共展示了PHTTP_BMO_REQ_OBJECT::GetClientAddr方法的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;
}
}
//.........这里部分代码省略.........