Padding at the end of message body?

marcin at saepia.net marcin at saepia.net
Mon May 30 17:14:31 UTC 2016


Hello,

I am writing Elixir client for D-Bus (https://github.com/mspanc/dbux).

I am capturing real messages generated by DBus implementation from GLib/GIO
to have point of origin, and I have encountered unspecified behaviour.

The message sometimes contains a bunch of null bytes after the body, please
take a look at the dump of the packet containing a method call to
RequestName, it ends with 7 extra null bytes.

The specification says "The message body need not end on an 8-byte
boundary." but "need not" does not equal "must not".

Can I safely assume that then such null bytes are allowed and drop them?


0000   6c 01 00 01 1c 00 00 00 02 00 00 00 7d 00 00 00  l...........}...
0010   08 01 67 00 02 73 75 00 01 01 6f 00 15 00 00 00  ..g..su...o.....
0020   2f 6f 72 67 2f 66 72 65 65 64 65 73 6b 74 6f 70  /org/freedesktop
0030   2f 44 42 75 73 00 00 00 03 01 73 00 0b 00 00 00  /DBus.....s.....
0040   52 65 71 75 65 73 74 4e 61 6d 65 00 00 00 00 00  RequestName.....
0050   02 01 73 00 14 00 00 00 6f 72 67 2e 66 72 65 65  ..s.....org.free
0060   64 65 73 6b 74 6f 70 2e 44 42 75 73 00 00 00 00  desktop.DBus....
0070   06 01 73 00 14 00 00 00 6f 72 67 2e 66 72 65 65  ..s.....org.free
0080   64 65 73 6b 74 6f 70 2e 44 42 75 73 00 00 00 00  desktop.DBus....
0090   10 00 00 00 63 6f 6d 2e 65 78 61 6d 70 6c 65 2e  ....com.example.
00a0   64 62 75 78 00 00 00 00 00 00 00 00              dbux........

Thanks,

Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20160530/d795a167/attachment.html>


More information about the dbus mailing list