diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-22 00:12:18 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-22 00:12:18 +0200 |
commit | 10f9272e45ea97d1b8f8059c9d285049ff4b606d (patch) | |
tree | dbb087c7ce3c4681d75252d79b6170460a2e2ec4 /src/exchange/taler-exchange-httpd.c | |
parent | 9ad3469f07cfd944c2012a44851cdabf46703e22 (diff) | |
download | exchange-10f9272e45ea97d1b8f8059c9d285049ff4b606d.tar.gz exchange-10f9272e45ea97d1b8f8059c9d285049ff4b606d.tar.bz2 exchange-10f9272e45ea97d1b8f8059c9d285049ff4b606d.zip |
-implement long polling support on reserve status (but not yet in C client library)
Diffstat (limited to 'src/exchange/taler-exchange-httpd.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index 80649c0bc..c06695e4d 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -1430,8 +1430,14 @@ run_single_request (void) } MHD_run (mhd); } - TEH_resume_keys_requests (true); - MHD_stop_daemon (mhd); + { + MHD_socket sock = MHD_quiesce_daemon (mhd); + + TEH_resume_keys_requests (true); + TEH_reserves_get_cleanup (); + MHD_stop_daemon (mhd); + GNUNET_break (0 == close (sock)); + } mhd = NULL; if (cld != waitpid (cld, &status, @@ -1494,8 +1500,15 @@ run_main_loop (int fh, { case GNUNET_OK: case GNUNET_SYSERR: - TEH_resume_keys_requests (true); - MHD_stop_daemon (mhd); + { + MHD_socket sock = MHD_quiesce_daemon (mhd); + + TEH_resume_keys_requests (true); + TEH_reserves_get_cleanup (); + MHD_stop_daemon (mhd); + GNUNET_break (0 == close (sock)); + } + mhd = NULL; break; case GNUNET_NO: { @@ -1507,7 +1520,9 @@ run_main_loop (int fh, flags = fcntl (sock, F_GETFD); GNUNET_assert (-1 != flags); flags &= ~FD_CLOEXEC; - GNUNET_assert (-1 != fcntl (sock, F_SETFD, flags)); + GNUNET_assert (-1 != fcntl (sock, + F_SETFD, + flags)); chld = fork (); if (-1 == chld) { @@ -1551,6 +1566,7 @@ run_main_loop (int fh, sleep (1); /* Now we're really done, practice clean shutdown */ TEH_resume_keys_requests (true); + TEH_reserves_get_cleanup (); MHD_stop_daemon (mhd); } break; |