summaryrefslogtreecommitdiffstats
path: root/src/NotificationProxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/NotificationProxy.c')
-rw-r--r--src/NotificationProxy.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/NotificationProxy.c b/src/NotificationProxy.c
index 1b13a29..f526f70 100644
--- a/src/NotificationProxy.c
+++ b/src/NotificationProxy.c
@@ -41,7 +41,7 @@ struct np_thread {
41 */ 41 */
42static void np_lock(np_client_t client) 42static void np_lock(np_client_t client)
43{ 43{
44 log_debug_msg("NP: Locked\n"); 44 debug_info("NP: Locked");
45 g_mutex_lock(client->mutex); 45 g_mutex_lock(client->mutex);
46} 46}
47 47
@@ -51,7 +51,7 @@ static void np_lock(np_client_t client)
51 */ 51 */
52static void np_unlock(np_client_t client) 52static void np_unlock(np_client_t client)
53{ 53{
54 log_debug_msg("NP: Unlocked\n"); 54 debug_info("NP: Unlocked");
55 g_mutex_unlock(client->mutex); 55 g_mutex_unlock(client->mutex);
56} 56}
57 57
@@ -131,7 +131,7 @@ np_error_t np_client_free(np_client_t client)
131 property_list_service_client_free(client->parent); 131 property_list_service_client_free(client->parent);
132 client->parent = NULL; 132 client->parent = NULL;
133 if (client->notifier) { 133 if (client->notifier) {
134 log_debug_msg("joining np callback\n"); 134 debug_info("joining np callback");
135 g_thread_join(client->notifier); 135 g_thread_join(client->notifier);
136 } 136 }
137 if (client->mutex) { 137 if (client->mutex) {
@@ -170,7 +170,7 @@ np_error_t np_post_notification(np_client_t client, const char *notification)
170 plist_free(dict); 170 plist_free(dict);
171 171
172 if (res != NP_E_SUCCESS) { 172 if (res != NP_E_SUCCESS) {
173 log_debug_msg("%s: Error sending XML plist to device!\n", __func__); 173 debug_info("Error sending XML plist to device!");
174 } 174 }
175 175
176 np_unlock(client); 176 np_unlock(client);
@@ -198,7 +198,7 @@ np_error_t np_observe_notification( np_client_t client, const char *notification
198 198
199 np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict)); 199 np_error_t res = np_error(property_list_service_send_xml_plist(client->parent, dict));
200 if (res != NP_E_SUCCESS) { 200 if (res != NP_E_SUCCESS) {
201 log_debug_msg("%s: Error sending XML plist to device!\n", __func__); 201 debug_info("Error sending XML plist to device!");
202 } 202 }
203 plist_free(dict); 203 plist_free(dict);
204 204
@@ -266,7 +266,7 @@ static int np_get_notification(np_client_t client, char **notification)
266 266
267 property_list_service_receive_plist_with_timeout(client->parent, &dict, 500); 267 property_list_service_receive_plist_with_timeout(client->parent, &dict, 500);
268 if (!dict) { 268 if (!dict) {
269 log_debug_msg("NotificationProxy: no notification received!\n"); 269 debug_info("NotificationProxy: no notification received!");
270 res = 0; 270 res = 0;
271 } else { 271 } else {
272 char *cmd_value = NULL; 272 char *cmd_value = NULL;
@@ -287,14 +287,14 @@ static int np_get_notification(np_client_t client, char **notification)
287 res = -2; 287 res = -2;
288 if (name_value_node && name_value) { 288 if (name_value_node && name_value) {
289 *notification = name_value; 289 *notification = name_value;
290 log_debug_msg("%s: got notification %s\n", __func__, name_value); 290 debug_info("got notification %s\n", __func__, name_value);
291 res = 0; 291 res = 0;
292 } 292 }
293 } else if (cmd_value && !strcmp(cmd_value, "ProxyDeath")) { 293 } else if (cmd_value && !strcmp(cmd_value, "ProxyDeath")) {
294 log_debug_msg("%s: ERROR: NotificationProxy died!\n", __func__); 294 debug_info("ERROR: NotificationProxy died!");
295 res = -1; 295 res = -1;
296 } else if (cmd_value) { 296 } else if (cmd_value) {
297 log_debug_msg("%d: unknown NotificationProxy command '%s' received!\n", __func__); 297 debug_info("unknown NotificationProxy command '%s' received!", cmd_value);
298 res = -1; 298 res = -1;
299 } else { 299 } else {
300 res = -2; 300 res = -2;
@@ -321,7 +321,7 @@ gpointer np_notifier( gpointer arg )
321 321
322 if (!npt) return NULL; 322 if (!npt) return NULL;
323 323
324 log_debug_msg("%s: starting callback.\n", __func__); 324 debug_info("starting callback.");
325 while (npt->client->parent) { 325 while (npt->client->parent) {
326 np_get_notification(npt->client, &notification); 326 np_get_notification(npt->client, &notification);
327 if (notification) { 327 if (notification) {
@@ -364,7 +364,7 @@ np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb
364 364
365 np_lock(client); 365 np_lock(client);
366 if (client->notifier) { 366 if (client->notifier) {
367 log_debug_msg("%s: callback already set, removing\n"); 367 debug_info("callback already set, removing\n");
368 property_list_service_client_t parent = client->parent; 368 property_list_service_client_t parent = client->parent;
369 client->parent = NULL; 369 client->parent = NULL;
370 g_thread_join(client->notifier); 370 g_thread_join(client->notifier);
@@ -384,7 +384,7 @@ np_error_t np_set_notify_callback( np_client_t client, np_notify_cb_t notify_cb
384 } 384 }
385 } 385 }
386 } else { 386 } else {
387 log_debug_msg("%s: no callback set\n", __func__); 387 debug_info("no callback set");
388 } 388 }
389 np_unlock(client); 389 np_unlock(client);
390 390