Skip to content

Commit

Permalink
allowing flow app_offline to remote client (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-wang authored Oct 3, 2016
1 parent 4ab0cdb commit b9fda49
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
39 changes: 37 additions & 2 deletions src/AspNetCore/Src/forwardinghandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,43 @@ VOID

if (m_pApplication->AppOfflineFound() && m_pAppOfflineHtm != NULL)
{

HTTP_DATA_CHUNK DataChunk;
HTTP_DATA_CHUNK DataChunk;
PCSTR pszANCMHeader;
DWORD cchANCMHeader;
BOOL fCompletionExpected = FALSE;

if (FAILED(m_pW3Context->GetServerVariable(STR_ANCM_CHILDREQUEST,
&pszANCMHeader,
&cchANCMHeader))) // first time failure
{
if (SUCCEEDED(hr = m_pW3Context->CloneContext(
CLONE_FLAG_BASICS | CLONE_FLAG_HEADERS | CLONE_FLAG_ENTITY,
&m_pChildRequestContext
)) &&
SUCCEEDED(hr = m_pChildRequestContext->SetServerVariable(
STR_ANCM_CHILDREQUEST,
L"1")) &&
SUCCEEDED(hr = m_pW3Context->ExecuteRequest(
TRUE, // fAsync
m_pChildRequestContext,
EXECUTE_FLAG_DISABLE_CUSTOM_ERROR, // by pass Custom Error module
NULL, // pHttpUser
&fCompletionExpected)))
{
if (!fCompletionExpected)
{
retVal = RQ_NOTIFICATION_CONTINUE;
}
else
{
retVal = RQ_NOTIFICATION_PENDING;
}
goto Finished;
}
//
// fail to create child request, fall back to default 502 error
//
}

DataChunk.DataChunkType = HttpDataChunkFromMemory;
DataChunk.FromMemory.pBuffer = (PVOID)m_pAppOfflineHtm->m_Contents.QueryStr();
Expand Down
12 changes: 0 additions & 12 deletions src/AspNetCore/version.h

This file was deleted.

0 comments on commit b9fda49

Please sign in to comment.