1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* agent.h (server_control_s): Add connection_fd field.

* command.c (start_command_handler): Init it here.
* gpg-agent.c (agent_init_default_ctrl): and here.
* call-scd.c: Add the CTRL arg to all functions calling start_scd
and pass it to start_scd.  Changed all callers
(start_scd): Keep track of the current active connection.
(agent_reset_scd): New.
* command.c (start_command_handler): Call it here.
* learncard.c (agent_handle_learn): Add arg CTRL; changed caller.
(send_cert_back): Ditto.
This commit is contained in:
Werner Koch 2004-01-29 20:17:27 +00:00
parent e4587ba874
commit b11106ebf0
7 changed files with 138 additions and 46 deletions

View file

@ -579,9 +579,10 @@ cmd_get_confirmation (ASSUAN_CONTEXT ctx, char *line)
static int
cmd_learn (ASSUAN_CONTEXT ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
int rc;
rc = agent_handle_learn (has_option (line, "--send")? ctx : NULL);
rc = agent_handle_learn (ctrl, has_option (line, "--send")? ctx : NULL);
if (rc)
log_error ("command learn failed: %s\n", gpg_strerror (rc));
return map_to_assuan_status (rc);
@ -771,6 +772,7 @@ start_command_handler (int listen_fd, int fd)
else
{
rc = assuan_init_connected_socket_server (&ctx, fd);
ctrl.connection_fd = fd;
}
if (rc)
{
@ -816,6 +818,8 @@ start_command_handler (int listen_fd, int fd)
}
}
/* Reset the SCD if needed. */
agent_reset_scd (&ctrl);
assuan_deinit_server (ctx);
if (ctrl.display)