qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Schloming <...@alum.mit.edu>
Subject Re: pn_data_put_string question
Date Wed, 18 Feb 2015 13:20:59 GMT
I just pushed a quick update of the docs that will hopefully make this
clear, but pn_data_get_string (and similar) copies the bytes passed to it
into an internal area inside the pn_data_t. The converse,
pn_data_get_string(...) returns a pointer to the internal bytes, so those
need to be copied if you are going to clear or free the pn_data_t.

--Rafael

On Wed, Feb 18, 2015 at 4:35 AM, Michael Ivanov <ivans@logit-ag.de> wrote:

> Greetings!
>
> I need to confirm a point about pn_data_put_string usage. Second argument
> is
> pn_bytes_t which contains pointer to text buffer and actual length of the
> string
> in bytes. When this value is assigned to data node does it mean that the
> ownership
> of the string buffer is transfered to data object? Will pn_data_clear (or
> pn_data_free)
> try to free such buffers? Or is it assumed that the string memory will be
> managed
> outside of pn_data_t?
>
> Best regards,
> --
>  \   / |                                   |
>  (OvO) |  Mikhail Iwanow                   |
>  (^^^) |      Voice:   +7 (911) 223-1300   |
>   \^/  |      E-mail:  ivans@logit-ag.de   |
>   ^ ^  |                                   |
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message