From 40d78525064e6d725a1050dea641c80640edee5d Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 5 Apr 2007 20:00:31 +0000 Subject: network: cancel pending auth if an error happens in the BNEP GIOChannel --- network/server.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/network/server.c b/network/server.c index f61d586c..2a3961ca 100644 --- a/network/server.c +++ b/network/server.c @@ -277,9 +277,14 @@ static int send_bnep_ctrl_rsp(GIOChannel *chan, uint16_t response) static void cancel_authorization(struct network_server *ns) { DBusMessage *msg; - const char *paddress = ns->pauth->addr; + const char *paddress; const char *uuid = ""; + if (!ns->pauth) + return; + + paddress = ns->pauth->addr; + msg = dbus_message_new_method_call("org.bluez", "/org/bluez", "org.bluez.Database", "CancelAuthorizationRequest"); @@ -406,7 +411,7 @@ static gboolean connect_setup_event(GIOChannel *chan, if (cond & (G_IO_ERR | G_IO_HUP)) { error("Hangup or error on BNEP socket"); - /* FIXME: Cancel the pending authorization if applied */ + cancel_authorization(ns); return FALSE; } -- cgit