log possible DoS attack
This commit is contained in:
parent
a37654e116
commit
5d5eb649c6
3 changed files with 5 additions and 5 deletions
|
@ -656,7 +656,7 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
|
||||
private static synchronized void resetReportedInvalidRequestsThrottle(boolean logReport) {
|
||||
if (logReport) {
|
||||
if (numThrottledInvalidRequestReports > 0) log.warn("We received {} other reports of invalid requests since the last log entry", numThrottledInvalidRequestReports);
|
||||
if (numThrottledInvalidRequestReports > 0) log.warn("Possible DoS attack detected. We received {} other reports of invalid requests since the last log entry", numThrottledInvalidRequestReports);
|
||||
numThrottledInvalidRequestReports = 0;
|
||||
lastLoggedInvalidRequestReportTs = System.currentTimeMillis();
|
||||
}
|
||||
|
@ -942,7 +942,7 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
boolean doLog = System.currentTimeMillis() - lastLoggedWarningTs > LOG_THROTTLE_INTERVAL_MS;
|
||||
if (doLog) {
|
||||
log.warn(msg);
|
||||
if (numThrottledWarnings > 0) log.warn("{} warnings were throttled since the last log entry", numThrottledWarnings);
|
||||
if (numThrottledWarnings > 0) log.warn("Possible DoS attack detected. {} warnings were throttled since the last log entry", numThrottledWarnings);
|
||||
numThrottledWarnings = 0;
|
||||
lastLoggedWarningTs = System.currentTimeMillis();
|
||||
} else {
|
||||
|
@ -954,7 +954,7 @@ public class Connection implements HasCapabilities, Runnable, MessageListener {
|
|||
boolean doLog = System.currentTimeMillis() - lastLoggedInfoTs > LOG_THROTTLE_INTERVAL_MS;
|
||||
if (doLog) {
|
||||
log.info(msg);
|
||||
if (numThrottledInfos > 0) log.info("{} info logs were throttled since the last log entry", numThrottledInfos);
|
||||
if (numThrottledInfos > 0) log.info("Possible DoS attack detected. {} info logs were throttled since the last log entry", numThrottledInfos);
|
||||
numThrottledInfos = 0;
|
||||
lastLoggedInfoTs = System.currentTimeMillis();
|
||||
} else {
|
||||
|
|
|
@ -173,7 +173,7 @@ class KeepAliveHandler implements MessageListener {
|
|||
boolean logWarning = System.currentTimeMillis() - lastLoggedWarningTs > LOG_THROTTLE_INTERVAL_MS;
|
||||
if (logWarning) {
|
||||
log.warn(msg);
|
||||
if (numThrottledWarnings > 0) log.warn("{} warnings were throttled since the last log entry", numThrottledWarnings);
|
||||
if (numThrottledWarnings > 0) log.warn("Possible DoS attack detected. {} warnings were throttled since the last log entry", numThrottledWarnings);
|
||||
numThrottledWarnings = 0;
|
||||
lastLoggedWarningTs = System.currentTimeMillis();
|
||||
} else {
|
||||
|
|
|
@ -222,7 +222,7 @@ class PeerExchangeHandler implements MessageListener {
|
|||
boolean logWarning = System.currentTimeMillis() - lastLoggedWarningTs > LOG_THROTTLE_INTERVAL_MS;
|
||||
if (logWarning) {
|
||||
log.warn(msg);
|
||||
if (numThrottledWarnings > 0) log.warn("{} warnings were throttled since the last log entry", numThrottledWarnings);
|
||||
if (numThrottledWarnings > 0) log.warn("Possible DoS attack detected. {} warnings were throttled since the last log entry", numThrottledWarnings);
|
||||
numThrottledWarnings = 0;
|
||||
lastLoggedWarningTs = System.currentTimeMillis();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue