public static final void message(String s) { if (_log != null) _log.debug(s); } public static final void message(String m1, String m2) {
/** required by {@link I2PSessionListener I2PSessionListener} to notify of disconnect */ public void disconnected(I2PSession session) { _log.debug("Disconnected"); // up = false; }
/** required by {@link I2PSessionListener I2PSessionListener} to notify of abuse */ public void reportAbuse(I2PSession session, int severity) { _log.debug("Abuse reported of severity " + severity); // up = false; } }
public void setWriteTimeout(int ms) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Changing write timeout from " + _writeTimeout + " to " + ms); _writeTimeout = ms; }
public void gotDateTime(long time) { if (_log.shouldDebug()) _log.debug("Got updated datetime block"); receiveTimestamp((time + 500) / 1000); // update skew }
public DatabaseEntry remove(Hash key) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Removing key " + key); return _data.remove(key); } }
public void run() { if (_log.shouldLog(Log.DEBUG)) _log.debug("timeout reached on " + _url + ": " + stimeout); _aborted = true; } });
/** what IP Alice is reachable on */ public void readIP(byte target[], int targetOffset) { int offset = readBodyOffset() + 4; int size = _message[offset] & 0xff; offset++; System.arraycopy(_message, offset, target, targetOffset, size); if (_log.shouldLog(Log.DEBUG)) _log.debug("read alice ip: " + Base64.encode(target, targetOffset, size)); } public int readPort() {
/** * Got a SessionDestroy on an established conn * @since 0.8.1 */ void receiveSessionDestroy(RemoteHostId from, PeerState state) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Receive session destroy (EST) from: " + from); _transport.dropPeer(state, false, "received destroy message"); }
/** * Outbound */ public void registerConnect(NTCPConnection con) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Registering " + con); _context.statManager().addRateData("ntcp.registerConnect", 1); _wantsConRegister.offer(con); _selector.wakeup(); }
public void disconnected(I2PSession session) { if (_log.shouldLog(Log.DEBUG)) _log.debug("I2P session disconnected"); close(); }
/** * Got a SessionDestroy during outbound establish * @since 0.8.1 */ void receiveSessionDestroy(RemoteHostId from, OutboundEstablishState state) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Receive session destroy (OB) from: " + from); _outboundStates.remove(from); Hash peer = state.getRemoteIdentity().calculateHash(); _transport.dropPeer(peer, false, "received destroy message during OB establish"); }
private void doShortCircuitTunnelGateway(I2NPMessage messageBody) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Shortcut dispatch tunnelGateway message " + messageBody); _context.tunnelDispatcher().dispatch((TunnelGatewayMessage)messageBody); }
public void gotPadding(int paddingLength, int frameLength) { if (_log.shouldDebug()) _log.debug("Got " + paddingLength + " bytes padding in " + frameLength + " byte frame; ratio: " + (((float) paddingLength) / ((float) frameLength)) + " configured min: " + _paddingConfig.getRecvMin() + " configured max: " + _paddingConfig.getRecvMax()); } }
/** update the stats and rates (this should be called once a minute) */ public void coalesceStats() { if (!_expanded) return; coalesceOnly(); updateValues(); if (_log.shouldLog(Log.DEBUG)) _log.debug("Coalesced: speed [" + _speedValue + "] capacity [" + _capacityValue + "] integration [" + _integrationValue + "] failing? [" + _isFailing + "]"); }
public void coalesceStats() { if (_log.shouldLog(Log.DEBUG)) _log.debug("Coallescing stats"); _failedLookupRate.coalesceStats(); _invalidReplyRate.coalesceStats(); }
public void runJob() { if (!_keepTesting) return; Set<RouterInfo> peers = selectPeersToTest(); if (_log.shouldLog(Log.DEBUG)) _log.debug("Testing " + peers.size() + " peers"); for (RouterInfo peer : peers) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Testing peer " + peer.getIdentity().getHash().toBase64()); testPeer(peer); } requeue(getPeerTestDelay()); }
public void handleMessage(I2CPMessage message, I2PSessionImpl session) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Handle message " + message); String reason = ((DisconnectMessage)message).getReason(); session.propogateError(reason, new I2PSessionException("Disconnect Message received: " + reason)); session.destroySession(false); if (reason.contains("restart")) { Thread t = new I2PAppThread(new Reconnector(session), "Reconnect " + session, true); t.start(); } }
/** * Set of Hash structures for routers we want to check next. This is the 'interesting' part of * the algorithm. But to keep you on your toes, we've refactored it to the PeerSelector.selectNearestExplicit * * @return ordered list of Hash objects */ private List<Hash> getClosestRouters(Hash key, int numClosest, Set<Hash> alreadyChecked) { Hash rkey = getContext().routingKeyGenerator().getRoutingKey(key); if (_log.shouldLog(Log.DEBUG)) _log.debug(getJobId() + ": Current routing key for " + key + ": " + rkey); return _peerSelector.selectNearestExplicit(rkey, numClosest, alreadyChecked, _facade.getKBuckets()); }
public void runJob() { File configFile = new File(getContext().router().getConfigFilename()); if (shouldReread(configFile)) { getContext().router().readConfig(); _lastRead = getContext().clock().now(); Log log = getContext().logManager().getLog(ReadConfigJob.class); if (log.shouldDebug()) log.debug("Reloaded " + configFile); } requeue(DELAY); }