From 50ba032f4a81155c5f10561d39a4f258a0e4f244 Mon Sep 17 00:00:00 2001 From: Hemant Gupta Date: Fri, 30 May 2014 22:25:20 +0530 Subject: OBEX: Handle GET operation properly This change handles GET operation properly whenever the Input stream is getting aborted in between. Without this patch it was observed that GET request was being sent by DUT even when abort has been sent/received resulting in IOT issues with some remote devices including PTS. Change-Id: Idcb4ea04abb57353af5ab1fef050b3a36579892e --- obex/javax/obex/ClientOperation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'obex') diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index cc20d39..883c8c6 100644 --- a/obex/javax/obex/ClientOperation.java +++ b/obex/javax/obex/ClientOperation.java @@ -784,12 +784,12 @@ public final class ClientOperation implements Operation, BaseStream { mReplyHeader.responseCode = ResponseCodes.OBEX_HTTP_CONTINUE; } - while (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE) { + while (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE && !mOperationDone) { if (!sendRequest(ObexHelper.OBEX_OPCODE_GET_FINAL)) { break; } } - while (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE) { + while (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE && !mOperationDone) { mParent.sendRequest(ObexHelper.OBEX_OPCODE_GET_FINAL, null, mReplyHeader, mPrivateInput, false); // Regardless of the SRM state, wait for the response. -- cgit v1.1