Skip to content

Commit

Permalink
Merge pull request #242 from alvin0319/feat/unlimited-encoding-settings
Browse files Browse the repository at this point in the history
Implement EncodingSettings.UNLIMITED
  • Loading branch information
SupremeMortal authored Jul 11, 2024
2 parents 3c07339 + 1a6cbdf commit 46a0295
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ public class EncodingSettings {
.maxStringLength(1024 * 32) // 32KB
.build();

/**
* A {@link EncodingSettings} instance for implementations
* that don't need such limits. (e.g. Proxy server client <-> downstream server connection)
* This setting is not generally recommended for use in most cases,
* as it will allow any large packets to be received.
*/
public static final EncodingSettings UNLIMITED = EncodingSettings.builder()
.maxListSize(-1)
.maxByteArraySize(-1)
.maxNetworkNBTSize(-1)
.maxItemNBTSize(-1)
.maxStringLength(-1)
.build();

private final int maxListSize;
private final int maxByteArraySize;
private final int maxNetworkNBTSize;
Expand Down

0 comments on commit 46a0295

Please sign in to comment.