From 422c86345e37274a5037197f5e0121946c3f4374 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Fri, 2 May 2025 14:50:33 -0600 Subject: [PATCH] Add logging --- Source/AaxDecrypter/NetworkFileStream.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/AaxDecrypter/NetworkFileStream.cs b/Source/AaxDecrypter/NetworkFileStream.cs index f482bd4f..cea86b9b 100644 --- a/Source/AaxDecrypter/NetworkFileStream.cs +++ b/Source/AaxDecrypter/NetworkFileStream.cs @@ -185,14 +185,19 @@ namespace AaxDecrypter } catch (HttpIOException e) when (e.HttpRequestError is HttpRequestError.ResponseEnded + && WritePosition != startPosition && WritePosition < ContentLength && !IsCancelled) { + Serilog.Log.Logger.Debug($"The download connection ended before the file completed downloading all 0x{ContentLength:X10} bytes"); + //the download made *some* progress since the last attempt. //Try again to complete the download from where it left off. //Make sure to rewind file to last flush position. _writeFile.Position = startPosition = WritePosition; blockResponse.Dispose(); blockResponse = await RequestNextByteRangeAsync(client); + + Serilog.Log.Logger.Debug($"Resuming the file download starting at position 0x{WritePosition:X10}."); } } }