commit 319b6416de00f7b6152315918c5ed6b00730d150
parent e3737fd44e88920202165ecb4f31ea4de267e939
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Tue, 31 Jul 2018 16:37:03 +0200
network: Stop tracking network last seen times
Drop the corresponding network_info field, function and D-Bus property.
The last seen times didn't seem useful but if a client needs them it can
probably implement the same logic with the information already available
through DBus.
Diffstat:
4 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/src/device.c b/src/device.c
@@ -308,9 +308,6 @@ static bool process_bss(struct device *device, struct scan_bss *bss,
network_get_ssid(network), security_to_str(security));
}
- if (network_bss_list_isempty(network))
- network_seen(network, timestamp);
-
network_bss_add(network, bss);
if (device->state != DEVICE_STATE_AUTOCONNECT)
@@ -1179,8 +1176,6 @@ next:
clock_gettime(CLOCK_REALTIME, &now);
- network_seen(network, &now);
-
/* See if we have anywhere to roam to */
if (!best_bss || bss_match(best_bss, device->connected_bss))
goto fail_free_bss;
diff --git a/src/knownnetworks.c b/src/knownnetworks.c
@@ -180,14 +180,6 @@ static bool known_network_append_properties(
datestr);
}
- if (network->seen_time.tv_sec != 0) {
- gmtime_r(&network->seen_time.tv_sec, &tm);
-
- if (strftime(datestr, sizeof(datestr), "%FT%TZ", &tm))
- dbus_dict_append_string(builder, "LastSeenTime",
- datestr);
- }
-
l_dbus_message_builder_leave_array(builder);
return true;
diff --git a/src/network.c b/src/network.c
@@ -109,19 +109,6 @@ static bool network_info_ptr_match(const void *a, const void *b)
return a == b;
}
-bool network_seen(struct network *network, struct timespec *when)
-{
- /*
- * Update the last seen time. Note this is not preserved across
- * the network going out of range and back, or program restarts.
- * It may be desirable for it to be preserved in some way but
- * without too frequent filesystem writes.
- */
- memcpy(&network->info->seen_time, when, sizeof(struct timespec));
-
- return true;
-}
-
void network_connected(struct network *network)
{
int err;
diff --git a/src/network.h b/src/network.h
@@ -28,7 +28,6 @@ struct device;
struct network;
struct scan_bss;
-bool network_seen(struct network *network, struct timespec *when);
void network_connected(struct network *network);
void network_disconnected(struct network *network);
bool network_rankmod(const struct network *network, double *rankmod);