We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 33d2fbb + b271fee commit adb70eaCopy full SHA for adb70ea
1 file changed
base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
@@ -615,8 +615,9 @@ public void sendMessage(ProtocolMessage protocolMsg) {
615
return;
616
}
617
618
- //Set the MTU according to session MTU provided by the IVI or the max data size for encryption if required
619
- final Long mtu = requiresEncryption ? TLS_MAX_DATA_TO_ENCRYPT_SIZE : getMtu(sessionType);
+ //Set the MTU according to service MTU provided by the IVI .
+ //If encryption is required the MTU will be set to lowest value between the max data size for encryption or service MTU
620
+ final Long mtu = requiresEncryption ? Math.min(TLS_MAX_DATA_TO_ENCRYPT_SIZE, getMtu(sessionType)) : getMtu(sessionType);
621
622
synchronized (messageLock) {
623
if (data != null && data.length > mtu) {
0 commit comments