Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Downloads stop at 5MB and silently fail #10

Closed
soupcan97 opened this issue Aug 4, 2023 · 2 comments
Closed

Downloads stop at 5MB and silently fail #10

soupcan97 opened this issue Aug 4, 2023 · 2 comments
Assignees

Comments

@soupcan97
Copy link

soupcan97 commented Aug 4, 2023

I am having an issue downloading larger files (5MB +). They stop at exactly 5.00 MB (5,242,880 bytes).

I am using NSIS 3.09 x86-unicode and tested on Windows 11 22H2 x64 and Windows Server 2016 x64.

The below is a simple script that can be used for testing.

Test Script
OutFile NSxferTest.exe

Section -

	NSxfer::Request /METHOD GET /INTERNETFLAG INTERNET_FLAG_NO_CACHE_WRITE /URL "https://download-installer.cdn.mozilla.net/pub/firefox/releases/116.0/linux-x86_64/en-US/firefox-116.0.tar.bz2" /LOCAL "$exedir\test.zip" /END
	Pop $0
	DetailPrint "Got transfer id $0"

	NSxfer::Wait /ID $0 /END
	Pop $0

	NSxfer::Query /ID $0 /STATUS /WININETSTATUS /FILESIZE /RECVSIZE /ERRORCODE /ERRORTEXT /END
	Pop $0
	Pop $1
	Pop $2
	Pop $3
	Pop $4
	Pop $5

	DetailPrint "STATUS: $0"
	DetailPrint "WININETSTATUS: $1"
	DetailPrint "FILESIZE: $2"
	DetailPrint "RECVSIZE: $3"
	DetailPrint "ERRORCODE: $4"
	DetailPrint "ERRORTEXT: $5"

SectionEnd
Output
Got transfer id 1
STATUS: 
WININETSTATUS: 
FILESIZE: 
RECVSIZE: 
ERRORCODE: 
ERRORTEXT: 
Completed

If I use NSxfer::Transfer the result on the stack is "OK".

@soupcan97 soupcan97 changed the title Downloads stop at 5MB, but return as success Downloads stop at 5MB and silently fail Aug 4, 2023
@negrutiu negrutiu self-assigned this Aug 4, 2023
negrutiu added a commit that referenced this issue Aug 4, 2023
Regression from GH-3

Buffer sizing logic used for memory downloads does not apply to file downloads.
We risk cutting down the buffer to zero bytes, which only makes sense when downloading to a size-limited memory buffer.
@negrutiu
Copy link
Owner

negrutiu commented Aug 4, 2023

Hi @sopadelata.
Issue fixed in the latest release. Could you give it a try?

@soupcan97
Copy link
Author

@negrutiu Did some quick testing and it appears resolved.

Thanks a ton!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants