* [PATCH] Fix process pending request if transfer canceled
@ 2010-10-18 8:36 Daniel Örstadius
2010-10-18 13:28 ` Luiz Augusto von Dentz
2010-10-18 14:24 ` Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Örstadius @ 2010-10-18 8:36 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Hi,
Please review.
/Daniel
[-- Attachment #2: 0001-Fix-process-pending-request-if-transfer-canceled.patch --]
[-- Type: text/x-patch, Size: 1590 bytes --]
From 7a0bd706951aebf7d66bd63f14d65e5799c9ea69 Mon Sep 17 00:00:00 2001
From: Daniel Orstadius <daniel.orstadius@nokia.com>
Date: Mon, 18 Oct 2010 11:16:40 +0300
Subject: [PATCH] Fix process pending request if transfer canceled
If the call to the Request method of the obex client agent returns
with an error (for example if the transfer is rejected), call
function session_terminate_transfer instead of unregister_transfer
to both unregister the transfer and handle the pending request.
---
client/session.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/client/session.c b/client/session.c
index ce3432d..0e635e7 100644
--- a/client/session.c
+++ b/client/session.c
@@ -89,6 +89,9 @@ struct agent_data {
static void session_prepare_put(struct session_data *session, GError *err,
void *data);
+static void session_terminate_transfer(struct session_data *session,
+ struct transfer_data *transfer,
+ GError *gerr);
static GQuark obex_io_error_quark(void)
{
@@ -803,11 +806,17 @@ static void session_request_reply(DBusPendingCall *call, gpointer user_data)
dbus_error_init(&derr);
if (dbus_set_error_from_message(&derr, reply)) {
+ GError *gerr = NULL;
+
error("Replied with an error: %s, %s",
derr.name, derr.message);
dbus_error_free(&derr);
dbus_message_unref(reply);
- transfer_unregister(pending->transfer);
+
+ g_set_error(&gerr, OBEX_IO_ERROR, -ECANCELED, "%s", derr.message);
+ session_terminate_transfer(session, pending->transfer, gerr);
+ g_clear_error(&gerr);
+
return;
}
--
1.6.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Fix process pending request if transfer canceled
2010-10-18 8:36 [PATCH] Fix process pending request if transfer canceled Daniel Örstadius
@ 2010-10-18 13:28 ` Luiz Augusto von Dentz
2010-10-18 14:24 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2010-10-18 13:28 UTC (permalink / raw)
To: Daniel Örstadius; +Cc: linux-bluetooth
Hi,
On Mon, Oct 18, 2010 at 11:36 AM, Daniel Örstadius
<daniel.orstadius@gmail.com> wrote:
> Hi,
>
> Please review.
>
> /Daniel
>
Acked-by: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix process pending request if transfer canceled
2010-10-18 8:36 [PATCH] Fix process pending request if transfer canceled Daniel Örstadius
2010-10-18 13:28 ` Luiz Augusto von Dentz
@ 2010-10-18 14:24 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2010-10-18 14:24 UTC (permalink / raw)
To: Daniel Örstadius; +Cc: linux-bluetooth
Hi Daniel,
On Mon, Oct 18, 2010, Daniel Örstadius wrote:
> If the call to the Request method of the obex client agent returns
> with an error (for example if the transfer is rejected), call
> function session_terminate_transfer instead of unregister_transfer
> to both unregister the transfer and handle the pending request.
> ---
> client/session.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
Pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-18 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-18 8:36 [PATCH] Fix process pending request if transfer canceled Daniel Örstadius
2010-10-18 13:28 ` Luiz Augusto von Dentz
2010-10-18 14:24 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox