session/ip info

This commit is contained in:
Arndt Brenschede 2021-04-18 19:32:07 +02:00
parent 8206a1ae84
commit 31e761e731
2 changed files with 26 additions and 9 deletions

View file

@ -152,8 +152,15 @@ public class RouteServer extends Thread implements Comparable<RouteServer>
InetAddress ip = clientSocket.getInetAddress();
String sIp = xff == null ? (ip==null ? "null" : ip.toString() ) : xff;
String sessionMode = IpAccessMonitor.touchIpAccess( sIp ) ? " new " : " ";
System.out.println( formattedTimestamp() + sessionMode + " ip=" + sIp + " -> " + getline );
boolean newSession = IpAccessMonitor.touchIpAccess( sIp );
String sessionInfo = " new";
if ( !newSession )
{
int sessionCount = IpAccessMonitor.getSessionCount();
sessionInfo = " " + Math.min( sessionCount, 999 );
sessionInfo = sessionInfo.substring( sessionInfo.length() - 4 );
}
System.out.println( formattedTimestamp() + sessionInfo + " ip=" + sIp + " -> " + getline );
String url = getline.split(" ")[1];
HashMap<String,String> params = getUrlParams(url);