Router: Misc. javadocs and debug

This commit is contained in:
zzz
2018-06-26 18:45:11 +00:00
parent 3c53dfe628
commit 96c565d486
7 changed files with 10 additions and 14 deletions

View File

@ -72,7 +72,6 @@ class SymmetricState implements Destroyable {
* Constructs a new symmetric state object. * Constructs a new symmetric state object.
* Noise protocol name is hardcoded. * Noise protocol name is hardcoded.
* *
* @param protocolName The name of the Noise protocol, which is assumed to be valid.
* @param cipherName The name of the cipher within protocolName. * @param cipherName The name of the cipher within protocolName.
* @param hashName The name of the hash within protocolName. * @param hashName The name of the hash within protocolName.
* *

View File

@ -157,11 +157,9 @@ public class RouterInfo extends DatabaseEntry {
} }
/** /**
* Retrieve the approximate date on which the info was published * Retrieve the timestamp on which the info was published,
* (essentially a version number for the routerInfo structure, except that * essentially a version number for the RouterInfo.
* it also contains freshness information - whether or not the router is * This should be used to expire old RouterInfo structures.
* currently publishing its information). This should be used to help expire
* old routerInfo structures
* *
*/ */
public long getPublished() { public long getPublished() {

View File

@ -371,12 +371,12 @@ public class OutNetMessage implements CDPQEntry {
buf.append(getMessageType()); buf.append(getMessageType());
buf.append(" ID ").append(_messageId); buf.append(" ID ").append(_messageId);
} }
buf.append(" expiring on ").append(new Date(_expiration)); buf.append(" expiring ").append(new Date(_expiration));
buf.append(" priority ").append(_priority); buf.append(" priority ").append(_priority);
if (_failedTransports != null) if (_failedTransports != null)
buf.append(" failed delivery on transports ").append(_failedTransports); buf.append(" failed transports: ").append(_failedTransports);
if (_target == null) if (_target == null)
buf.append(" targetting no one in particular..."); buf.append(" (null target)");
else else
buf.append(" targetting ").append(_target.getIdentity().getHash().toBase64()); buf.append(" targetting ").append(_target.getIdentity().getHash().toBase64());
if (_onReply != null) if (_onReply != null)

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 0; public final static long BUILD = 1;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";

View File

@ -572,8 +572,7 @@ public class DHSessionKeyBuilder {
*/ */
public void returnUnused(DHSessionKeyBuilder builder) { public void returnUnused(DHSessionKeyBuilder builder) {
if (builder.getPeerPublicValue() != null) { if (builder.getPeerPublicValue() != null) {
if (_log.shouldLog(Log.WARN)) _log.error("builder returned used", new Exception());
_log.warn("builder returned used");
return; return;
} }
_context.statManager().addRateData("crypto.DHReused", 1); _context.statManager().addRateData("crypto.DHReused", 1);

View File

@ -310,7 +310,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
int port = getRequestedPort(); int port = getRequestedPort();
if (port < 0) { if (port < 0) {
port = UDPEndpoint.selectRandomPort(_context); port = UDPEndpoint.selectRandomPort(_context);
Map<String, String> changes = new HashMap<String, String>(); Map<String, String> changes = new HashMap<String, String>(2);
changes.put(PROP_INTERNAL_PORT, Integer.toString(port)); changes.put(PROP_INTERNAL_PORT, Integer.toString(port));
changes.put(PROP_EXTERNAL_PORT, Integer.toString(port)); changes.put(PROP_EXTERNAL_PORT, Integer.toString(port));
_context.router().saveConfig(changes, null); _context.router().saveConfig(changes, null);

View File

@ -305,7 +305,7 @@ public class TunnelPool {
/** /**
* Return a list of tunnels in the pool * Return a list of tunnels in the pool
* *
* @return list of TunnelInfo objects * @return A copy of the list of TunnelInfo objects
*/ */
public List<TunnelInfo> listTunnels() { public List<TunnelInfo> listTunnels() {
synchronized (_tunnels) { synchronized (_tunnels) {