libventi: protocol support for blocks larger than 64k

This commit is contained in:
Russ Cox 2009-05-25 00:30:17 -07:00
parent 9cac97f2c5
commit 33b446b8bb
6 changed files with 79 additions and 23 deletions

View file

@ -65,6 +65,10 @@ vtreadpacket(VtConn *z, uchar score[VtScoreSize], uint type, int n)
if(memcmp(score, vtzeroscore, VtScoreSize) == 0)
return packetalloc();
if(z->version[1] == '2' && n >= (1<<16)) {
werrstr("read count too large for protocol");
return nil;
}
memset(&tx, 0, sizeof tx);
tx.msgtype = VtTread;
tx.blocktype = type;