HomeClusterLabs Projects

Refactor: libcrmcommon: Use GByteArray for the crm_ipc_s buffer.
e80246c55155Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.
This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or 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
rPca32585acecf: Refactor: libcrmcommon: Remove max_buf_size from crm_ipc_s.
Branches
Unknown
Tags
Unknown

Event Timeline