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
This commit is contained in:
Hemant Gupta
2015-08-28 15:13:47 +05:30
committed by Myles Watson
parent dc98d6e44b
commit b366d50971

View File

@@ -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;