Skip to content

Commit

Permalink
Merge branch 'master' of i2pgit.org:i2p-hackers/i2p.i2p
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Nov 29, 2023
2 parents fb09344 + 5287da1 commit 02aa509
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 54 deletions.
3 changes: 3 additions & 0 deletions apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2574,6 +2574,9 @@ public void run() {
try { Thread.sleep(delay); } catch (InterruptedException ie) {}
// Remove that first message
_messages.clearThrough(id);
} else if (_context.isRouterContext()) {
// to wait for client manager to be up so we can get bandwidth limits
try { Thread.sleep(3000); } catch (InterruptedException ie) {}
}

// here because we need to delay until I2CP is up
Expand Down
2 changes: 1 addition & 1 deletion apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public void clear() {
public String renderStatusHTML() {
long uptime = Math.max(1000, _context.clock().now() - _started);
StringBuilder buf = new StringBuilder(256);
buf.append("<br><hr class=\"debug\"><b>DHT DEBUG</b><br><hr class=\"debug\"><hr><b>TX:</b> ").append(_txPkts.get()).append(" pkts / ")
buf.append("<br><hr class=\"debug\"><br><hr class=\"debug\"><hr><b>TX:</b> ").append(_txPkts.get()).append(" pkts / ")
.append(DataHelper.formatSize2(_txBytes.get())).append("B / ")
.append(DataHelper.formatSize2Decimal(_txBytes.get() * 1000 / uptime)).append("Bps<br>" +
"<b>RX:</b> ").append(_rxPkts.get()).append(" pkts / ")
Expand Down
4 changes: 0 additions & 4 deletions apps/i2psnark/resources/themes/dark/snark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,6 @@ input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent
margin: -23px 0 -12px;
}

.dhtDebug th b:first-of-type, .dhtDebug th b:first-of-type + br + hr.debug {
display: none;
}

input#toggle_debug:not(checked) + label {
padding-bottom: 2px;
}
Expand Down
4 changes: 0 additions & 4 deletions apps/i2psnark/resources/themes/light/snark.css
Original file line number Diff line number Diff line change
Expand Up @@ -1837,10 +1837,6 @@ input#toggle_addtorrent:checked + label + hr + table, input#toggle_createtorrent
margin: -19px 0 -12px;
}

.dhtDebug th b:first-of-type, .dhtDebug th b:first-of-type + br + hr.debug {
display: none;
}

input#toggle_debug:not(checked) + label {
padding-bottom: 2px;
}
Expand Down
4 changes: 0 additions & 4 deletions apps/i2psnark/resources/themes/ubergine/snark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2304,10 +2304,6 @@ input#toggle_debug:not(checked) + label {
}
}

.dhtDebug th b:first-of-type, .dhtDebug th b:first-of-type + br + hr.debug {
display: none;
}

input#toggle_debug:not(checked) + label {
padding-bottom: 2px;
}
Expand Down
4 changes: 0 additions & 4 deletions apps/i2psnark/resources/themes/vanilla/snark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2152,10 +2152,6 @@ hr.debug:last-child {
border-radius: 0 0 2px 2px;
}

.dhtDebug th b:first-of-type, .dhtDebug th b:first-of-type + br + hr.debug {
display: none;
}

/* toggle debug view */

input#toggle_debug:not(checked) + label {
Expand Down
2 changes: 1 addition & 1 deletion installer/resources/checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
- `core/java/src/net/i2p/CoreVersion.java`
- (both VERSION and PUBLISHED_VERSION)
- `router/java/src/net/i2p/router/RouterVersion.java`
- (change to BUILD = 0 and EXTRA = "")
- (change to BUILD = 0 and EXTRA = "" and QUALIFIER = "")
8. `git commit`
Expand Down
2 changes: 1 addition & 1 deletion router/java/src/net/i2p/router/RouterVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class RouterVersion {
public final static String VERSION = CoreVersion.VERSION;
/** for example: "beta", "alpha", "rc" */
public final static String QUALIFIER = "-rc";
public final static long BUILD = 14;
public final static long BUILD = 15;
/** for example "-test" */
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + QUALIFIER + EXTRA;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,9 @@ public void distribute(I2NPMessage msg, Hash target, TunnelId tunnel) {
} // switch
} // client != null

