summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/taler-merchant-httpd.c')
-rw-r--r--src/backend/taler-merchant-httpd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index a1397ed3..9cc198e5 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -48,6 +48,7 @@
#include "taler-merchant-httpd_refund.h"
#include "taler-merchant-httpd_check-payment.h"
#include "taler-merchant-httpd_trigger-pay.h"
+#include "taler-merchant-httpd_config.h"
/**
* Backlog for listen operation on unix-domain sockets.
@@ -291,6 +292,9 @@ url_handler (void *cls,
{ "/public/trigger-pay", MHD_HTTP_METHOD_GET, "text/plain",
NULL, 0,
&MH_handler_trigger_pay, MHD_HTTP_OK},
+ { "/config", MHD_HTTP_METHOD_GET, "text/plain",
+ NULL, 0,
+ &MH_handler_config, MHD_HTTP_OK},
{NULL, NULL, NULL, NULL, 0, 0 }
};
static struct TMH_RequestHandler h404 =
@@ -850,6 +854,20 @@ wireformat_iterator_cb (void *cls,
"url", payto,
"salt", salt_str);
GNUNET_free (salt_str);
+
+ /* Make sure every path component exists. */
+ if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn))
+ {
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "mkdir",
+ fn);
+ GNUNET_free (fn);
+ GNUNET_free (payto);
+ json_decref (j);
+ iic->ret = GNUNET_SYSERR;
+ return;
+ }
+
if (0 != json_dump_file (j,
fn,
JSON_COMPACT | JSON_SORT_KEYS))