feat(core): stream flash-transfer uploads from disk

create_flash_task loaded every fileset file through loadBinarySource
and kept the bytes through hash, commit, and sliceupload, so a single
file over 1 GiB could not be sent. Stage to disk like group files,
stream MD5/SHA1/Sha1StateV, then POST 1 MiB chunks from FileChunkSource.

Do not reuse video sha1Blocks as Sha1StateV: an exact N-MiB file would
ship an extra un-finalized last-slice state. Local/HTTP sources use the
4 GiB group-file ceiling; inline base64 stays at 1 GiB because stage
still decodes it in RAM. Protocol order, seconds-pass, and multi-file
commit are unchanged.

Fixes #359
This commit is contained in:
DrSmoothl committed 2026-08-13 18:34:27 +08:00
1 parent e7322e2e72
commit b8b9be83c3
5 files changed
+542 -79

No files matched your search

+7
View File
@@ -20,6 +20,13 @@ export interface LoadedBinary {
const DEFAULT_MAX_BINARY_SIZE = 1024 * 1024 * 1024; // 1 GiB
/** Hard ceiling QQ's file protocol supports — used by group/private files. */
export const FILE_UPLOAD_MAX_BYTES = 4 * 1024 * 1024 * 1024; // 4 GiB
/** Local / HTTP flash sources. Official fileset max is unknown; reuse the
* group/private file ceiling so create_flash_task is not stuck on
* `loadBinarySource`'s 1 GiB default. */
export const FLASH_TRANSFER_MAX_BYTES = FILE_UPLOAD_MAX_BYTES;
/** Inline `base64://` / `data:` flash sources still decode into RAM inside
* `stageSourceToDisk`, so they keep the 1 GiB buffered-load ceiling. */
export const FLASH_TRANSFER_INLINE_MAX_BYTES = DEFAULT_MAX_BINARY_SIZE;
const FETCH_TIMEOUT_MS = 60_000;
/**