Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Invalid response when large file piped to http response #1974

Open
lauriro opened this issue Aug 11, 2021 · 1 comment
Open

Invalid response when large file piped to http response #1974

lauriro opened this issue Aug 11, 2021 · 1 comment

Comments

@lauriro
Copy link
Contributor

lauriro commented Aug 11, 2021

When file larger than a kernel page is piped to http response,
first page is missing and second page is sent twice,
resulting a corrupt file.

minimal example: https://github.com/lauriro/iotjs-buffer-error-example
commit 02599f3
build: ./tools/build.py --jerry-profile=es2015-subset

@lauriro
Copy link
Contributor Author

lauriro commented Aug 12, 2021

I created a fs.js in example repo.

$ iotjs fs.js 4kb.txt
Same true
...
$ node fs.js 4kb.txt
Same false

Iotjs reuses buffer and refill it before it is written to underlying system stream

lauriro added a commit to lauriro/iotjs that referenced this issue Aug 12, 2021
lauriro added a commit to lauriro/iotjs that referenced this issue Aug 13, 2021
fix jerryscript-project#1974

IoT.js-DCO-1.0-Signed-off-by: Lauri Rooden [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant