HomeClusterLabs Projects

Refactor: libcrmcommon: Use GByteArray for the crm_ipc_s buffer.
55e8baada4aeUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Refactor: libcrmcommon: Use GByteArray for the crm_ipc_s buffer.

This has the built-in advantage of various library functions that can be
used to manipulate it instead of using pointer arithmetic. For the
moment, this isn't important but it will become important later when
we're doing split up IPC messages.

On the other hand, there's a couple other changes here that are not
advantages. First, instead of reading directly into the GByteArray, we
now have to allocate a buffer to read into, and then append that to the
GByteArray. This also means we need to be careful about freeing that
buffer.

Second, because there's no way to clear out a GByteArray and inserting
new bytes directly at the beginning, we just need to allocate and free
it every time we do a read. This also means we need to be more careful
about checking if it's NULL. This will be less of a problem later when
we are reading into the same GByteArray multiple times for a split up
message.

Details

Provenance
clumensAuthored on Thu, Apr 10, 9:51 AM
Parents
rP13a9a87b2453: Merge pull request #3864 from clumens/ipc-no-compression
Branches
Unknown
Tags
Unknown

Event Timeline