summaryrefslogtreecommitdiff
path: root/client/session.c
diff options
context:
space:
mode:
authorMikel Astiz <mikel.astiz@bmw-carit.de>2012-02-28 13:56:22 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-29 13:53:36 -0600
commitc07ddfbd019d3545cce2d7ec694143cdc55a2167 (patch)
treec171cb0a715a0281400433122b63c29f683f5055 /client/session.c
parent1125f7a6d26211d766a5574b490f39b6f185cf59 (diff)
downloadobexd-c07ddfbd019d3545cce2d7ec694143cdc55a2167.tar.gz
client: free active transfer on session shutdown
The currently active request should be canceled just like any other queued transfer. Otherwise obex timeout is reported.
Diffstat (limited to 'client/session.c')
-rw-r--r--client/session.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/session.c b/client/session.c
index c4645fb..42eba10 100644
--- a/client/session.c
+++ b/client/session.c
@@ -496,6 +496,14 @@ void obc_session_shutdown(struct obc_session *session)
err = g_error_new(OBEX_IO_ERROR, OBEX_IO_DISCONNECTED,
"Session closed by user");
+ if (session->p != NULL) {
+ if (session->p->func)
+ session->p->func(session, err, session->p->data);
+
+ pending_request_free(session->p);
+ session->p = NULL;
+ }
+
while ((p = g_queue_pop_head(session->queue))) {
if (p->func)
p->func(session, err, p->data);