From b458fd41c2e4393c42498a9587a9a696a80a621c Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 23 Apr 2014 17:55:15 +0300 Subject: [PATCH] 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." --- obexd/src/obex.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.47.3