mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
+ implement support for terminating a HTTPSys web service handler that's blocking inside WaitForRequest
This commit is contained in:
parent
2650049b2c
commit
86d4820760
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user