Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
fix issue #26 AspNetCoreModule needs to abort failed responses
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-wang committed Oct 31, 2016
1 parent ae727d6 commit 388b906
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/AspNetCore/Inc/forwardinghandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum FORWARDING_REQUEST_STATUS
FORWARDER_SENDING_REQUEST,
FORWARDER_RECEIVING_RESPONSE,
FORWARDER_RECEIVED_WEBSOCKET_RESPONSE,
FORWARDER_RESET_CONNECTION,
FORWARDER_DONE
};

Expand Down
2 changes: 1 addition & 1 deletion src/AspNetCore/Src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ VOID
HKEY hKey;

if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\IIS Extensions\\AspNetCore Module\\Parameters",
L"SOFTWARE\\Microsoft\\IIS Extensions\\IIS AspNetCore Module\\Parameters",
0,
KEY_READ,
&hKey) == NO_ERROR)
Expand Down
12 changes: 12 additions & 0 deletions src/AspNetCore/Src/forwardinghandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,12 @@ Return Value:
retVal = RQ_NOTIFICATION_PENDING;
goto Finished;
}
else if (m_RequestStatus == FORWARDER_RESET_CONNECTION)
{
hr = HRESULT_FROM_WIN32(ERROR_WINHTTP_INVALID_SERVER_RESPONSE);
goto Failure;

}

//
// Begins normal completion handling. There is already a shared acquired
Expand Down Expand Up @@ -2185,6 +2191,12 @@ None

Failure:

if (hr == HRESULT_FROM_WIN32(ERROR_WINHTTP_INVALID_SERVER_RESPONSE))
{
m_RequestStatus = FORWARDER_RESET_CONNECTION;
goto Finished;
}

m_RequestStatus = FORWARDER_DONE;

pResponse->DisableKernelCache();
Expand Down

0 comments on commit 388b906

Please sign in to comment.