aboutsummaryrefslogtreecommitdiff
path: root/src/backend/anastasis-httpd_truth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/anastasis-httpd_truth.c')
-rw-r--r--src/backend/anastasis-httpd_truth.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c
index 613e27f..4853e15 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -316,8 +316,8 @@ AH_truth_shutdown (void)
316 } 316 }
317 if (gc->suspended) 317 if (gc->suspended)
318 { 318 {
319 MHD_resume_connection (gc->connection);
320 gc->suspended = false; 319 gc->suspended = false;
320 MHD_resume_connection (gc->connection);
321 } 321 }
322 if (NULL != gc->as) 322 if (NULL != gc->as)
323 { 323 {
@@ -576,8 +576,8 @@ proposal_cb (void *cls,
576 gc); 576 gc);
577 gc->in_list = false; 577 gc->in_list = false;
578 GNUNET_assert (gc->suspended); 578 GNUNET_assert (gc->suspended);
579 MHD_resume_connection (gc->connection);
580 gc->suspended = false; 579 gc->suspended = false;
580 MHD_resume_connection (gc->connection);
581 AH_trigger_daemon (NULL); 581 AH_trigger_daemon (NULL);
582 if (MHD_HTTP_OK != por->hr.http_status) 582 if (MHD_HTTP_OK != por->hr.http_status)
583 { 583 {
@@ -641,8 +641,8 @@ check_payment_cb (void *cls,
641 gc); 641 gc);
642 gc->in_list = false; 642 gc->in_list = false;
643 GNUNET_assert (gc->suspended); 643 GNUNET_assert (gc->suspended);
644 MHD_resume_connection (gc->connection);
645 gc->suspended = false; 644 gc->suspended = false;
645 MHD_resume_connection (gc->connection);
646 AH_trigger_daemon (NULL); 646 AH_trigger_daemon (NULL);
647 647
648 switch (hr->http_status) 648 switch (hr->http_status)
@@ -895,6 +895,7 @@ run_authorization_process (struct MHD_Connection *connection,
895 enum ANASTASIS_AUTHORIZATION_Result ret; 895 enum ANASTASIS_AUTHORIZATION_Result ret;
896 enum GNUNET_DB_QueryStatus qs; 896 enum GNUNET_DB_QueryStatus qs;
897 897
898 GNUNET_assert (! gc->suspended);
898 ret = gc->authorization->process (gc->as, 899 ret = gc->authorization->process (gc->as,
899 gc->timeout, 900 gc->timeout,
900 connection); 901 connection);
@@ -922,13 +923,13 @@ run_authorization_process (struct MHD_Connection *connection,
922 return MHD_YES; 923 return MHD_YES;
923 case ANASTASIS_AUTHORIZATION_RES_SUSPENDED: 924 case ANASTASIS_AUTHORIZATION_RES_SUSPENDED:
924 /* connection was suspended */ 925 /* connection was suspended */
926 gc->suspended = true;
925 if (NULL == AH_to_heap) 927 if (NULL == AH_to_heap)
926 AH_to_heap = GNUNET_CONTAINER_heap_create ( 928 AH_to_heap = GNUNET_CONTAINER_heap_create (
927 GNUNET_CONTAINER_HEAP_ORDER_MIN); 929 GNUNET_CONTAINER_HEAP_ORDER_MIN);
928 gc->hn = GNUNET_CONTAINER_heap_insert (AH_to_heap, 930 gc->hn = GNUNET_CONTAINER_heap_insert (AH_to_heap,
929 gc, 931 gc,
930 gc->timeout.abs_value_us); 932 gc->timeout.abs_value_us);
931 gc->suspended = true;
932 if (NULL != to_task) 933 if (NULL != to_task)
933 { 934 {
934 GNUNET_SCHEDULER_cancel (to_task); 935 GNUNET_SCHEDULER_cancel (to_task);
@@ -1135,6 +1136,7 @@ AH_handler_truth_get (
1135 GNUNET_assert (NULL != gc->authorization); 1136 GNUNET_assert (NULL != gc->authorization);
1136 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1137 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1137 "Continuing with running the authorization process\n"); 1138 "Continuing with running the authorization process\n");
1139 GNUNET_assert (! gc->suspended);
1138 return run_authorization_process (connection, 1140 return run_authorization_process (connection,
1139 gc); 1141 gc);
1140 1142
@@ -1547,6 +1549,7 @@ AH_handler_truth_get (
1547 GNUNET_CONTAINER_DLL_insert (gc_head, 1549 GNUNET_CONTAINER_DLL_insert (gc_head,
1548 gc_tail, 1550 gc_tail,
1549 gc); 1551 gc);
1552 GNUNET_assert (! gc->suspended);
1550 return run_authorization_process (connection, 1553 return run_authorization_process (connection,
1551 gc); 1554 gc);
1552} 1555}