sd_bus_message_read_array returns error -74

Naseer Kalyandrug naseer.in at gmail.com
Fri Nov 5 14:04:34 UTC 2021


Hello Lennat , thanks for your email.

I did try readin the message type with sd_bus_message_peek_type and it
retired read message type =a hence it confirms that there an array of bytes
sitting there to be read

below is the snippet

  char *borrowed=NULL;
   size_t datasize=0;
   dbrc=sd_bus_message_read_array(m,SD_BUS_TYPE_BYTE,(const void
**)&borrowed,&datasize);



in your earlier reply i did not get you message " Note that
sd_bus_message_read_array() should be called *without*
entering the array container first."
appreciate if you could eloborate on this

On Fri, Nov 5, 2021 at 7:58 AM Lennart Poettering <mzqohf at 0pointer.de>
wrote:

> On Do, 04.11.21 22:04, Naseer Kalyandrug (naseer.in at gmail.com) wrote:
>
> > Hello
> >
> > I am trying to read array of bytes in using the sd_bus_message_read_array
> > by type 'y' , the sender also has the same format which send the array of
> > bytes as 'y'
> >
> > However i see the read_array is failing with erro no -74
> >
> > Can you please some help me in understanding the error and further
> triage .
>
> EBADMSG usually means that your message doesn't actually contain at
> the current read index what you try to read. You can use
> sd_bus_message_peek_type() to query what type should be read next.
>
> Note that sd_bus_message_read_array() should be called *without*
> entering the array container first.
>
> Lennart
>
> --
> Lennart Poettering, Berlin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20211105/ef703c61/attachment.htm>


More information about the dbus mailing list