本文整理汇总了C++中PHTTP_BMO_REQ_OBJECT类的典型用法代码示例。如果您正苦于以下问题:C++ PHTTP_BMO_REQ_OBJECT类的具体用法?C++ PHTTP_BMO_REQ_OBJECT怎么用?C++ PHTTP_BMO_REQ_OBJECT使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PHTTP_BMO_REQ_OBJECT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnscAcquireLock
ANSC_STATUS
HttpSpoDestroyBmoReqPool
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_SIMPLE_PROXY_OBJECT pMyObject = (PHTTP_SIMPLE_PROXY_OBJECT )hThisObject;
PHTTP_SIMPLE_PROXY_PROPERTY pProperty = (PHTTP_SIMPLE_PROXY_PROPERTY)&pMyObject->Property;
PHTTP_BMO_REQ_OBJECT pBmoReq = NULL;
PSINGLE_LINK_ENTRY pSLinkEntry = NULL;
AnscAcquireLock(&pMyObject->BmoReqSListLock);
pSLinkEntry = AnscSListPopEntry(&pMyObject->BmoReqSList);
while ( pSLinkEntry )
{
pBmoReq = ACCESS_HTTP_BMO_REQ_OBJECT(pSLinkEntry);
pSLinkEntry = AnscSListPopEntry(&pMyObject->BmoReqSList);
pBmoReq->Remove((ANSC_HANDLE)pBmoReq);
}
AnscReleaseLock(&pMyObject->BmoReqSListLock);
return ANSC_STATUS_SUCCESS;
}
示例2:
ANSC_STATUS
WebRooDoPost
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hBmoReq,
ANSC_HANDLE hBmoRep
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PWEB_RESOURCE_OWNER_OBJECT pMyObject = (PWEB_RESOURCE_OWNER_OBJECT )hThisObject;
PWEB_RESOURCE_OWNER_PROPERTY pProperty = (PWEB_RESOURCE_OWNER_PROPERTY)&pMyObject->Property;
PHTTP_RCP_INTERFACE pRcpIf = (PHTTP_RCP_INTERFACE )pMyObject->hRcpIf;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )hBmoReq;
PHTTP_BMO_REP_OBJECT pBmoRep = (PHTTP_BMO_REP_OBJECT )hBmoRep;
PHTTP_REQUEST_INFO pReqInfo = (PHTTP_REQUEST_INFO )pBmoReq->GetReqInfo ((ANSC_HANDLE)pBmoReq);
PANSC_TOKEN_CHAIN pPathTokenChain = (PANSC_TOKEN_CHAIN )pBmoReq->GetRecvContext((ANSC_HANDLE)pBmoReq);
PWEB_GENERAL_SESSION_OBJECT pSession = (PWEB_GENERAL_SESSION_OBJECT )pBmoRep->GetRecvContext((ANSC_HANDLE)pBmoRep);
returnStatus =
pMyObject->ReplyReq
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep,
HTTP_STATUS_OK,
(ANSC_HANDLE)NULL
);
return returnStatus;
}
示例3: AnscSListPushEntry
ANSC_STATUS
HttpSpoReleaseBmoReq
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hBmoReq
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_SIMPLE_PROXY_OBJECT pMyObject = (PHTTP_SIMPLE_PROXY_OBJECT )hThisObject;
PHTTP_SIMPLE_PROXY_PROPERTY pProperty = (PHTTP_SIMPLE_PROXY_PROPERTY)&pMyObject->Property;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )hBmoReq;
pBmoReq->Reset((ANSC_HANDLE)pBmoReq);
if ( pMyObject->ProxyMode & HTTP_SPO_MODE_COMPACT )
{
pBmoReq->Remove((ANSC_HANDLE)pBmoReq);
}
else
{
AnscAcquireLock (&pMyObject->BmoReqSListLock);
AnscSListPushEntry(&pMyObject->BmoReqSList, &pBmoReq->Linkage);
AnscReleaseLock (&pMyObject->BmoReqSListLock);
}
return ANSC_STATUS_SUCCESS;
}
示例4:
ANSC_STATUS
HttpBmoReqCopyStartLineFrom
(
ANSC_HANDLE hThisObject,
PVOID buffer,
PULONG pulSize
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_BMO_REQ_OBJECT pMyObject = (PHTTP_BMO_REQ_OBJECT)hThisObject;
PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf;
PHTTP_REQUEST_INFO pReqInfo = (PHTTP_REQUEST_INFO )pMyObject->hReqInfo;
ULONG ulStartLineSize = pMyObject->GetStartLineSize((ANSC_HANDLE)pMyObject);
if ( *pulSize < ulStartLineSize )
{
return ANSC_STATUS_BAD_SIZE;
}
returnStatus =
pHfpIf->BuildRequestLine
(
pHfpIf->hOwnerContext,
(ANSC_HANDLE)pReqInfo,
buffer,
ulStartLineSize
);
*pulSize = ulStartLineSize;
return returnStatus;
}
示例5: AnscFreeMemory
ANSC_STATUS
HttpBmoReqRemove
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_BMO_REQ_OBJECT pMyObject = (PHTTP_BMO_REQ_OBJECT)hThisObject;
PHTTP_CGI_INTERFACE pCgiIf = (PHTTP_CGI_INTERFACE )pMyObject->hCgiIf;
PHTTP_RCP_INTERFACE pRcpIf = (PHTTP_RCP_INTERFACE )pMyObject->hRcpIf;
pMyObject->Reset((ANSC_HANDLE)pMyObject);
if ( pCgiIf )
{
AnscFreeMemory(pCgiIf);
}
if ( pRcpIf )
{
AnscFreeMemory(pRcpIf);
}
if ( pMyObject->RcpDpad )
{
AnscFreeMemory(pMyObject->RcpDpad);
}
HttpBmoRemove((ANSC_HANDLE)pMyObject);
return ANSC_STATUS_SUCCESS;
}
示例6:
char*
HttpBmoReqRcpGetServerName
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hBmoReq
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_BMO_REQ_OBJECT pMyObject = (PHTTP_BMO_REQ_OBJECT )hThisObject;
return pMyObject->GetServerName((ANSC_HANDLE)pMyObject);
}
示例7: AnscBdoGetBlockSize
ANSC_STATUS
HttpTroRecvFromClient
(
ANSC_HANDLE hThisObject,
PVOID buffer,
ULONG ulSize,
ANSC_HANDLE hBufferContext
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_TRANS_RECORD_OBJECT pMyObject = (PHTTP_TRANS_RECORD_OBJECT )hThisObject;
PHTTP_ADVANCED_PROXY_OBJECT pAdvancedProxy = (PHTTP_ADVANCED_PROXY_OBJECT )pMyObject->hOwnerContext;
PHTTP_WAM_INTERFACE pWamIf = (PHTTP_WAM_INTERFACE )pMyObject->hWamIf;
PHTTP_SBC_INTERFACE pSbcIf = (PHTTP_SBC_INTERFACE )pMyObject->hSbcIf;
PANSC_DAEMON_SOCKET_TCP_OBJECT pClientSocket = (PANSC_DAEMON_SOCKET_TCP_OBJECT)pMyObject->hClientSocket;
PANSC_BROKER_SOCKET_TCP_OBJECT pServerSocket = (PANSC_BROKER_SOCKET_TCP_OBJECT)pMyObject->hServerSocket;
PANSC_BUFFER_DESCRIPTOR pBufferDesp = (PANSC_BUFFER_DESCRIPTOR )hBufferContext;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )pMyObject->hBmoReq;
ULONG ulBmoState = HTTP_BMO_STATE_EMPTY;
/*
* At time like this, you will always have two options on how to proceed with the message
* processing:
*
* $ Examine the current object states and the content of the message payload
* to make the processing decisions in this object.
*
* $ Offload the examination and certain state-transition functions to another
* object and provide an interface to be notified when something happens.
*
* Guess which one we're using here ...
*/
buffer = AnscBdoGetBlock (pBufferDesp);
ulSize = AnscBdoGetBlockSize(pBufferDesp);
returnStatus =
pBmoReq->Process
(
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBufferDesp
);
if ( (returnStatus != ANSC_STATUS_SUCCESS ) &&
(returnStatus != ANSC_STATUS_DO_IT_AGAIN) )
{
pMyObject->TransState = HTTP_TRO_STATE_FINISHED;
}
return returnStatus;
}
示例8:
ANSC_STATUS
BwspWsoDoHead
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hBmoReq,
ANSC_HANDLE hBmoRep
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PBWSP_WEB_SERVLET_OBJECT pMyObject = (PBWSP_WEB_SERVLET_OBJECT )hThisObject;
PBWSP_WEB_SERVLET_PROPERTY pProperty = (PBWSP_WEB_SERVLET_PROPERTY )&pMyObject->Property;
PBWSP_WSH_INTERFACE pBwspWshIf = (PBWSP_WSH_INTERFACE )pMyObject->hBwspWshIf;
PHTTP_RCP_INTERFACE pRcpIf = (PHTTP_RCP_INTERFACE )pMyObject->hRcpIf;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )hBmoReq;
PHTTP_BMO_REP_OBJECT pBmoRep = (PHTTP_BMO_REP_OBJECT )hBmoRep;
PHTTP_REQUEST_INFO pReqInfo = (PHTTP_REQUEST_INFO )pBmoReq->GetReqInfo ((ANSC_HANDLE)pBmoReq);
PANSC_TOKEN_CHAIN pPathTokenChain = (PANSC_TOKEN_CHAIN )pBmoReq->GetRecvContext((ANSC_HANDLE)pBmoReq);
PWEB_GENERAL_SESSION_OBJECT pSession = (PWEB_GENERAL_SESSION_OBJECT)pBmoRep->GetRecvContext((ANSC_HANDLE)pBmoRep);
if ( pBwspWshIf->DoHead )
{
returnStatus =
pBwspWshIf->DoHead
(
pBwspWshIf->hOwnerContext,
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
}
else
{
returnStatus =
pMyObject->ReplyReq
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep,
HTTP_STATUS_OK,
(ANSC_HANDLE)NULL
);
}
return returnStatus;
}
示例9: AnscFreeBdo
ANSC_STATUS
HttpTroFinishedByClient
(
ANSC_HANDLE hThisObject,
PVOID buffer,
ULONG ulSize,
ANSC_HANDLE hBufferContext
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_TRANS_RECORD_OBJECT pMyObject = (PHTTP_TRANS_RECORD_OBJECT )hThisObject;
PHTTP_ADVANCED_PROXY_OBJECT pAdvancedProxy = (PHTTP_ADVANCED_PROXY_OBJECT )pMyObject->hOwnerContext;
PHTTP_WAM_INTERFACE pWamIf = (PHTTP_WAM_INTERFACE )pMyObject->hWamIf;
PHTTP_SBC_INTERFACE pSbcIf = (PHTTP_SBC_INTERFACE )pMyObject->hSbcIf;
PANSC_DAEMON_SOCKET_TCP_OBJECT pClientSocket = (PANSC_DAEMON_SOCKET_TCP_OBJECT)pMyObject->hClientSocket;
PANSC_BROKER_SOCKET_TCP_OBJECT pServerSocket = (PANSC_BROKER_SOCKET_TCP_OBJECT)pMyObject->hServerSocket;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )pMyObject->hBmoReq;
PANSC_BUFFER_DESCRIPTOR pBufferDesp = (PANSC_BUFFER_DESCRIPTOR )hBufferContext;
ULONG ulBmoState = pBmoReq->GetState((ANSC_HANDLE)pBmoReq);
if ( (ulBmoState == HTTP_BMO_STATE_COMPLETE ) ||
(ulBmoState == HTTP_BMO_STATE_OVER_PACKED) )
{
if ( pBufferDesp )
{
AnscFreeBdo((ANSC_HANDLE)pBufferDesp);
}
return ANSC_STATUS_UNAPPLICABLE;
}
buffer = AnscBdoGetBlock (pBufferDesp);
ulSize = AnscBdoGetBlockSize(pBufferDesp);
returnStatus =
pBmoReq->CloseUp
(
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBufferDesp
);
return returnStatus;
}
示例10: AnscFreeBdo
ANSC_STATUS
HttpWstoFinish
(
ANSC_HANDLE hThisObject,
PVOID buffer,
ULONG ulSize,
ANSC_HANDLE hBufferContext
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_WEBS_TRANS_OBJECT pMyObject = (PHTTP_WEBS_TRANS_OBJECT )hThisObject;
PHTTP_SIMPLE_SERVER_OBJECT pSimpleServer = (PHTTP_SIMPLE_SERVER_OBJECT )pMyObject->hOwnerContext;
PHTTP_WSP_INTERFACE pWspIf = (PHTTP_WSP_INTERFACE )pMyObject->hWspIf;
PANSC_DAEMON_SOCKET_TCP_OBJECT pWebSocket = (PANSC_DAEMON_SOCKET_TCP_OBJECT)pMyObject->hWebSocket;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )pMyObject->hBmoReq;
PANSC_BUFFER_DESCRIPTOR pBufferDesp = (PANSC_BUFFER_DESCRIPTOR )hBufferContext;
ULONG ulBmoState = pBmoReq->GetState((ANSC_HANDLE)pBmoReq);
if ( (ulBmoState == HTTP_BMO_STATE_COMPLETE ) ||
(ulBmoState == HTTP_BMO_STATE_OVER_PACKED) )
{
if ( pBufferDesp )
{
AnscFreeBdo((ANSC_HANDLE)pBufferDesp);
}
return ANSC_STATUS_UNAPPLICABLE;
}
buffer = AnscBdoGetBlock (pBufferDesp);
ulSize = AnscBdoGetBlockSize(pBufferDesp);
returnStatus =
pBmoReq->CloseUp
(
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBufferDesp
);
return returnStatus;
}
示例11: 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;
}
}
//.........这里部分代码省略.........
示例12: while
static void
HttpScoSetCookie
(
ANSC_HANDLE hHfpIf,
ANSC_HANDLE hResponse,
ANSC_HANDLE hRequest
)
{
PHTTP_HFP_INTERFACE pHttpHfpIf = (PHTTP_HFP_INTERFACE)hHfpIf;
PHTTP_BMO_REP_OBJECT pResponse = (PHTTP_BMO_REP_OBJECT)hResponse;
PHTTP_BMO_REQ_OBJECT pRequest = (PHTTP_BMO_REQ_OBJECT)hRequest;
char* pSetCookie = NULL;
BOOL bSetCookie2 = FALSE;
ULONG ulCount1 = 0;
ULONG ulCount2 = 0;
PHTTP_HEADER_FIELD pHttpHfo = NULL;
pRequest->DelHeaderField((ANSC_HANDLE)pRequest, HTTP_HEADER_ID_COOKIE);
while ( TRUE )
{
pSetCookie = pResponse->GetHeaderValueByName2((ANSC_HANDLE)pResponse, "Set-Cookie2", ulCount1++);
if ( !pSetCookie )
{
pSetCookie = pResponse->GetHeaderValueByName2((ANSC_HANDLE)pResponse, "Set-Cookie", ulCount2++);
bSetCookie2 = TRUE;
}
if ( !pSetCookie )
{
break;
}
else
{
char* pCookie = NULL;
ULONG ulCookieSize = AnscSizeOfString(pSetCookie) + 64;
pCookie = (char *)AnscAllocateMemory(ulCookieSize);
if ( pCookie )
{
PHTTP_HFO_SET_COOKIE pHfoSetCookie = NULL;
if ( bSetCookie2 )
{
_ansc_sprintf(pCookie, "Set-Cookie2: %s", pSetCookie);
}
else
{
_ansc_sprintf(pCookie, "Set-Cookie: %s", pSetCookie);
}
pHfoSetCookie = (PHTTP_HFO_SET_COOKIE)pHttpHfpIf->ParseHeader(pHttpHfpIf->hOwnerContext, pCookie, AnscSizeOfString(pCookie));
if ( pHfoSetCookie )
{
char* pCookieValue = NULL;
pHfoSetCookie->HeaderId = HTTP_HEADER_ID_COOKIE;
pHfoSetCookie->Flags &= ~HTTP_FIELD_FLAG_VALUE_PRESENT;
pHfoSetCookie->Flags &= ~HTTP_FIELD_FLAG_LINE_PRESENT;
ulCookieSize = pHttpHfpIf->GetHeaderSize(pHttpHfpIf->hOwnerContext, (ANSC_HANDLE)pHfoSetCookie);
pHttpHfpIf->BuildHeader(pHttpHfpIf->hOwnerContext, (ANSC_HANDLE)pHfoSetCookie, pCookie, ulCookieSize);
pCookie[ulCookieSize] = 0;
if ( pCookie )
{
pRequest->SetHeaderValueByName((ANSC_HANDLE)pRequest, "Cookie", pCookie + 8);
}
AnscFreeMemory(pHfoSetCookie);
}
AnscFreeMemory(pCookie);
}
}
}
}
示例13: AnscBdoGetBlockSize
ANSC_STATUS
HttpBmoReqParseStartLine
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_BMO_REQ_OBJECT pMyObject = (PHTTP_BMO_REQ_OBJECT )hThisObject;
PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf;
PANSC_BUFFER_DESCRIPTOR pHeaderBdo = (PANSC_BUFFER_DESCRIPTOR)pMyObject->hHeaderBdo;
PHTTP_REQUEST_INFO pReqInfo = (PHTTP_REQUEST_INFO )pMyObject->hReqInfo;
PVOID pHeaderBuffer = NULL;
ULONG ulBufferSize = 0;
char* pHfStart = NULL;
ULONG ulSkipSize = 0;
char* pRawHfLine = NULL;
char* pStdHfLine = (char*)pMyObject->ScratchPad1;
ULONG ulRawLineSize = 0;
ULONG ulStdLineSize = 0;
pMyObject->DelStartLine((ANSC_HANDLE)pMyObject);
if ( !pHeaderBdo )
{
return ANSC_STATUS_UNAPPLICABLE;
}
else
{
pHeaderBuffer = AnscBdoGetBlock (pHeaderBdo);
ulBufferSize = AnscBdoGetBlockSize(pHeaderBdo);
}
AnscHttpFindHfStart(pHeaderBuffer, ulBufferSize, pHfStart);
if ( !pHfStart )
{
return ANSC_STATUS_UNAPPLICABLE;
}
else
{
ulSkipSize = (ULONG)pHfStart - (ULONG)pHeaderBuffer;
ulBufferSize -= ulSkipSize;
pRawHfLine = pHfStart;
}
AnscHttpGetHfLineSize(pRawHfLine, ulBufferSize, ulRawLineSize);
if ( ulRawLineSize <= pMyObject->PadSize1 )
{
AnscHttpPrepareHeader(pRawHfLine, ulRawLineSize, pStdHfLine, ulStdLineSize);
pStdHfLine[ulStdLineSize + 0] = HTTP_CARRIAGE_RETURN;
pStdHfLine[ulStdLineSize + 1] = HTTP_LINE_FEED;
pReqInfo =
(PHTTP_REQUEST_INFO)pHfpIf->ParseRequestLine
(
pHfpIf->hOwnerContext,
pStdHfLine,
ulStdLineSize
);
}
else
{
pReqInfo = NULL;
}
if ( !pReqInfo )
{
return ANSC_STATUS_BAD_PAYLOAD;
}
else
{
pMyObject->hReqInfo = (ANSC_HANDLE)pReqInfo;
}
return ANSC_STATUS_SUCCESS;
}
示例14: if
ANSC_STATUS
WebRooProcess
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hBmoReq,
ANSC_HANDLE hBmoRep
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PWEB_RESOURCE_OWNER_OBJECT pMyObject = (PWEB_RESOURCE_OWNER_OBJECT )hThisObject;
PWEB_RESOURCE_OWNER_PROPERTY pProperty = (PWEB_RESOURCE_OWNER_PROPERTY)&pMyObject->Property;
PHTTP_RCP_INTERFACE pRcpIf = (PHTTP_RCP_INTERFACE )pMyObject->hRcpIf;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )hBmoReq;
PHTTP_BMO_REP_OBJECT pBmoRep = (PHTTP_BMO_REP_OBJECT )hBmoRep;
PHTTP_REQUEST_INFO pReqInfo = (PHTTP_REQUEST_INFO )pBmoReq->GetReqInfo ((ANSC_HANDLE)pBmoReq);
PANSC_TOKEN_CHAIN pPathTokenChain = (PANSC_TOKEN_CHAIN )pBmoReq->GetRecvContext((ANSC_HANDLE)pBmoReq);
PWEB_GENERAL_SESSION_OBJECT pSession = (PWEB_GENERAL_SESSION_OBJECT )pBmoRep->GetRecvContext((ANSC_HANDLE)pBmoRep);
PWEB_AUTH_SERVER_OBJECT pAuthServer = (PWEB_AUTH_SERVER_OBJECT )pMyObject->hAuthServer;
BOOL bAuthenticated = TRUE;
pBmoReq->SetRcpIf ((ANSC_HANDLE)pBmoReq, (ANSC_HANDLE)pRcpIf );
pBmoRep->SetWebServlet((ANSC_HANDLE)pBmoReq, (ANSC_HANDLE)pMyObject);
if ( pReqInfo->MajorVersion != HTTP_CURRENT_MAJOR_VERSION )
{
returnStatus =
pMyObject->ReplyReq
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep,
HTTP_STATUS_VERSION_NOT_SUPPORTED,
(ANSC_HANDLE)NULL
);
goto EXIT1;
}
if ( pAuthServer )
{
returnStatus =
pAuthServer->AuthenticateReq
(
(ANSC_HANDLE)pAuthServer,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
bAuthenticated = ( returnStatus == ANSC_STATUS_SUCCESS );
returnStatus = ANSC_STATUS_SUCCESS;
}
if ( bAuthenticated )
{
switch ( pBmoReq->GetMethod((ANSC_HANDLE)pBmoReq) )
{
case HTTP_METHOD_CODE_OPTIONS :
returnStatus =
pMyObject->DoOptions
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
break;
case HTTP_METHOD_CODE_GET :
returnStatus =
pMyObject->DoGet
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
break;
case HTTP_METHOD_CODE_HEAD :
returnStatus =
pMyObject->DoHead
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
);
break;
case HTTP_METHOD_CODE_POST :
returnStatus =
pMyObject->DoPost
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
(ANSC_HANDLE)pBmoRep
//.........这里部分代码省略.........
示例15: if
ANSC_STATUS
HttpTroResumeTransaction
(
ANSC_HANDLE hThisObject,
ANSC_HANDLE hReserved,
ULONG ulSbcPmode
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_TRANS_RECORD_OBJECT pMyObject = (PHTTP_TRANS_RECORD_OBJECT )hThisObject;
PHTTP_ADVANCED_PROXY_OBJECT pAdvancedProxy = (PHTTP_ADVANCED_PROXY_OBJECT )pMyObject->hOwnerContext;
PHTTP_ADVANCED_PROXY_PROPERTY pSpoProperty = (PHTTP_ADVANCED_PROXY_PROPERTY )&pAdvancedProxy->Property;
PHTTP_WAM_INTERFACE pWamIf = (PHTTP_WAM_INTERFACE )pMyObject->hWamIf;
PANSC_DAEMON_SOCKET_TCP_OBJECT pClientSocket = (PANSC_DAEMON_SOCKET_TCP_OBJECT)pMyObject->hClientSocket;
PANSC_BROKER_SOCKET_TCP_OBJECT pServerSocket = (PANSC_BROKER_SOCKET_TCP_OBJECT)pMyObject->hServerSocket;
PHTTP_BMO_REQ_OBJECT pBmoReq = (PHTTP_BMO_REQ_OBJECT )pMyObject->hBmoReq;
if ( pMyObject->SbcPmode != HTTP_SBC_PMODE_QUEUE )
{
return ANSC_STATUS_UNAPPLICABLE;
}
else if ( (ulSbcPmode != HTTP_SBC_PMODE_RELAY1) &&
(ulSbcPmode != HTTP_SBC_PMODE_RELAY2) &&
(ulSbcPmode != HTTP_SBC_PMODE_STORE ) )
{
return ANSC_STATUS_UNAPPLICABLE;
}
pMyObject->AcquireAccess((ANSC_HANDLE)pMyObject);
if ( !pServerSocket )
{
returnStatus =
pMyObject->SetUpConnection
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)NULL
);
}
if ( returnStatus != ANSC_STATUS_SUCCESS )
{
pMyObject->ReleaseAccess((ANSC_HANDLE)pMyObject);
return returnStatus;
}
else
{
pMyObject->SbcPmode = ulSbcPmode;
returnStatus =
pMyObject->SendToServer
(
(ANSC_HANDLE)pMyObject,
(ANSC_HANDLE)pBmoReq,
HTTP_TRO_SFLAG_HEADERS | HTTP_TRO_SFLAG_BODY
);
}
if ( (ulSbcPmode == HTTP_SBC_PMODE_RELAY1) ||
(ulSbcPmode == HTTP_SBC_PMODE_RELAY2) )
{
pBmoReq->SetMboMode((ANSC_HANDLE)pBmoReq, HTTP_MBO_MODE_RELAY);
}
else
{
pBmoReq->SetMboMode((ANSC_HANDLE)pBmoReq, HTTP_MBO_MODE_STORE);
}
pMyObject->ReleaseAccess((ANSC_HANDLE)pMyObject);
return returnStatus;
}