You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2021/02/03 13:53:05 UTC
[openmeetings] branch master updated: [OPENMEETINGS-2551] code
clean-up
This is an automated email from the ASF dual-hosted git repository.
solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git
The following commit(s) were added to refs/heads/master by this push:
new 48859fa [OPENMEETINGS-2551] code clean-up
48859fa is described below
commit 48859faa98a14d6092ebea4e36354039481479ff
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Wed Feb 3 20:52:50 2021 +0700
[OPENMEETINGS-2551] code clean-up
---
.../java/org/apache/openmeetings/webservice/NetTestWebService.java | 6 +++++-
.../apache/openmeetings/webservice/util/RateLimitRequestFilter.java | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/NetTestWebService.java b/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/NetTestWebService.java
index 44f0b50..b95c25c 100644
--- a/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/NetTestWebService.java
+++ b/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/NetTestWebService.java
@@ -57,7 +57,7 @@ public class NetTestWebService {
private static final int JITTER_PACKET_SIZE = 1024;
private static final int MAX_UPLOAD_SIZE = 16 * 1024 * 1024;
public static final AtomicInteger CLIENT_COUNT = new AtomicInteger();
- public static int maxClients = 100;
+ private static int maxClients = 100;
@PostConstruct
private void report() {
@@ -160,4 +160,8 @@ public class NetTestWebService {
private void setMaxClients(int count) {
maxClients = count;
}
+
+ public static int getMaxClients() {
+ return maxClients;
+ }
}
diff --git a/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/util/RateLimitRequestFilter.java b/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/util/RateLimitRequestFilter.java
index 2d071c2..50352cb 100644
--- a/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/util/RateLimitRequestFilter.java
+++ b/openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/util/RateLimitRequestFilter.java
@@ -56,7 +56,7 @@ public class RateLimitRequestFilter implements ContainerRequestFilter {
return;
}
}
- if (NetTestWebService.CLIENT_COUNT.get() > NetTestWebService.maxClients) {
+ if (NetTestWebService.CLIENT_COUNT.get() > NetTestWebService.getMaxClients()) {
log.error("Download: Max client count reached");
context.abortWith(Response.status(Status.TOO_MANY_REQUESTS).build());
return;