]> git.proxmox.com Git - mirror_edk2.git/commit - ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c
ShellPkg/TftpDynamicCommand: Change file writing method in tftp
authorSongpeng Li <songpeng.li@intel.com>
Mon, 7 Jan 2019 02:44:18 +0000 (10:44 +0800)
committerJiaxin Wu <Jiaxin.wu@intel.com>
Fri, 11 Jan 2019 01:33:24 +0000 (09:33 +0800)
commitb85c8fb4d4dee870b6f37d6f53b9229f47c31450
treed490e9c420b037b9a456a1c5440031f2bf44e358
parenta653a525515698d80cbecc1ca3d0e8f48e7390a2
ShellPkg/TftpDynamicCommand: Change file writing method in tftp

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1433

v2: Remove an unused variable.

Current logic of shell tftp download was writing file after tftp
download finished, when the file is large, it looks like the shell
tftp command hanged after download was finished. To improve
end-user experience, the solution is using split file writing
instead.

This patch update the code to open and close file inside
DownloadFile(), and save each packet to file within callback
function CheckPacket().

Since AllocatePage() is no-longer needed, This patch can also
remove the memory limitation. The download file can be larger
than system free memory now.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c