… | |
… | |
268 | struct packet |
268 | struct packet |
269 | { |
269 | { |
270 | enum { bufsize = MAXSOCKBUF }; |
270 | enum { bufsize = MAXSOCKBUF }; |
271 | |
271 | |
272 | // strategy: only check on variable-length adds |
272 | // strategy: only check on variable-length adds |
273 | // and allow 32 bytes for any headers. |
273 | // and allow 256 bytes for any headers. |
274 | uint8 *cur; |
274 | uint8 *cur; |
275 | uint8 buf [bufsize + 32]; |
275 | uint8 buf [bufsize + 256]; |
276 | |
276 | |
277 | packet () { reset (); } |
277 | packet () { reset (); } |
278 | |
278 | |
279 | void reset (int offset = 0) { cur = buf + offset; } |
279 | void reset (int offset = 0) { cur = buf + offset; } |
280 | int length () const { return cur - buf; } |
280 | int length () const { return cur - buf; } |