summaryrefslogtreecommitdiffstats
path: root/obex
diff options
context:
space:
mode:
Diffstat (limited to 'obex')
-rw-r--r--obex/javax/obex/ClientOperation.java3
-rw-r--r--obex/javax/obex/HeaderSet.java2
-rw-r--r--obex/javax/obex/Operation.java2
-rw-r--r--obex/javax/obex/ServerOperation.java35
4 files changed, 32 insertions, 10 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java
index 05b498c..294b502 100644
--- a/obex/javax/obex/ClientOperation.java
+++ b/obex/javax/obex/ClientOperation.java
@@ -723,4 +723,7 @@ public final class ClientOperation implements Operation, BaseStream {
}
}
}
+
+ public void noBodyHeader(){
+ }
}
diff --git a/obex/javax/obex/HeaderSet.java b/obex/javax/obex/HeaderSet.java
index b89b707..2b3066f 100644
--- a/obex/javax/obex/HeaderSet.java
+++ b/obex/javax/obex/HeaderSet.java
@@ -464,6 +464,8 @@ public final class HeaderSet {
return mHttpHeader;
case WHO:
return mWho;
+ case CONNECTION_ID:
+ return mConnectionID;
case OBJECT_CLASS:
return mObjectClass;
case APPLICATION_PARAMETER:
diff --git a/obex/javax/obex/Operation.java b/obex/javax/obex/Operation.java
index 25656ed..5b4d5ace 100644
--- a/obex/javax/obex/Operation.java
+++ b/obex/javax/obex/Operation.java
@@ -178,4 +178,6 @@ public interface Operation {
void close() throws IOException;
int getMaxPacketSize();
+
+ public void noBodyHeader();
}
diff --git a/obex/javax/obex/ServerOperation.java b/obex/javax/obex/ServerOperation.java
index d1476d2..fc441e0 100644
--- a/obex/javax/obex/ServerOperation.java
+++ b/obex/javax/obex/ServerOperation.java
@@ -88,6 +88,8 @@ public final class ServerOperation implements Operation, BaseStream {
private boolean mHasBody;
+ private boolean mSendBodyHeader = true;
+
/**
* Creates new ServerOperation
* @param p the parent that created this object
@@ -364,24 +366,33 @@ 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(mSendBodyHeader == true) {
+ out.write(0x49);
+ bodyLength += 3;
+ out.write((byte)(bodyLength >> 8));
+ out.write((byte)bodyLength);
+ out.write(body);
+ }
} else {
+ if(mSendBodyHeader == true) {
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(mSendBodyHeader == true) {
+ out.write(0x49);
+ orginalBodyLength = 3;
+ out.write((byte)(orginalBodyLength >> 8));
+ out.write((byte)orginalBodyLength);
+ }
}
mResponseSize = 3;
@@ -711,4 +722,8 @@ public final class ServerOperation implements Operation, BaseStream {
public void streamClosed(boolean inStream) throws IOException {
}
+
+ public void noBodyHeader(){
+ mSendBodyHeader = false;
+ }
}