Only send updates if byte count actually changed
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 5 Jan 2010 15:07:44 +0000 (07:07 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 5 Jan 2010 15:07:44 +0000 (07:07 -0800)
src/counter.c

index 224d122..31d463e 100644 (file)
@@ -164,6 +164,10 @@ void __connman_counter_notify(unsigned int rx_bytes, unsigned int tx_bytes)
        while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) {
                struct connman_counter *counter = value;
 
+               if (counter->rx_bytes == rx_bytes &&
+                                       counter->tx_bytes == tx_bytes)
+                       continue;
+
                counter->rx_bytes = rx_bytes;
                counter->tx_bytes = tx_bytes;