Skip to contentSkip to conversation

Always use "nice abort" in osso-gwobex

PATCH In review Bastien Nocera 2 participants 3 messages Feb 18, 2010 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Always use "nice abort" in osso-gwobex

Heya,

As discussed on IRC, we should always use the "nice abort" of openobex, rather than disconnecting from device when cancelling transfers.

The other patch fixes a little typo.

Cheers

Quoted 1 line

From c1b889e33fc4a40f3164ce4616d59adca149b81e Mon Sep 17 00:00:00 2001

From: Bastien Nocera <[email protected]>
Date: Thu, 18 Feb 2010 01:05:25 +0000
Subject: [PATCH 1/2] Fix typo in "incomming"

---
 src/obex-priv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/obex-priv.c +1 -1
index a8b12ea..f99740a 100644
@@ -371,7 +371,7 @@ static void obex_readstream(GwObex *ctx, obex_object_t *object) {
     int actual;
 
     if (!xfer) {
-        debug("Incomming data even though no xfer active!\n");
+        debug("Incoming data even though no xfer active!\n");
         /* Flush incomming stream */
         actual = OBEX_ObjectReadStream(ctx->handle, object, &buf);
         if (actual > 0)
Signature · 1 line
1.6.6.1
Quoted 1 line

From 62e697f0cf06dcf22899188e08ef7ebfcf349fc7 Mon Sep 17 00:00:00 2001

From: Bastien Nocera <[email protected]>
Date: Thu, 18 Feb 2010 01:05:37 +0000
Subject: [PATCH 2/2] Always use "nice abort"

So we don't disconnect when cancelling a request.

---
 configure.ac    |    1 -
 src/obex-xfer.c |    8 --------
 2 files changed, 0 insertions(+), 9 deletions(-)
configure.ac +0 -1
index 7688054..f0dcd53 100644
@@ -38,7 +38,6 @@ AC_SUBST(LDFLAGS)
 
 AC_ARG_ENABLE(docs,      [  --enable-docs        build DOXYGEN documentation (requires Doxygen)],enable_docs=$enableval,enable_docs=auto)
 AC_ARG_ENABLE(tracing,   [  --enable-tracing     Enable debuging information],enable_tracing=$enableval,enable_tracing=no)
-AC_ARG_ENABLE(niceabort, [  --enable-niceabort   Enable proper abort],enable_niceabort=$enableval,enable_niceabort=no)
 AC_ARG_ENABLE(localtime, [  --enable-localtime   Send time as local instead of UTC],enable_localtime=$enableval,enable_localtime=no)
 AC_ARG_ENABLE(coverage,  [  --enable-coverage    Enable coverage], enable_coverage=$enableval, enable_coverage=no)
 
src/obex-xfer.c +0 -8
index 38a2f4f..81ac5dc 100644
@@ -98,18 +98,10 @@ gboolean gw_obex_xfer_do_abort(struct gw_obex_xfer *xfer) {
 
     xfer->abort = TRUE;
 
-#ifdef USE_NICE_ABORT
     debug("Performing nice abort\n");
     if (OBEX_CancelRequest(xfer->ctx->handle, TRUE) != 0)
         return FALSE;
     return TRUE;
-#else
-    debug("Performing abort through disconnection (without ABORT command)\n");
-    xfer->ctx->done = TRUE;
-    OBEX_CancelRequest(xfer->ctx->handle, FALSE);
-    obex_link_error(xfer->ctx);
-    return FALSE;
-#endif
 }
 
 GwObexXfer *gw_obex_put_async(GwObex *ctx, const char *name, const char *type,
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 4 lines · Bastien Nocera

Heya,

As discussed on IRC, we should always use the "nice abort" of openobex, rather than disconnecting from device when cancelling transfers.

Updated patch for that, forgot to remove some bits in configure.ac

Cheers

Quoted 1 line

From 4812cec279691aa057540abad443d2ccf9aff6ea Mon Sep 17 00:00:00 2001

From: Bastien Nocera <[email protected]>
Date: Thu, 18 Feb 2010 01:05:37 +0000
Subject: [PATCH 2/2] Always use "nice abort"

So we don't disconnect when cancelling a request.

---
 configure.ac    |    5 -----
 src/obex-xfer.c |    8 --------
 2 files changed, 0 insertions(+), 13 deletions(-)
configure.ac +0 -5
index 9d2c19f..a915ec7 100644
@@ -38,7 +38,6 @@ AC_SUBST(LDFLAGS)
 
 AC_ARG_ENABLE(docs,      [  --enable-docs        build DOXYGEN documentation (requires Doxygen)],enable_docs=$enableval,enable_docs=auto)
 AC_ARG_ENABLE(tracing,   [  --enable-tracing     Enable debuging information],enable_tracing=$enableval,enable_tracing=no)
-AC_ARG_ENABLE(niceabort, [  --enable-niceabort   Enable proper abort],enable_niceabort=$enableval,enable_niceabort=no)
 AC_ARG_ENABLE(localtime, [  --enable-localtime   Send time as local instead of UTC],enable_localtime=$enableval,enable_localtime=no)
 AC_ARG_ENABLE(coverage,  [  --enable-coverage    Enable coverage], enable_coverage=$enableval, enable_coverage=no)
 
@@ -98,10 +97,6 @@ else
     AC_MSG_RESULT(no)
 fi
 
-if (test x$enable_niceabort = xyes); then
-        AC_DEFINE(USE_NICE_ABORT, 1, [Enable nice abort support.])
-fi
-
 if (test x$enable_localtime = xyes); then
         AC_DEFINE(USE_LOCALTIME, 1, [Send time as local instead of UTC.])
 fi
src/obex-xfer.c +0 -8
index 38a2f4f..81ac5dc 100644
@@ -98,18 +98,10 @@ gboolean gw_obex_xfer_do_abort(struct gw_obex_xfer *xfer) {
 
     xfer->abort = TRUE;
 
-#ifdef USE_NICE_ABORT
     debug("Performing nice abort\n");
     if (OBEX_CancelRequest(xfer->ctx->handle, TRUE) != 0)
         return FALSE;
     return TRUE;
-#else
-    debug("Performing abort through disconnection (without ABORT command)\n");
-    xfer->ctx->done = TRUE;
-    OBEX_CancelRequest(xfer->ctx->handle, FALSE);
-    obex_link_error(xfer->ctx);
-    return FALSE;
-#endif
 }
 
 GwObexXfer *gw_obex_put_async(GwObex *ctx, const char *name, const char *type,
Signature · 1 line
1.6.6.1
#2 lore raw

Hi Bastien,

Quoted 7 lines · Bastien Nocera
Quoted 4 lines · Bastien Nocera

Heya,

As discussed on IRC, we should always use the "nice abort" of openobex, rather than disconnecting from device when cancelling transfers.

Updated patch for that, forgot to remove some bits in configure.ac

Both patches have been pushed upstream. Thanks.

Johan