diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-22 03:41:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-05-20 02:09:03 +0200 |
commit | a0cc21f8bb6752ffe0ee5f4f5b575dc50d6d46ae (patch) | |
tree | 950cbd47691d09ecef51dab996e93163d938a2f1 /dbus/dbus-transport-protected.h | |
parent | ba7daa606cf20ff3b5e992907f380a425feaef01 (diff) |
unix-fd: add message encoding/decoding for unix fds
When appending unix fds to the message a new entry in the fd array will
be allocated and the index to it will be written to the message payload.
When parsing unix fds from the message the index will be read from the
payload and then looked up in the fd array.
When we read fds we put them in a queue first. Since each message knows
how many fds are attached to it we will then pop enough fds from this
queue each time we decode a message from the stream.
This should make sending and receiving more portable since we don't make
any strong requirements on the exact semantics of the SCM_RIGHTS
implementation: as long as fds are recieved in order, none or lost and
the arrive at the same time as at least one byte from the actual message
dat we should be able to handle them correctly.
Diffstat (limited to 'dbus/dbus-transport-protected.h')
-rw-r--r-- | dbus/dbus-transport-protected.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dbus/dbus-transport-protected.h b/dbus/dbus-transport-protected.h index 4d56a72f..023549d0 100644 --- a/dbus/dbus-transport-protected.h +++ b/dbus/dbus-transport-protected.h @@ -23,6 +23,8 @@ #ifndef DBUS_TRANSPORT_PROTECTED_H #define DBUS_TRANSPORT_PROTECTED_H +#include <config.h> + #include <dbus/dbus-internals.h> #include <dbus/dbus-errors.h> #include <dbus/dbus-transport.h> @@ -71,6 +73,10 @@ struct DBusTransportVTable /**< Get socket file descriptor */ }; +/** How many unix file descriptors may be queued up before they are + handed off to messages */ +#define DBUS_MAX_QUEUED_FDS 1024 + /** * Object representing a transport such as a socket. * A transport can shuttle messages from point A to point B, |