diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 851daa2..fe508f4 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
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;
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;
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);