diff options
author | Kenneth Skovhede <kenneth@hexad.dk> | 2019-11-05 15:29:25 +0300 |
---|---|---|
committer | Kenneth Skovhede <kenneth@hexad.dk> | 2019-11-05 15:29:25 +0300 |
commit | c726e6561a15371b04fe90853240ec80c122aeea (patch) | |
tree | b406430dfb4dcd19bb76085a82af887ad1fa14ec | |
parent | 7d3ba5ebd4960beb1566e1e7781b53eed5ceac60 (diff) | |
parent | 44779a1894d2b023f804a0abc9c3ae907ac9f990 (diff) |
Merge branch 'master' of github.com:duplicati/duplicati
7 files changed, 40 insertions, 11 deletions
diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs index 0ca5b64fd..574b9bfc5 100644 --- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs +++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs @@ -226,8 +226,13 @@ namespace Duplicati.GUI.TrayIcon private class SaltAndNonce
{
- public readonly string Salt = null;
- public readonly string Nonce = null;
+ // ReSharper disable once FieldCanBeMadeReadOnly.Local
+ // This cannot be made readonly as its value is set by a deserializer.
+ public string Salt = null;
+
+ // ReSharper disable once FieldCanBeMadeReadOnly.Local
+ // This cannot be made readonly as its value is set by a deserializer.
+ public string Nonce = null;
}
private SaltAndNonce GetSaltAndNonce()
diff --git a/Duplicati/Library/Main/Operation/Backup/FilePreFilterProcess.cs b/Duplicati/Library/Main/Operation/Backup/FilePreFilterProcess.cs index ae602ec98..bf6833bf4 100644 --- a/Duplicati/Library/Main/Operation/Backup/FilePreFilterProcess.cs +++ b/Duplicati/Library/Main/Operation/Backup/FilePreFilterProcess.cs @@ -41,6 +41,7 @@ namespace Duplicati.Library.Main.Operation.Backup new
{
Input = Channels.ProcessedFiles.ForRead,
+ ProgressChannel = Channels.ProgressEvents.ForWrite,
Output = Channels.AcceptedChangedFile.ForWrite
},
@@ -81,6 +82,7 @@ namespace Duplicati.Library.Main.Operation.Backup if (tooLargeFile)
{
Logging.Log.WriteVerboseMessage(FILELOGTAG, "SkipCheckTooLarge", "Skipped checking file, because the size exceeds limit {0}", e.Path);
+ await self.ProgressChannel.WriteAsync(new ProgressEvent() { Filepath = e.Path, Length = filestatsize, Type = EventType.FileSkipped });
continue;
}
@@ -106,6 +108,7 @@ namespace Duplicati.Library.Main.Operation.Backup throw;
Logging.Log.WriteWarningMessage(FILELOGTAG, "FailedToAddFile", ex, "Failed while attempting to add unmodified file to database: {0}", e.Path);
}
+ await self.ProgressChannel.WriteAsync(new ProgressEvent() { Filepath = e.Path, Length = filestatsize, Type = EventType.FileSkipped });
continue;
}
@@ -143,6 +146,7 @@ namespace Duplicati.Library.Main.Operation.Backup {
Logging.Log.WriteWarningMessage(FILELOGTAG, "FailedToAddFile", ex, "Failed while attempting to add unmodified file to database: {0}", e.Path);
}
+ await self.ProgressChannel.WriteAsync(new ProgressEvent() { Filepath = e.Path, Length = filestatsize, Type = EventType.FileSkipped });
}
}
});
diff --git a/Duplicati/Library/Main/Operation/Backup/ProgressHandler.cs b/Duplicati/Library/Main/Operation/Backup/ProgressHandler.cs index ec75ffde1..f1973a08b 100644 --- a/Duplicati/Library/Main/Operation/Backup/ProgressHandler.cs +++ b/Duplicati/Library/Main/Operation/Backup/ProgressHandler.cs @@ -73,6 +73,13 @@ namespace Duplicati.Library.Main.Operation.Backup filesStarted.Remove(t.Filepath);
fileProgress.Remove(t.Filepath);
break;
+ case EventType.FileSkipped:
+
+ processedFileCount += 1;
+ processedFileSize += t.Length;
+
+ stat.OperationProgressUpdater.UpdatefilesProcessed(processedFileCount, processedFileSize);
+ break;
}
if (current == null)
diff --git a/Duplicati/Library/Main/Operation/Common/ProgressEvent.cs b/Duplicati/Library/Main/Operation/Common/ProgressEvent.cs index 90f41ba5f..50a98d9fb 100644 --- a/Duplicati/Library/Main/Operation/Common/ProgressEvent.cs +++ b/Duplicati/Library/Main/Operation/Common/ProgressEvent.cs @@ -25,7 +25,8 @@ namespace Duplicati.Library.Main.Operation.Common {
FileStarted,
FileProgressUpdate,
- FileClosed
+ FileClosed,
+ FileSkipped
}
/// <summary>
diff --git a/Duplicati/Library/Main/Options.cs b/Duplicati/Library/Main/Options.cs index f07399623..6f6c56328 100644 --- a/Duplicati/Library/Main/Options.cs +++ b/Duplicati/Library/Main/Options.cs @@ -291,7 +291,7 @@ namespace Duplicati.Library.Main new CommandLineArgument("asynchronous-upload-limit", CommandLineArgument.ArgumentType.Integer, Strings.Options.AsynchronousuploadlimitShort, Strings.Options.AsynchronousuploadlimitLong, "4"),
new CommandLineArgument("asynchronous-concurrent-upload-limit", CommandLineArgument.ArgumentType.Integer, Strings.Options.AsynchronousconcurrentuploadlimitShort, Strings.Options.AsynchronousconcurrentuploadlimitLong, "4"),
new CommandLineArgument("asynchronous-upload-folder", CommandLineArgument.ArgumentType.Path, Strings.Options.AsynchronousuploadfolderShort, Strings.Options.AsynchronousuploadfolderLong, System.IO.Path.GetTempPath()),
-
+
new CommandLineArgument("disable-streaming-transfers", CommandLineArgument.ArgumentType.Boolean, Strings.Options.DisableStreamingShort, Strings.Options.DisableStreamingLong, "false"),
new CommandLineArgument("throttle-upload", CommandLineArgument.ArgumentType.Size, Strings.Options.ThrottleuploadShort, Strings.Options.ThrottleuploadLong, "0kb"),
@@ -1097,7 +1097,7 @@ namespace Duplicati.Library.Main return value;
}
}
-
+
/// <summary>
/// Gets the logfile filename
/// </summary>
diff --git a/Duplicati/Library/Main/Strings.cs b/Duplicati/Library/Main/Strings.cs index 4ad1339d5..632d9645b 100644 --- a/Duplicati/Library/Main/Strings.cs +++ b/Duplicati/Library/Main/Strings.cs @@ -86,7 +86,7 @@ namespace Duplicati.Library.Main.Strings public static string EncryptionmoduleLong { get { return LC.L(@"Duplicati supports pluggable encryption modules. Use this option to select a module to use for encryption. This is only applied when creating new volumes, when reading an existing file, the filename is used to select the encryption module."); } }
public static string EncryptionmoduleShort { get { return LC.L(@"Select what module to use for encryption"); } }
public static string DisablemoduleLong { get { return LC.L(@"Supply one or more module names, separated by commas to unload them"); } }
- public static string DisablemoduleShort { get { return LC.L(@"Disabled one or more modules"); } }
+ public static string DisablemoduleShort { get { return LC.L(@"Disables one or more modules"); } }
public static string EnablemoduleLong { get { return LC.L(@"Supply one or more module names, separated by commas to load them"); } }
public static string EnablemoduleShort { get { return LC.L(@"Enables one or more modules"); } }
public static string SnapshotpolicyLong { get { return LC.L(@"This setting controls the usage of snapshots, which allows Duplicati to backup files that are locked by other programs. If this is set to ""off"", Duplicati will not attempt to create a disk snapshot. Setting this to ""auto"" makes Duplicati attempt to create a snapshot, and fail silently if that was not allowed or supported (note that the OS may still log system warnings). A setting of ""on"" will also make Duplicati attempt to create a snapshot, but will produce a warning message in the log if it fails. Setting it to ""required"" will make Duplicati abort the backup if the snapshot creation fails. On windows this uses the Volume Shadow Copy Services (VSS) and requires administrative privileges. On Linux this uses Logical Volume Management (LVM) and requires root privileges."); } }
diff --git a/Duplicati/Library/Main/Volumes/FilesetVolumeWriter.cs b/Duplicati/Library/Main/Volumes/FilesetVolumeWriter.cs index 60a0dff2c..a5faba88b 100644 --- a/Duplicati/Library/Main/Volumes/FilesetVolumeWriter.cs +++ b/Duplicati/Library/Main/Volumes/FilesetVolumeWriter.cs @@ -8,7 +8,8 @@ namespace Duplicati.Library.Main.Volumes {
public class FilesetVolumeWriter : VolumeWriterBase
{
- private readonly MemoryStream m_memorystream;
+ private readonly Library.Utility.TempFile m_tempFile;
+ private readonly Stream m_tempStream;
private StreamWriter m_streamwriter;
private readonly JsonWriter m_writer;
private long m_filecount;
@@ -19,8 +20,9 @@ namespace Duplicati.Library.Main.Volumes public FilesetVolumeWriter(Options options, DateTime timestamp)
: base(options, timestamp)
{
- m_memorystream = new MemoryStream();
- m_streamwriter = new StreamWriter(m_memorystream, ENCODING);
+ m_tempFile = new Library.Utility.TempFile();
+ m_tempStream = File.Open(m_tempFile, FileMode.Create, FileAccess.ReadWrite);
+ m_streamwriter = new StreamWriter(m_tempStream, ENCODING);
m_writer = new JsonTextWriter(m_streamwriter);
m_writer.WriteStartArray();
}
@@ -138,6 +140,16 @@ namespace Duplicati.Library.Main.Volumes m_streamwriter = null;
}
+ if (m_tempStream != null)
+ {
+ m_tempStream.Dispose();
+ }
+
+ if (m_tempFile != null)
+ {
+ m_tempFile.Dispose();
+ }
+
base.Close();
}
@@ -149,8 +161,8 @@ namespace Duplicati.Library.Main.Volumes using (Stream sr = m_compression.CreateFile(FILELIST, CompressionHint.Compressible, DateTime.UtcNow))
{
- m_memorystream.Seek(0, SeekOrigin.Begin);
- m_memorystream.CopyTo(sr);
+ m_tempStream.Seek(0, SeekOrigin.Begin);
+ m_tempStream.CopyTo(sr);
sr.Flush();
}
}
|