From 551189e78d24402f2f4739b1e258d028c05351f4 Mon Sep 17 00:00:00 2001 From: Ashwini Munigala Date: Fri, 28 Aug 2015 15:13:47 +0530 Subject: OBEX: Avoid pre-sending CONTINUE for SRM enabled case. OBEX lib handles a PUT Request case with NO BODY header on server session with CONTINUE response until body is found in request packet from remote. However, this needs to be avoided if SRM is enabled from remote to get proceed transfer authorization from Application layer. Change-Id: I1b5bfd65f9023d77850a34bcb08cfbb435e9a474 CRs-Fixed: 898467 --- obex/javax/obex/ServerOperation.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'obex/javax') diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java index 28f5906..87943bf 100644 --- a/obex/javax/obex/ServerOperation.java +++ b/obex/javax/obex/ServerOperation.java @@ -196,7 +196,12 @@ public final class ServerOperation implements Operation, BaseStream { if(!handleObexPacket(packet)) { return; } - if (!mHasBody) { + /* Don't Pre-Send continue when Remote requested for SRM + * Let the Application confirm. + */ + if(V) Log.v(TAG, "Get App confirmation if SRM ENABLED case: " + mSrmEnabled + + " not hasBody case: " + mHasBody); + if (!mHasBody && !mSrmEnabled) { while ((!mGetOperation) && (!finalBitSet)) { sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); if (mPrivateInput.available() > 0) { @@ -205,8 +210,13 @@ public final class ServerOperation implements Operation, BaseStream { } } } - - while ((!mGetOperation) && (!finalBitSet) && (mPrivateInput.available() == 0)) { + /* Don't Pre-Send continue when Remote requested for SRM + * Let the Application confirm. + */ + if(V) Log.v(TAG, "Get App confirmation if SRM ENABLED case: " + mSrmEnabled + + " not finalPacket: " + finalBitSet + " not GETOp Case: " + mGetOperation); + while ((!mSrmEnabled) && (!mGetOperation) && (!finalBitSet) + && (mPrivateInput.available() == 0)) { sendReply(ResponseCodes.OBEX_HTTP_CONTINUE); if (mPrivateInput.available() > 0) { break; -- cgit v1.1