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

implement _write() #1

Merged
merged 3 commits into from
May 7, 2022
Merged

implement _write() #1

merged 3 commits into from
May 7, 2022

Conversation

bburky
Copy link
Contributor

@bburky bburky commented May 6, 2022

Even if _writev() is implemented, it appears that _write() is not optional:

https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1
nodejs/node#28408 (comment)

I ran into this when testing @frida/web-client in the browser, compiled with rollup. I did need to use vite-compatible-readable-stream instead of readable-stream due to rollup circular dependency issues: nodejs/readable-stream#348 (comment). At runtime I was getting errors about _write.

This commit implements _write() in terms of _writev(). I think this is appropriate, and is very simple to implement this way.

Copy link
Member

@oleavr oleavr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, great catch! 🙌

index.ts Outdated Show resolved Hide resolved
index.ts Outdated Show resolved Hide resolved
@oleavr oleavr merged commit c25d2b5 into frida:main May 7, 2022
@oleavr
Copy link
Member

oleavr commented May 7, 2022

(Just published @frida/[email protected] with this fix.)

@bburky bburky deleted the stream-write branch May 7, 2022 17:37
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

Successfully merging this pull request may close these issues.

2 participants