GCS_MAVLink: fixed FTP terminate session error

this caused ftp downloads to intermittently fail. The cause is the FTP
client may ask for a session terminate and then immediately afterwards
a ftp open. The open would fail as the ftp session was considered
active
This commit is contained in:
Andrew Tridgell 2023-01-15 11:44:30 +11:00 committed by Randy Mackay
parent 2883ec856a
commit d48ab3b384

View File

@ -116,7 +116,11 @@ bool GCS_MAVLINK::send_ftp_reply(const pending_ftp &reply)
reply.chan,
0, reply.sysid, reply.compid,
payload);
ftp.last_send_ms = AP_HAL::millis();
if (reply.req_opcode == FTP_OP::TerminateSession) {
ftp.last_send_ms = 0;
} else {
ftp.last_send_ms = AP_HAL::millis();
}
return true;
}