mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Enables the HTTP compression in JBOSH
Adds an extra parameter "compressionEnabled" to ConnectionConfiguration that is used to set the setCompressionEnabled() of BOSHClientConfig
This commit is contained in:
parent
b7ea226c56
commit
1ea10831b6
3 changed files with 23 additions and 32 deletions
|
@ -41,8 +41,6 @@ public final class XMPPTCPConnectionConfiguration extends ConnectionConfiguratio
|
|||
*/
|
||||
public static int DEFAULT_CONNECT_TIMEOUT = 30000;
|
||||
|
||||
private final boolean compressionEnabled;
|
||||
|
||||
/**
|
||||
* How long the socket will wait until a TCP connection is established (in milliseconds).
|
||||
*/
|
||||
|
@ -50,23 +48,9 @@ public final class XMPPTCPConnectionConfiguration extends ConnectionConfiguratio
|
|||
|
||||
private XMPPTCPConnectionConfiguration(Builder builder) {
|
||||
super(builder);
|
||||
compressionEnabled = builder.compressionEnabled;
|
||||
connectTimeout = builder.connectTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the connection is going to use stream compression. Stream compression
|
||||
* will be requested after TLS was established (if TLS was enabled) and only if the server
|
||||
* offered stream compression. With stream compression network traffic can be reduced
|
||||
* up to 90%. By default compression is disabled.
|
||||
*
|
||||
* @return true if the connection is going to use stream compression.
|
||||
*/
|
||||
@Override
|
||||
public boolean isCompressionEnabled() {
|
||||
return compressionEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* How long the socket will wait until a TCP connection is established (in milliseconds). Defaults to {@link #DEFAULT_CONNECT_TIMEOUT}.
|
||||
*
|
||||
|
@ -91,20 +75,6 @@ public final class XMPPTCPConnectionConfiguration extends ConnectionConfiguratio
|
|||
private Builder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the connection is going to use stream compression. Stream compression
|
||||
* will be requested after TLS was established (if TLS was enabled) and only if the server
|
||||
* offered stream compression. With stream compression network traffic can be reduced
|
||||
* up to 90%. By default compression is disabled.
|
||||
*
|
||||
* @param compressionEnabled if the connection is going to use stream compression.
|
||||
* @return a reference to this object.
|
||||
*/
|
||||
public Builder setCompressionEnabled(boolean compressionEnabled) {
|
||||
this.compressionEnabled = compressionEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set how long the socket will wait until a TCP connection is established (in milliseconds).
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue