Browse Source

fcl-web: fixed av on logging TFPHTTPConnection.DoHandleRequest

mattias 2 years ago
parent
commit
c0f9878e2f

BIN
packages/fcl-web/examples/httpserver/simplehttpserver


+ 5 - 0
packages/fcl-web/examples/httpserver/simplehttpserver.compiled

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <Compiler Value="/usr/lib/fpc/3.3.1/ppcx64" Date="1680458816"/>
+  <Params Value=" -MObjFPC -Scghi -Cg -O1 -g -gl -l -vewnhibq -Fu/home/mattias/pascal/fpc_sources/3.3.1/packages/fcl-web/examples/echo/webmodule -Fu/home/mattias/pascal/fpc_sources/3.3.1/packages/fcl-web/examples/httpserver/ -o/home/mattias/pascal/fpc_sources/3.3.1/packages/fcl-web/examples/httpserver/simplehttpserver simplehttpserver.pas"/>
+</CONFIG>

+ 1 - 0
packages/fcl-web/examples/httpserver/simplehttpserver.lpi

@@ -7,6 +7,7 @@
         <SaveOnlyProjectUnits Value="True"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <MainUnitHasScaledStatement Value="False"/>
         <CompatibilityMode Value="True"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>

+ 0 - 2
packages/fcl-web/examples/httpserver/simplehttpserver.pas

@@ -11,8 +11,6 @@ uses
 
 Type
 
-  { TTestHTTPServer }
-
   { THTTPServer }
 
   THTTPServer = Class(TTestHTTPServer)

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

@@ -1247,7 +1247,12 @@ begin
     if Assigned(Resp) and (not Resp.ContentSent) then
       Resp.SendContent;
     If Assigned(Server) and Server.CanLog(hlmRequestDone) then
-      Server.DoLog(hlmRequestDone,SRequestDone,[Resp.ToString]);
+      begin
+      if Assigned(Resp) then
+        Server.DoLog(hlmRequestDone,SRequestDone,[Resp.ToString])
+      else
+        Server.DoLog(hlmRequestDone,SRequestDone,['Response was freed']);
+      end;
   Finally
     FreeAndNil(Resp);
     FreeAndNil(Req);