diff --git a/htroot/Connections_p.java b/htroot/Connections_p.java index 3e5820336..34d7ce5f3 100644 --- a/htroot/Connections_p.java +++ b/htroot/Connections_p.java @@ -230,11 +230,12 @@ public final class Connections_p { prop.putNum("numActivePending", numActivePending); // client sessions - Set a = HttpConnectionInfo.getAllConnections(); + Set allConnections = HttpConnectionInfo.getAllConnections(); // TODO sorting // Arrays.sort(a, httpc.connectionTimeComparatorInstance); int c = 0; - for (HttpConnectionInfo conInfo: a) { + synchronized (allConnections) { + for (HttpConnectionInfo conInfo: allConnections) { prop.put("clientList_" + c + "_clientProtocol", conInfo.getProtocol()); prop.putNum("clientList_" + c + "_clientLifetime", conInfo.getLifetime()); prop.putNum("clientList_" + c + "_clientIdletime", conInfo.getIdletime()); @@ -242,7 +243,8 @@ public final class Connections_p { prop.putHTML("clientList_" + c + "_clientCommand", conInfo.getCommand()); prop.put("clientList_" + c + "_clientID", conInfo.getID()); c++; - } + } + } prop.put("clientList", c); prop.put("clientActive", JakartaCommonsHttpClient.connectionCount()); diff --git a/source/de/anomic/http/HttpConnectionInfo.java b/source/de/anomic/http/HttpConnectionInfo.java index fa75cf664..a3c6e266a 100644 --- a/source/de/anomic/http/HttpConnectionInfo.java +++ b/source/de/anomic/http/HttpConnectionInfo.java @@ -111,6 +111,10 @@ public class HttpConnectionInfo { } /** + * gets a {@link Set} of all collected ConnectionInfos + * + * Important: iterations must be synchronized! + * * @return the allConnections */ public static Set getAllConnections() {