From e1883bcaa4e6be77b89f4df86eb62492bd3555b8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 15 Jan 2023 11:44:30 +1100 Subject: [PATCH] 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 --- libraries/GCS_MAVLink/GCS_FTP.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/GCS_MAVLink/GCS_FTP.cpp b/libraries/GCS_MAVLink/GCS_FTP.cpp index 4bae82bb27..e86fafdd84 100644 --- a/libraries/GCS_MAVLink/GCS_FTP.cpp +++ b/libraries/GCS_MAVLink/GCS_FTP.cpp @@ -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; }