>>>>> "John" == John Birrell <jb@stripped> writes:
John> I think that the embedded server vio_read() code is
John> over-running the end of the buffered packets. It needs
John> to do something to limit the read request size like:
John> if (vio->where_in_packet + size > vio->end_of_packet)
John> size = vio->end_of_packet - vio->where_in_packet;
Tim, could you check this out (I don't have a test case to test this)
The if is right, but there should not be a need to readjust size
John, any change of getting me a test case for this?
John> I'm unsure if it supposed to go on to the next buffered
John> packet, or just return a smaller number of bytes.
John> I patched my local source with the code above and
John> it fixes the "Packets out of order" error, allowing
John> correct number of rows to be fetched. I'm not sure
John> how this code is supposed to behave, though.
The current idea is as follows (we will probably optimize this later)
- Each packet will be allocated separately
(To do this with 'alloc_root' gives very little overhead)
- On write, we are always writing a full packet.
- When reading, we will do two reads for each packet; First read the length
and then read the data.