radarsat1 / liblo

liblo is an implementation of the Open Sound Control protocol for POSIX systems
GNU Lesser General Public License v2.1
190 stars 60 forks source link

Discard corrupted messages when receiving #102

Closed malloch closed 4 years ago

malloch commented 4 years ago

When playing with multithreaded senders I realized that corrupted messages are not released from the receive buffer leading to unnecessary increases to the buffer size. This change copies and returns valid messages from the buffer as before, but decrements the buffer read offset regardless, effectively removing corrupted data from the buffer.