Skip to content

Incorrect packet length due to padding encoding #15

@bitflogger

Description

@bitflogger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions