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

Commit 002c8b9

Browse files
authored
Adding shutdown http message to support the scenario that ctrl signal is not allowed (#118)
1 parent 622da80 commit 002c8b9

File tree

4 files changed

+384
-107
lines changed

4 files changed

+384
-107
lines changed

src/AspNetCore/Inc/resource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
#define ASPNETCORE_EVENT_PROCESS_START_NOTREADY_ERROR_MSG L"Application '%s' with physical root '%s' created process with commandline '%s' but either crashed or did not reponse or did not listen on the given port '%d', ErrorCode = '0x%x'"
1717
#define ASPNETCORE_EVENT_INVALID_STDOUT_LOG_FILE_MSG L"Warning: Could not create stdoutLogFile %s, ErrorCode = %d."
1818
#define ASPNETCORE_EVENT_GRACEFUL_SHUTDOWN_FAILURE_MSG L"Failed to gracefully shutdown process '%d'."
19+
#define ASPNETCORE_EVENT_SENT_SHUTDOWN_HTTP_REQUEST_MSG L"Sent shutdown HTTP message to process '%d' and received http status '%d'."
20+

src/AspNetCore/Inc/serverprocess.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,27 @@ class SERVER_PROCESS
252252
return digits;
253253
}
254254

255+
static
256+
VOID
257+
SendShutDownSignal(
258+
LPVOID lpParam
259+
);
260+
261+
VOID
262+
SendShutDownSignalInternal(
263+
VOID
264+
);
265+
266+
HRESULT
267+
SendShutdownHttpMessage(
268+
VOID
269+
);
270+
271+
VOID
272+
TerminateBackendProcess(
273+
VOID
274+
);
275+
255276
FORWARDER_CONNECTION *m_pForwarderConnection;
256277
BOOL m_fStdoutLogEnabled;
257278
BOOL m_fWindowsAuthEnabled;
@@ -291,6 +312,11 @@ class SERVER_PROCESS
291312
HANDLE m_hProcessHandle;
292313
HANDLE m_hListeningProcessHandle;
293314
HANDLE m_hProcessWaitHandle;
315+
HANDLE m_hShutdownHandle;
316+
//
317+
// m_hChildProcessHandle is the handle to process created by
318+
// m_hProcessHandle process if it does.
319+
294320
//
295321
// m_hChildProcessHandle is the handle to process created by
296322
// m_hProcessHandle process if it does.

src/AspNetCore/Src/aspnetcore_msg.mc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ Language=English
6161
%1
6262
.
6363
64+
Messageid=1006
65+
SymbolicName=ASPNETCORE_EVENT_SENT_SHUTDOWN_HTTP_REQUEST
66+
Language=English
67+
%1
68+
.
69+
6470
;
6571
;#endif // _ASPNETCORE_MODULE_MSG_H_
6672
;

0 commit comments

Comments
 (0)