Browse Source

Fix TFPHTTPConnectionThread.Execute repeat loop

Ondrej Pokorny 4 years ago
parent
commit
ae1c809a2d
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/fcl-web/src/base/fphttpserver.pp

+ 4 - 4
packages/fcl-web/src/base/fphttpserver.pp

@@ -569,7 +569,7 @@ begin
   Try
   Try
     if FSetupSocket then
     if FSetupSocket then
       begin
       begin
-      SetupSocket;
+    SetupSocket;
       FSetupSocket:=False;
       FSetupSocket:=False;
       end;
       end;
     // Read headers.
     // Read headers.
@@ -644,8 +644,8 @@ begin
         and not Connection.Socket.CanRead(Connection.KeepAliveTimeout) then
         and not Connection.Socket.CanRead(Connection.KeepAliveTimeout) then
           break;
           break;
 
 
-        FConnection.HandleRequest;
-      until not (Terminated and FConnection.EnableKeepAlive and FConnection.KeepAlive and (FConnection.Socket.LastError=0));
+      FConnection.HandleRequest;
+      until not (not Terminated and FConnection.EnableKeepAlive and FConnection.KeepAlive and (FConnection.Socket.LastError=0));
     finally
     finally
       FreeAndNil(FConnection);
       FreeAndNil(FConnection);
       if Assigned(FThreadList) then
       if Assigned(FThreadList) then
@@ -973,7 +973,7 @@ begin
     try
     try
       for I:= ThreadList.Count-1 downto 0 do
       for I:= ThreadList.Count-1 downto 0 do
         try
         try
-          CloseSocket(TFPHTTPConnectionThread(ThreadList[I]).Connection.Socket.Handle);
+        CloseSocket(TFPHTTPConnectionThread(ThreadList[I]).Connection.Socket.Handle);
         except
         except
           // ignore exceptions during CloseSocket
           // ignore exceptions during CloseSocket
         end
         end