Browse Source

Bug 1994: Do not abort "Keep remote directory up to date" when connection is lost while deleting files or looking for differences and the session is reconnected

https://winscp.net/tracker/1994
(cherry picked from commit 240301bbdb7d70ece52db544f7721ac73a86c2c0)

Source commit: bb2c829eacb5a405cb706a634c63deb91ef105c4
Martin Prikryl 4 years ago
parent
commit
08da07eb8d
1 changed files with 19 additions and 5 deletions
  1. 19 5
      source/forms/CustomScpExplorer.cpp

+ 19 - 5
source/forms/CustomScpExplorer.cpp

@@ -5456,15 +5456,29 @@ void __fastcall TCustomScpExplorerForm::DoSynchronize(
     }
     catch (Exception & E)
     {
-      if (FLAGSET(Params.Options, soContinueOnError) && Terminal->Active &&
-          DebugAlwaysTrue(FOnFeedSynchronizeError != NULL))
+      if (!Terminal->Active)
       {
-        // noop, already logged in MoreMessageDialog
+        ShowExtendedExceptionEx(Terminal, &E);
+        // Do not abort the "keep up to date" when the session was succesfully reconnected.
+        if (!Terminal->Active)
+        {
+          throw;
+        }
       }
       else
       {
-        ShowExtendedExceptionEx(Terminal, &E);
-        throw;
+        if (FLAGSET(Params.Options, soContinueOnError) &&
+            DebugAlwaysTrue(FOnFeedSynchronizeError != NULL))
+        {
+          // noop, already logged in MoreMessageDialog
+        }
+        else
+        {
+          // We get mostly EAbort here, so this is noop.
+          // Exception is an error when listing directories while looking for differences.
+          ShowExtendedExceptionEx(Terminal, &E);
+          throw;
+        }
       }
     }
   }