mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 02:43:33 +08:00
Fixed mavlink_ftp read
Instead of always reading the max data length, it now properly respects the requested amount of bytes (as per documentation)
This commit is contained in:
@@ -572,7 +572,7 @@ MavlinkFTP::_workRead(PayloadHeader *payload)
|
||||
return kErrFailErrno;
|
||||
}
|
||||
|
||||
int bytes_read = ::read(_session_info.fd, &payload->data[0], kMaxDataLength);
|
||||
int bytes_read = ::read(_session_info.fd, &payload->data[0], payload->size);
|
||||
|
||||
if (bytes_read < 0) {
|
||||
// Negative return indicates error other than eof
|
||||
|
||||
Reference in New Issue
Block a user