mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 20:31:14 +00:00
haze: fix file size transmission issue
This commit is contained in:
parent
8e2eca2004
commit
a7300b0fa4
1 changed files with 6 additions and 1 deletions
|
@ -722,7 +722,9 @@ namespace haze {
|
||||||
R_TRY(m_fs.SetFileSize(std::addressof(file), 0));
|
R_TRY(m_fs.SetFileSize(std::addressof(file), 0));
|
||||||
|
|
||||||
/* Expand to the needed size. */
|
/* Expand to the needed size. */
|
||||||
R_TRY(m_fs.SetFileSize(std::addressof(file), data_header.length));
|
if (data_header.length > sizeof(PtpUsbBulkContainer)) {
|
||||||
|
R_TRY(m_fs.SetFileSize(std::addressof(file), data_header.length - sizeof(PtpUsbBulkContainer)));
|
||||||
|
}
|
||||||
|
|
||||||
/* Begin writing to the filesystem. */
|
/* Begin writing to the filesystem. */
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -743,6 +745,9 @@ namespace haze {
|
||||||
R_TRY(read_res);
|
R_TRY(read_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Truncate the file to the received size. */
|
||||||
|
R_TRY(m_fs.SetFileSize(std::addressof(file), offset));
|
||||||
|
|
||||||
/* Write the success response. */
|
/* Write the success response. */
|
||||||
R_RETURN(this->WriteResponse(PtpResponseCode_Ok));
|
R_RETURN(this->WriteResponse(PtpResponseCode_Ok));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue