Re: [PATCH] obex-client-tool: Set the length header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin,

On Wed, Apr 23, 2014 at 11:20 AM, Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
> Hi Martin,
>
> On Wed, Apr 23, 2014 at 10:54 AM, Martin Kampas <martin.kampas@xxxxxxxxx> wrote:
>> Hi Luiz,
>>
>> On Wednesday, April 23, 2014 10:24:17 AM Luiz Augusto von Dentz wrote:
>>> The patch itself is fine but there got to be something wrong with
>>> obexd if it cannot accept a PUT without length, maybe it is the agent
>>> that is rejecting it?
>>
>> If I am not wrong it is rejected inside the opp plugin in opp_chkput() [1] (where OBJECT_SIZE_DELETE should be the initial value of obex_session::size), called from check_put() [2]
>>
>> I also tried with an Android 4.1 device and got the same result.
>>
>> BR,
>> Martin
>>
>> [1] http://git.kernel.org/cgit/bluetooth/obexd.git/tree/plugins/opp.c?id=0.48#n122
>> [2] http://git.kernel.org/cgit/bluetooth/obexd.git/tree/src/obex.c?id=0.48#n918
>
> Hmm, looks likes it is still broken, btw the proper check is probably
> to check the existence of a body header and then set size to
> OBJECT_SIZE_UNKNOWN before parse_length.

Try the with the following patch:

diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index bd4770d..7b4634e 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);


-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux