Procházet zdrojové kódy

Bug 2132 (de072c6e) broke download transfer resume

Source commit: a87af8cf7efcabaf15945ef90cd6527224f8f1bf
Martin Prikryl před 2 roky
rodič
revize
ddd3256919
1 změnil soubory, kde provedl 16 přidání a 6 odebrání
  1. 16 6
      source/filezilla/FtpControlSocket.cpp

+ 16 - 6
source/filezilla/FtpControlSocket.cpp

@@ -2620,11 +2620,6 @@ void CFtpControlSocket::ResetTransferSocket(int Error)
 int CFtpControlSocket::OpenTransferFile(CFileTransferData * pData)
 {
   int nReplyError = 0;
-  if (m_pDataFile != NULL)
-  {
-    delete m_pDataFile;
-    m_pDataFile = NULL;
-  }
   bool res;
   if (pData->transferfile.get)
   {
@@ -2678,7 +2673,7 @@ int CFtpControlSocket::OpenTransferFile(CFileTransferData * pData)
 int CFtpControlSocket::ActivateTransferSocket(CFileTransferData * pData)
 {
   int nReplyError = 0;
-  if (pData->transferfile.get)
+  if (pData->transferfile.get && (m_pDataFile == NULL))
   {
     nReplyError = OpenTransferFile(pData);
   }
@@ -3601,6 +3596,12 @@ void CFtpControlSocket::FileTransfer(t_transferfile *transferfile/*=0*/,BOOL bFi
         else
           m_Operation.nOpState = FILETRANSFER_RETRSTOR;
 
+        if (m_pDataFile != NULL)
+        {
+          delete m_pDataFile;
+          m_pDataFile = NULL;
+        }
+
         if (!m_pTransferSocket)
         {
           nReplyError=FZ_REPLY_ERROR;
@@ -3645,6 +3646,15 @@ void CFtpControlSocket::FileTransfer(t_transferfile *transferfile/*=0*/,BOOL bFi
         }
         else
         {
+          if (pData->transferdata.bResume)
+          {
+            nReplyError = OpenTransferFile(pData);
+            if (nReplyError)
+            {
+              break;
+            }
+          }
+
           CString remotefile=pData->transferfile.remotefile;
           if (m_pDirectoryListing)
             for (int i=0; i<m_pDirectoryListing->num; i++)