Skip to content

Commit

Permalink
OBEX: Include NameHeader in final PUT Server Response
Browse files Browse the repository at this point in the history
Check and include NameHeader for Server Response set
from obex upper layer in FINAL packet instead of
first CONTINUE packet.

Change-Id: Ida9546d5b7664df8be708cba48eb7ddd86e5c94e
CRs-fixed: 765163
  • Loading branch information
Ashwini Munigala authored and Steve Kondik committed Mar 22, 2015
1 parent 0bdaefa commit b87d33d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions btobex/javax/btobex/ServerSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,22 @@ private void handlePutRequest(int type) throws IOException {
if (VERBOSE) Log.v(TAG, "handlePutRequest pre != HTTP_OK sendReply");
op.sendReply(response, false, false);
} else if (!op.isAborted) {
String nameHeader = (String)op.replyHeader.getHeader(HeaderSet.NAME);
if (!op.finalBitSet && nameHeader != null) {
if (VERBOSE) Log.v(TAG, "handlePutRequest Saved: "+nameHeader);
//Donot Include NameHeader in CONTINUE
op.replyHeader.setHeader(HeaderSet.NAME, null);
}
// wait for the final bit
while (!op.finalBitSet) {
if (VERBOSE) Log.v(TAG, "handlePutRequest pre looped sendReply");
op.sendReply(ResponseCodes.OBEX_HTTP_CONTINUE, op.mSingleResponseActive, false);
}
if (nameHeader != null) {
if (VERBOSE) Log.v(TAG, "handlePutRequest SETHeader: "+nameHeader);
//PUT NameHeader in Final Packet
op.replyHeader.setHeader(HeaderSet.NAME, nameHeader);
}
op.sendReply(response, false,false);
}
} catch (Exception e) {
Expand Down

0 comments on commit b87d33d

Please sign in to comment.