disable KeepAlive flag in CloseConnectionSocket to close hanging keep-alive connections

This commit is contained in:
Ondrej Pokorny 2022-11-03 12:35:40 +01:00 committed by Michael Van Canneyt
parent 0dbf40a24c
commit a1a30876d5

View File

@ -652,7 +652,10 @@ end;
procedure TFPHTTPServerConnectionListHandler.CloseConnectionSocket(aConnection: TFPHTTPConnection; var aContinue: boolean);
begin
if Not aConnection.IsUpgraded then
begin
sockets.CloseSocket(aConnection.Socket.Handle);
aConnection.FKeepAlive:=False; // to exit the keep-alive loop for hanging sockets
end;
end;
procedure TFPHTTPServerConnectionListHandler.Foreach(aIterator: TConnectionIterator);