Skip to content

Conversation

@plichard
Copy link
Contributor

@plichard plichard commented Sep 2, 2024

Solved Problem

When trying to list an empty directory, I found that the mavlink ftp implementation does not return EOF.

Solution

payload->offset == 0 should be checked as well for EOF.
This also changes the behavior to return kErrFailErrno when retrieving a dir entry fails, instead of failing silently (while removing duplicated payload->size and closedir logic).

Changelog Entry

For release notes:

Bugfix mavlink ftp not returning EOF on empty directory list.

@github-actions github-actions bot added the stale label Oct 3, 2024
@dakejahl
Copy link
Contributor

dakejahl commented Nov 5, 2024

what issue is this fixing? What are the steps to reproduce?

@plichard
Copy link
Contributor Author

plichard commented Nov 5, 2024

If I remember correctly, was a while ago, the directory listing of an empty directory would time-out with certain mavlink ftp clients, because they were waiting for the NAK (EOF) as described in point 4 of https://mavlink.io/en/services/ftp.html#list_directory, which the current implementation would never send (for an empty directory).

I can give you more details when I come back from holidays, I don't have access to the setup right now.

@dakejahl dakejahl merged commit 79bb30c into PX4:main Nov 5, 2024
@dakejahl
Copy link
Contributor

dakejahl commented Nov 5, 2024

okay I see. Tested with mavsdk and I see the ACK now

JoelJ18 pushed a commit to microstrain-robotics/PX4-Autopilot that referenced this pull request Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants