* [PATCH obexd] Make proper use of user_data when using bt_io_listen
@ 2011-06-21 7:00 Luiz Augusto von Dentz
2011-06-21 7:46 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-06-21 7:00 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This changes the user_data from server pointer to service driver pointer
since the former is not really used in the callback but the latter is.
---
plugins/bluetooth.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index 851daa2..fe508f4 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -459,7 +459,7 @@ static int request_service_authorization(struct bluetooth_service *service,
static void confirm_event(GIOChannel *io, void *user_data)
{
- struct bluetooth_service *service;
+ struct bluetooth_service *service = user_data;
GError *err = NULL;
char address[18];
uint8_t channel;
@@ -477,12 +477,6 @@ static void confirm_event(GIOChannel *io, void *user_data)
info("bluetooth: New connection from: %s, channel %u", address,
channel);
- service = find_service(NULL, channel);
- if (service == NULL) {
- error("bluetooth: Unable to find service");
- goto drop;
- }
-
if (service->driver->service != OBEX_OPP) {
if (request_service_authorization(service, io, address) < 0)
goto drop;
@@ -510,7 +504,7 @@ static GIOChannel *start(struct obex_server *server,
GError *err = NULL;
io = bt_io_listen(BT_IO_RFCOMM, NULL, confirm_event,
- server, NULL, &err,
+ service, NULL, &err,
BT_IO_OPT_CHANNEL, service->channel,
BT_IO_OPT_SEC_LEVEL, sec_level,
BT_IO_OPT_INVALID);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH obexd] Make proper use of user_data when using bt_io_listen
2011-06-21 7:00 [PATCH obexd] Make proper use of user_data when using bt_io_listen Luiz Augusto von Dentz
@ 2011-06-21 7:46 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-06-21 7:46 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Tue, Jun 21, 2011, Luiz Augusto von Dentz wrote:
> This changes the user_data from server pointer to service driver pointer
> since the former is not really used in the callback but the latter is.
> ---
> plugins/bluetooth.c | 10 ++--------
> 1 files changed, 2 insertions(+), 8 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-21 7:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 7:00 [PATCH obexd] Make proper use of user_data when using bt_io_listen Luiz Augusto von Dentz
2011-06-21 7:46 ` 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).