Fixed packing of the array to allow the 256 byte length in big endian #47

Merged
merged 1 commit into from Jun 19, 2012

Conversation

Projects
None yet
2 participants
Contributor

tompesman commented Jun 19, 2012

If a notification is sent with payload_size == 256, the delivery fails with error_code: 4 and error_description: 'Missing payload'.

The documentation says: 'The payload must not exceed 256 bytes and must not be null-terminated.' There is a problem with the the pack method in notification.rb. The documentation states 2 bytes for the payload length, the pack method uses the c value for the payload_size which is a 8-bit signed integer. So I removed the 1 and c. The other c is replaced the a n which is: Integer, 16-bit unsigned, network (big-endian) byte order.

@ileitch ileitch added a commit that referenced this pull request Jun 19, 2012

@ileitch ileitch Merge pull request #47 from tompesman/missing_payload_fix
Fixed packing of the array to allow the 256 byte length in big endian
12eec1f

@ileitch ileitch merged commit 12eec1f into ileitch:master Jun 19, 2012

Owner

ileitch commented Jun 19, 2012

Good catch, cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment