You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have a microserver built with Brookframework (main branch updated 26-06-2024) and libsagui 3.5.0.
I've tested it under Windows 11 and Ubuntu 24.04 too.
I've used an instance of TBrookHTTPUploadsEnumerator class to retrieve the files uploaded by the client (react web app).
When the user uploads 2 or more files the following cycle works only if the server is under Windows:
upldEn := ARequest.Uploads.GetEnumerator;
repeat
[code that uses upldEn.Current]
until upldEn.MoveNext;
In linux upldEn.MoveNext returns true immediately, so in linux I can't use the enumerator.
I found that this code instead is working fine in linux:
for i := 0 to ARequest.Uploads.Count - 1 do
begin
if i = 0 then
upld := ARequest.Uploads.First
else
upld := ARequest.Uploads.Next;
[code that uses upld]
end;
Environment:
OS, compiler and Brook version to reproduce the problem:
Windows 11 / XUbuntu 24.04
Lazarus 3.2 FPC 3.2.2
Brook 5.7.0
Sagui 3.5.0 x86_64 windows/linux
Is this a bug or I am doing something wrong?
Thanks in advance and thanks for the beautiful framework,
Domenico
The text was updated successfully, but these errors were encountered:
DomenicoMammola
changed the title
TBrookHTTPUploadsEnumerator weird behaviour under linux (Ubuntu 20.04)
TBrookHTTPUploadsEnumerator weird behaviour under linux (Ubuntu 24.04)
Jun 26, 2024
Hello,
I have a microserver built with Brookframework (main branch updated 26-06-2024) and libsagui 3.5.0.
I've tested it under Windows 11 and Ubuntu 24.04 too.
I've used an instance of TBrookHTTPUploadsEnumerator class to retrieve the files uploaded by the client (react web app).
When the user uploads 2 or more files the following cycle works only if the server is under Windows:
upldEn := ARequest.Uploads.GetEnumerator; repeat [code that uses upldEn.Current] until upldEn.MoveNext;
In linux upldEn.MoveNext returns true immediately, so in linux I can't use the enumerator.
I found that this code instead is working fine in linux:
for i := 0 to ARequest.Uploads.Count - 1 do begin if i = 0 then upld := ARequest.Uploads.First else upld := ARequest.Uploads.Next; [code that uses upld] end;
Environment:
OS, compiler and Brook version to reproduce the problem:
Is this a bug or I am doing something wrong?
Thanks in advance and thanks for the beautiful framework,
Domenico
The text was updated successfully, but these errors were encountered: