mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:09:19 +02:00
* Get rid of the need to fill the internal table.
git-svn-id: trunk@12868 -
This commit is contained in:
parent
b28dd26e7b
commit
009324f617
@ -587,20 +587,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TApacheRequest.InitFromRequest;
|
procedure TApacheRequest.InitFromRequest;
|
||||||
|
|
||||||
Var
|
|
||||||
I : Integer;
|
|
||||||
S : String;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// This fills the internal table. We should try
|
ParseCookies;
|
||||||
// to get rid of it.
|
|
||||||
For I:=0 to NoHTTPFields do
|
|
||||||
begin
|
|
||||||
S:=GetFieldValue(i);
|
|
||||||
If (S<>'') then
|
|
||||||
SetFieldValue(I,S);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Constructor TApacheRequest.CreateReq(App : TCustomApacheApplication; ARequest : PRequest_rec);
|
Constructor TApacheRequest.CreateReq(App : TCustomApacheApplication; ARequest : PRequest_rec);
|
||||||
@ -609,8 +597,8 @@ begin
|
|||||||
FApache:=App;
|
FApache:=App;
|
||||||
FRequest:=Arequest;
|
FRequest:=Arequest;
|
||||||
ReturnedPathInfo:=App.BaseLocation;
|
ReturnedPathInfo:=App.BaseLocation;
|
||||||
InitFromRequest;
|
|
||||||
Inherited Create;
|
Inherited Create;
|
||||||
|
InitFromRequest;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TApacheResponse }
|
{ TApacheResponse }
|
||||||
|
@ -498,18 +498,18 @@ Var
|
|||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
For I:=1 to NoHTTPFields do
|
For I:=1 to NoHTTPFields do
|
||||||
If (FFields[i]<>'') then
|
If (GetFieldValue(i)<>'') then
|
||||||
Inc(Result);
|
Inc(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function THTTPHeader.GetContentLength: Integer;
|
function THTTPHeader.GetContentLength: Integer;
|
||||||
begin
|
begin
|
||||||
Result:=StrToIntDef(FFields[9],0);
|
Result:=StrToIntDef(GetFieldValue(9),0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure THTTPHeader.SetContentLength(Value: Integer);
|
procedure THTTPHeader.SetContentLength(Value: Integer);
|
||||||
begin
|
begin
|
||||||
FFields[9]:=IntToStr(Value);
|
SetFieldValue(9,IntToStr(Value));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -522,7 +522,7 @@ begin
|
|||||||
I:=1;
|
I:=1;
|
||||||
While (I<=NoHTTPFields) and (AIndex>=0) do
|
While (I<=NoHTTPFields) and (AIndex>=0) do
|
||||||
begin
|
begin
|
||||||
If (FFields[i]<>'') then
|
If (GetFieldValue(i)<>'') then
|
||||||
Dec(AIndex);
|
Dec(AIndex);
|
||||||
Inc(I);
|
Inc(I);
|
||||||
end;
|
end;
|
||||||
@ -545,7 +545,7 @@ Var
|
|||||||
begin
|
begin
|
||||||
I:=GetFieldIndex(Index);
|
I:=GetFieldIndex(Index);
|
||||||
If (I<>-1) then
|
If (I<>-1) then
|
||||||
Result:=FFields[I];
|
Result:=GetFieldValue(I);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function THTTPHeader.GetSetField(AIndex: Integer): String;
|
function THTTPHeader.GetSetField(AIndex: Integer): String;
|
||||||
@ -555,7 +555,7 @@ var
|
|||||||
begin
|
begin
|
||||||
I:=GetFieldIndex(AIndex);
|
I:=GetFieldIndex(AIndex);
|
||||||
If (I<>-1) then
|
If (I<>-1) then
|
||||||
Result := HTTPFieldNames[I] + ': ' + FFields[I];
|
Result := HTTPFieldNames[I] + ': ' + GetFieldValue(I);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function THTTPHeader.GetSetFieldName(AIndex: Integer): String;
|
function THTTPHeader.GetSetFieldName(AIndex: Integer): String;
|
||||||
@ -588,12 +588,8 @@ begin
|
|||||||
else
|
else
|
||||||
case Index of
|
case Index of
|
||||||
0 : Result:=FHTTPVersion;
|
0 : Result:=FHTTPVersion;
|
||||||
25 : Result:=''; // Property PathInfo
|
else
|
||||||
26 : Result:=''; // Property PathTranslated
|
Result := '';
|
||||||
27 : Result:=''; // Property RemoteAddress
|
|
||||||
28 : Result:=''; // Property RemoteHost
|
|
||||||
29 : Result:=''; // Property ScriptName
|
|
||||||
30 : Result:=''; // Property ServerPort
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user