summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-10-31 08:45:35 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-10-31 08:45:35 +0200
commitfb3586f04163444e71f75d9a843793de49b15e9d (patch)
tree992485661b1c4302748a582958e1250e558e21e3
parent69af00a3b4be37a4ca9f6cffd3fc9d26eac14bb9 (diff)
downloadobexd-fb3586f04163444e71f75d9a843793de49b15e9d.tar.gz
Improve the dc_cb/xfer callback workaround
It's in anycase not safe to call these two callbacks at the same time here, but in case some code does use the dc_cb for calling gw_obex_close (which is quite a rational thing to do in this case) give it a chance to work.
-rw-r--r--gwobex/obex-priv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gwobex/obex-priv.c b/gwobex/obex-priv.c
index 8a4e22e..a08599f 100644
--- a/gwobex/obex-priv.c
+++ b/gwobex/obex-priv.c
@@ -637,10 +637,10 @@ gboolean gw_obex_cb(GIOChannel *chan, GIOCondition cond, gpointer data) {
debug("gw_obex_cb: error or connection closed\n");
obex_link_error(ctx);
GW_OBEX_UNLOCK(ctx);
- if (ctx->dc_cb)
- ctx->dc_cb(ctx, ctx->dc_data);
if (ctx->xfer && ctx->xfer->cb)
ctx->xfer->cb(ctx->xfer, ctx->xfer->cb_data);
+ else if (ctx->dc_cb)
+ ctx->dc_cb(ctx, ctx->dc_data);
return FALSE;
}