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

Incorrect packet length due to padding encoding #15

Open
bitflogger opened this issue Apr 29, 2020 · 0 comments
Open

Incorrect packet length due to padding encoding #15

bitflogger opened this issue Apr 29, 2020 · 0 comments

Comments

@bitflogger
Copy link

hi,

I noticed that the packets sent in pyping are way too big. After some investigation I found out the padding is 4x larger than expected. It looks like the encoding will add 4 bytes to the datagram for every int in the padBytes array.

I fixed this by changing 'data = bytes(padBytes)' to 'str(bytearray(padBytes))' in /pyping/core.py function 'send_one_ping'.

I understand that bytearray is only available since python 2.6, so to preserve backward compatibility, you may want to use a slightly different method.

I use python 2.7.17 by the way.

regards,
/steven

ps; sorry if i did not put a savvy diff in here. i'm new to this.

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