Skip to content

Conversation

baranowb
Copy link
Contributor

@baranowb baranowb commented Sep 3, 2025

…andler
Issue: https://issues.redhat.com/browse/UNDERTOW-2537

This needs review. Initially I was going to have Long as key and use bit shifts to encode there everything, but:

  1. it tad harder to debug
  2. due to some errors I had to debug....

If needs be I can switch it to above without problem. It follows similar concept of common sliding window with low accuracy as apache does in its impl. However interface should allow to implement different stategies as well relatively easily .
TestCase is a bit of PITa as to test different aspects it has to be at least 60s( might be less) so it chugs some time on CI...

@baranowb baranowb added enhancement Enhances existing behaviour or code under verification Currently being verified (running tests, reviewing) before posting a review to contributor waiting CI check Ready to be merged but waiting for CI check new feature/API change New feature to be introduced or a change to the API (non suitable to minor releases) labels Sep 3, 2025
}
}

private String getIPAddress(final HttpServerExchange exchange, final boolean warn) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not ideal, this code is repeated in Handler class to get log details as well.

final String current = String.valueOf(currentPrefix);
final String next = String.valueOf(currentPrefix + 1);

ConcurrentHashMap.KeySetView<String, AtomicInteger> keys = requestCounter.keySet();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String could be turned into Long with high bits holding IP in pure form and lower working as in this case. But its harder to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhances existing behaviour or code new feature/API change New feature to be introduced or a change to the API (non suitable to minor releases) under verification Currently being verified (running tests, reviewing) before posting a review to contributor waiting CI check Ready to be merged but waiting for CI check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant