diff options
author | Christian Fetzer <christian.fetzer@bmw-carit.de> | 2013-09-13 17:28:35 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-09-16 12:59:54 +0300 |
commit | 0416930e7eb889caa0876d5257721f8225af6ded (patch) | |
tree | 7ff0415c5756b74fe62a34e4c0e9d83a3428c0a4 /obexd | |
parent | 1852ab4e7b4fcb04ca9e10dcae36d84813fd99c0 (diff) |
obexd: Use pending request in UpdateInbox
Diffstat (limited to 'obexd')
-rw-r--r-- | obexd/client/map.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/obexd/client/map.c b/obexd/client/map.c index 290cfee88..8b56143b4 100644 --- a/obexd/client/map.c +++ b/obexd/client/map.c @@ -1559,21 +1559,21 @@ static void update_inbox_cb(struct obc_session *session, struct obc_transfer *transfer, GError *err, void *user_data) { - struct map_data *map = user_data; + struct pending_request *request = user_data; DBusMessage *reply; if (err != NULL) { - reply = g_dbus_create_error(map->msg, + reply = g_dbus_create_error(request->msg, ERROR_INTERFACE ".Failed", "%s", err->message); goto done; } - reply = dbus_message_new_method_return(map->msg); + reply = dbus_message_new_method_return(request->msg); done: g_dbus_send_message(conn, reply); - dbus_message_unref(map->msg); + pending_request_free(request); } static DBusMessage *map_update_inbox(DBusConnection *connection, @@ -1584,6 +1584,7 @@ static DBusMessage *map_update_inbox(DBusConnection *connection, char contents[2]; struct obc_transfer *transfer; GError *err = NULL; + struct pending_request *request; contents[0] = FILLER_BYTE; contents[1] = '\0'; @@ -1594,11 +1595,13 @@ static DBusMessage *map_update_inbox(DBusConnection *connection, if (transfer == NULL) goto fail; + request = pending_request_new(map, message); + if (!obc_session_queue(map->session, transfer, update_inbox_cb, - map, &err)) + request, &err)) { + pending_request_free(request); goto fail; - - map->msg = dbus_message_ref(message); + } return NULL; |