mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-23 11:49:12 +02:00
* Make TResponse.Content a RawByteString
git-svn-id: trunk@42767 -
This commit is contained in:
parent
ee6c426e05
commit
6a3530f69d
@ -475,8 +475,8 @@ type
|
|||||||
FContentSent: Boolean;
|
FContentSent: Boolean;
|
||||||
FRequest : TRequest;
|
FRequest : TRequest;
|
||||||
FCookies : TCookies;
|
FCookies : TCookies;
|
||||||
function GetContent: String;
|
function GetContent: RawByteString;
|
||||||
procedure SetContent(const AValue: String);
|
procedure SetContent(const AValue: RawByteString);
|
||||||
procedure SetContents(AValue: TStrings);
|
procedure SetContents(AValue: TStrings);
|
||||||
procedure SetContentStream(const AValue: TStream);
|
procedure SetContentStream(const AValue: TStream);
|
||||||
procedure SetFirstHeaderLine(const line: String);
|
procedure SetFirstHeaderLine(const line: String);
|
||||||
@ -507,7 +507,7 @@ type
|
|||||||
Property RetryAfter : String Index Ord(hhRetryAfter) Read GetHeaderValue Write SetHeaderValue;
|
Property RetryAfter : String Index Ord(hhRetryAfter) Read GetHeaderValue Write SetHeaderValue;
|
||||||
Property FirstHeaderLine : String Read GetFirstHeaderLine Write SetFirstHeaderLine;
|
Property FirstHeaderLine : String Read GetFirstHeaderLine Write SetFirstHeaderLine;
|
||||||
Property ContentStream : TStream Read FContentStream Write SetContentStream;
|
Property ContentStream : TStream Read FContentStream Write SetContentStream;
|
||||||
Property Content : String Read GetContent Write SetContent;
|
Property Content : RawByteString Read GetContent Write SetContent;
|
||||||
property Contents : TStrings read FContents Write SetContents;
|
property Contents : TStrings read FContents Write SetContents;
|
||||||
Property HeadersSent : Boolean Read FHeadersSent;
|
Property HeadersSent : Boolean Read FHeadersSent;
|
||||||
Property ContentSent : Boolean Read FContentSent;
|
Property ContentSent : Boolean Read FContentSent;
|
||||||
@ -1985,7 +1985,7 @@ begin
|
|||||||
FContents:=TStringList.Create;
|
FContents:=TStringList.Create;
|
||||||
TStringList(FContents).OnChange:=@ContentsChanged;
|
TStringList(FContents).OnChange:=@ContentsChanged;
|
||||||
FCookies:=TCookies.Create(TCookie);
|
FCookies:=TCookies.Create(TCookie);
|
||||||
FCustomHeaders:=TStringList.Create;
|
FCustomHeaders:=TStringList.Create; // Destroyed in parent
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TResponse.destroy;
|
destructor TResponse.destroy;
|
||||||
@ -2074,14 +2074,18 @@ begin
|
|||||||
FContents.Assign(AValue);
|
FContents.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TResponse.GetContent: String;
|
function TResponse.GetContent: RawByteString;
|
||||||
begin
|
begin
|
||||||
Result:=Contents.Text;
|
Result:=Contents.Text;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TResponse.SetContent(const AValue: String);
|
procedure TResponse.SetContent(const AValue: RawByteString);
|
||||||
begin
|
begin
|
||||||
FContentStream:=Nil;
|
if Assigned(FContentStream) then
|
||||||
|
if FreeContentStream then
|
||||||
|
FreeAndNil(FContentStream)
|
||||||
|
else
|
||||||
|
FContentStream:=Nil;
|
||||||
FContents.Text:=AValue;
|
FContents.Text:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user