summaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-09 22:10:14 +0200
committerChristian Grothoff <christian@grothoff.org>2015-07-09 22:10:14 +0200
commitbe535b68e1c5911c9ec011a0d24714d0f4b42377 (patch)
treef3105779d95265b4ebdaa8aff735bad31cc22d71 /src/mint/taler-mint-httpd.c
parentbe778784ea2ceaf609426041c5ac3a0241ea242e (diff)
downloadexchange-be535b68e1c5911c9ec011a0d24714d0f4b42377.tar.gz
exchange-be535b68e1c5911c9ec011a0d24714d0f4b42377.tar.bz2
exchange-be535b68e1c5911c9ec011a0d24714d0f4b42377.zip
fix a few pointer passing issues, add remark about #3886
Diffstat (limited to 'src/mint/taler-mint-httpd.c')
-rw-r--r--src/mint/taler-mint-httpd.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/mint/taler-mint-httpd.c b/src/mint/taler-mint-httpd.c
index a0f1eca4b..4fa867759 100644
--- a/src/mint/taler-mint-httpd.c
+++ b/src/mint/taler-mint-httpd.c
@@ -105,6 +105,7 @@ handle_mhd_completion_callback (void *cls,
void **con_cls,
enum MHD_RequestTerminationCode toe)
{
+ fprintf (stderr, "CC called (%p)!\n", *con_cls);
if (NULL == *con_cls)
return;
TMH_PARSE_post_cleanup_callback (*con_cls);
@@ -482,9 +483,32 @@ main (int argc, char *const *argv)
"Failed to start HTTP server.\n");
return 1;
}
-
ret = TMH_KS_loop ();
- MHD_stop_daemon (mydaemon);
+ switch (ret)
+ {
+ case GNUNET_OK:
+ case GNUNET_SYSERR:
+ MHD_stop_daemon (mydaemon);
+ break;
+ case GNUNET_NO:
+ {
+ MHD_socket sock = MHD_quiesce_daemon (mydaemon);
+
+ /* FIXME #3474: fork another MHD, passing on the listen socket! */
+ while (0 != MHD_get_daemon_info (mydaemon,
+ MHD_DAEMON_INFO_CURRENT_CONNECTIONS)->num_connections)
+ sleep (1);
+ MHD_stop_daemon (mydaemon);
+
+ close (sock); /* FIXME: done like this because #3474 is open */
+ }
+ break;
+ default:
+ GNUNET_break (0);
+ MHD_stop_daemon (mydaemon);
+ break;
+ }
+
if (GNUNET_YES == TMH_test_mode)
{
struct TALER_MINTDB_Session *session;
@@ -499,5 +523,5 @@ main (int argc, char *const *argv)
}
TALER_MINTDB_plugin_unload (TMH_plugin);
- return (GNUNET_OK == ret) ? 0 : 1;
+ return (GNUNET_SYSERR == ret) ? 1 : 0;
}