* [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register
@ 2012-06-07 8:31 Luiz Augusto von Dentz
2012-06-07 8:31 ` [PATCH obexd 2/2] client: Use session path as prefix for transfer path Luiz Augusto von Dentz
2012-06-07 15:33 ` [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-06-07 8:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Make use of the connection parameter instead of assuming the connection
will always be to the session bus.
---
client/transfer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/transfer.c b/client/transfer.c
index 000a510..be61f40 100644
--- a/client/transfer.c
+++ b/client/transfer.c
@@ -309,7 +309,7 @@ gboolean obc_transfer_register(struct obc_transfer *transfer,
transfer->path = g_strdup_printf("%s/transfer%ju",
TRANSFER_BASEPATH, counter++);
- transfer->conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
+ transfer->conn = dbus_connection_ref(conn);
if (transfer->conn == NULL) {
g_set_error(err, OBC_TRANSFER_ERROR, -EFAULT,
"Unable to connect to D-Bus");
--
1.7.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH obexd 2/2] client: Use session path as prefix for transfer path
2012-06-07 8:31 [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register Luiz Augusto von Dentz
@ 2012-06-07 8:31 ` Luiz Augusto von Dentz
2012-06-07 15:33 ` [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-06-07 8:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This should make it easier to identify to which session the transfer
belongs.
---
client/session.c | 4 ++--
client/transfer.c | 5 ++---
client/transfer.h | 1 +
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/client/session.c b/client/session.c
index 7014396..7f88a6a 100644
--- a/client/session.c
+++ b/client/session.c
@@ -656,8 +656,8 @@ guint obc_session_queue(struct obc_session *session,
return 0;
}
- if (!obc_transfer_register(transfer, session->conn, session->owner,
- err)) {
+ if (!obc_transfer_register(transfer, session->conn, session->path,
+ session->owner, err)) {
obc_transfer_unregister(transfer);
return 0;
}
diff --git a/client/transfer.c b/client/transfer.c
index be61f40..1e7cb46 100644
--- a/client/transfer.c
+++ b/client/transfer.c
@@ -44,7 +44,6 @@
#include "transfer.h"
#define TRANSFER_INTERFACE "org.bluez.obex.Transfer"
-#define TRANSFER_BASEPATH "/org/bluez/obex"
#define OBC_TRANSFER_ERROR obc_transfer_error_quark()
@@ -301,13 +300,13 @@ static struct obc_transfer *obc_transfer_create(guint8 op,
gboolean obc_transfer_register(struct obc_transfer *transfer,
DBusConnection *conn,
+ const char *path,
const char *owner,
GError **err)
{
transfer->owner = g_strdup(owner);
- transfer->path = g_strdup_printf("%s/transfer%ju",
- TRANSFER_BASEPATH, counter++);
+ transfer->path = g_strdup_printf("%s/transfer%ju", path, counter++);
transfer->conn = dbus_connection_ref(conn);
if (transfer->conn == NULL) {
diff --git a/client/transfer.h b/client/transfer.h
index 071b6d3..968903a 100644
--- a/client/transfer.h
+++ b/client/transfer.h
@@ -36,6 +36,7 @@ struct obc_transfer *obc_transfer_put(const char *type, const char *name,
gboolean obc_transfer_register(struct obc_transfer *transfer,
DBusConnection *conn,
+ const char *path,
const char *owner,
GError **err);
--
1.7.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register
2012-06-07 8:31 [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register Luiz Augusto von Dentz
2012-06-07 8:31 ` [PATCH obexd 2/2] client: Use session path as prefix for transfer path Luiz Augusto von Dentz
@ 2012-06-07 15:33 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-06-07 15:33 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Thu, Jun 07, 2012, Luiz Augusto von Dentz wrote:
> Make use of the connection parameter instead of assuming the connection
> will always be to the session bus.
> ---
> client/transfer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Both patches have been applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-07 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-07 8:31 [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register Luiz Augusto von Dentz
2012-06-07 8:31 ` [PATCH obexd 2/2] client: Use session path as prefix for transfer path Luiz Augusto von Dentz
2012-06-07 15:33 ` [PATCH obexd 1/2] client: Fix not using connection passed to obc_transfer_register Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).