* Daniel Cheng (SDiZ) <[EMAIL PROTECTED]> [2008-04-14 15:09:45]:
> On Mon, Apr 14, 2008 at 3:05 PM, Florent Daignière
> <[EMAIL PROTECTED]> wrote:
> > * Daniel Cheng <[EMAIL PROTECTED]> [2008-04-14 15:00:50]:
> >
> > > On Mon, Apr 14, 2008 at 2:21 PM, <[EMAIL PROTECTED]> wrote:
> > > > Author: nextgens
> > > > Date: 2008-04-14 06:21:05 +0000 (Mon, 14 Apr 2008)
> > > > New Revision: 19304
> > > >
> > > > Modified:
> > > > trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
> > > > trunk/freenet/src/freenet/keys/ClientCHKBlock.java
> > > > trunk/freenet/src/freenet/keys/FreenetURI.java
> > > > trunk/freenet/src/freenet/node/FailureTable.java
> > > > trunk/freenet/src/freenet/node/PeerManager.java
> > > > trunk/freenet/src/freenet/node/PeerNode.java
> > > > trunk/freenet/src/freenet/support/LoggerHookChain.java
> > > > trunk/freenet/src/freenet/support/SectoredRandomGrabArray.java
> > > > Log:
> > > > some paranoia code to prevent race conditions and out-of-bound
> > exceptions
> > > >
> > > > Modified:
> > trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
> > > > ===================================================================
> > > > ---
> > trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
> > 2008-04-14 05:28:57 UTC (rev 19303)
> > > > +++
> > trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
> > 2008-04-14 06:21:05 UTC (rev 19304)
> > > > @@ -531,10 +531,11 @@
> > > > }
> > > > } else {
> > > > SendableGet[] gets = (SendableGet[]) o;
> > > > - SendableGet[] newGets = new
> > SendableGet[gets.length-1];
> > > > + final int getsLength = gets.length;
> > > <snip>
> > > > @@ -555,7 +556,7 @@
> > > > } else if(x == 1) {
> > > > pendingKeys.put(key,
> > newGets[0]);
> > > > } else {
> > > > - if(x != gets.length-1) {
> > > > + if(x != -1) {
> > > > SendableGet[]
> > newNewGets = new SendableGet[x];
> > > Should this be
> > > if ( x != getsLength-1) {
> > > ?
> >
> > Doh, fixed in r19305.
> >
>
> Is this "race condition" fix really needed?Heh, it's paranoia code; I haven't claimed that it's needed nor even useful. It's just good practice and looking cleaner. > As far as I can see, all related objects are protected by > synchronized(pendingKeys). On that snippet of code it's probably useless, yes.
signature.asc
Description: Digital signature
_______________________________________________ Devl mailing list [email protected] http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
