summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-14 22:24:26 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-14 22:28:45 +0200
commitbc7fd8cdbef54ebd3902cdd455ecad3e095f7450 (patch)
tree74df33906ba2efeae69c6d77f3b94d17171e55d5 /src/libsystemd-bus/bus-message.h
parenta3dc35472f3a48ea8445ad7a943e2ff253170417 (diff)
bus: properly handle message bodies that are a chain of memory areas rather than a single one
Diffstat (limited to 'src/libsystemd-bus/bus-message.h')
-rw-r--r--src/libsystemd-bus/bus-message.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/libsystemd-bus/bus-message.h b/src/libsystemd-bus/bus-message.h
index 86a41a73b6..1c50c7357a 100644
--- a/src/libsystemd-bus/bus-message.h
+++ b/src/libsystemd-bus/bus-message.h
@@ -50,6 +50,16 @@ struct bus_header {
uint32_t fields_size;
} _packed_;
+struct bus_body_part {
+ void *data;
+ size_t size;
+ size_t mapped;
+ int memfd;
+ bool free_this:1;
+ bool sealed:1;
+ struct bus_body_part *next;
+};
+
struct sd_bus_message {
unsigned n_ref;
@@ -80,19 +90,22 @@ struct sd_bus_message {
bool gid_valid:1;
bool free_header:1;
bool free_fields:1;
- bool free_body:1;
bool free_kdbus:1;
bool free_fds:1;
bool release_kdbus:1;
+ bool poisoned:1;
struct bus_header *header;
void *fields;
- void *body;
- struct kdbus_msg *kdbus;
+ struct bus_body_part body;
+ struct bus_body_part *body_end;
+ unsigned n_body_parts;
char *label;
size_t rindex;
+ struct bus_body_part *cached_rindex_part;
+ size_t cached_rindex_part_begin;
uint32_t n_fds;
int *fds;
@@ -100,9 +113,12 @@ struct sd_bus_message {
struct bus_container root_container, *containers;
unsigned n_containers;
- struct iovec iovec[3];
+ struct iovec *iovec;
+ struct iovec iovec_fixed[3];
unsigned n_iovec;
+ struct kdbus_msg *kdbus;
+
char *peeked_signature;
usec_t timeout;
@@ -199,3 +215,5 @@ int bus_message_append_ap(sd_bus_message *m, const char *types, va_list ap);
int bus_message_parse_fields(sd_bus_message *m);
int bus_header_size(struct bus_header *h, size_t *sum);
+
+struct bus_body_part *message_append_part(sd_bus_message *m);