Add http infomation for pcap and checking length of packet
[platform/core/connectivity/stc-manager.git] / plugin / appstatus / stc-plugin-appstatus.c
old mode 100644 (file)
new mode 100755 (executable)
index 2fd1b9e..108e0ab
@@ -87,7 +87,7 @@ static void __stc_gdbus_handle_aul_changestate(GDBusConnection *connection,
        else
                apptype = STC_APP_TYPE_GUI;
 
-       if (STC_DEBUG_LOG) {
+       if (STC_STAT_LOG) {
                STC_LOGD("\033[1;34mAPP STATUS\033[0;m: PkgID[\033[0;34m%s\033[0;m] "
                        "AppID[\033[0;32m%s\033[0;m] PID[\033[1;33m%d\033[0;m] Status[%s] Type[%s]",
                        pkgid, appid, pid, statstr, pkgtype);
@@ -127,10 +127,13 @@ signal_map_s signal_map[] = {
 static stc_error_e __ground_status_monitor_init(stc_s *stc)
 {
        guint i = 0;
+       guint size = 0;
 
        ret_value_msg_if(stc == NULL, STC_ERROR_INVALID_PARAMETER, "failed to get stc data");
 
-       for (i = 0; signal_map[i].member != NULL; i++) {
+       size = sizeof(signal_map) / sizeof(signal_map[0]);
+
+       for (i = 0; signal_map[i].member != NULL && i < size; i++) {
                signal_map[i].sub_id =
                        g_dbus_connection_signal_subscribe(stc->connection,
                                                           NULL,
@@ -152,10 +155,13 @@ static stc_error_e __ground_status_monitor_init(stc_s *stc)
 static stc_error_e __ground_status_monitor_deinit(stc_s *stc)
 {
        guint i = 0;
+       guint size = 0;
 
        ret_value_msg_if(stc == NULL, STC_ERROR_INVALID_PARAMETER, "failed to get stc data");
 
-       for (i = 0; signal_map[i].member != NULL; i++) {
+       size = sizeof(signal_map) / sizeof(signal_map[0]);
+
+       for (i = 0; signal_map[i].member != NULL && i < size; i++) {
                g_dbus_connection_signal_unsubscribe(stc->connection,
                                                     signal_map[i].sub_id);
                signal_map[i].sub_id = 0;