[Telepathy] Review: telepathy-spec-stream

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Jun 4 03:49:04 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 04 Jun 2007 at 10:05:40 +0200, Guillaume Desmottes wrote:
> Le vendredi 01 juin 2007 à 17:31 +0100, Simon McVittie a écrit :
> >   * we still haven't reached a conclusion about the type of the "socket"
> >     parameter? I think it should be 'ay' rather than 's'; ditto for
> >     GetStreamUnixSocketAddress
> 
> I'm OK to change but then maybe some words in the spec about why we use
> this type instead of a simple string could be useful.
> Actually, I'm still not sure to under the real reason of this. It's
> about abstract sockets who can have NULL in their path or something?

Two reasons:

- - Abstract sockets on Linux start with a null byte, then "The  socket’s
  address  in  this namespace  is  given  by  the rest of the bytes in
  sun_path. Note that names in the abstract namespace are not
  zero-terminated." (quoting from unix(7)). From reading D-Bus source
  and unix(7) it appears that the normal format for abstract socket
  addresses is a null byte, followed by up to UNIX_PATH_MAX-1 characters of a
  path-like string, followed by >=0 null bytes to make it up to
  UNIX_PATH_MAX characters. In particular, abstract socket addresses
  may, but need not, have trailing NULs, and it appears that embedded
  NULs are allowed too.

- - Non-abstract sockets are identified by arbitrary Unix paths. A Unix
  path is defined as a byte-string, which need not be in any particular
  character set, or even in a consistent character set - "/tmp/\xff\x99" is a
  valid Unix path. D-Bus strings, on the other hand, are defined to be
  sequences of nonzero Unicode characters, encoded in UTF-8. I don't
  feel like defining a mapping from one to the other if we could just be
  using a byte-array and avoiding the issue completely.

Regards,
	Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFGY+4gWSc8zVUw7HYRAjDEAKCD8WAJCoXJLkgHykHglRshyxjaTwCfcCmb
xCIeTguNSEXs2t7rIJ3xRQ8=
=NUyJ
-----END PGP SIGNATURE-----


More information about the Telepathy mailing list