mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 08:46:09 +02:00
* Added FreeContentStream property to TResponse.
git-svn-id: trunk@21390 -
This commit is contained in:
parent
11968c4261
commit
5aeb9c860d
@ -319,6 +319,7 @@ type
|
|||||||
FContentStream : TStream;
|
FContentStream : TStream;
|
||||||
FCode: Integer;
|
FCode: Integer;
|
||||||
FCodeText: String;
|
FCodeText: String;
|
||||||
|
FFreeContentStream: Boolean;
|
||||||
FHeadersSent: Boolean;
|
FHeadersSent: Boolean;
|
||||||
FContentSent: Boolean;
|
FContentSent: Boolean;
|
||||||
FRequest : TRequest;
|
FRequest : TRequest;
|
||||||
@ -341,6 +342,9 @@ type
|
|||||||
Procedure SendContent;
|
Procedure SendContent;
|
||||||
Procedure SendHeaders;
|
Procedure SendHeaders;
|
||||||
Procedure SendResponse; // Delphi compatibility
|
Procedure SendResponse; // Delphi compatibility
|
||||||
|
Function GetCustomHeader(const Name: String) : String;
|
||||||
|
Procedure SetCustomHeader(const Name, Value: String);
|
||||||
|
Procedure SendRedirect(const TargetURL:String);
|
||||||
Property Request : TRequest Read FRequest;
|
Property Request : TRequest Read FRequest;
|
||||||
Property Code: Integer Read FCode Write FCode;
|
Property Code: Integer Read FCode Write FCode;
|
||||||
Property CodeText: String Read FCodeText Write FCodeText;
|
Property CodeText: String Read FCodeText Write FCodeText;
|
||||||
@ -352,9 +356,7 @@ type
|
|||||||
Property ContentSent : Boolean Read FContentSent;
|
Property ContentSent : Boolean Read FContentSent;
|
||||||
property Cookies: TCookies read FCookies;
|
property Cookies: TCookies read FCookies;
|
||||||
Property CustomHeaders: TStringList read FCustomHeaders;
|
Property CustomHeaders: TStringList read FCustomHeaders;
|
||||||
Function GetCustomHeader(const Name: String) : String;
|
Property FreeContentStream : Boolean Read FFreeContentStream Write FFreeContentStream;
|
||||||
Procedure SetCustomHeader(const Name, Value: String);
|
|
||||||
Procedure SendRedirect(const TargetURL:String);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSessionVariable }
|
{ TSessionVariable }
|
||||||
@ -1483,6 +1485,8 @@ end;
|
|||||||
|
|
||||||
destructor TResponse.destroy;
|
destructor TResponse.destroy;
|
||||||
begin
|
begin
|
||||||
|
if FreeContentStream then
|
||||||
|
FreeAndNil(FContentStream);
|
||||||
FreeAndNil(FCookies);
|
FreeAndNil(FCookies);
|
||||||
FreeAndNil(FContents);
|
FreeAndNil(FContents);
|
||||||
FreeAndNil(FCustomHeaders);
|
FreeAndNil(FCustomHeaders);
|
||||||
@ -1593,6 +1597,8 @@ procedure TResponse.SetContentStream(const AValue: TStream);
|
|||||||
begin
|
begin
|
||||||
If (FContentStream<>AValue) then
|
If (FContentStream<>AValue) then
|
||||||
begin
|
begin
|
||||||
|
if (FContentStream<>Nil) and FreeContentStream then
|
||||||
|
FreeAndNil(FContentStream);
|
||||||
FContentStream:=AValue;
|
FContentStream:=AValue;
|
||||||
If (FContentStream<>Nil) then
|
If (FContentStream<>Nil) then
|
||||||
ContentLength:=FContentStream.Size
|
ContentLength:=FContentStream.Size
|
||||||
|
Loading…
Reference in New Issue
Block a user