mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 13:49:17 +02:00
* Reverted accidentally committed files in r12989
git-svn-id: trunk@12990 -
This commit is contained in:
parent
37dcbd6612
commit
49f2270221
@ -126,7 +126,6 @@ Var
|
|||||||
AlternateHandler : ap_hook_handler_t = Nil;
|
AlternateHandler : ap_hook_handler_t = Nil;
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
uses ctypes;
|
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
SErrNoModuleNameForRequest = 'Could not determine HTTP module name for request';
|
SErrNoModuleNameForRequest = 'Could not determine HTTP module name for request';
|
||||||
@ -208,15 +207,12 @@ Var
|
|||||||
Resp : TApacheResponse;
|
Resp : TApacheResponse;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
LogErrorMessage('Test 1',3);
|
|
||||||
Req:=TApacheRequest.CreateReq(Self,P);
|
Req:=TApacheRequest.CreateReq(Self,P);
|
||||||
Try
|
Try
|
||||||
Req.InitRequestVars;
|
Req.InitRequestVars;
|
||||||
Resp:=TApacheResponse.CreateApache(Req);
|
Resp:=TApacheResponse.CreateApache(Req);
|
||||||
Try
|
Try
|
||||||
LogErrorMessage('Test 2',3);
|
|
||||||
HandleRequest(Req,Resp);
|
HandleRequest(Req,Resp);
|
||||||
LogErrorMessage('Test 3',3);
|
|
||||||
If Not Resp.ContentSent then
|
If Not Resp.ContentSent then
|
||||||
Resp.SendContent;
|
Resp.SendContent;
|
||||||
Finally
|
Finally
|
||||||
@ -337,11 +333,9 @@ Var
|
|||||||
Var II:Integer;
|
Var II:Integer;
|
||||||
begin
|
begin
|
||||||
FCriticalSection.Enter;
|
FCriticalSection.Enter;
|
||||||
LogErrorMessage('Test I',3);
|
|
||||||
try
|
try
|
||||||
if (FMaxRequests>0) and (FWorkingWebModules.Count>=FMaxRequests) then
|
if (FMaxRequests>0) and (FWorkingWebModules.Count>=FMaxRequests) then
|
||||||
Raise EFPApacheError.Create(SErrTooManyRequests);
|
Raise EFPApacheError.Create(SErrTooManyRequests);
|
||||||
LogErrorMessage('Test II',3);
|
|
||||||
if (FIdleWebModules.Count>0) then
|
if (FIdleWebModules.Count>0) then
|
||||||
begin
|
begin
|
||||||
II := FIdleWebModules.Count - 1;
|
II := FIdleWebModules.Count - 1;
|
||||||
@ -353,25 +347,18 @@ LogErrorMessage('Test II',3);
|
|||||||
FIdleWebModules.Delete(II);
|
FIdleWebModules.Delete(II);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
LogErrorMessage('Test III',3);
|
|
||||||
if (M=nil) then
|
if (M=nil) then
|
||||||
begin
|
begin
|
||||||
LogErrorMessage('Test IV',3);
|
|
||||||
if assigned(mc) then LogErrorMessage('Test ---',3);
|
|
||||||
M:=MC.Create(Self);
|
M:=MC.Create(Self);
|
||||||
LogErrorMessage('Test V',3);
|
|
||||||
M.Name := '';
|
M.Name := '';
|
||||||
end;
|
end;
|
||||||
LogErrorMessage('Test VI',3);
|
|
||||||
FWorkingWebModules.Add(M);
|
FWorkingWebModules.Add(M);
|
||||||
finally
|
finally
|
||||||
FCriticalSection.Leave;
|
FCriticalSection.Leave;
|
||||||
end;
|
end;
|
||||||
LogErrorMessage('Test VII',3);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
LogErrorMessage('Test a',3);
|
|
||||||
try
|
try
|
||||||
MC:=Nil;
|
MC:=Nil;
|
||||||
M := Nil;
|
M := Nil;
|
||||||
@ -390,11 +377,8 @@ LogErrorMessage('Test a',3);
|
|||||||
|
|
||||||
MC:=MI.ModuleClass;
|
MC:=MI.ModuleClass;
|
||||||
end;
|
end;
|
||||||
LogErrorMessage('Test b',3);
|
|
||||||
GetAWebModule;
|
GetAWebModule;
|
||||||
LogErrorMessage('Test c',3);
|
|
||||||
M.HandleRequest(ARequest,AResponse);
|
M.HandleRequest(ARequest,AResponse);
|
||||||
LogErrorMessage('Test d',3);
|
|
||||||
|
|
||||||
FCriticalSection.Enter;
|
FCriticalSection.Enter;
|
||||||
try
|
try
|
||||||
@ -410,7 +394,6 @@ LogErrorMessage('Test d',3);
|
|||||||
ShowRequestException(AResponse,E);
|
ShowRequestException(AResponse,E);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
LogErrorMessage('Test e',3);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TApacheRequest }
|
{ TApacheRequest }
|
||||||
@ -593,7 +576,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Initialization
|
Initialization
|
||||||
// BeginThread(@__dummythread);//crash prevention for simultaneous requests
|
BeginThread(@__dummythread);//crash prevention for simultaneous requests
|
||||||
sleep(300);
|
sleep(300);
|
||||||
|
|
||||||
InitApache;
|
InitApache;
|
||||||
|
@ -38,10 +38,10 @@ Type
|
|||||||
Procedure DoHandleRequest(ARequest : TRequest; AResponse : TResponse; Var Handled : Boolean); override;
|
Procedure DoHandleRequest(ARequest : TRequest; AResponse : TResponse; Var Handled : Boolean); override;
|
||||||
Procedure DoGetContent(ARequest : TRequest; Content : TStream; Var Handled : Boolean); virtual;
|
Procedure DoGetContent(ARequest : TRequest; Content : TStream; Var Handled : Boolean); virtual;
|
||||||
Procedure GetContent(ARequest : TRequest; Content : TStream; Var Handled : Boolean);
|
Procedure GetContent(ARequest : TRequest; Content : TStream; Var Handled : Boolean);
|
||||||
|
Procedure Assign(Source : TPersistent); override;
|
||||||
Public
|
Public
|
||||||
Constructor create(ACollection : TCollection); override;
|
Constructor create(ACollection : TCollection); override;
|
||||||
Destructor destroy; override;
|
Destructor destroy; override;
|
||||||
Procedure Assign(Source : TPersistent); override;
|
|
||||||
published
|
published
|
||||||
Property Content : String Read GetStringContent Write SetContent;
|
Property Content : String Read GetStringContent Write SetContent;
|
||||||
Property Contents : TStrings Read GetContents Write SetContents;
|
Property Contents : TStrings Read GetContents Write SetContents;
|
||||||
@ -116,7 +116,7 @@ Type
|
|||||||
Procedure GetTemplateContent(ARequest : TRequest; AResponse : TResponse); virtual;
|
Procedure GetTemplateContent(ARequest : TRequest; AResponse : TResponse); virtual;
|
||||||
function GetContent: String;virtual;
|
function GetContent: String;virtual;
|
||||||
Public
|
Public
|
||||||
Constructor Create(AOwner: TComponent); override;
|
Constructor CreateNew(AOwner : TComponent; CreateMode : Integer); override;
|
||||||
Destructor Destroy; override;
|
Destructor Destroy; override;
|
||||||
Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); override;
|
Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); override;
|
||||||
Property Actions : TFPWebActions Read FActions Write SetActions;
|
Property Actions : TFPWebActions Read FActions Write SetActions;
|
||||||
@ -314,13 +314,12 @@ end;
|
|||||||
function TCustomFPWebModule.GetOnGetAction: TGetActionEvent;
|
function TCustomFPWebModule.GetOnGetAction: TGetActionEvent;
|
||||||
begin
|
begin
|
||||||
Result:=FActions.OnGetAction;
|
Result:=FActions.OnGetAction;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TCustomFPWebModule.SetActions(const AValue: TFPWebActions);
|
procedure TCustomFPWebModule.SetActions(const AValue: TFPWebActions);
|
||||||
begin
|
begin
|
||||||
if (FActions<>AValue) then
|
if (FActions<>AValue) then;
|
||||||
FActions.Assign(AValue);
|
FActions.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -398,20 +397,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TCustomFPWebModule.Create(AOwner: TComponent);
|
constructor TCustomFPWebModule.CreateNew(AOwner: TComponent; CreateMode : Integer);
|
||||||
begin
|
begin
|
||||||
|
inherited;
|
||||||
FActions:=TFPWebActions.Create(TFPWebAction);
|
FActions:=TFPWebActions.Create(TFPWebAction);
|
||||||
FTemplate:=TFPWebTemplate.Create(Self);
|
FTemplate:=TFPWebTemplate.Create(Self);
|
||||||
FTemplateVars:=TTemplateVars.Create(TTemplateVar);
|
FTemplateVars:=TTemplateVars.Create(TTemplateVar);
|
||||||
inherited;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomFPWebModule.Destroy;
|
destructor TCustomFPWebModule.Destroy;
|
||||||
begin
|
begin
|
||||||
inherited Destroy;
|
|
||||||
FreeAndNil(FTemplateVars);
|
FreeAndNil(FTemplateVars);
|
||||||
FreeAndNil(FTemplate);
|
FreeAndNil(FTemplate);
|
||||||
FreeAndNil(FActions);
|
FreeAndNil(FActions);
|
||||||
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user