@Override public void onDisconnect(PeerContext ctx) { // Ok. pn.noLongerRoutingTo(origTag, true); }
@Override public void onDisconnect(PeerContext ctx) { next.noLongerRoutingTo(tag, false); }
@Override public void onDisconnect(PeerContext ctx) { next.noLongerRoutingTo(origTag, false); }
@Override public void onRestarted(PeerContext ctx) { next.noLongerRoutingTo(origTag, false); }
@Override public void onRestarted(PeerContext ctx) { next.noLongerRoutingTo(tag, false); }
@Override public void onRestarted(PeerContext ctx) { // Ok. pn.noLongerRoutingTo(origTag, true); }
@Override public void onRestarted(PeerContext ctx) { next.noLongerRoutingTo(tag, false); }
@Override public void blockReceiveFailed(RetrievalException e) { if(!wasFork) origTag.senderTransferEnds((NodeCHK)key, RequestSender.this); next.noLongerRoutingTo(origTag, false); }
public boolean failIfReceiveFailed(InsertTag tag, PeerNode next) { synchronized(backgroundTransfers) { if(!receiveFailed) return false; } if(logMINOR) Logger.minor(this, "Failing because receive failed on "+this); if(tag != null && next != null) { next.noLongerRoutingTo(tag, false); } return true; }
@Override public void onMatched(Message m) { OFFER_STATUS status = isSSK ? handleSSKOfferReply(m, pn, offer) : handleCHKOfferReply(m, pn, offer, null); if(status != OFFER_STATUS.FETCHING) pn.noLongerRoutingTo(origTag, true); // If FETCHING, the block transfer will unlock it. if(logMINOR) Logger.minor(this, "Forked get offered key due to two stage timeout completed with status "+status+" from message "+m+" for "+RequestSender.this+" to "+pn); }
@Override public void blockReceived(byte[] buf) { if(!wasFork) origTag.senderTransferEnds((NodeCHK)key, RequestSender.this); next.noLongerRoutingTo(origTag, false); }
/** A fatal timeout occurred, and we don't know whether the peer is still running the * request we passed in for us. If it is, we cannot reuse that slot. So we need to * query it periodically until it is no longer running it. If we cannot send the query * or if we don't get a response, we disconnect via fatalTimeout() (with no arguments). * @param tag The request which we routed to this peer. It may or may not still be * running. */ public void fatalTimeout(UIDTag tag, boolean offeredKey) { // FIXME implement! For now we just disconnect (no-op). // A proper implementation requires new messages. noLongerRoutingTo(tag, offeredKey); fatalTimeout(); }
@Override public void onDisconnect(PeerContext ctx) { Logger.normal(this, "Disconnected from "+waitingFor+" while waiting for data on "+uid); waitingFor.noLongerRoutingTo(origTag, false); if(noReroute) return; // Try another peer. routeRequests(); }
@Override public void onDisconnect(PeerContext ctx) { Logger.normal(this, "Disconnected "+ctx+" for "+this); receivedNotice(true, false, true); // as far as we know pn.noLongerRoutingTo(thisTag, false); }
@Override public void onRestarted(PeerContext ctx) { Logger.normal(this, "Restarted "+ctx+" for "+this); receivedNotice(true, false, true); pn.noLongerRoutingTo(thisTag, false); }
/** Called when we get a failure, e.g. DataInsertRejected. */ public void kill() { Logger.normal(this, "Killed "+this); receivedNotice(false, false, true); // as far as we know pn.noLongerRoutingTo(thisTag, false); } }
@Override public void onMatched(Message m) { if(m.getSpec() == DMT.FNPRejectedLoop || m.getSpec() == DMT.FNPRejectedOverload) { // Ok. next.noLongerRoutingTo(origTag, false); } else { // Accepted. May as well wait for the data, if any. onAccepted(next, true, htl); } }
private void handleRouteNotFound(Message msg, PeerNode next, InsertTag thisTag) { if(logMINOR) Logger.minor(this, "Rejected: RNF"); short newHtl = msg.getShort(DMT.HTL); if(newHtl < 0) newHtl = 0; if (htl > newHtl) htl = newHtl; next.successNotOverload(realTimeFlag); next.noLongerRoutingTo(thisTag, false); }
private void handleDataNotFound(Message msg, boolean wasFork, PeerNode next) { next.successNotOverload(realTimeFlag); node.failureTable.onFinalFailure(key, next, htl, origHTL, FailureTable.RECENTLY_FAILED_TIME, FailureTable.REJECT_TIME, source); if(!wasFork) finish(DATA_NOT_FOUND, next, false); else next.noLongerRoutingTo(origTag, false); }
private void handleRouteNotFound(Message msg, PeerNode next) { // Backtrack within available hops short newHtl = msg.getShort(DMT.HTL); if(newHtl < 0) newHtl = 0; if(newHtl < htl) htl = newHtl; next.successNotOverload(realTimeFlag); int t = timeSinceSent(); node.failureTable.onFailed(key, next, htl, t, t); next.noLongerRoutingTo(origTag, false); }