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

Commit 4569d6d

Browse files
authored
fix issue #26 AspNetCoreModule needs to abort failed responses (#34)
1 parent ae727d6 commit 4569d6d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/AspNetCore/Inc/forwardinghandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ enum FORWARDING_REQUEST_STATUS
2727
FORWARDER_SENDING_REQUEST,
2828
FORWARDER_RECEIVING_RESPONSE,
2929
FORWARDER_RECEIVED_WEBSOCKET_RESPONSE,
30+
FORWARDER_RESET_CONNECTION,
3031
FORWARDER_DONE
3132
};
3233

src/AspNetCore/Src/dllmain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ VOID
5151
HKEY hKey;
5252

5353
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
54-
L"SOFTWARE\\Microsoft\\IIS Extensions\\AspNetCore Module\\Parameters",
54+
L"SOFTWARE\\Microsoft\\IIS Extensions\\IIS AspNetCore Module\\Parameters",
5555
0,
5656
KEY_READ,
5757
&hKey) == NO_ERROR)

src/AspNetCore/Src/forwardinghandler.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,12 @@ Return Value:
15911591
retVal = RQ_NOTIFICATION_PENDING;
15921592
goto Finished;
15931593
}
1594+
else if (m_RequestStatus == FORWARDER_RESET_CONNECTION)
1595+
{
1596+
hr = HRESULT_FROM_WIN32(ERROR_WINHTTP_INVALID_SERVER_RESPONSE);
1597+
goto Failure;
1598+
1599+
}
15941600

15951601
//
15961602
// Begins normal completion handling. There is already a shared acquired
@@ -2185,6 +2191,12 @@ None
21852191

21862192
Failure:
21872193

2194+
if (hr == HRESULT_FROM_WIN32(ERROR_WINHTTP_INVALID_SERVER_RESPONSE))
2195+
{
2196+
m_RequestStatus = FORWARDER_RESET_CONNECTION;
2197+
goto Finished;
2198+
}
2199+
21882200
m_RequestStatus = FORWARDER_DONE;
21892201

21902202
pResponse->DisableKernelCache();

0 commit comments

Comments
 (0)