Skip to content

Commit

Permalink
MAX_DATA_REMAINING should be long; review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuch committed Nov 22, 2024
1 parent ac6ecb1 commit 13559b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/java.base/share/classes/sun/net/NetProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
*
*/
public class NetProperties {
private static Properties props = new Properties();
static {
loadDefaultProperties();
}
private static final Properties props = loadDefaultProperties(new Properties());

private NetProperties() { };

Expand All @@ -50,7 +47,7 @@ public class NetProperties {
* Loads the default networking system properties
* the file is in jre/lib/net.properties
*/
private static void loadDefaultProperties() {
private static Properties loadDefaultProperties(Properties props) {
String fname = StaticProperty.javaHome();
if (fname == null) {
throw new Error("Can't find java.home ??");
Expand All @@ -66,6 +63,7 @@ private static void loadDefaultProperties() {
// Do nothing. We couldn't find or access the file
// so we won't have default properties...
}
return props;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class KeepAliveStreamCleaner
implements Runnable
{
// maximum amount of remaining data that we will try to clean up
protected static final int MAX_DATA_REMAINING;
protected static final long MAX_DATA_REMAINING;

// maximum amount of KeepAliveStreams to be queued
protected static final int MAX_CAPACITY;
Expand All @@ -62,7 +62,7 @@ class KeepAliveStreamCleaner

static {
final String maxDataKey = "http.KeepAlive.remainingData";
MAX_DATA_REMAINING = NetProperties.getInteger(maxDataKey, 512) * 1024;
MAX_DATA_REMAINING = NetProperties.getInteger(maxDataKey, 512) * 1024L;

final String maxCapacityKey = "http.KeepAlive.queuedConnections";
MAX_CAPACITY = NetProperties.getInteger(maxCapacityKey, 10);
Expand Down

0 comments on commit 13559b3

Please sign in to comment.