diff options
author | Hemant Gupta <hemantg@codeaurora.org> | 2015-08-28 15:13:47 +0530 |
---|---|---|
committer | Myles Watson <mylesgw@google.com> | 2017-11-29 18:18:58 +0000 |
commit | b366d50971594562859d64c379ada79746fc06e7 (patch) | |
tree | 2b9bb9bfc10e1744c328fbd9d86bf7a0a7a77aa7 /obex | |
parent | dc98d6e44b3e477ca6a97859a6be5fb610093161 (diff) |
OBEX: Avoid pre-sending CONTINUE for SRM enabled case
Remote Device: LG-G2 as OPP client
Use Case:
1) Pair DUT with Remote.
2) Now push the file from Remote.
3) Ignore the incoming request from Remote
Failure:
RX_Notification lasts only for 10 seconds.
Fix:
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.
Test: Send connection request from remote device and verified that
connection is sustainable for 30 seconds until timeout.
Bug: 37886388
Change-Id: I1b5bfd65f9023d77850a34bcb08cfbb435e9a474
Diffstat (limited to 'obex')
-rw-r--r-- | obex/javax/obex/ServerOperation.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java index 56a675acf082..15ea36789e2c 100644 --- a/obex/javax/obex/ServerOperation.java +++ b/obex/javax/obex/ServerOperation.java @@ -195,7 +195,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) { @@ -204,8 +209,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; |