From 4f76d02efef485ff92b7d9be3e6857eba48d80f5 Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 27 May 2026 17:45:12 -0400 Subject: [PATCH] Tunnels: Request IBGW limits on all IB tunnels (prop. 168) --- .../net/i2p/router/tunnel/pool/BuildRequestor.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java b/router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java index 58070fae5..a55706706 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java +++ b/router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java @@ -535,11 +535,22 @@ abstract class BuildRequestor { log.warn("Pool: " + pool + " min: " + min + " avg: " + bw + " req: " + req); props.setProperty(PROP_MIN_BW, Integer.toString(min / 1000)); props.setProperty(PROP_REQ_BW, Integer.toString(req / 1000)); - // TOOO if (i == 0 && pool.getSettings().isExploratory()) set PROP_MAX_BW + } + if (key != null && i == 0 && cfg.isInbound()) { + // IBGW Limit + if (props.isEmpty()) + props = new Properties(); // replace EmptyProperties + int limit = (bw > 0) ? Math.max(20000, bw * 3) : 20000; + int vari = 4 * limit / 10; + limit += ctx.random().nextInt(vari); + if (log.shouldWarn()) + log.warn("Pool: " + pool + " IBGW limit: " + limit); + props.setProperty(PROP_MAX_BW, Integer.toString(limit / 1000)); } Properties p = key != null ? props : EmptyProperties.INSTANCE; BuildMessageGenerator.createRecord(i, hop, msg, cfg, replyRouter, replyTunnel, ctx, key, p); + props.clear(); } BuildMessageGenerator.layeredEncrypt(ctx, msg, cfg, order); //if (useShortTBM && log.shouldWarn())