final BlockReceiver br = new BlockReceiver(node.usm, next, uid, prb, this, node.getTicker(), true, realTimeFlag, myTimeoutHandler, true);
if(failNow) {
if(logMINOR) Logger.minor(this, "Terminating forked transfer on "+this+" from "+next);
prb.abort(RetrievalException.CANCELLED_BY_RECEIVER, "Cancelling fork", true);
br.receive(new BlockReceiverCompletion() {
@Override
public void blockReceived(byte[] buf) {
if(!wasFork)
origTag.senderTransferEnds((NodeCHK)key, RequestSender.this);
next.noLongerRoutingTo(origTag, false);
}
@Override
public void blockReceiveFailed(RetrievalException e) {
if(!wasFork)
origTag.senderTransferEnds((NodeCHK)key, RequestSender.this);
next.noLongerRoutingTo(origTag, false);
}
});
return;
}
if(logMINOR) Logger.minor(this, "Receiving data");
if(!wasFork) {
synchronized(this) {
transferringFrom = next;
}
} else
if(logMINOR) Logger.minor(this, "Receiving data from fork");
receivingAsync = true;
br.receive(new BlockReceiverCompletion() {
@Override
public void blockReceived(byte[] data) {
try {
long tEnd = System.currentTimeMillis();