I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit c9cef19a authored by zzz's avatar zzz
Browse files

* Tunnel BuildHandler: add config router.participantOnly,

      set to true to refuse OBEP and IBGW roles, should
      reduce connections significantly if set.
parent 9f57be5f
No related branches found
No related tags found
No related merge requests found
...@@ -460,6 +460,7 @@ class BuildHandler { ...@@ -460,6 +460,7 @@ class BuildHandler {
return 0; return 0;
} }
private static final String PROP_REJECT_NONPARTICIPANT = "router.participantOnly";
private void handleReq(RouterInfo nextPeerInfo, BuildMessageState state, BuildRequestRecord req, Hash nextPeer) { private void handleReq(RouterInfo nextPeerInfo, BuildMessageState state, BuildRequestRecord req, Hash nextPeer) {
long ourId = req.readReceiveTunnelId(); long ourId = req.readReceiveTunnelId();
long nextId = req.readNextTunnelId(); long nextId = req.readNextTunnelId();
...@@ -497,6 +498,11 @@ class BuildHandler { ...@@ -497,6 +498,11 @@ class BuildHandler {
} }
} }
if (response == 0 && (isInGW || isOutEnd) &&
Boolean.valueOf(_context.getProperty(PROP_REJECT_NONPARTICIPANT))) {
response = TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
}
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("Responding to " + state.msg.getUniqueId() + "/" + ourId _log.debug("Responding to " + state.msg.getUniqueId() + "/" + ourId
+ " after " + recvDelay + "/" + proactiveDrops + " with " + response + " after " + recvDelay + "/" + proactiveDrops + " with " + response
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment