This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: receiveing UDP packets
- From: Tom Tromey <tromey at redhat dot com>
- To: Michael Koch <konqueror at gmx dot de>
- Cc: java-patches at gcc dot gnu dot org
- Date: 10 May 2004 10:27:21 -0600
- Subject: Re: Patch: receiveing UDP packets
- References: <200405071514.17172.konqueror@gmx.de>
- Reply-to: tromey at redhat dot com
>>>>> "Michael" == Michael Koch <konqueror@gmx.de> writes:
Michael> Ok to commit to trunk ? This should probably go into 3.4 too ?
Does this fix a regression? I thought 3.4 was in regressions-only
mode.
Michael> jbyte *dbytes = elements (p->getData()) + p->getOffset();
Michael> - jint maxlen = p->maxlen - p->getOffset();
Does it make sense to remove the offset from `maxlen' but keep it for
`dbytes'? I don't get that. Plus, don't we want to keep `offset' in
the computation anyway?
Also, it seems to me that we're missing some checking in
DatagramPacket. At least, the class javadoc claims:
* Note that for all method below where the buffer length passed by the
* caller cannot exceed the actually length of the byte array passed as
* the buffer, if this condition is not true, then the method silently
* reduces the length value to maximum allowable value.
... but I don't see code to actually implement this. setLength tries
to throw an exception in this situation (though it may be vulnerable
to wrapping). So there's at least a little inconsistency.
Tom