From 5f089a5e64b4b86b3a5e1c34f7c7d5776838eac2 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Tue, 8 Oct 2024 07:32:25 +1100 Subject: [PATCH 1/2] Fix issue where session upload files contain zero data or are corrupt * Fix issue where session upload files contain zero data or are corrupt --- src/sync.d | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/sync.d b/src/sync.d index 16a544429..598e80426 100644 --- a/src/sync.d +++ b/src/sync.d @@ -8453,6 +8453,9 @@ class SyncEngine { void processForInterruptedSessionUploads() { // For each upload_session file that has been found, process the data to ensure it is still valid foreach (sessionFilePath; interruptedUploadsSessionFiles) { + // What session data are we trying to restore + if (verboseLogging) {addLogEntry("Attempting to restore file upload session using this session data file: " ~ sessionFilePath, ["verbose"]);} + // Does this pass validation? if (!validateUploadSessionFileData(sessionFilePath)) { // Remove upload_session file as it is invalid // upload_session file file contains an error - cant resume this session @@ -8491,7 +8494,14 @@ class SyncEngine { // Try and read the text from the session file as a JSON array try { - sessionFileData = readText(sessionFilePath).parseJSON(); + if (getSize(sessionFilePath) > 0) { + // There is data to read in + sessionFileData = readText(sessionFilePath).parseJSON(); + } else { + // No data to read in - invalid file + if (debugLogging) {addLogEntry("SESSION-RESUME: Invalid JSON file: " ~ sessionFilePath, ["debug"]);} + return false; + } } catch (JSONException e) { if (debugLogging) {addLogEntry("SESSION-RESUME: Invalid JSON data in: " ~ sessionFilePath, ["debug"]);} return false; From b424a5d5e742da5aff8b145b1e7ab1e20863c0d0 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Wed, 9 Oct 2024 06:05:17 +1100 Subject: [PATCH 2/2] Update install.md * Update documentation to clarify LDC use when building on ARMHF or ARM64 --- docs/install.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/install.md b/docs/install.md index a68b5b606..8a8ce855f 100644 --- a/docs/install.md +++ b/docs/install.md @@ -228,11 +228,13 @@ as far as possible automatically, but can be overridden by passing > [!IMPORTANT] > For successful compilation of this application, it's crucial that the build environment is equipped with a minimum of 1GB of memory and an additional 1GB of swap space. To verify your system's swap space availability, you can use the `swapon` command. Ensuring these requirements are met is vital for the application's compilation process. +> [!NOTE] +> The 'configure' step will detect the correct version of LDC to be used when compiling the client under ARMHF and ARM64 cpu architectures. + ```text git clone https://github.com/abraunegg/onedrive.git cd onedrive -./configure DC=/usr/bin/ldmd2 -make clean; make +./configure; make clean; make; sudo make install ```