From: YoungHun Kim Date: Wed, 31 Jan 2018 00:30:27 +0000 (+0900) Subject: Update the value of connection state change X-Git-Tag: submit/tizen/20180202.020558~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52b457bfdc98b7df975f901dbe1bda1b4e48d7f6;p=platform%2Fcore%2Fmultimedia%2Fmmsvc-core.git Update the value of connection state change Change-Id: I1c4c879ddaa1d05587717a985852545eb1640242 --- diff --git a/core/src/muse_core.c b/core/src/muse_core.c index 9d14fa1..f388907 100644 --- a/core/src/muse_core.c +++ b/core/src/muse_core.c @@ -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; diff --git a/packaging/mused.spec b/packaging/mused.spec index 4436558..6ec502b 100644 --- a/packaging/mused.spec +++ b/packaging/mused.spec @@ -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 diff --git a/server/include/muse_server_module.h b/server/include/muse_server_module.h index 9abbf0b..e7016ba 100644 --- a/server/include/muse_server_module.h +++ b/server/include/muse_server_module.h @@ -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; diff --git a/server/include/muse_server_workqueue.h b/server/include/muse_server_workqueue.h index 59dd2b9..a5977d1 100644 --- a/server/include/muse_server_workqueue.h +++ b/server/include/muse_server_workqueue.h @@ -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; diff --git a/server/src/muse_server_connection.c b/server/src/muse_server_connection.c index af74022..0251552 100644 --- a/server/src/muse_server_connection.c +++ b/server/src/muse_server_connection.c @@ -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;