mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
agent,dirmngr: Tiny restructuring.
* agent/gpg-agent.c (handle_connections): Add a comment. * dirmngr/dirmngr.c (main): Move assuan_sock_close of the listening socket to ... (handle_connections): here. Add a comment why we keep the listening socket open during a shutdown. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
854adc8ae1
commit
aa6ab9e0bc
@ -2829,7 +2829,12 @@ handle_connections (gnupg_fd_t listen_fd,
|
|||||||
break; /* ready */
|
break; /* ready */
|
||||||
|
|
||||||
/* Do not accept new connections but keep on running the
|
/* Do not accept new connections but keep on running the
|
||||||
loop to cope with the timer events. */
|
* loop to cope with the timer events.
|
||||||
|
*
|
||||||
|
* Note that we do not close the listening socket because a
|
||||||
|
* client trying to connect to that socket would instead
|
||||||
|
* restart a new dirmngr instance - which is unlikely the
|
||||||
|
* intention of a shutdown. */
|
||||||
FD_ZERO (&fdset);
|
FD_ZERO (&fdset);
|
||||||
nfd = -1;
|
nfd = -1;
|
||||||
if (my_inotify_fd != -1)
|
if (my_inotify_fd != -1)
|
||||||
|
@ -1026,7 +1026,6 @@ main (int argc, char **argv)
|
|||||||
crl_cache_init ();
|
crl_cache_init ();
|
||||||
http_register_netactivity_cb (netactivity_action);
|
http_register_netactivity_cb (netactivity_action);
|
||||||
handle_connections (3);
|
handle_connections (3);
|
||||||
assuan_sock_close (3);
|
|
||||||
shutdown_reaper ();
|
shutdown_reaper ();
|
||||||
}
|
}
|
||||||
#endif /*HAVE_W32_SYSTEM*/
|
#endif /*HAVE_W32_SYSTEM*/
|
||||||
@ -1234,7 +1233,6 @@ main (int argc, char **argv)
|
|||||||
crl_cache_init ();
|
crl_cache_init ();
|
||||||
http_register_netactivity_cb (netactivity_action);
|
http_register_netactivity_cb (netactivity_action);
|
||||||
handle_connections (fd);
|
handle_connections (fd);
|
||||||
assuan_sock_close (fd);
|
|
||||||
shutdown_reaper ();
|
shutdown_reaper ();
|
||||||
}
|
}
|
||||||
else if (cmd == aListCRLs)
|
else if (cmd == aListCRLs)
|
||||||
@ -1925,7 +1923,8 @@ my_inotify_is_name (int fd, const char *name)
|
|||||||
#endif /*HAVE_INOTIFY_INIT*/
|
#endif /*HAVE_INOTIFY_INIT*/
|
||||||
|
|
||||||
|
|
||||||
/* Main loop in daemon mode. */
|
/* Main loop in daemon mode. Note that LISTEN_FD will be owned by
|
||||||
|
* this function. */
|
||||||
static void
|
static void
|
||||||
handle_connections (assuan_fd_t listen_fd)
|
handle_connections (assuan_fd_t listen_fd)
|
||||||
{
|
{
|
||||||
@ -2006,7 +2005,14 @@ handle_connections (assuan_fd_t listen_fd)
|
|||||||
break; /* ready */
|
break; /* ready */
|
||||||
|
|
||||||
/* Do not accept new connections but keep on running the
|
/* Do not accept new connections but keep on running the
|
||||||
loop to cope with the timer events. */
|
* loop to cope with the timer events.
|
||||||
|
*
|
||||||
|
* Note that we do not close the listening socket because a
|
||||||
|
* client trying to connect to that socket would instead
|
||||||
|
* restart a new dirmngr instance - which is unlikely the
|
||||||
|
* intention of a shutdown. */
|
||||||
|
/* assuan_sock_close (listen_fd); */
|
||||||
|
/* listen_fd = -1; */
|
||||||
FD_ZERO (&fdset);
|
FD_ZERO (&fdset);
|
||||||
nfd = -1;
|
nfd = -1;
|
||||||
if (my_inotify_fd != -1)
|
if (my_inotify_fd != -1)
|
||||||
@ -2109,6 +2115,8 @@ handle_connections (assuan_fd_t listen_fd)
|
|||||||
close (my_inotify_fd);
|
close (my_inotify_fd);
|
||||||
#endif /*HAVE_INOTIFY_INIT*/
|
#endif /*HAVE_INOTIFY_INIT*/
|
||||||
npth_attr_destroy (&tattr);
|
npth_attr_destroy (&tattr);
|
||||||
|
if (listen_fd != -1)
|
||||||
|
assuan_sock_close (fd);
|
||||||
cleanup ();
|
cleanup ();
|
||||||
log_info ("%s %s stopped\n", strusage(11), strusage(13));
|
log_info ("%s %s stopped\n", strusage(11), strusage(13));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user