Re: [PATCH Bluez 1/1] advertising: Timeout of 0 should not fire a callback Setting a timeout of 0 on an advertisement should let the advertisement run forever. The client was released immediately after, although the advertisement was still in the air.

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

 



Hi Troels,

On Mon, Apr 29, 2019 at 2:16 PM Troels Dalsgaard Hoffmeyer
<troels.d.hoffmeyer@xxxxxxxxx> wrote:
>

Please rework the commit message, the subject should be rather short
and you should put some stuff in the description.

> ---
>  src/advertising.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/advertising.c b/src/advertising.c
> index 2f187edcf..26e24ee01 100644
> --- a/src/advertising.c
> +++ b/src/advertising.c
> @@ -587,8 +587,10 @@ static bool parse_timeout(DBusMessageIter *iter,
>         if (client->to_id)
>                 g_source_remove(client->to_id);
>
> -       client->to_id = g_timeout_add_seconds(client->timeout, client_timeout,
> -                                                               client);
> +       if(client->timeout > 0) {
> +               client->to_id = g_timeout_add_seconds(client->timeout, client_timeout,
> +                                                                                                                                               client);
> +       }
>
>         return true;
>  }

While I do agree we should handle timeout 0 as no timeout the reason
you are hitting this in the first place is a misused of the API where
you are setting a Timeout parameter when there shouldn't be one.

-- 
Luiz Augusto von Dentz



[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