diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-11-25 14:15:08 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-11-25 14:15:08 +0000 |
commit | 7ae80340d621d6add95f6c7d9e5e7a0e921f0b42 (patch) | |
tree | fdf6c4edee23a85248dc448c347d7056a0bebfff /src/libskabus/skabus_rpc_reply.c | |
parent | 38c9492b4fb971fe08e4ac0167e06e5dccb3eb2e (diff) | |
download | skabus-7ae80340d621d6add95f6c7d9e5e7a0e921f0b42.tar.xz |
Finish skabus_rpc doc, add missing functions
Diffstat (limited to 'src/libskabus/skabus_rpc_reply.c')
-rw-r--r-- | src/libskabus/skabus_rpc_reply.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/libskabus/skabus_rpc_reply.c b/src/libskabus/skabus_rpc_reply.c index 491772b..c1b72b2 100644 --- a/src/libskabus/skabus_rpc_reply.c +++ b/src/libskabus/skabus_rpc_reply.c @@ -1,17 +1,10 @@ /* ISC license. */ -#include <sys/uio.h> -#include <skalibs/uint64.h> -#include <skalibs/unixmessage.h> #include <skalibs/skaclient.h> #include <skabus/rpc.h> -int skabus_rpc_reply_withfds (skabus_rpc_t *a, uint64_t serial, char result, char const *s, size_t len, int const *fds, unsigned int nfds, unsigned char const *bits) +int skabus_rpc_reply_withfds (skabus_rpc_t *a, uint64_t serial, char result, char const *s, size_t len, int const *fds, unsigned int nfds, unsigned char const *bits, tain_t const *deadline, tain_t *stamp) { - char pack[10] = "R" ; - struct iovec v[2] = { { .iov_base = pack, .iov_len = 10 }, { .iov_base = (char *)s, .iov_len = len } } ; - unixmessage_v_t m = { .v = v, .vlen = 2, .fds = (int *)fds, .nfds = nfds } ; - uint64_pack_big(pack+1, serial) ; - pack[9] = result ; - return skaclient_aputv_and_close(&a->connection, &m, bits) ; + return skabus_rpc_reply_withfds_async(a, serial, result, s, len, fds, nfds, bits) + && skaclient_timed_aflush(&a->connection, deadline, stamp) ; } |