* Tunnels: Reject participating tunnels when hidden (ticket #1314)

This commit is contained in:
zzz
2014-06-23 20:23:32 +00:00
parent 986de4c1d6
commit 690b40ed77
3 changed files with 15 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2014-06-23 zzz
* Streaming:
- Bundle new socket messages for translation
- Fix connection error message
* Tunnels: Reject participating tunnels when hidden (ticket #1314)
2014-06-21 zzz
* i2psnark:
- Display webapp name in html title (ticket #1311)

View File

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

View File

@@ -593,7 +593,13 @@ class BuildHandler implements Runnable {
long now = (_context.clock().now() / (60l*60l*1000l)) * (60*60*1000);
int ourSlot = -1;
int response = _context.throttle().acceptTunnelRequest();
int response;
if (_context.router().isHidden()) {
_context.throttle().setTunnelStatus(_x("Rejecting tunnels: Hidden mode"));
response = TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
} else {
response = _context.throttle().acceptTunnelRequest();
}
// This only checked OUR tunnels, so the log message was wrong.
// Now checked by TunnelDispatcher.joinXXX()
@@ -609,6 +615,7 @@ class BuildHandler implements Runnable {
// response = TunnelHistory.TUNNEL_REJECT_PROBABALISTIC_REJECT;
long recvDelay = _context.clock().now()-state.recvTime;
if (response == 0) {
// unused
//int proactiveDrops = countProactiveDrops();