summaryrefslogtreecommitdiff
path: root/po
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-09-15 05:15:48 +0800
committerYohann Ferreira <yohann.ferreira@orange.fr>2011-09-16 07:10:39 +0800
commitf2f4dc7de862cfa706c8388e3c3cd76742a8a9a6 (patch)
tree34bfab27c590ca4bc2a2aeb3c0ce985945116ae1 /po
parentf295cd8484f28d634bc6c0c3c33ea77b811a94fd (diff)
downloadmana-f2f4dc7de862cfa706c8388e3c3cd76742a8a9a6.tar.gz
mana-f2f4dc7de862cfa706c8388e3c3cd76742a8a9a6.tar.bz2
mana-f2f4dc7de862cfa706c8388e3c3cd76742a8a9a6.tar.xz
mana-f2f4dc7de862cfa706c8388e3c3cd76742a8a9a6.zip
Improve handling of packet lengths.
* Use a symbol, VAR, instead of -1 for variable-length packets. * Also change it's value to 1, so the length can be properly unsigned. Note: A packet can't actually have length 1, since packet ID is 2 bytes. * Use correct type (uint16_t) for packet id and length in more places. * Avoid reading beyond the length of the array. * Immediately parse variable length packets with length 4 (i.e. no body) instead of waiting for another byte to arrive first. Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
Diffstat (limited to 'po')
0 files changed, 0 insertions, 0 deletions