logo       

RE: Rfcomm Use Count: msg#00079

linux.bluez.devel

Subject: RE: Rfcomm Use Count

Hi Marcel,

> > The L2CAP solution looks very sane to me, but I am not sure
> about the
> > RFCOMM part and we may will have a locking problem. This
> really needs
> > intensive testing.
>
> Excellent. Thank you very much.
>
> I'll let you know how it works for me.

Looks like the rfcomm part isn't quite there. The accept queue doesn't fill
up, but the use count still increases. And /proc/bluetooth/rfcomm still
lists all of the closed sockets.

I added rfcomm_sock_close() and rfcomm_sock_kill() right after your addition
to rfcomm_sk_state_change() and it seems to work. The affects of
rfcomm_sock_alloc() (called by ...connect_ind()) needed to be dealt with. I
changed it as follows:

--- mh_sock.c 2004-09-21 14:21:36.000000000 -0700
+++ sock.c 2004-09-21 14:21:47.000000000 -0700
@@ -104,8 +104,11 @@
rfcomm_session_getaddr(d->session,
&bluez_pi(sk)->src, NULL);
sk->state_change(sk);
} else {
- if (d->state == BT_CLOSED)
+ if (d->state == BT_CLOSED) {
bluez_accept_unlink(sk);
+ rfcomm_sock_close(sk);
+ rfcomm_sock_kill(sk);
+ }
parent->data_ready(parent, 0);
}

I am not sure about the possible negative side effects of this. What do you
think?

-Daryl.



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise