mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 21:09:07 +02:00
* Small improvement to dumprecord
git-svn-id: trunk@23210 -
This commit is contained in:
parent
0602984934
commit
3f1111649b
@ -395,8 +395,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
ACgiVarNr:=HttpToCGI[Index];
|
ACgiVarNr:=HttpToCGI[Index];
|
||||||
if ACgiVarNr>0 then
|
if ACgiVarNr>0 then
|
||||||
Result:=FCGIParams.Values[CgiVarNames[ACgiVarNr]]
|
begin
|
||||||
else
|
Result:=FCGIParams.Values[CgiVarNames[ACgiVarNr]];
|
||||||
|
if (ACgiVarNr = 5) and //PATH_INFO
|
||||||
|
(length(Result)>=2)and(word(Pointer(@Result[1])^)=$2F2F)then //mod_proxy_fcgi gives double slashes at the beginning for some reason
|
||||||
|
Delete(Result, 1, 1); //Remove the extra first one
|
||||||
|
end else
|
||||||
Result := '';
|
Result := '';
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -629,23 +633,30 @@ function TFCgiHandler.Read_FCGIRecord : PFCGI_Header;
|
|||||||
Procedure DumpFCGIRecord (Var Header :FCGI_Header; ContentLength : word; PaddingLength : byte; ResRecord : Pointer);
|
Procedure DumpFCGIRecord (Var Header :FCGI_Header; ContentLength : word; PaddingLength : byte; ResRecord : Pointer);
|
||||||
|
|
||||||
Var
|
Var
|
||||||
s : string;
|
S, s1, s2 : string;
|
||||||
I : Integer;
|
I : Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Writeln('Dumping record ', Sizeof(Header),',',Contentlength,',',PaddingLength);
|
Writeln(Format('Dumping record, Sizeof(Header)=%d, ContentLength=%d, PaddingLength=%d',[SizeOf(Header),ContentLength,PaddingLength]));
|
||||||
|
S:=''; s1 := '';
|
||||||
For I:=0 to Sizeof(Header)+ContentLength+PaddingLength-1 do
|
For I:=0 to Sizeof(Header)+ContentLength+PaddingLength-1 do
|
||||||
|
begin
|
||||||
|
s2 := Format('%:2X ',[PByte(ResRecord)[i]]);
|
||||||
|
if s2[1] = ' ' then s2[1] := '0';
|
||||||
|
s1 := s1 + s2;
|
||||||
|
If PByte(ResRecord)[i]>32 then
|
||||||
|
S:=S+char(PByte(ResRecord)[i])
|
||||||
|
else
|
||||||
|
S:=S+' ';
|
||||||
|
if (I>0) and (((I+1) mod 16) = 0) then
|
||||||
begin
|
begin
|
||||||
Write(Format('%:3d ',[PByte(ResRecord)[i]]));
|
Writeln(s1 + ' ' + S);
|
||||||
If PByte(ResRecord)[i]>30 then
|
S:=''; s1 := '';
|
||||||
S:=S+char(PByte(ResRecord)[i]);
|
|
||||||
if (I mod 16) = 0 then
|
|
||||||
begin
|
|
||||||
writeln(' ',S);
|
|
||||||
S:='';
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
Writeln(' ',S)
|
end;
|
||||||
|
if length(s1)<48 then
|
||||||
|
repeat s1 := s1 + ' ' until length(s1)>=48;
|
||||||
|
Writeln(s1 + ' '+S)
|
||||||
end;
|
end;
|
||||||
{$ENDIF DUMPRECORD}
|
{$ENDIF DUMPRECORD}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user