| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The PR looks great, can you add a test just to ensure the issue is fixed? |
Sorry, something went wrong.
There was a problem hiding this comment.
This is looking good. I guess we can improve the conditions a tad with my suggestions and I wonder if we have to do the same for the non-encoding situation. Is that also impacted? Let's add regression tests for both to be safe.
Sorry, something went wrong.
There was a problem hiding this comment.
What about changing the chunkedRead above instead:
const chunkedRead = length > kReadFileBufferLength || size === 0;That would automatically check for it and it's one boolean check in the loop less.
Sorry, something went wrong.
There was a problem hiding this comment.
I believe the premise here for chunkedRead is already knowing the size of the file, meaning size === 0 cannot imply the need for chunkedRead, have I misunderstand something?
Sorry, something went wrong.
There was a problem hiding this comment.
| result += decoder.write(noSize && bytesRead !== kReadFileUnknownBufferLength ? | |
| buffer.subarray(0, bytesRead) : buffer); | |
| const writeBuffer = bytesRead !== buffer.length ? | |
| buffer.subarray(0, bytesRead) : | |
| buffer; | |
| result += decoder.write(writeBuffer); |
Sorry, something went wrong.
|
Sorry, something went wrong.
Thanks for the reminder :) |
Sorry, something went wrong.
Sorry, something went wrong.
|
could you take a look? @legendecas |
Sorry, something went wrong.
There was a problem hiding this comment.
If I understand correctly, this is not a buffer for a "write" operation. Instead, it is a result of "read".
| const writeBuffer = bytesRead !== buffer.length ? | |
| const readBuffer = bytesRead !== buffer.length ? |
Sorry, something went wrong.
There was a problem hiding this comment.
Resolved. Thanks!
Sorry, something went wrong.
Sorry, something went wrong.
|
Can this be backported to v20? |
Sorry, something went wrong.
PR-URL: nodejs#52178 Fixes: nodejs#52155 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
| Back | FazBrowse Home | New Git URL |
Fixes: #52155