mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 07:19:17 +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);
|
fBuffer := GetMem(fBufferSize);
|
||||||
end;
|
end;
|
||||||
until res <> ERROR_MORE_DATA;
|
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])
|
DoError(SErrReceiveRequest, [res])
|
||||||
else begin
|
else begin
|
||||||
ProcessRequest(fBuffer, readsize, aRequest, aResponse);
|
ProcessRequest(fBuffer, readsize, aRequest, aResponse);
|
||||||
@ -688,6 +690,10 @@ end;
|
|||||||
|
|
||||||
procedure THTTPSysHandler.Terminate;
|
procedure THTTPSysHandler.Terminate;
|
||||||
begin
|
begin
|
||||||
|
if fHandle <> INVALID_HANDLE_VALUE then begin
|
||||||
|
HttpCloseRequestQueue(fHandle);
|
||||||
|
fHandle := INVALID_HANDLE_VALUE;
|
||||||
|
end;
|
||||||
inherited Terminate;
|
inherited Terminate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user