Commit: d4477e8fc3dc5b06ba6068741c082d7b4c3f084c
Parent: 23f7d0f12eea713bed716b7531b0db6f64cd2e13
Author: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2017-07-21 14:34:39
Tree: aa1d4c75626debd5c5b11ff946b6513b93eff31c

plugins: Fix reconnect_interval for cases of improper main.conf There are two problems: - When main.conf is not found, bluetoothd copies short the default set of reconnecting intervals to reconnect_interval. It does not match the reconnct_interval_len used as the array length. So if a link of device is disconnected, bluetoothd is run over reconnect_interval as time proceeds and will not time out as expected. bluetooothd with --debug option outputed the following log in my box: plugins/policy.c:reconnect_set_timer() attempt 1/7 1 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 2/7 2 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 3/7 0 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 4/7 0 seconds - When ReconnectIntervals in main.conf includes invalid characters, reconnct_interval_len value is bigger than the default array length. So if ReconnectAttempts value in main.conf is bigger than reconnct_interval_len value and a link of device is disconnected, bluetoothd is run over reconnect_interval as time proceeds and will not time out as expected. bluetooothd with --debug option outputed the following log in my box, if ReconnectAttempts value was 28 and ReconnectIntervals was inproper: ... plugins/policy.c:reconnect_set_timer() attempt 6/28 32 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 7/28 64 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 8/28 0 seconds ... plugins/policy.c:reconnect_set_timer() attempt 25/28 1 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 26/28 3 seconds plugins/policy.c:reconnect_timeout() Reconnecting profiles plugins/policy.c:conn_fail_cb() status 4 plugins/policy.c:reconnect_set_timer() attempt 27/28 110683472 seconds This fix properly uses the default set of reconnecting intervals.

Diffstat

M plugins/policy.c | 7 ++++- - -

1 files changed, 4 insertions(+), 3 deletions(-)

View Full Diff | Patch