If the last (or only) frame received on a framed UDP channel had zero length,
we would not send it to the application, but keep it in the receive buffer
until more frames had been received.
buffer_clear(&c->rcvbuf);
// Handle whole frames
- while(left > 2) {
+ while(left >= 2) {
uint16_t framelen;
memcpy(&framelen, ptr, sizeof(framelen));
- if(left <= (size_t)framelen + 2) {
+ if(left < (size_t)framelen + 2) {
break;
}