[patch] demarshalling messages

nf2 nf2 at scheinwelt.at
Thu Mar 29 10:39:13 PDT 2007


Dafydd Harries wrote:
> 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
>
>   
cool! beeing able to use dbus message marshaling independently could be 
very useful for my "vio" project, which also has a custom IPC mechanism 
(no message queues, low overhead for sending raw data...)

norbert



More information about the dbus mailing list