From 852fedd60b4c1a21d42cf50fbd3c921711a298e3 Mon Sep 17 00:00:00 2001 From: Troels Dalsgaard Hoffmeyer Date: Tue, 30 Apr 2019 13:51:47 +0200 Subject: [PATCH] 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. --- src/advertising.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/advertising.c b/src/advertising.c index 2f187edcf..3ed13766c 100644 --- a/src/advertising.c +++ b/src/advertising.c @@ -587,8 +587,9 @@ 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; } -- 2.47.3