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

Bad handling of buffer in JS library #8

Open
EggPool opened this issue Nov 24, 2018 · 0 comments
Open

Bad handling of buffer in JS library #8

EggPool opened this issue Nov 24, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@EggPool
Copy link
Owner

EggPool commented Nov 24, 2018

return resolve(JSON.parse(response.toString('utf8').substr(10)));

@gabidi

This just drops the first 10 bytes of each buffer.
The first 10 bytes are the len of what to read next and have to be read and enforced.
One command is not one packet/buffer.

You can have one command over 2 buffers, or 2 commands in one buffer.

@EggPool EggPool added the bug Something isn't working label Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant