Quellcode durchsuchen

httpserver keep-alive first attempt

Ondrej Pokorny vor 4 Jahren
Ursprung
Commit
9d9128a747
2 geänderte Dateien mit 1 neuen und 7 gelöschten Zeilen
  1. 1 6
      packages/fcl-net/src/ssockets.pp
  2. 0 1
      packages/fcl-web/src/base/fphttpserver.pp

+ 1 - 6
packages/fcl-net/src/ssockets.pp

@@ -491,16 +491,11 @@ var
   B: Byte;
   B: Byte;
   lTM: Integer;
   lTM: Integer;
 begin
 begin
-  // ToDo: support properly with the socket select() function
-  // currently a workaround
   lTM := IOTimeout;
   lTM := IOTimeout;
   IOTimeout := TimeOut;
   IOTimeout := TimeOut;
   FHandler.Recv(B,0);
   FHandler.Recv(B,0);
   Result := FHandler.FLastError=0;
   Result := FHandler.FLastError=0;
-  try
-    IOTimeout := lTM;
-  except
-  end;
+  IOTimeout := lTM;
 end;
 end;
 
 
 Function TSocketStream.Read (Var Buffer; Count : Longint) : longint;
 Function TSocketStream.Read (Var Buffer; Count : Longint) : longint;

+ 0 - 1
packages/fcl-web/src/base/fphttpserver.pp

@@ -85,7 +85,6 @@ Type
     Property Server : TFPCustomHTTPServer Read FServer;
     Property Server : TFPCustomHTTPServer Read FServer;
     Property OnRequestError : TRequestErrorHandler Read FOnError Write FOnError;
     Property OnRequestError : TRequestErrorHandler Read FOnError Write FOnError;
     Property LookupHostNames : Boolean Read GetLookupHostNames;
     Property LookupHostNames : Boolean Read GetLookupHostNames;
-
     // Set to true if you want to support HTTP 1.1 connection: keep-alive - only available for threaded server
     // Set to true if you want to support HTTP 1.1 connection: keep-alive - only available for threaded server
     Property EnableKeepAlive: Boolean read FEnableKeepAlive write FEnableKeepAlive;
     Property EnableKeepAlive: Boolean read FEnableKeepAlive write FEnableKeepAlive;
     // time-out for keep-alive: how many ms should the server keep the connection alive after a request has been handled
     // time-out for keep-alive: how many ms should the server keep the connection alive after a request has been handled