summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Gupta <hemantg@codeaurora.org>2015-07-24 18:08:25 +0530
committerAjay Panicker <apanicke@google.com>2017-02-03 21:47:39 +0000
commit3fba4935a7d2353f6f3ec1091729e3509ba73d41 (patch)
treef1c0a2ca4792d8ddfe890dcccee947f038698af2
parent6678d341332bbb8ef01159a487ac96529f4fb00e (diff)
OBEX: Set Min maxPacketLength negotiated in CONNECT Operation.
Set OBEX Server maxRxLength to the minium value acceptable from either server and client during CONNECT Operation. Below basic and all PUT test cases fail without this fix, as the maxPacketLength for later is less than maxRxLength of server. TC_MSE_MMU_BV_03_I TC_MSE_MMU_BV_02_I Change-Id: Iaa4f92e3146dc13d647dca12c84eb43b91657efa
-rw-r--r--obex/javax/obex/ServerSession.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java
index acee5ddd5f8f..3831cf7285da 100644
--- a/obex/javax/obex/ServerSession.java
+++ b/obex/javax/obex/ServerSession.java
@@ -658,6 +658,11 @@ public final class ServerSession extends ObexSession implements Runnable {
*/
byte[] sendData = new byte[totalLength];
int maxRxLength = ObexHelper.getMaxRxPacketSize(mTransport);
+ if (maxRxLength > mMaxPacketLength) {
+ if(V) Log.v(TAG,"Set maxRxLength to min of maxRxServrLen:" + maxRxLength +
+ " and MaxNegotiated from Client: " + mMaxPacketLength);
+ maxRxLength = mMaxPacketLength;
+ }
sendData[0] = (byte)code;
sendData[1] = length[2];
sendData[2] = length[3];