It was possible to skip over an information packet but not read any
further reply, so the packet type test (rbuffer[0] == ...) would not
work correctly.
// Information packet; discard.
fillBufferTo(&rbuffer, fd, 1);
int pktlen = (unsigned char) rbuffer[1];
+
+ rbuffer.consume(1); // Consume one byte so we'll read one byte of the next packet
fillBufferTo(&rbuffer, fd, pktlen);
- rbuffer.consume(pktlen);
+ rbuffer.consume(pktlen - 1);
}
}