summaryrefslogtreecommitdiffstats
path: root/obex
diff options
context:
space:
mode:
authorAshwini Munigala <AshwiniM@codeaurora.org>2015-08-28 15:13:47 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:28:16 -0600
commit551189e78d24402f2f4739b1e258d028c05351f4 (patch)
treed6dc32e196f9c55e35e4586a8055b5aad2ff8c9a /obex
parent8f5cc869db28a9bfb5c9cec90852f92914444639 (diff)
downloadframeworks_base-551189e78d24402f2f4739b1e258d028c05351f4.zip
frameworks_base-551189e78d24402f2f4739b1e258d028c05351f4.tar.gz
frameworks_base-551189e78d24402f2f4739b1e258d028c05351f4.tar.bz2
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
Diffstat (limited to 'obex')
-rw-r--r--obex/javax/obex/ServerOperation.java16
1 files changed, 13 insertions, 3 deletions
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;