diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-05 20:00:31 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-05 20:00:31 +0000 | 
| commit | 40d78525064e6d725a1050dea641c80640edee5d (patch) | |
| tree | e9c6d43b64ce082d4d849390c8decc2d32baa631 | |
| parent | eac4f4085dcfbad3344109f76bce6ab2656a6b50 (diff) | |
network: cancel pending auth if an error happens in the BNEP GIOChannel
| -rw-r--r-- | network/server.c | 9 | 
1 files 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;  	} | 
