diff options
author | Marcus Brinkmann <mb@g10code.com> | 2009-11-19 23:57:35 +0000 |
---|---|---|
committer | Marcus Brinkmann <mb@g10code.com> | 2009-11-19 23:57:35 +0000 |
commit | cb53f862ff2a864da822d1c16d3df6a02157608b (patch) | |
tree | 7e2dc047048fe7053ef795f275537f899c986092 /src/assuan-pipe-server.c | |
parent | 7cceb82f044654adccc7c998c979eca5af0f903b (diff) | |
download | libassuan-cb53f862ff2a864da822d1c16d3df6a02157608b.tar.gz |
2009-11-19 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am (common_sources): Remove assuan-connect.c and add
client.c.
* client.c, server.c: New file.
* assuan-defs.h (_assuan_disconnect): Remove.
(struct assuan_context_s): Remove members deinit_handler.
(_assuan_client_release, _assuan_client_finish)
(_assuan_server_finish, _assuan_server_release): New.
* assuan-socket-server.c (accept_connection_bottom): Use
ASSUAN_INVALID_PID, not -1.
(finish_connection, deinit_socket_server): Remove.
(assuan_init_socket_server): Use _assuan_server_release.
* assuan-socket-connect.c (do_finish, do_deinit): Remove.
(assuan_socket_connect): Use _assuan_client_release.
* assuan-pipe-connect.c (do_finish, do_deinit): Remove.
(pipe_connect): Update deinitialization.
(socketpair_connect): Here as well.
* context.c (assuan_get_pid): New from ...
* assuan-connect.c (assuan_get_pid): ... here. Remove this file.
* assuan-pipe-server.c (_assuan_deinit_server, accept_connection)
(deinit_pipe_server, finish_connection): Remove unused function.
* assuan-listen.c (assuan_accept): Check CTX->accept_handler
before calling. Initialize RC. Do not call finish handler for
pipe server.
* assuan-uds.c (_assuan_uds_deinit): Do not call finish handler.
Diffstat (limited to 'src/assuan-pipe-server.c')
-rw-r--r-- | src/assuan-pipe-server.c | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/src/assuan-pipe-server.c b/src/assuan-pipe-server.c index 7849fa5..56c3947 100644 --- a/src/assuan-pipe-server.c +++ b/src/assuan-pipe-server.c @@ -34,26 +34,6 @@ #include "assuan-defs.h" -static void -deinit_pipe_server (assuan_context_t ctx) -{ - /* nothing to do for this simple server */ -} - -static gpg_error_t -accept_connection (assuan_context_t ctx) -{ - /* This is a NOP for a pipe server */ - return 0; -} - -static void -finish_connection (assuan_context_t ctx) -{ - /* This is a NOP for a pipe server */ -} - - /* Returns true if atoi(S) denotes a valid socket. */ #ifndef HAVE_W32_SYSTEM static int @@ -114,7 +94,7 @@ assuan_init_pipe_server (assuan_context_t ctx, int filedes[2]) #endif ctx->is_server = 1; - ctx->engine.release = deinit_pipe_server; + ctx->engine.release = _assuan_server_release; ctx->engine.readfnc = _assuan_simple_read; ctx->engine.writefnc = _assuan_simple_write; ctx->engine.sendfd = NULL; @@ -126,35 +106,13 @@ assuan_init_pipe_server (assuan_context_t ctx, int filedes[2]) ctx->pid = (pid_t)ul; else ctx->pid = (pid_t)-1; - ctx->accept_handler = accept_connection; - ctx->finish_handler = finish_connection; - ctx->deinit_handler = deinit_pipe_server; + ctx->accept_handler = NULL; + ctx->finish_handler = _assuan_server_finish; ctx->inbound.fd = infd; ctx->outbound.fd = outfd; if (is_usd) - { - _assuan_init_uds_io (ctx); - ctx->deinit_handler = _assuan_uds_deinit; - } + _assuan_init_uds_io (ctx); return 0; } - - -void -_assuan_deinit_server (assuan_context_t ctx) -{ - /* We use this function pointer to avoid linking other server when - not needed but still allow for a generic deinit function. */ - ctx->deinit_handler (ctx); - ctx->deinit_handler = NULL; - - _assuan_inquire_release (ctx); - _assuan_free (ctx, ctx->hello_line); - ctx->hello_line = NULL; - _assuan_free (ctx, ctx->okay_line); - ctx->okay_line = NULL; - _assuan_free (ctx, ctx->cmdtbl); - ctx->cmdtbl = NULL; -} |