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

fix issue #26 AspNetCoreModule needs to abort failed responses #34

Merged
merged 1 commit into from
Oct 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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