aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-buffer.c
diff options
context:
space:
mode:
authorNeal Walfield <[email protected]>2002-11-24 18:27:59 +0000
committerNeal Walfield <[email protected]>2002-11-24 18:27:59 +0000
commit5d0f173af5f4036a3793392899836b0fe7a01376 (patch)
tree43b9429c3fccf7d41b1e34c9e745ab38bc47d238 /src/assuan-buffer.c
parent2002-11-24 Neal H. Walfield <[email protected]> (diff)
downloadlibassuan-5d0f173af5f4036a3793392899836b0fe7a01376.tar.gz
libassuan-5d0f173af5f4036a3793392899836b0fe7a01376.zip
2002-11-24 Neal H. Walfield <[email protected]>
* assuan.h (assuan_sendfd): New prototype. (assuan_receivefd): New prototype. * assuan-buffer.c (assuan_sendfd): New function. (assuan_receivefd): New function. * assuan-handler.c (parse_cmd_input_output): Recognize incoming file descriptors and act appropriately. * assuan-defs.h (struct assuan_io): Add fields sendfd and receivefd. (struct assuan_context_s): Add fields pendingfds and pendingfdscount. * assuan-pipe-server.c (_assuan_new_context): Update IO to reflect new features. * assuan-domain-connect.c (do_deinit): Cleanup any unreceived file descriptors. (domain_reader): Receive file descriptors. (domain_sendfd): New function. (domain_receivefd): New function. (_assuan_domain_init): Update initialization code to reflect new features.
Diffstat (limited to '')
-rw-r--r--src/assuan-buffer.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c
index 8ccd3bd..bbe3990 100644
--- a/src/assuan-buffer.c
+++ b/src/assuan-buffer.c
@@ -437,3 +437,23 @@ assuan_send_data (ASSUAN_CONTEXT ctx, const void *buffer, size_t length)
return 0;
}
+
+AssuanError
+assuan_sendfd (ASSUAN_CONTEXT ctx, int fd)
+{
+ if (! ctx->io->sendfd)
+ return set_error (ctx, Not_Implemented,
+ "server does not support sending and receiving "
+ "of file descriptors");
+ return ctx->io->sendfd (ctx, fd);
+}
+
+AssuanError
+assuan_receivefd (ASSUAN_CONTEXT ctx, int *fd)
+{
+ if (! ctx->io->receivefd)
+ return set_error (ctx, Not_Implemented,
+ "server does not support sending and receiving "
+ "of file descriptors");
+ return ctx->io->receivefd (ctx, fd);
+}