Skip to content

TBrookHTTPUploadsEnumerator weird behaviour under linux (Ubuntu 24.04) #55

Description

@DomenicoMammola

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions