[Patch] Moving FD passing into the header
Thiago Macieira
thiago at kde.org
Wed Jun 16 05:11:17 PDT 2010
Em Quarta-feira 16 Junho 2010, às 13:15:52, Christian Dywan escreveu:
> Am Tue, 15 Jun 2010 23:14:32 +0200
>
> schrieb Thiago Macieira <thiago at kde.org>:
> > Em Terça-feira 15. Junho 2010, às 18.18.57, Christian Dywan escreveu:
> > > Hejsan,
> > >
> > > so I changed Unix FD to not be a basic type anymore, and it's not
> > > anymore part of the message arguments. Instead you add and retrieve
> > > them specifically, see
> > >
> > > http://lists.freedesktop.org/archives/dbus/2010-April/012509.html
> > >
> > > The API is this:
> > >
> > > dbus_bool_t dbus_message_append_unix_fd (DBusMessage *message,
> > >
> > > int fd);
> > >
> > > dbus_bool_t dbus_message_contains_unix_fds (DBusMessage
> > > *message); int dbus_message_get_n_unix_fds
> > > (DBusMessage *message); int
> > > dbus_message_get_unix_fd (DBusMessage *message,
> > > int index);
> > >
> > > *Getting* duplicates the handle. It is an error to try to get more
> > > descriptors than exist in the message.
> > >
> > > I adjusted the two test cases accordingly to use the new API.
> >
> > Are they still part of the signature? How do I differentiate two fds
> > from one array of fds?
>
> Hey Thiago,
>
> file descriptor *indices* are no longer part of the signature and you
> can't anymore use dbus_message_append_args, dbus_message_get_args and
> friends on them.
>
> You append one descriptor after the other and you can read them back in
> the order you put them in.
So you what you're saying is that file descriptors aren't arguments to the
callback functions.
I'm not sure I like this approach. Transmarshalling will become just a lot
more complex.
I prefer Lennart's approach.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20100616/99cf595f/attachment.pgp>
More information about the dbus
mailing list