Extract send_limit, rcv_limit, rcv_warn_limit and send_warn_limit as int64 81/130381/3
authorNishant Chaprana <n.chaprana@samsung.com>
Mon, 22 May 2017 11:28:35 +0000 (16:58 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Mon, 22 May 2017 11:28:35 +0000 (16:58 +0530)
Description: smart-traffic-control library sends limits as int64 but manager
was extracting these values as uint64, due to which values were not extracted
and limits were not updated.

Below is the error log:-

D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Key : [rcv_limit]
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Value: [int64 1024000]
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(180) > Enter
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(207) > rcv_limit: [0]
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(235) > Quit
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Key : [send_limit]
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Value: [int64 1024000]
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(180) > Enter
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(211) > send_limit: [0]
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(235) > Quit
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Key : [rcv_warn_limit]
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Value: [int64 1020000]
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(180) > Enter
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(215) > rcv_warn_limit: [0]
D/STC_MANAGER(  386): stc-restriction.c: __stc_extract_restriction_rule(235) > Quit
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Key : [send_warn_limit]
D/STC_MANAGER(  386): stc-manager-gdbus.c: stc_manager_gdbus_dict_foreach(298) > Value: [int64 1020000]

Change-Id: I2e5ea475bc5545f631b7c74d208b2b1a27d41308
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/stc-manager.spec
src/stc-restriction.c

index d3fdb69..074ac00 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.0.8
+Version:    0.0.9
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index 721d25c..ba4e9ea 100755 (executable)
@@ -203,19 +203,19 @@ static void __stc_extract_restriction_rule(const char *key, GVariant *value,
                STC_LOGD("iftype: [%u]", (unsigned int) rule->iftype);
 
        } else if (!g_strcmp0(key, "rcv_limit")) {
-               rule->rcv_limit = g_variant_get_uint64(value);
+               rule->rcv_limit = g_variant_get_int64(value);
                STC_LOGD("rcv_limit: [%lld]", rule->rcv_limit);
 
        } else if (!g_strcmp0(key, "send_limit")) {
-               rule->send_limit = g_variant_get_uint64(value);
+               rule->send_limit = g_variant_get_int64(value);
                STC_LOGD("send_limit: [%lld]", rule->send_limit);
 
        } else if (!g_strcmp0(key, "rcv_warn_limit")) {
-               rule->rcv_warn_limit = g_variant_get_uint64(value);
+               rule->rcv_warn_limit = g_variant_get_int64(value);
                STC_LOGD("rcv_warn_limit: [%lld]", rule->rcv_warn_limit);
 
        } else if (!g_strcmp0(key, "send_warn_limit")) {
-               rule->send_warn_limit = g_variant_get_uint64(value);
+               rule->send_warn_limit = g_variant_get_int64(value);
                STC_LOGD("send_warn_limit: [%lld]", rule->send_warn_limit);
 
        } else if (!g_strcmp0(key, "roaming")) {