2015-01-30 11:07:12

by Bharat Bhusan Panda

[permalink] [raw]
Subject: [PATCH ] obexd/client: clear pending transfers if fails

In case of obex transfer fails, clear all pending
transfers in the session.
---
obexd/client/session.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/obexd/client/session.c b/obexd/client/session.c
index d2ae4fd..512d6b7 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -901,8 +901,12 @@ static void session_terminate_transfer(struct obc_session *session,

pending_request_free(p);

- if (session->p == NULL)
- session_process_queue(session);
+ if (session->p == NULL) {
+ if (gerr != NULL)
+ obc_session_shutdown(session);
+ else
+ session_process_queue(session);
+ }

obc_session_unref(session);
}
--
1.9.1



2015-01-30 11:16:53

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH ] obexd/client: clear pending transfers if fails

Hi,

On Fri, Jan 30, 2015 at 1:07 PM, Bharat Panda <[email protected]> wrote:
> In case of obex transfer fails, clear all pending
> transfers in the session.
> ---
> obexd/client/session.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/obexd/client/session.c b/obexd/client/session.c
> index d2ae4fd..512d6b7 100644
> --- a/obexd/client/session.c
> +++ b/obexd/client/session.c
> @@ -901,8 +901,12 @@ static void session_terminate_transfer(struct obc_session *session,
>
> pending_request_free(p);
>
> - if (session->p == NULL)
> - session_process_queue(session);
> + if (session->p == NULL) {
> + if (gerr != NULL)
> + obc_session_shutdown(session);
> + else
> + session_process_queue(session);

Would that also work for transfer cancelled? Im afraid some errors are
not really critical that we should cancel the whole queue.



--
Luiz Augusto von Dentz