From 3fba4935a7d2353f6f3ec1091729e3509ba73d41 Mon Sep 17 00:00:00 2001 From: Hemant Gupta Date: Fri, 24 Jul 2015 18:08:25 +0530 Subject: 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 --- obex/javax/obex/ServerSession.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'obex') 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]; -- cgit v1.2.3