|
@@ -656,11 +656,11 @@ begin
|
|
|
try
|
|
|
repeat
|
|
|
FConnection.HandleRequest;
|
|
|
- if Connection.EnableKeepAlive and Connection.KeepAlive
|
|
|
+ if not Terminated and Connection.EnableKeepAlive and Connection.KeepAlive
|
|
|
and not Connection.Socket.CanRead(Connection.KeepAliveTimeout) then
|
|
|
break;
|
|
|
FConnection.HandleRequest;
|
|
|
- until not (FConnection.EnableKeepAlive and FConnection.KeepAlive and (FConnection.Socket.LastError=0));
|
|
|
+ until not (Terminated and FConnection.EnableKeepAlive and FConnection.KeepAlive and (FConnection.Socket.LastError=0));
|
|
|
finally
|
|
|
FreeAndNil(FConnection);
|
|
|
if Assigned(FThreadList) then
|
|
@@ -988,7 +988,7 @@ begin
|
|
|
try
|
|
|
for I:= ThreadList.Count-1 downto 0 do
|
|
|
try
|
|
|
- CloseSocket(TFPHTTPConnectionThread(ThreadList[I]).Connection.Socket.Handle);
|
|
|
+ CloseSocket(TFPHTTPConnectionThread(ThreadList[I]).Connection.Socket.Handle);
|
|
|
except
|
|
|
// ignore exceptions during CloseSocket
|
|
|
end
|