Преглед изворни кода

Bug fix: FTP keepalive command was sometime sent right after the transfer finished

(cherry picked from commit 76d59492483274ed60aeb770adedcc7d8c7c892c)

Source commit: adb4c0f69d8ba4f80f6b90263732d48a10bea264
Martin Prikryl пре 4 година
родитељ
комит
b045f97c36
1 измењених фајлова са 9 додато и 2 уклоњено
  1. 9 2
      source/filezilla/FtpControlSocket.cpp

+ 9 - 2
source/filezilla/FtpControlSocket.cpp

@@ -1606,9 +1606,16 @@ void CFtpControlSocket::CheckForTimeout()
   int delay=GetOptionVal(OPTION_TIMEOUTLENGTH);
   if (m_pTransferSocket)
   {
-    int res=m_pTransferSocket->CheckForTimeout(delay);
-    if (res)
+    int res = m_pTransferSocket->CheckForTimeout(delay);
+    if (res != 0)
+    {
+      if (res == 1)
+      {
+        // avoid trying to set keepalive command right after the transfer finishes
+        m_LastSendTime = CTime::GetCurrentTime();
+      }
       return;
+    }
   }
   CTimeSpan span=CTime::GetCurrentTime()-m_LastRecvTime;
   if (span.GetTotalSeconds()>=delay)