diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-03-21 22:50:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-03-21 22:53:29 +0100 |
commit | e3017af97310da024ffb378ed155bc1676922ce7 (patch) | |
tree | a09b0a555b89f7ec00d0ab62294770db99c5642a /src/libsystemd-bus/bus-message.c | |
parent | 43b4c9aaf56aefdc55c4b6c1df78e30cdcf3988f (diff) |
bus: implement full method call timeout logic
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index ec2dd07dba..c0a0242fd6 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -403,6 +403,8 @@ static int message_new_reply( if (!call) return -EINVAL; + if (!call->sealed) + return -EPERM; if (call->header->type != SD_BUS_MESSAGE_TYPE_METHOD_CALL) return -EINVAL; if (!m) @@ -2441,14 +2443,17 @@ static void setup_iovec(sd_bus_message *m) { assert(m->sealed); m->n_iovec = 0; + m->size = 0; m->iovec[m->n_iovec].iov_base = m->header; m->iovec[m->n_iovec].iov_len = sizeof(*m->header); + m->size += m->iovec[m->n_iovec].iov_len; m->n_iovec++; if (m->fields) { m->iovec[m->n_iovec].iov_base = m->fields; m->iovec[m->n_iovec].iov_len = m->header->fields_size; + m->size += m->iovec[m->n_iovec].iov_len; m->n_iovec++; if (m->header->fields_size % 8 != 0) { @@ -2456,6 +2461,7 @@ static void setup_iovec(sd_bus_message *m) { m->iovec[m->n_iovec].iov_base = (void*) padding; m->iovec[m->n_iovec].iov_len = 8 - m->header->fields_size % 8; + m->size += m->iovec[m->n_iovec].iov_len; m->n_iovec++; } } @@ -2463,6 +2469,7 @@ static void setup_iovec(sd_bus_message *m) { if (m->body) { m->iovec[m->n_iovec].iov_base = m->body; m->iovec[m->n_iovec].iov_len = m->header->body_size; + m->size += m->iovec[m->n_iovec].iov_len; m->n_iovec++; } } |