how to get the DBusConnection for dbus_connection_dispatch from a DBusWatch of a DBusServer ?

Alexander Neundorf neundorf at eit.uni-kl.de
Wed Jul 8 02:59:50 PDT 2009


On Wednesday 01 July 2009 15:13:40 Havoc Pennington wrote:
> Hi,
>
> On Wed, Jul 1, 2009 at 3:34 AM, Alexander
>
> Neundorf<neundorf at eit.uni-kl.de> wrote:
> > 16721: DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND
> >
> > So the server receives something.
> >
> > Am I right that here something is going wrong ?
> > If so, what do I have to do in the server to make it work ?
>
> Server has bytes to send in order to complete authentication. Calling
> dbus_connection_dispatch() would probably get it to do this.
>
> It looks like there could be a bug that
> _dbus_transport_get_dispatch_status returns DBUS_DISPATCH_COMPLETE
> when auth state could be BYTES_TO_SEND. I'm not sure without digging
> into it deeper.
>
> In any case you need to figure out why auth is not completing.

Ok. 
The server receives "AUTH EXTERNAL 31303030", handles it and creates a reply 
in auth->outgoing: "OK 8b022ce4308edc1f633fe96a4a5468b9".
But this reply is never sent, so the client waits forever.
It is not written, because do_authentication() is called with do_writing = 0.
This is because do_authentication() is called only in the 

if (watch == socket_transport->read_watch && (flags & DBUS_WATCH_READABLE))

branch but not in the 

if (watch == socket_transport->write_watch && (flags & DBUS_WATCH_WRITABLE))

branch of socket_handle_watch().
It seems I'm doing something wrong with the watches...
In the watchAdded callback I store the watch and use its file descriptor in 
poll(), then call dbus_connection_get_dispatch_status() and 
dbus_connection_dispatch() on the connection.

Any idea ?
Am I missing something ?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.log.gz
Type: application/x-gzip
Size: 1805 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20090708/07b51ba1/attachment.bin 


More information about the dbus mailing list