From 9ad7474568a6c9f1fbb12fb8048f2083078a8144 Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Tue, 19 Apr 2022 10:35:24 +0100 Subject: use struct iovec for grouping buffer and length (#658) This make it tidier and easier to pass to function the buffer and length, instead of passing the whole msg. Signed-off-by: Thanos Makatos Reviewed-by: John Levon --- lib/private.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'lib/private.h') diff --git a/lib/private.h b/lib/private.h index 21c6dbd..1d19e6f 100644 --- a/lib/private.h +++ b/lib/private.h @@ -60,10 +60,10 @@ /* * Structure used to hold an in-flight request+reply. * - * Incoming request body and fds are stored in in_*. + * Incoming request body and fds are stored in in.*. * - * Outgoing requests are either stored in out_data, or out_iovecs. In the latter - * case, the iovecs refer to data that should not be freed. + * Outgoing requests are either stored in out.iov.iov_base, or out_iovecs. In + * the latter case, the iovecs refer to data that should not be freed. */ typedef struct { /* in/out */ @@ -71,17 +71,11 @@ typedef struct { bool processed_cmd; - int *in_fds; - size_t nr_in_fds; - - void *in_data; - size_t in_size; - - int *out_fds; - size_t nr_out_fds; - - void *out_data; - size_t out_size; + struct { + int *fds; + size_t nr_fds; + struct iovec iov; + } in, out; struct iovec *out_iovecs; size_t nr_out_iovecs; -- cgit v1.1