summaryrefslogtreecommitdiff
path: root/obexd/src
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-04-23 17:55:15 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-04-23 17:55:15 +0300
commitb458fd41c2e4393c42498a9587a9a696a80a621c (patch)
treeddad74913a141a16f7a60bff1b6b9bdc073b2333 /obexd/src
parenta7a73c508cd686932aeab1bfd4d3448c6895b8dd (diff)
downloadbluez-b458fd41c2e4393c42498a9587a9a696a80a621c.tar.gz
obexd: Fix treating PUT with Body header as delete
Requests have the size set to OBJECT_SIZE_DELETE but if the request has a body header the size should be set to OBJECT_SIZE_UNKNOWN as it no longer can be considered a delete request: "3.4.3.6 Put-Delete and Create-Empty Methods A PUT operation with NO Body or End-of-Body headers whatsoever should be treated as a delete request."
Diffstat (limited to 'obexd/src')
-rw-r--r--obexd/src/obex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index bd4770df5..7b4634e9a 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -873,6 +873,10 @@ static void cmd_put(GObex *obex, GObexPacket *req, gpointer user_data)
os->cmd = G_OBEX_OP_PUT;
+ /* Set size to unknown if a body header exists */
+ if (g_obex_packet_get_body(req))
+ os->size = OBJECT_SIZE_UNKNOWN;
+
parse_name(os, req);
parse_length(os, req);
parse_time(os, req);