|
Hi Trustin, You are correct. But maybe then, some way
to peek at the value (without moving the reading position) would do. Something like: int peekInt() short peekShort() etc. This will resolve most of the nasty part
and allow people to check for denials as well. How about that? Jose Alberto From:
Trustin Lee [mailto:[EMAIL PROTECTED] Hi Jose, 2005/12/5, Jose Alberto Fernandez <[EMAIL PROTECTED]>: Now
that we have support for length prefixed strings, it would be nice to have an
easy way to ask if the ByteBuffer has available (remaining) an amount specified
by a byte/short/int without needing to read the value, check if there is
enough, rewind and wait for more to come. Something like:
Boolean enoughAvailable(int prefixSizeLength) This may
be very useful on many protocols that provide a size header in front of
variable data being sent. It looks very useful, but it has a big pitfall; a possible DoS
attack. We always have to check if the length of the data doesn't exceed
the predefined limit value, so providing this kind of method doesn't reduce the
complexity much IMHO. -- |
- RE: [MINA] Another useful shortcut Jose Alberto Fernandez
- Re: [MINA] Another useful shortcut Trustin Lee
- RE: [MINA] Another useful shortcut Jose Alberto Fernandez
