summaryrefslogtreecommitdiff
path: root/sdl_android
diff options
context:
space:
mode:
authorMarkos Rapitis <mrapitis@ford.com>2017-04-27 10:04:03 -0400
committerMarkos Rapitis <mrapitis@ford.com>2017-04-27 10:04:03 -0400
commit018de51cb222c6b0b3fad68e4431f10e6770a22d (patch)
tree70666847242f3871e716be6a0779ec01f05ef261 /sdl_android
parentab9be9c963bfa258b5cc3f49f106ebdbc2689a81 (diff)
downloadsdl_android-bugfix/issue_473.tar.gz
Updated BUFF_READ_SIZE and byte array allocation to match tls record sizing needs.bugfix/issue_473
Diffstat (limited to 'sdl_android')
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java3
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java9
2 files changed, 10 insertions, 2 deletions
diff --git a/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java b/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
index 7b36b1689..af6973d2e 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/protocol/WiProProtocol.java
@@ -25,6 +25,7 @@ public class WiProProtocol extends AbstractProtocol {
public static final int V2_HEADER_SIZE = 12;
private static int HEADER_SIZE = 8;
private static int MAX_DATA_SIZE = V1_V2_MTU_SIZE - HEADER_SIZE;
+ private static int TLS_MAX_RECORD_SIZE = 16384;
int hashID = 0;
int messageID = 0;
@@ -147,7 +148,7 @@ public class WiProProtocol extends AbstractProtocol {
if (session == null)
return;
- byte[] dataToRead = new byte[4096];
+ byte[] dataToRead = new byte[TLS_MAX_RECORD_SIZE];
SdlSecurityBase sdlSec = session.getSdlSecurity();
if (sdlSec == null)
return;
diff --git a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java b/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
index 525d94739..40cc7d5ed 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
@@ -14,7 +14,14 @@ public class StreamPacketizer extends AbstractPacketizer implements Runnable{
private Thread t = null;
- private final static int BUFF_READ_SIZE = 1024;
+
+ private final static int TLS_MAX_RECORD_SIZE = 16384;
+ private final static int TLS_RECORD_HEADER_SIZE = 5;
+ private final static int TLS_RECORD_MES_AUTH_CDE_SIZE = 32;
+ private final static int TLS_MAX_RECORD_PADDING_SIZE = 256;
+
+
+ private final static int BUFF_READ_SIZE = TLS_MAX_RECORD_SIZE - TLS_RECORD_HEADER_SIZE - TLS_RECORD_MES_AUTH_CDE_SIZE - TLS_MAX_RECORD_PADDING_SIZE;
public SdlConnection sdlConnection = null;
private Object mPauseLock;