diff options
Diffstat (limited to 'obex')
-rw-r--r-- | obex/javax/obex/ClientOperation.java | 11 | ||||
-rw-r--r-- | obex/javax/obex/ServerSession.java | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index 294b502..0c65283 100644 --- a/obex/javax/obex/ClientOperation.java +++ b/obex/javax/obex/ClientOperation.java @@ -121,6 +121,13 @@ 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); + + } } /** @@ -420,7 +427,7 @@ public final class ClientOperation implements Operation, BaseStream { //split the headerArray end = ObexHelper.findHeaderEnd(headerArray, start, mMaxPacketSize - ObexHelper.BASE_PACKET_LENGTH); - // can not split + // can not split if (end == -1) { mOperationDone = true; abort(); @@ -521,7 +528,7 @@ public final class ClientOperation implements Operation, BaseStream { return false; } - // send all of the output data in 0x48, + // send all of the output data in 0x48, // send 0x49 with empty body if ((mPrivateOutput != null) && (mPrivateOutput.size() > 0)) returnValue = true; diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java index a4b9759..f1b9a0d 100644 --- a/obex/javax/obex/ServerSession.java +++ b/obex/javax/obex/ServerSession.java @@ -256,6 +256,10 @@ public final class ServerSession extends ObexSession implements Runnable { public void sendResponse(int code, byte[] header) throws IOException { int totalLength = 3; byte[] data = null; + OutputStream op = mOutput; + if (op == null) { + return; + } if (header != null) { totalLength += header.length; @@ -270,8 +274,8 @@ public final class ServerSession extends ObexSession implements Runnable { data[1] = (byte)0x00; data[2] = (byte)totalLength; } - mOutput.write(data); - mOutput.flush(); + op.write(data); + op.flush(); } /** |