if ( (target == null) && (tunnel == null) ) {
// Since the InboundMessageDistributor handles messages for the endpoint,
// most messages that arrive here have both target==null and tunnel==null.
// Messages with targeting instructions need careful handling, and will
// typically be dropped because we're the endpoint. Especially when they
// specifically target this router (_context.routerHash().equals(target)).
if ( (target == null) || ( (tunnel == null) && (_context.routerHash().equals(target) ) ) ) {
// targetting us either implicitly (no target) or explicitly (no tunnel)
// make sure we don't honor any remote requests directly (garlic instructions, etc)
if (type == GarlicMessage.MESSAGE_TYPE) {
// in case we're looking for replies to a garlic message (cough load tests cough)
_context.inNetMessagePool().handleReplies(msg);
Expand All @@ -212,40 +209,47 @@ public void distribute(I2NPMessage msg, Hash target, TunnelId tunnel) {
_receiver.receive((GarlicMessage)msg);
} else {
if (_log.shouldLog(Log.INFO))
_log.info("distributing inbound tunnel message into our inNetMessagePool"
+ " (for client " + _clientNickname + " ("
+ ((_client != null) ? _client.toBase32() : "null")
+ ") to target=NULL/tunnel=NULL " + msg);
_context.inNetMessagePool().add(msg, null, null, _msgIDBloomXor);
_log.info("distributing inbound tunnel message into our inNetMessagePool: " + msg);
_context.inNetMessagePool().add(msg, null, null);
}
/****** latency measuring attack?
} else if (_context.routerHash().equals(target)) {
if (type == GarlicMessage.MESSAGE_TYPE)
if (_log.shouldLog(Log.WARN))
_log.warn("Dropping inbound garlic message TARGETED TO OUR ROUTER for client "
+ _clientNickname + " ("
+ ((_client != null) ? _client.toBase32() : "null")
+ ") to " + target + " / " + tunnel);
else
if (_log.shouldLog(Log.WARN))
_log.warn("Dropping inbound message TARGETED TO OUR ROUTER for client "
+ _clientNickname + " (" + ((_client != null) ? _client.toBase32() : "null")
+ ") to " + target + " / " + tunnel + " : " + msg);
return;
// the want to send it to a tunnel, except we are also that tunnel's gateway
// dispatch it directly
if (_log.shouldLog(Log.INFO))
_log.info("distributing inbound tunnel message back out, except we are the gateway");
TunnelGatewayMessage gw = new TunnelGatewayMessage(_context);
gw.setMessage(msg);
gw.setTunnelId(tunnel);
gw.setMessageExpiration(_context.clock().now()+10*1000);
gw.setUniqueId(_context.random().nextLong(I2NPMessage.MAX_ID_VALUE));
_context.tunnelDispatcher().dispatch(gw);
******/
} else {
if (type == GarlicMessage.MESSAGE_TYPE)
// ok, they want us to send it remotely, but that'd bust our anonymity,
// so we send it out a tunnel first
// TODO use the OCMOSJ cache to pick OB tunnel we are already using?
TunnelInfo out = _context.tunnelManager().selectOutboundTunnel(_client, target);
if (out == null) {
if (_log.shouldLog(Log.WARN))
_log.warn("Dropping targeted inbound garlic message for client "
+ _clientNickname + " ("
+ ((_client != null) ? _client.toBase32() : "null")
+ ") to " + target + " / " + tunnel);
else
if (_log.shouldLog(Log.WARN))
_log.warn("Dropping targeted inbound message for client " + _clientNickname
+ " (" + ((_client != null) ? _client.toBase32() : "null")
+ " to " + target + " / " + tunnel + " : " + msg);
return;
_log.warn("no outbound tunnel to send the client message for " + _client + ": " + msg);
return;
}
if (_log.shouldLog(Log.DEBUG))
_log.debug("distributing IB tunnel msg type " + type + " back out " + out
+ " targetting " + target);
TunnelId outId = out.getSendTunnelId(0);
if (outId == null) {
if (_log.shouldLog(Log.ERROR))
_log.error("strange? outbound tunnel has no outboundId? " + out
+ " failing to distribute " + msg);
return;
}
long exp = _context.clock().now() + 20*1000;
if (msg.getMessageExpiration() < exp)
msg.setMessageExpiration(exp);
_context.tunnelDispatcher().dispatchOutbound(msg, outId, tunnel, target);
}

}

/**
Expand Down

0 comments on commit 02aa509

Please sign in to comment.