I have an ISAPI extension that does some processing on file uploads before they are passed to an ASP.NET application. I'm using the HSE_REQ_EXEC_UNICODE_URL mechanism in IIS 6.0 to replace the entire request entity body.
This works, but it seems to be horribly slow with larger request bodies.
Over the LAN if I upload a 12MB file normally without the ISAPI processing it, it takes about 1.5 seconds all together.
With the ISAPI extension enabled, just from the time I set the entity body and call HSE_REQ_EXEC_UNICODE_URL, to the time the IO completion callback is called, it takes about 6 seconds.
My code looks roughly like this:
LPHSE_EXEC_URL_ENTITY_INFO entity = new HSE_EXEC_URL_ENTITY_INFO;
entity->lpbData = (LPBYTE)data;
entity->cbAvailable = dataSize;
LPHSE_EXEC_UNICODE_URL_INFO pHseExecUrlInfo = new HSE_EXEC_UNICODE_URL_INFO;
ZeroMemory(pHseExecUrlInfo, sizeof(HSE_EXEC_UNICODE_URL_INFO));
pHseExecUrlInfo->pszChildHeaders = newHeaders;
pHseExecUrlInfo->pEntity = entity;
pHseExecUrlInfo->dwExecUrlFlags = HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR;
pECB->ServerSupportFunction( pECB->ConnID,
HSE_REQ_IO_COMPLETION,
UploadCompletion,
NULL,
(LPDWORD)pHseExecUrlInfo );
// Include other functionality here
if ( pECB->ServerSupportFunction( pECB->ConnID,
HSE_REQ_EXEC_UNICODE_URL,
pHseExecUrlInfo,
NULL,
NULL ) )
{
return HSE_STATUS_PENDING;
}
else
{
return HSE_STATUS_ERROR;
}
Is there something that I'm doing wrong, or anything that can be done to make this faster, or is that just how it's going to work?