lathoub / Arduino-AppleMIDI-Library

Send and receive MIDI messages over Ethernet (rtpMIDI or AppleMIDI)
Other
306 stars 66 forks source link

Remove processed rtp-journal data from buffer #82

Closed hugbug closed 4 years ago

hugbug commented 4 years ago

When journal section is present but has no entries the data pointer isn't advanced. That causes the next parsing to attempt to analyse the wrong data which of course fail.

This small PR fixes the issue.

It's also possible that _journalSectionComplete should be also set:

 _journalSectionComplete = true;

I'm not sure about that, please add if necessary.

lathoub commented 4 years ago

Thanks @hugbug Do you have the bytes that make up the message with the empty journalSection? (I'll put it in the test script, see /test folder - Ethernet.h)

hugbug commented 4 years ago

Here is the packet:

Screen Shot 2020-05-01 at 22 35 25

I can also provide a full Wireshark capture file if you like.

lathoub commented 4 years ago

@hugbug thanks for the Wireshark packet 👍

lathoub commented 4 years ago

Thank you @hugbug for spotting the bug!