From b29147c00079b72cb386ea3c388f9c0d9e5540a2 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 31 Oct 2008 08:45:35 +0200 Subject: [PATCH] obexd: 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. --- obexd/gwobex/obex-priv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obexd/gwobex/obex-priv.c b/obexd/gwobex/obex-priv.c index 8a4e22e07..a08599fe3 100644 --- a/obexd/gwobex/obex-priv.c +++ b/obexd/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; } -- 2.47.3