All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kampas <martin.kampas@tieto.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] obex-client-tool: Set the length header
Date: Wed, 23 Apr 2014 12:20:06 +0200	[thread overview]
Message-ID: <5012684.PXV09D887U@5th> (raw)
In-Reply-To: <CABBYNZJjB6D4Bekqu+wK9EeRrzg=26GFhB-KW-Spzq7X-tt4cg@mail.gmail.com>

Hi Luiz,

On Wednesday, April 23, 2014 11:28:55 AM Luiz Augusto von Dentz wrote:
> 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);

I tried your patch with the old obexd v0.48 and it worked (I am sorry I could not easily try with the newest obexd from bluez tree).

Both patches seems worth to apply - mine to make the obex-client-tool work with old buggy devices.

Here is your patch aligned for v0.48:

diff --git a/src/obex.c b/src/obex.c
index 9044961..5ae4ff1 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -961,6 +961,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);
--

BR,
Martin




      reply	other threads:[~2014-04-23 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22  5:08 [PATCH] obex-client-tool: Set the length header Martin Kampas
2014-04-23  7:24 ` Luiz Augusto von Dentz
2014-04-23  7:54   ` Martin Kampas
2014-04-23  8:20     ` Luiz Augusto von Dentz
2014-04-23  8:28       ` Luiz Augusto von Dentz
2014-04-23 10:20         ` Martin Kampas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5012684.PXV09D887U@5th \
    --to=martin.kampas@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.