瀏覽代碼

* Set the global CustomApplication variable, usefull for logging

git-svn-id: trunk@15622 -
joost 15 年之前
父節點
當前提交
c024cbfb4c
共有 3 個文件被更改,包括 16 次插入1 次删除
  1. 6 0
      packages/fcl-web/src/base/fpapache.pp
  2. 4 1
      packages/fcl-web/src/base/fpcgi.pp
  3. 6 0
      packages/fcl-web/src/base/fpfcgi.pp

+ 6 - 0
packages/fcl-web/src/base/fpapache.pp

@@ -164,6 +164,8 @@ Var
 
 Implementation
 
+uses CustApp;
+
 resourcestring
   SErrNoModuleNameForRequest = 'Could not determine HTTP module name for request';
   SErrNoModuleForRequest = 'Could not determine HTTP module for request "%s"';
@@ -180,12 +182,16 @@ Procedure InitApache;
 
 begin
   Application:=TCustomApacheApplication.Create(Nil);
+  if not assigned(CustomApplication) then
+    CustomApplication := Application;
 end;
 
 Procedure DoneApache;
 
 begin
   Try
+    if CustomApplication=Application then
+      CustomApplication := nil;
     FreeAndNil(Application);
   except
     if ShowCleanUpErrors then

+ 4 - 1
packages/fcl-web/src/base/fpcgi.pp

@@ -38,13 +38,16 @@ Procedure InitCGI;
 
 begin
   Application:=TCGIApplication.Create(Nil);
-  CustomApplication:=Application;
+  if not assigned(CustomApplication) then
+    CustomApplication := Application;
 end;
 
 Procedure DoneCGI;
 
 begin
   Try
+    if CustomApplication=Application then
+      CustomApplication := nil;
     FreeAndNil(Application);
   except
     if ShowCleanUpErrors then

+ 6 - 0
packages/fcl-web/src/base/fpfcgi.pp

@@ -31,16 +31,22 @@ Var
   
 Implementation
 
+uses CustApp;
+
 Procedure InitFCGI;
 
 begin
   Application:=TFCGIApplication.Create(Nil);
+  if not assigned(CustomApplication) then
+    CustomApplication := Application;
 end;
 
 Procedure DoneFCGI;
 
 begin
   Try
+    if CustomApplication=Application then
+      CustomApplication := nil;
     FreeAndNil(Application);
   except
     if ShowCleanUpErrors then