Author: j16sdiz
Date: 2008-04-11 08:42:00 +0000 (Fri, 11 Apr 2008)
New Revision: 19172

Modified:
   trunk/freenet/src/freenet/io/xfer/BulkReceiver.java
   trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java
Log:
fix bug in r19166


Modified: trunk/freenet/src/freenet/io/xfer/BulkReceiver.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BulkReceiver.java 2008-04-11 08:41:35 UTC 
(rev 19171)
+++ trunk/freenet/src/freenet/io/xfer/BulkReceiver.java 2008-04-11 08:42:00 UTC 
(rev 19172)
@@ -38,6 +38,8 @@
                this.uid = uid;
                this.peerBootID = peer.getBootID();
                this.ctr = ctr;
+               
+               prb.recv = this;
        }

        public void onAborted() {

Modified: trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java        
2008-04-11 08:41:35 UTC (rev 19171)
+++ trunk/freenet/src/freenet/io/xfer/PartiallyReceivedBulk.java        
2008-04-11 08:42:00 UTC (rev 19172)
@@ -30,6 +30,8 @@
        final int blocks;
        private BulkTransmitter[] transmitters;
        final MessageCore usm;
+       /** The one and only BulkReceiver */
+       BulkReceiver recv;
        private int blocksReceivedCount;
        // Abort status
        boolean _aborted;
@@ -130,17 +132,21 @@
                if(Logger.shouldLog(Logger.NORMAL, this))
                        Logger.normal(this, "Aborting "+this+": "+errCode+" : 
"+why, new Exception("debug"));
                BulkTransmitter[] notifyBTs;
+               BulkReceiver notifyBR;
                synchronized(this) {
                        _aborted = true;
                        _abortReason = errCode;
                        _abortDescription = why;
                        notifyBTs = transmitters;
+                       notifyBR = recv;
                }
                if(notifyBTs != null) {
                        for(int i=0;i<notifyBTs.length;i++) {
                                notifyBTs[i].onAborted();
                        }
                }
+               if(notifyBR != null)
+                       notifyBR.onAborted();
                raf.close();
        }



Reply via email to