[PATCH 02/10] ch_monitor: Update virCHMonitorGet to handle accept a response
Douglas, William
william.douglas at intel.com
Mon Jul 12 22:19:25 UTC 2021
On Mon, 2021-07-12 at 14:05 +0200, Michal Prívozník wrote:
> On 6/30/21 1:05 AM, William Douglas wrote:
>
> > + memcpy(data->content, contents, content_size);
> > + data->content[content_size] = 0;
> > + data->size = content_size;
> > +
> > + return content_size;
>
> .. are we sure that the incoming data is split into small enough
> hunks
> that this function is called just once? I mean, the other
> WRITEFUNCTION
> callbacks we have in our code are aware of this and pick up where the
> previous run dropped.
It should always be within 16K but somebody could have a differently
configured curl regardless. Will fix.
> > + *response = virJSONValueFromString(data.content);
>
> data.content is not eaten by virJSONValueFromString(). You need to
> free
> it explicitly.
Oops, thanks.
More information about the libvir-list
mailing list