Changeset View
Changeset View
Standalone View
Standalone View
agent/gpg-agent.c
Context not available. | |||||
oS2KCalibration, | oS2KCalibration, | ||||
oAutoExpandSecmem, | oAutoExpandSecmem, | ||||
oListenBacklog, | oListenBacklog, | ||||
oLimitActiveConnections, | |||||
oWriteEnvFile | oWriteEnvFile | ||||
}; | }; | ||||
Context not available. | |||||
ARGPARSE_s_i (oListenBacklog, "listen-backlog", "@"), | ARGPARSE_s_i (oListenBacklog, "listen-backlog", "@"), | ||||
ARGPARSE_s_i (oLimitActiveConnections, "limit-active-connections", "@"), | |||||
/* Dummy options for backward compatibility. */ | /* Dummy options for backward compatibility. */ | ||||
ARGPARSE_o_s (oWriteEnvFile, "write-env-file", "@"), | ARGPARSE_o_s (oWriteEnvFile, "write-env-file", "@"), | ||||
ARGPARSE_s_n (oUseStandardSocket, "use-standard-socket", "@"), | ARGPARSE_s_n (oUseStandardSocket, "use-standard-socket", "@"), | ||||
Context not available. | |||||
/* Number of active connections. */ | /* Number of active connections. */ | ||||
static int active_connections; | static int active_connections; | ||||
static int limit_active_connections; | |||||
/* This object is used to dispatch progress messages from Libgcrypt to | /* This object is used to dispatch progress messages from Libgcrypt to | ||||
* the right thread. Given that we will have at max only a few dozen | * the right thread. Given that we will have at max only a few dozen | ||||
Context not available. | |||||
listen_backlog = pargs.r.ret_int; | listen_backlog = pargs.r.ret_int; | ||||
break; | break; | ||||
case oLimitActiveConnections: | |||||
limit_active_connections = pargs.r.ret_int; | |||||
break; | |||||
case oDebugQuickRandom: | case oDebugQuickRandom: | ||||
/* Only used by the first stage command line parser. */ | /* Only used by the first stage command line parser. */ | ||||
break; | break; | ||||
Context not available. | |||||
agent_deinit_default_ctrl (ctrl); | agent_deinit_default_ctrl (ctrl); | ||||
xfree (ctrl); | xfree (ctrl); | ||||
active_connections--; | active_connections--; | ||||
if (limit_active_connections && active_connections < limit_active_connections) | |||||
kill (0, SIGUSR1); | |||||
return NULL; | return NULL; | ||||
} | } | ||||
Context not available. | |||||
agent_deinit_default_ctrl (ctrl); | agent_deinit_default_ctrl (ctrl); | ||||
xfree (ctrl); | xfree (ctrl); | ||||
active_connections--; | active_connections--; | ||||
if (limit_active_connections && active_connections < limit_active_connections) | |||||
kill (0, SIGUSR1); | |||||
return NULL; | return NULL; | ||||
} | } | ||||
Context not available. | |||||
thus a simple assignment is fine to copy the entire set. */ | thus a simple assignment is fine to copy the entire set. */ | ||||
read_fdset = fdset; | read_fdset = fdset; | ||||
if (limit_active_connections && active_connections >= limit_active_connections) | |||||
{ | |||||
FD_CLR (FD2INT(listen_fd), &read_fdset); | |||||
if (listen_fd_ssh != GNUPG_INVALID_FD) | |||||
FD_CLR (FD2INT(listen_fd_ssh), &read_fdset); | |||||
if (listen_fd_extra != GNUPG_INVALID_FD) | |||||
FD_CLR (FD2INT(listen_fd_extra), &read_fdset); | |||||
if (listen_fd_browser != GNUPG_INVALID_FD) | |||||
FD_CLR (FD2INT(listen_fd_browser), &read_fdset); | |||||
} | |||||
npth_clock_gettime (&curtime); | npth_clock_gettime (&curtime); | ||||
if (!(npth_timercmp (&curtime, &abstime, <))) | if (!(npth_timercmp (&curtime, &abstime, <))) | ||||
{ | { | ||||
Context not available. |