thans, i post my code here, there is something wrong with it, though i can get whole post data, but can't set post back to next request, the web site page can't show.
ISAPI_REQUEST request(pECB);
ISAPI_BUFFER buffEntity;
ISAPI_STRING strData;
CString strBuffer2;
long nContentLength;
if (request.GetServerVariable("CONTENT_LENGTH", &strData))
{
nContentLength = atol(strData.QueryStr());
if (nContentLength > 0)
{
buffEntity.SetMaxAlloc(nContentLength);
if (!request.ReadAllEntity(&buffEntity))
{
OutputDebugString("request body get fail, too big!");
return process_original_url(pECB);
}
}
} else {
OutputDebugString("request body length get fail!");
return process_original_url(pECB);
}
char *tmp = (char*)malloc(nContentLength);
memset(tmp, 0, nContentLength);
strcpy(tmp, (char*)buffEntity.QueryPtr());
struffer2 = tmp;
if(NULL != tmp)
{
delete tmp;
tmp = NULL;
}
return SetRequestPackage(pECB, buffEntity, request.IsCallReadClient());
DWORD SetRequestPackage(EXTENSION_CONTROL_BLOCK *pecb, ISAPI_BUFFER buffEntity, bool flag)
{
HSE_EXEC_URL_INFO* pExecUrlInfo = new HSE_EXEC_URL_INFO;
if(NULL == pExecUrlInfo)
{
return HSE_STATUS_ERROR;
}
ZeroMemory( pExecUrlInfo, sizeof( HSE_EXEC_URL_INFO ) );
pExecUrlInfo->pszUrl = NULL; //URL
pExecUrlInfo->pszMethod = NULL; //method
pExecUrlInfo->pszChildHeaders = NULL; //header
pExecUrlInfo->pUserInfo = NULL; //user info
pExecUrlInfo->pEntity = NULL; //body
pExecUrlInfo->dwExecUrlFlags = HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR;
EXTENSION_DATA* ped = new EXTENSION_DATA;
ped->pHEUI = pExecUrlInfo;
ped->pBody = NULL;
if(flag)
{
DWORD dwSize = buffEntity.QueryDataSize();
ped->pBody = (char*)buffEntity.QueryPtr();
HSE_EXEC_URL_ENTITY_INFO* pEntityInfo = new HSE_EXEC_URL_ENTITY_INFO;
pEntityInfo->lpbData = (void*)ped->pBody;
pEntityInfo->cbAvailable = dwSize;
pExecUrlInfo->pEntity = pEntityInfo;
}
if ( pecb->ServerSupportFunction(pecb->ConnID, HSE_REQ_IO_COMPLETION, HandleCompletion, NULL, (LPDWORD)ped) == FALSE) {
WriteLog("ServerSupportFunction1");
return SyncSendGenericServerError(pecb);
}
if ( pecb->ServerSupportFunction( pecb->ConnID, HSE_REQ_EXEC_URL, pExecUrlInfo, NULL, NULL) == FALSE) {
WriteLog("ServerSupportFunction2");
return SyncSendGenericServerError(pecb);
}
return HSE_STATUS_PENDING;
}
can anybody give me some advice?