I'm writing some code with OpenOBEX that is required to support the special
"Put-Delete" and "Create-Empty" commands that are specified through Put
operations. The specs say that a Put-Delete is where a Put is received
without any Body and End-of-Body headers, and a Create-Empty is where a Put
is received with an empty End-of-Body header.
This is easy enough to support on the client side, but it seems a bit harder
when implementing a service. The problem is that I can't examine the Body
and End-of-Body headers when a Put is received. OpenOBEX will stream or
package up the body data and pass it on, but there's no way to find out if
it received empty Body or End-of-Body headers, or if it didn't receive them
Is there a way to get around this? ObexFTP's obexftpd seems to determine
there's a Put-Delete if it receives a final packet that doesn't have a Body
header. It's able to access the Body header because it doesn't enable
streaming, but the implementation I am working on requires streaming. Also,
there's no way to check the End-of-Body header even if streaming is not
If this is not currently possible, an idea would be to set some flags when
parsing the incoming headers that indicate if there is something special
about the Body and End-of-Body headers (e.g. if they are missing or empty).
These flags could be retrieved through a method, e.g.
From: Hendrik Sattler <sattler2000@gm...> - 2006-11-15 14:19:11
Am Mittwoch 15 November 2006 07:56 schrieb Bea Lam:
> I'm writing some code with OpenOBEX that is required to support the special
> "Put-Delete" and "Create-Empty" commands that are specified through Put
> operations. The specs say that a Put-Delete is where a Put is received
> without any Body and End-of-Body headers, and a Create-Empty is where a Put
> is received with an empty End-of-Body header.
That is written (for reference: chapter 22.214.171.124) but I hope that they meant
that a bit different (else it would be complete non-sense):
The key word, here, is "Similarly". The Create-Empty shall be used if no body
header was send and the end-of-body header is empty.
If an empty end-of-body headers always indicates an empty file despite
previously sent body headers, is one supposed to discard the already-sent
data? That doesn't sound logical and is the opposite of the suggestion in
chapter 126.96.36.199 (second paragraph).
That makes the Create-Empty pretty easy to implement on both client and server
without any(?) changes (don't check the length, though).
As for Put-Delete, it may be possible to realize that as event
OBEX_EV_BODYMISSING or command OBEX_CMD_DELETE.