You've already forked lazarus-ccr
Provide a property manager to the filters so a "Password" can be store and retrieved.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2380 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -32,8 +32,16 @@ type
|
|||||||
function GetFilterString: string;
|
function GetFilterString: string;
|
||||||
procedure SetFilterString(const Value: string);
|
procedure SetFilterString(const Value: string);
|
||||||
private
|
private
|
||||||
procedure FilterInput(ASource, ADest : TStream);
|
procedure FilterInput(
|
||||||
procedure FilterOutput(ASource, ADest : TStream);
|
ASource,
|
||||||
|
ADest : TStream;
|
||||||
|
const AProps : IPropertyManager
|
||||||
|
);
|
||||||
|
procedure FilterOutput(
|
||||||
|
ASource,
|
||||||
|
ADest : TStream;
|
||||||
|
const AProps : IPropertyManager
|
||||||
|
);
|
||||||
protected
|
protected
|
||||||
procedure ProcessMessage(
|
procedure ProcessMessage(
|
||||||
const AMessageStage : TMessageStage;
|
const AMessageStage : TMessageStage;
|
||||||
@ -68,7 +76,9 @@ var
|
|||||||
rb : IRequestBuffer;
|
rb : IRequestBuffer;
|
||||||
strm : TStream;
|
strm : TStream;
|
||||||
locStream : TMemoryStream;
|
locStream : TMemoryStream;
|
||||||
|
locProps : IPropertyManager;
|
||||||
begin
|
begin
|
||||||
|
locProps := ACallContext.GetPropertyManager();
|
||||||
case AMessageStage of
|
case AMessageStage of
|
||||||
msBeforeDeserialize :
|
msBeforeDeserialize :
|
||||||
begin
|
begin
|
||||||
@ -79,7 +89,7 @@ begin
|
|||||||
{$ENDIF WST_DBG}
|
{$ENDIF WST_DBG}
|
||||||
locStream := TMemoryStream.Create();
|
locStream := TMemoryStream.Create();
|
||||||
try
|
try
|
||||||
FilterOutput(strm,locStream);
|
FilterOutput(strm,locStream,locProps);
|
||||||
{$IFDEF WST_DBG}
|
{$IFDEF WST_DBG}
|
||||||
locStream.SaveToFile('req.log');
|
locStream.SaveToFile('req.log');
|
||||||
{$ENDIF WST_DBG}
|
{$ENDIF WST_DBG}
|
||||||
@ -97,7 +107,7 @@ begin
|
|||||||
strm := rb.GetResponse();
|
strm := rb.GetResponse();
|
||||||
locStream := TMemoryStream.Create();
|
locStream := TMemoryStream.Create();
|
||||||
try
|
try
|
||||||
FilterInput(strm,locStream);
|
FilterInput(strm,locStream,locProps);
|
||||||
strm.Size := locStream.Size;
|
strm.Size := locStream.Size;
|
||||||
strm.Position := 0;
|
strm.Position := 0;
|
||||||
strm.CopyFrom(locStream,0);
|
strm.CopyFrom(locStream,0);
|
||||||
@ -109,13 +119,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFilterExtension.FilterInput(ASource, ADest: TStream);
|
procedure TFilterExtension.FilterInput(
|
||||||
|
ASource,
|
||||||
|
ADest : TStream;
|
||||||
|
const AProps : IPropertyManager
|
||||||
|
);
|
||||||
var
|
var
|
||||||
locInBuffer, locBuffer : TByteDynArray;
|
locInBuffer, locBuffer : TByteDynArray;
|
||||||
locOldPos : Int64;
|
locOldPos : Int64;
|
||||||
begin
|
begin
|
||||||
if ASource.InheritsFrom(TMemoryStream) then begin
|
if ASource.InheritsFrom(TMemoryStream) then begin
|
||||||
locBuffer := FFilter.ExecuteInput(TMemoryStream(ASource).Memory^,ASource.Size);
|
locBuffer := FFilter.ExecuteInput(TMemoryStream(ASource).Memory^,ASource.Size,AProps);
|
||||||
end else begin
|
end else begin
|
||||||
SetLength(locInBuffer,ASource.Size);
|
SetLength(locInBuffer,ASource.Size);
|
||||||
locOldPos := ASource.Position;
|
locOldPos := ASource.Position;
|
||||||
@ -125,7 +139,7 @@ begin
|
|||||||
finally
|
finally
|
||||||
ASource.Position := locOldPos;
|
ASource.Position := locOldPos;
|
||||||
end;
|
end;
|
||||||
locBuffer := FFilter.ExecuteInput(locInBuffer[0],Length(locInBuffer));
|
locBuffer := FFilter.ExecuteInput(locInBuffer[0],Length(locInBuffer),AProps);
|
||||||
end;
|
end;
|
||||||
ADest.Size := Length(locBuffer);
|
ADest.Size := Length(locBuffer);
|
||||||
ADest.Position := 0;
|
ADest.Position := 0;
|
||||||
@ -133,13 +147,17 @@ begin
|
|||||||
ADest.Position := 0;
|
ADest.Position := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFilterExtension.FilterOutput(ASource, ADest: TStream);
|
procedure TFilterExtension.FilterOutput(
|
||||||
|
ASource,
|
||||||
|
ADest : TStream;
|
||||||
|
const AProps : IPropertyManager
|
||||||
|
);
|
||||||
var
|
var
|
||||||
locInBuffer, locBuffer : TByteDynArray;
|
locInBuffer, locBuffer : TByteDynArray;
|
||||||
locOldPos : Int64;
|
locOldPos : Int64;
|
||||||
begin
|
begin
|
||||||
if ASource.InheritsFrom(TMemoryStream) then begin
|
if ASource.InheritsFrom(TMemoryStream) then begin
|
||||||
locBuffer := FFilter.ExecuteOutput(TMemoryStream(ASource).Memory^,ASource.Size);
|
locBuffer := FFilter.ExecuteOutput(TMemoryStream(ASource).Memory^,ASource.Size,AProps);
|
||||||
end else begin
|
end else begin
|
||||||
SetLength(locInBuffer,ASource.Size);
|
SetLength(locInBuffer,ASource.Size);
|
||||||
locOldPos := ASource.Position;
|
locOldPos := ASource.Position;
|
||||||
@ -149,7 +167,7 @@ begin
|
|||||||
finally
|
finally
|
||||||
ASource.Position := locOldPos;
|
ASource.Position := locOldPos;
|
||||||
end;
|
end;
|
||||||
locBuffer := FFilter.ExecuteOutput(locInBuffer[0],Length(locInBuffer));
|
locBuffer := FFilter.ExecuteOutput(locInBuffer[0],Length(locInBuffer),AProps);
|
||||||
end;
|
end;
|
||||||
ADest.Size := Length(locBuffer);
|
ADest.Size := Length(locBuffer);
|
||||||
ADest.Position := 0;
|
ADest.Position := 0;
|
||||||
|
Reference in New Issue
Block a user