Update the value of connection state change 69/168769/1
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 31 Jan 2018 00:30:27 +0000 (09:30 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 31 Jan 2018 00:30:39 +0000 (09:30 +0900)
Change-Id: I1c4c879ddaa1d05587717a985852545eb1640242

core/src/muse_core.c
packaging/mused.spec
server/include/muse_server_module.h
server/include/muse_server_workqueue.h
server/src/muse_server_connection.c

index 9d14fa1..f388907 100644 (file)
@@ -34,7 +34,7 @@ static void _muse_msg_json_set_error(muse_core_msg_parse_err_e *err, int jerr);
 static json_object *_muse_msg_json_tokener_parse_len(const char *str, int *len, muse_core_msg_parse_err_e *err);
 static gboolean _muse_msg_is_mem_ptr_valid(gpointer ptr);
 static void _muse_msg_json_factory_args(json_object *jobj, va_list ap);
-static json_object *_muse_msg_json_find_obj(json_object * jobj, const char *find_key);
+static json_object *_muse_msg_json_find_obj(json_object *jobj, const char *find_key);
 
 static int _muse_get_valid_fd_count(int *fds)
 {
@@ -156,7 +156,7 @@ static void _muse_msg_json_factory_args(json_object *jobj, va_list ap)
        }
 }
 
-static json_object *_muse_msg_json_find_obj(json_object * jobj, const char *find_key)
+static json_object *_muse_msg_json_find_obj(json_object *jobj, const char *find_key)
 {
        size_t key_len = 0;
 
index 4436558..6ec502b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.30
+Version:    0.3.31
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 9abbf0b..e7016ba 100644 (file)
@@ -30,7 +30,7 @@ extern "C" {
 
 typedef gboolean (*muse_module_dispatchfunc) (muse_module_h m);
 typedef gboolean (*muse_module_cmd_dispatchfunc) (muse_module_h m);
-typedef gboolean (*muse_module_callback) (GIOChannel * source, GIOCondition condition, gpointer data);
+typedef gboolean (*muse_module_callback) (GIOChannel *source, GIOCondition condition, gpointer data);
 
 typedef struct ms_module {
        int idx;
index 59dd2b9..a5977d1 100644 (file)
@@ -17,7 +17,7 @@ extern "C" {
 #define MUSE_WORK_THREAD_NUM                   1
 
 typedef struct ms_workqueue_job {
-       gboolean(*job_function) (struct ms_workqueue_job * job);
+       gboolean(*job_function) (struct ms_workqueue_job *job);
        void *user_data;
        struct ms_workqueue_job *prev;
        struct ms_workqueue_job *next;
index af74022..0251552 100644 (file)
@@ -156,14 +156,18 @@ ms_event_e ms_connection_event_trigger(int *value)
                return MUSE_EVENT_UNKNOWN;
        }
 
-       for (idx = 0 ; idx < fd_count ; idx++) {
+       for (idx = 0; idx < fd_count; idx++) {
                p_event = &connection->events[idx];
 
-               if (p_event->events == EPOLLIN || p_event->events == EPOLLOUT)
+               if (p_event->events == EPOLLIN || p_event->events == EPOLLOUT) {
+                       if (*value != MUSE_CONNECTION_STATE_CONNECTED)
+                               event_value = MUSE_EVENT_CONNECTION_STATE_CHANGED;
                        *value = MUSE_CONNECTION_STATE_CONNECTED;
-               else
+               } else {
+                       if (*value != MUSE_CONNECTION_STATE_DISCONNECTED)
+                               event_value = MUSE_EVENT_CONNECTION_STATE_CHANGED;
                        *value = MUSE_CONNECTION_STATE_DISCONNECTED;
-               event_value = MUSE_EVENT_CONNECTION_STATE_CHANGED;
+               }
        }
 
        return event_value;