diff options
| author | 2010-11-28 17:00:45 +0100 | |
|---|---|---|
| committer | 2010-11-28 18:49:43 +0100 | |
| commit | 0fe512caeb70ff9e376e1be2146c8fe2081ce1d5 (patch) | |
| tree | 05df604d4812a56ef9263df101e390b053fb5e64 /src/notification_proxy.c | |
| parent | 4d7fdcc4d63dc61c9b1c4cc114604ae1f9d2e7de (diff) | |
| download | libimobiledevice-0fe512caeb70ff9e376e1be2146c8fe2081ce1d5.tar.gz libimobiledevice-0fe512caeb70ff9e376e1be2146c8fe2081ce1d5.tar.bz2 | |
notification_proxy: read ProxyDeath message after posting notification
This prevents ugly error messages appearing in the device's syslog.
Diffstat (limited to 'src/notification_proxy.c')
| -rw-r--r-- | src/notification_proxy.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/notification_proxy.c b/src/notification_proxy.c index c0f718e..80a82c4 100644 --- a/src/notification_proxy.c +++ b/src/notification_proxy.c | |||
| @@ -178,6 +178,27 @@ np_error_t np_post_notification(np_client_t client, const char *notification) | |||
| 178 | debug_info("Error sending XML plist to device!"); | 178 | debug_info("Error sending XML plist to device!"); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | // try to read an answer, we just ignore errors here | ||
| 182 | dict = NULL; | ||
| 183 | property_list_service_receive_plist(client->parent, &dict); | ||
| 184 | if (dict) { | ||
| 185 | #ifndef STRIP_DEBUG_CODE | ||
| 186 | char *cmd_value = NULL; | ||
| 187 | plist_t cmd_value_node = plist_dict_get_item(dict, "Command"); | ||
| 188 | if (plist_get_node_type(cmd_value_node) == PLIST_STRING) { | ||
| 189 | plist_get_string_val(cmd_value_node, &cmd_value); | ||
| 190 | } | ||
| 191 | |||
| 192 | if (cmd_value && !strcmp(cmd_value, "ProxyDeath")) { | ||
| 193 | // this is the expected answer | ||
| 194 | } else { | ||
| 195 | debug_plist(dict); | ||
| 196 | } | ||
| 197 | g_free(cmd_value); | ||
| 198 | #endif | ||
| 199 | plist_free(dict); | ||
| 200 | } | ||
| 201 | |||
| 181 | np_unlock(client); | 202 | np_unlock(client); |
| 182 | return res; | 203 | return res; |
| 183 | } | 204 | } |
