Skip to content

Commit

Permalink
[SCB-2894] use the self-defined compression switch const
Browse files Browse the repository at this point in the history
  • Loading branch information
yhs0092 committed Dec 13, 2024
1 parent fd4bf2e commit 53ea039
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class WebSocketTransportClientOptionsSPI extends WebSocketClientOptionsSP

public static final String CLIENT_TAG = "websocket.consumer";

public static final boolean DEFAULT_CLIENT_COMPRESSION_SUPPORT = false;

private static final int DEFAULT_IDLE_TIME_OUT = 150;

@Override
Expand Down Expand Up @@ -198,15 +200,15 @@ public int getMaxConnections() {
public boolean getTryUsePerFrameCompression() {
return DynamicPropertyFactory.getInstance()
.getBooleanProperty("servicecomb.websocket.client.tryUsePerFrameCompression",
HttpClientOptions.DEFAULT_TRY_USE_PER_FRAME_WEBSOCKET_COMPRESSION)
DEFAULT_CLIENT_COMPRESSION_SUPPORT)
.get();
}

@Override
public boolean getTryUsePerMessageCompression() {
return DynamicPropertyFactory.getInstance()
.getBooleanProperty("servicecomb.websocket.client.tryUsePerMessageCompression",
HttpClientOptions.DEFAULT_TRY_USE_PER_MESSAGE_WEBSOCKET_COMPRESSION)
DEFAULT_CLIENT_COMPRESSION_SUPPORT)
.get();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ public static int getWebSocketCompressionLevel() {
public static boolean getPerFrameWebSocketCompressionSupported() {
return DynamicPropertyFactory.getInstance()
.getBooleanProperty("servicecomb.websocket.server.perFrameCompressionSupported",
HttpServerOptions.DEFAULT_PER_FRAME_WEBSOCKET_COMPRESSION_SUPPORTED)
DEFAULT_SERVER_COMPRESSION_SUPPORT)
.get();
}

public static boolean getPerMessageWebSocketCompressionSupported() {
return DynamicPropertyFactory.getInstance()
.getBooleanProperty("servicecomb.websocket.server.perMessageCompressionSupported",
HttpServerOptions.DEFAULT_PER_MESSAGE_WEBSOCKET_COMPRESSION_SUPPORTED)
DEFAULT_SERVER_COMPRESSION_SUPPORT)
.get();
}
}

0 comments on commit 53ea039

Please sign in to comment.