diff options
Diffstat (limited to 'obex')
-rw-r--r-- | obex/javax/obex/ClientOperation.java | 12 | ||||
-rw-r--r-- | obex/javax/obex/Operation.java | 2 | ||||
-rw-r--r-- | obex/javax/obex/ServerOperation.java | 36 |
3 files changed, 38 insertions, 12 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index 05b498c..2abddd9 100644 --- a/obex/javax/obex/ClientOperation.java +++ b/obex/javax/obex/ClientOperation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2009, Motorola, Inc. + * Copyright (c) 2010-2011, Motorola, Inc. * * All rights reserved. * @@ -121,6 +121,12 @@ public final class ClientOperation implements Operation, BaseStream { (header).mAuthResp.length); } + if ((header).mConnectionID != null) { + mRequestHeader.mConnectionID = new byte[4]; + System.arraycopy((header).mConnectionID, 0, mRequestHeader.mConnectionID, 0, + 4); + + } } /** @@ -723,4 +729,8 @@ public final class ClientOperation implements Operation, BaseStream { } } } + + public void noEndofBody() { + + } } diff --git a/obex/javax/obex/Operation.java b/obex/javax/obex/Operation.java index 25656ed..c827749 100644 --- a/obex/javax/obex/Operation.java +++ b/obex/javax/obex/Operation.java @@ -175,6 +175,8 @@ public interface Operation { DataOutputStream openDataOutputStream() throws IOException; + void noEndofBody(); + void close() throws IOException; int getMaxPacketSize(); diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java index d1476d2..a17226d 100644 --- a/obex/javax/obex/ServerOperation.java +++ b/obex/javax/obex/ServerOperation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2009, Motorola, Inc. + * Copyright (c) 2010-2011, Motorola, Inc. * * All rights reserved. * @@ -88,6 +88,8 @@ public final class ServerOperation implements Operation, BaseStream { private boolean mHasBody; + private boolean mEndofBody = true; + /** * Creates new ServerOperation * @param p the parent that created this object @@ -364,24 +366,31 @@ public final class ServerOperation implements Operation, BaseStream { * (End of Body) otherwise, we need to send 0x48 (Body) */ if ((finalBitSet) || (mPrivateOutput.isClosed())) { - out.write(0x49); + if (mEndofBody) { + out.write((byte)0x49); + bodyLength += 3; + out.write((byte)(bodyLength >> 8)); + out.write((byte)bodyLength); + out.write(body); + } } else { out.write(0x48); + bodyLength += 3; + out.write((byte)(bodyLength >> 8)); + out.write((byte)bodyLength); + out.write(body); } - bodyLength += 3; - out.write((byte)(bodyLength >> 8)); - out.write((byte)bodyLength); - out.write(body); } } if ((finalBitSet) && (type == ResponseCodes.OBEX_HTTP_OK) && (orginalBodyLength <= 0)) { - out.write(0x49); - orginalBodyLength = 3; - out.write((byte)(orginalBodyLength >> 8)); - out.write((byte)orginalBodyLength); - + if (mEndofBody) { + out.write(0x49); + orginalBodyLength = 3; + out.write((byte)(orginalBodyLength >> 8)); + out.write((byte)orginalBodyLength); + } } mResponseSize = 3; @@ -711,4 +720,9 @@ public final class ServerOperation implements Operation, BaseStream { public void streamClosed(boolean inStream) throws IOException { } + + public void noEndofBody() { + mEndofBody = false; + } + } |