Session timeout bug

Issue #1 resolved
Vladimir Dzhuvinov created an issue

Reported by John Kim <firstwave AT tanetworks.com>:

I found some bug(?) or mistake in your code about timeout.

here is the code in your SRP6Session.java.

/ * Returns {@code true} if the session has timed out, based on the * timeout configuration and the last activity timestamp. * @return {@code true} if the session has timed out, else * {@code false}. / public boolean hasTimedOut() {

if (timeout == 0) return false;

final long now = System.currentTimeMillis();

if (now > lastActivity * 1000) return true; else return false; }

I think this should be

public boolean hasTimedOut() {

if (timeout == 0) return false;

final long now = System.currentTimeMillis();

if (now > lastActivity + (timeout * 1000) ) return true; else return false; }

Another one is your HexUtil.java source code. It declare static variable LOOKUPLENGTH, loopUpHexAlphbet but does not use them at all. //

Comments (2)

  1. Log in to comment