From e88ca3f054da842f29695de3fef8c4cc352f9be4 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 17 Apr 2023 15:16:41 -0400 Subject: [PATCH] haze: improve host-to-device file transfer performance --- troposphere/haze/source/ptp_responder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/troposphere/haze/source/ptp_responder.cpp b/troposphere/haze/source/ptp_responder.cpp index c009f3e57..591cdd950 100644 --- a/troposphere/haze/source/ptp_responder.cpp +++ b/troposphere/haze/source/ptp_responder.cpp @@ -723,6 +723,9 @@ namespace haze { s64 offset = 0; R_TRY(m_fs.SetFileSize(std::addressof(file), 0)); + /* Expand to the needed size. */ + R_TRY(m_fs.SetFileSize(std::addressof(file), data_header.length)); + /* Begin writing to the filesystem. */ while (true) { /* Read as many bytes as we can. */