summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2015-11-17 14:38:45 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2015-11-17 14:38:45 +0100
commit965cefde1f05541ac113ad37bc798d1e8f115293 (patch)
tree8dafac4f24294e9649c1c3d3e5f896381dce370a
parent8d8779e945cb8537e8ce669eae1c36390766e9ff (diff)
downloadmerchant-965cefde1f05541ac113ad37bc798d1e8f115293.tar.gz
merchant-965cefde1f05541ac113ad37bc798d1e8f115293.tar.bz2
merchant-965cefde1f05541ac113ad37bc798d1e8f115293.zip
Fixing the unfree-able MHD response; removing debugg-ish prints
-rw-r--r--src/backend/taler-merchant-httpd.c2
-rw-r--r--src/backend/taler-merchant-httpd_pay.c24
-rw-r--r--src/frontend/pay.php3
3 files changed, 15 insertions, 14 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 54819c86..ba359bd1 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -415,7 +415,7 @@ handle_mhd_completion_callback (void *cls,
void **con_cls,
enum MHD_RequestTerminationCode toe)
{
- struct TM_HandlerContext *hc = *con_cls;
+ struct TM_HandlerContext *hc = *con_cls; /* 'hc' is also a 'struct PayContext' */
if (NULL == hc)
return;
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c
index eff11fd2..7b524b6a 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -73,11 +73,6 @@ deposit_fee_from_coin_aggregate (struct MHD_Connection *connection,
if (GNUNET_OK != res)
return res; /* may return GNUNET_NO */
- /*printf ("mint %s (%d), pends: %d\n",
- mints[mint_index].hostname,
- mint_index,
- mints[mint_index].pending);*/
-
if (1 == mints[mint_index].pending)
return GNUNET_SYSERR;
keys = TALER_MINT_get_keys (mints[mint_index].conn);
@@ -187,14 +182,12 @@ deposit_cb (void *cls,
int i;
/*FIXME the index is the same for every individual cb */
- printf ("deposit cb [coins_index %d]\n", dcc->index);
if (GNUNET_SYSERR ==
MERCHANT_DB_update_deposit_permission (db_conn,
dcc->pc->transaction_id,
0))
/* TODO */
printf ("db error\n");
- printf ("/deposit ack'd\n");
dcc->pc->dc[dcc->index].ackd = 1;
dcc->pc->dc[dcc->index].exit_status = http_status;
dcc->pc->dc[dcc->index].proof = proof;
@@ -215,8 +208,7 @@ deposit_cb (void *cls,
dcc->pc->response = MHD_create_response_from_buffer (strlen ("All coins ack'd by the mint\n"),
"All coins ack'd by the mint\n",
- MHD_RESPMEM_MUST_FREE);
- printf ("response [%p]\n", dcc->pc->response);
+ MHD_RESPMEM_MUST_COPY);
dcc->pc->response_code = MHD_HTTP_OK;
/* Clean up what we can already */
MHD_resume_connection (dcc->pc->connection);
@@ -234,12 +226,18 @@ pay_context_cleanup (struct TM_HandlerContext *hc)
GNUNET_free_non_null (pc->dc[i].dcc);
TMH_PARSE_post_cleanup_callback (pc->json_parse_context);
- printf ("response cu [%p]\n", pc->response);
+
+ #if 0
if (NULL != pc->response)
{
+ /* undestroyable regardless of the other MHD_destroy_response called
+ in this source, FIXME */
+
MHD_destroy_response (pc->response);
pc->response = NULL;
}
+ #endif
+
GNUNET_free_non_null (pc->dc);
GNUNET_free (pc);
}
@@ -331,12 +329,15 @@ MH_handler_pay (struct TMH_RequestHandler *rh,
res = MHD_queue_response (connection,
pc->response_code,
pc->response);
- printf ("response main [%p]\n", pc->response);
+ #if 0
if (pc->response != NULL)
{
+ /* undestroyable regardless of the other MHD_destroy_response called
+ in this source, FIXME */
MHD_destroy_response (pc->response);
pc->response = NULL;
}
+ #endif
return res;
}
@@ -537,7 +538,6 @@ MH_handler_pay (struct TMH_RequestHandler *rh,
}
}
- printf ("poller task: %p\n", poller_task);
GNUNET_SCHEDULER_cancel (poller_task);
GNUNET_SCHEDULER_add_now (context_task, mints[mint_index].ctx);
return MHD_YES;
diff --git a/src/frontend/pay.php b/src/frontend/pay.php
index 33f3b712..946cb160 100644
--- a/src/frontend/pay.php
+++ b/src/frontend/pay.php
@@ -92,7 +92,8 @@ if ($status_code != 200)
}
else
{
- echo "Payment succedeed!\n";
+ echo $resp->body->toString ();
+ //echo "Payment succeeded!\n";
}
?>