iotjs icon indicating copy to clipboard operation
iotjs copied to clipboard

Invalid response when large file piped to http response

Open lauriro opened this issue 4 years ago • 1 comments

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 02599f35810cfa6ea5495bbc42194ed576b969de build: ./tools/build.py --jerry-profile=es2015-subset

lauriro avatar Aug 11 '21 14:08 lauriro

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 avatar Aug 12 '21 06:08 lauriro