1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Fixed CookieAccessFilter events not being triggered

Fixed SimpleServer demo to call the updated ICefPostData function names
This commit is contained in:
Salvador Díaz Fau
2019-10-04 16:49:53 +02:00
parent 437c3bf4c0
commit 7b82de6abe
6 changed files with 87 additions and 48 deletions

View File

@ -195,37 +195,55 @@ end;
procedure TSimpleServerFrm.ShowPostDataInfo(const aPostData : ICefPostData);
var
i, j : integer;
i : integer;
TempLen : NativeUInt;
TempList : IInterfaceList;
TempElement : ICefPostDataElement;
TempBytes : TBytes;
TempArray : TCefPostDataElementArray;
begin
if (aPostData = nil) then exit;
TempArray := nil;
i := 0;
j := aPostData.GetCount;
TempList := aPostData.GetElements(j);
while (i < j) do
begin
TempElement := TempList.Items[i] as ICefPostDataElement;
if (TempElement.GetBytesCount > 0) then
try
try
if (aPostData <> nil) and (aPostData.GetElementCount > 0) then
begin
SetLength(TempBytes, TempElement.GetBytesCount);
TempLen := TempElement.GetBytes(TempElement.GetBytesCount, @TempBytes[0]);
aPostData.GetElements(aPostData.GetElementCount, TempArray);
if (TempLen > 0) then
i := 0;
while (i < length(TempArray)) do
begin
ConnectionLogMem.Lines.Add('Post contents length : ' + inttostr(TempLen));
ConnectionLogMem.Lines.Add('Post contents sample : ' + BufferToString(TempBytes));
if (TempArray[i].GetBytesCount > 0) then
begin
SetLength(TempBytes, TempArray[i].GetBytesCount);
TempLen := TempArray[i].GetBytes(TempArray[i].GetBytesCount, @TempBytes[0]);
if (TempLen > 0) then
begin
ConnectionLogMem.Lines.Add('Post contents length : ' + inttostr(TempLen));
ConnectionLogMem.Lines.Add('Post contents sample : ' + BufferToString(TempBytes));
end;
end;
inc(i);
end;
i := 0;
while (i < length(TempArray)) do
begin
TempArray[i] := nil;
inc(i);
end;
end;
inc(i);
except
on e : exception do
if CustomExceptionHandler('TSimpleServerFrm.ShowPostDataInfo', e) then raise;
end;
finally
if (TempArray <> nil) then
begin
Finalize(TempArray);
TempArray := nil;
end;
end;
end;
function TSimpleServerFrm.BufferToString(const aBuffer : TBytes) : string;