]> git.ipfire.org Git - thirdparty/systemd.git/commit
varlink: rework varlink_collect()
authorLennart Poettering <lennart@poettering.net>
Thu, 8 Feb 2024 10:34:49 +0000 (11:34 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 12 Feb 2024 11:04:18 +0000 (12:04 +0100)
commit9bca9891834e0e71484e2e1b38ac59b3ce257043
treef3a1ee1e9c8932f33fefdcc7248a44ebbd5176f9
parent72226a2f95aefb9b97baebb68fbac62844eb1575
varlink: rework varlink_collect()

This reworks varlink_collect() so that it is not just a wrapper around
varlink_observe(), varlink_bind_reply() and others. It becomes a first
class operation.

This has various benefits:

1. Memory management is normalized: the reply json variant is now
   tracked as part of the varlink object, and thus we do not pass
   ownership to the caller. This is just like we do it for simple method
   calls and removes a lot of confusion.
2. The bind reply/user data pointer can be used for user stuff, we'll
   not silently override this.
3. We enforce an overall time-out operation on the whole thing, so that
   this synchronous operation does no longer block forever.
src/shared/varlink.c
src/shared/varlink.h
src/test/test-varlink.c