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.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c
index 15f72586..bd74405a 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -366,7 +366,7 @@ url_handler (void *cls,
CURL *curl;
CURLcode curl_res;
- int res = GNUNET_SYSERR;
+ uint32_t res = GNUNET_SYSERR;
#define URL_HELLO "/hello"
#define URL_CONTRACT "/contract"
@@ -588,18 +588,25 @@ url_handler (void *cls,
goto end;
}
- if (NULL == (contract_str = MERCHANT_handle_contract (root,
- db_conn,
- &contract,
- now,
- expiry,
- edate,
- refund,
- nounce)))
+ res = MERCHANT_handle_contract (root,
+ db_conn,
+ &contract,
+ now,
+ expiry,
+ edate,
+ refund,
+ &contract_str,
+ nounce);
+ if (GNUNET_SYSERR == res)
{
status = MHD_HTTP_INTERNAL_SERVER_ERROR;
goto end;
}
+ if (GNUNET_NO == res)
+ {
+ status = MHD_HTTP_METHOD_NOT_ACCEPTABLE;
+ goto end;
+ }
GNUNET_CRYPTO_eddsa_sign (privkey, &contract.purpose, &c_sig);
GNUNET_CRYPTO_hash (contract_str, strlen (contract_str) + 1, &h_contract_str);