[patch] Fix refcounting and locking in dbus-connection

Havoc Pennington hp at redhat.com
Tue Sep 5 16:44:26 PDT 2006


John (J5) Palmieri wrote:
> Yes.  They are both handled.  Basically shared means I am shared by
> connection_open and am in the shared_connections hash.  In the case of a
> bus connection we take another ref so the connection doesn't go away
> until the bus is done with it also.

But what happens if the bus.c connection is not shared in the 
connection.c sense? There is no reason it has to be, since connection.c 
only shares connections if they have the special "guid" property.

The solution might be to change things so the guid property is required, 
and address parsing fails if it's missing - but I don't remember why the 
guid is optional or what might break.

Another solution is to create a guid on the fly if the guid is missing, 
so the connection is "shared" but never actually returned twice from 
dbus_connection_open().

I have some faint memory I may have planned to have connections return 
their guid during authentication if it wasn't in the address, but I 
don't know why we wouldn't just require it in the address.

As an aside, the guid is way too long; for mugshot we made it a lot 
shorter using "base53" encoding instead of hex encoding ;-) also 128 
bits is probably huge overkill.

Havoc


More information about the dbus mailing list