[patch] demarshalling messages

Dafydd Harries daf at rhydd.org
Wed Mar 28 07:39:21 PDT 2007


Ar 26/03/2007 am 21:07, ysgrifennodd Havoc Pennington:
> Dafydd Harries wrote:
> >+  _dbus_string_append_len (&tmp,
> >+      _dbus_string_get_data (&(msg->body)),
> >+      _dbus_string_get_length (&(msg->body)));
> 
> I think there's a little more too this, I don't have the code at hand 
> but iirc there is some trick with the header padding - there may be a 
> _dbus_message_get_stuff_to_send_over_the_wire kind of method that 
> handles this? I'm not sure. Just a vague memory, I can look later if you 
> don't see anything in the code just before the _dbus_write that writes 
> out the message.

Are you maybe thinking of correct_header_padding? That seems to be called
whenever the header is modified, though.

New patch attached:

 - naming: I've gone for marshal/demarshal
 - indentation should be more standard
 - moved lengths after buffers in parameters
 - added error parameter to dbus_message_demarshal
 - added _dbus_return_val_if_fail checks
 - used _dbus_string_copy/_dbus_string_steal_data for copying marshalled
   buffers
 - fix missed OOM cases
 - marginally expanded documentation

-- 
Dafydd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libdbus-marshal.diff
Type: text/x-diff
Size: 4253 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070328/0631630e/libdbus-marshal.bin


More information about the dbus mailing list