private void handleRNF(Message msg, PeerNode next, InsertTag thisTag) { if(logMINOR) Logger.minor(this, "Rejected: RNF"); short newHtl = msg.getShort(DMT.HTL); if(newHtl < 0) newHtl = 0; synchronized (this) { if (htl > newHtl) htl = newHtl; } // Finished as far as this node is concerned - except for the data transfer, which will continue until it finishes. next.successNotOverload(realTimeFlag); }
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); }
@Override public void onMatched(Message m) { pn.successNotOverload(realTimeFlag); PeerNode pn = (PeerNode) m.getSource(); // pn cannot be null, because the filters will prevent garbage collection of the nodes if(this.pn.equals(pn)) { boolean anyTimedOut = m.getBoolean(DMT.ANY_TIMED_OUT); if(anyTimedOut) { CHKInsertSender.this.setTransferTimedOut(); } receivedNotice(!anyTimedOut, false, false); } else { Logger.error(this, "received completion notice for wrong node: "+pn+" != "+this.pn); } }
private void handleDataInsertRejected(Message msg, PeerNode next, InsertTag thisTag) { next.successNotOverload(realTimeFlag); short reason = msg.getShort(DMT.DATA_INSERT_REJECTED_REASON); if(logMINOR) Logger.minor(this, "DataInsertRejected: " + reason); if (reason == DMT.DATA_INSERT_REJECTED_VERIFY_FAILED) { if (fromStore) { // That's odd... Logger.error(this,"Verify failed on next node " + next + " for DataInsert but we were sending from the store!"); } } Logger.error(this, "SSK insert rejected! Reason=" + DMT.getDataInsertRejectedReason(reason)); next.noLongerRoutingTo(thisTag, false); }
private void handleRecentlyFailed(Message msg, boolean wasFork, PeerNode next) { next.successNotOverload(realTimeFlag);
origTag.senderTransferEnds((NodeCHK)key, RequestSender.this); next.transferSuccess(realTimeFlag); next.successNotOverload(realTimeFlag); node.nodeStats.successfulBlockReceive(realTimeFlag, source == null); if(logMINOR) Logger.minor(this, "Received data");
private DO handleMessage(Message msg, PeerNode next, InsertTag thisTag) { if (msg.getSpec() == DMT.FNPRejectedOverload) { if(handleRejectedOverload(msg, next, thisTag)) return DO.NEXT_PEER; else return DO.WAIT; } if (msg.getSpec() == DMT.FNPRouteNotFound) { handleRouteNotFound(msg, next, thisTag); // Finished as far as this node is concerned return DO.NEXT_PEER; } if (msg.getSpec() == DMT.FNPDataInsertRejected) { handleDataInsertRejected(msg, next, thisTag); return DO.NEXT_PEER; // What else can we do? } if(msg.getSpec() == DMT.FNPSSKDataFoundHeaders) { return handleSSKDataFoundHeaders(msg, next, thisTag); } if (msg.getSpec() != DMT.FNPInsertReply) { Logger.error(this, "Unknown reply: " + msg); finish(INTERNAL_ERROR, next); return DO.FINISHED; } // Our task is complete next.successNotOverload(realTimeFlag); finish(SUCCESS, next); return DO.FINISHED; }
next.successNotOverload(realTimeFlag); int t = timeSinceSent(); node.failureTable.onFailed(key, next, htl, t, t);
private void handleDataInsertRejected(Message msg, PeerNode next, InsertTag thisTag) { next.successNotOverload(realTimeFlag); short reason = msg .getShort(DMT.DATA_INSERT_REJECTED_REASON);