+ implement support for terminating a HTTPSys web service handler that's blocking inside WaitForRequest

This commit is contained in:
Sven Barth 2021-09-06 22:37:07 +02:00
parent 2650049b2c
commit 86d4820760

View File

@ -653,7 +653,9 @@ begin
fBuffer := GetMem(fBufferSize);
end;
until res <> ERROR_MORE_DATA;
if res <> NO_ERROR then
if res = ERROR_OPERATION_ABORTED then
Break
else if res <> NO_ERROR then
DoError(SErrReceiveRequest, [res])
else begin
ProcessRequest(fBuffer, readsize, aRequest, aResponse);
@ -688,6 +690,10 @@ end;
procedure THTTPSysHandler.Terminate;
begin
if fHandle <> INVALID_HANDLE_VALUE then begin
HttpCloseRequestQueue(fHandle);
fHandle := INVALID_HANDLE_VALUE;
end;
inherited Terminate;
end;