-nicer suicide

This commit is contained in:
Christian Grothoff 2021-11-30 22:57:20 +01:00
parent 3a3d7f1ffb
commit c47cb65fb8
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -918,15 +918,6 @@ handle_mhd_request (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Handling new request\n"); "Handling new request\n");
cnt = req_count++;
if (req_max == cnt)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Restarting exchange service after %llu requests\n",
cnt);
(void) kill (getpid (),
SIGTERM);
}
/* We're in a new async scope! */ /* We're in a new async scope! */
rc = *con_cls = GNUNET_new (struct TEH_RequestContext); rc = *con_cls = GNUNET_new (struct TEH_RequestContext);
@ -1661,6 +1652,15 @@ connection_done (void *cls,
if (NULL != input_filename) if (NULL != input_filename)
GNUNET_SCHEDULER_shutdown (); GNUNET_SCHEDULER_shutdown ();
#endif #endif
cnt = req_count++;
if (req_max == cnt)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Restarting exchange service after %llu requests\n",
cnt);
(void) kill (getpid (),
SIGTERM);
}
} }