[fpc-pascal] FastCGI and FpWeb

Luiz Americo Pereira Camara luizmed at oi.com.br
Sat Jul 3 20:03:51 CEST 2010


Michael Van Canneyt escreveu:
>
>
> On Sat, 3 Jul 2010, Luiz Americo Pereira Camara wrote:
>
>> I've created some CGI applications with fpWeb with success.
>>
>> I tried to create a FastCGI application (a simple hello world) but =

>> when a request is done the program start, Application.Initialize and =

>> Application.Run is called. TCustomWebApplication.HandleRequest (I've =

>> monitored OnGetModule) is not called. WebModule is not created.
>> The application consumes all cpu.
>>
>> Using fpc 2.4.0, windows xp, apache 2.2.15, mod_fcgid 2.3.5
>>
>> Any hints on what going wrong?
>>
>> It was there any fix in fastcgi/fpweb after 2.4.0?
>
> Many, but they are all in trunk, I don't know if any fixes have been =

> merged.
>
> Maybe you can try to copy the fastcgi units over from trunk, and use =

> those
> to compile your application.

Compiled fastcgi plus fclweb from trunk. Unfortunately it also does not =

worked (Attached patch to compile with fpc240).

Does anybody has experience using fpWeb with FastCGI?

Luiz

>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>

-------------- next part --------------
Index: src/base/custweb.pp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- src/base/custweb.pp	(revision 15519)
+++ src/base/custweb.pp	(working copy)
@@ -89,8 +89,10 @@
     FHandleGetOnPost : Boolean;
     FRedirectOnError : Boolean;
     FRedirectOnErrorURL : String;
-    FEventLog: TEventLog;
+    {$ifndef VER2_4}
+	FEventLog: TEventLog;
     function GetEventLog: TEventLog;
+	{$endif}
   protected
     Function GetModuleName(Arequest : TRequest) : string;
     function WaitForRequest(out ARequest : TRequest; out AResponse : TResp=
onse) : boolean; virtual; abstract;
@@ -110,7 +112,9 @@
     Procedure ShowException(E: Exception);override;
     Procedure DoHandleRequest(ARequest : TRequest; AResponse : TResponse);
     Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); v=
irtual;
+	{$ifndef VER2_4}
     Procedure Log(EventType: TEventType; Msg: String); override;
+	{$endif}
     Property HandleGetOnPost : Boolean Read FHandleGetOnPost Write FHandle=
GetOnPost;
     Property RedirectOnError : boolean Read FRedirectOnError Write FRedire=
ctOnError;
     Property RedirectOnErrorURL : string Read FRedirectOnErrorURL Write FR=
edirectOnErrorURL;
@@ -122,7 +126,9 @@
     Property Email : String Read GetEmail Write FEmail;
     Property Administrator : String Read GetAdministrator Write FAdministr=
ator;
     property OnShowRequestException: TOnShowRequestException read FOnShowR=
equestException write FOnShowRequestException;
+	{$ifndef VER2_4}
     Property EventLog: TEventLog read GetEventLog;
+	{$endif}
   end;
 =

   EFPWebError =3D Class(Exception);
@@ -282,10 +288,12 @@
   end;
 end;
 =

+{$ifndef VER2_4}
 procedure TCustomWebApplication.Log(EventType: TEventType; Msg: String);
 begin
   EventLog.log(EventType,Msg);
 end;
+{$endif}
 =

 Procedure TCustomWebApplication.Initialize;
 =

@@ -294,12 +302,14 @@
   Inherited;
 end;
 =

+{$ifndef VER2_4}
 function TCustomWebApplication.GetEventLog: TEventLog;
 begin
   if not assigned(FEventLog) then
     FEventLog :=3D TEventLog.Create(self);
   Result :=3D FEventLog;
 end;
+{$endif}
 =

 function TCustomWebApplication.GetApplicationURL(ARequest: TRequest): Stri=
ng;
 begin
@@ -399,8 +409,9 @@
 =

 destructor TCustomWebApplication.Destroy;
 begin
-  if assigned(FEventLog) then
-    FEventLog.Free;
+  {$ifndef VER2_4}
+  FEventLog.Free;
+  {$endif}
   inherited Destroy;
 end;
 =

Index: src/base/fpcgi.pp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- src/base/fpcgi.pp	(revision 15519)
+++ src/base/fpcgi.pp	(working copy)
@@ -38,7 +38,9 @@
 =

 begin
   Application:=3DTCGIApplication.Create(Nil);
+  {$ifndef VER2_4}
   CustomApplication:=3DApplication;
+  {$endif}
 end;
 =

 Procedure DoneCGI;


More information about the fpc-pascal mailing list