summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-06 13:36:30 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-06 13:36:30 +0100
commit9a6e0aeb07f6d5d17201e8630d0958b4275a31eb (patch)
treee054da4e168a991a4b372ee18a8efbb46f8cce59
parent8cbdf68695418f1e879c4005615df82dea4ef688 (diff)
downloadmerchant-9a6e0aeb07f6d5d17201e8630d0958b4275a31eb.tar.gz
merchant-9a6e0aeb07f6d5d17201e8630d0958b4275a31eb.tar.bz2
merchant-9a6e0aeb07f6d5d17201e8630d0958b4275a31eb.zip
describe meaning of return values in comments, use corret return values
-rw-r--r--src/backend/taler-merchant-httpd_pay.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c
index f2773edb..36d08346 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -914,7 +914,13 @@ get_instance (struct json_t *json);
*
* Schedules an error response in the connection on failure.
*
- * @return #GNUNET_YES on success
+ *
+ * @param connection HTTP connection we are receiving payment on
+ * @param root JSON upload with payment data
+ * @param pc context we use to handle the payment
+ * @return #GNUNET_OK on success,
+ * #GNUNET_NO on failure (response was queued with MHD)
+ * #GNUNET_SYSERR on hard error (MHD connection must be dropped)
*/
static int
parse_pay (struct MHD_Connection *connection,
@@ -1162,6 +1168,12 @@ parse_pay (struct MHD_Connection *connection,
/**
* Process a payment for a proposal.
+ *
+ * @param connection HTTP connection we are receiving payment on
+ * @param root JSON upload with payment data
+ * @param pc context we use to handle the payment
+ * @return value to return to MHD (#MHD_NO to drop connection,
+ * #MHD_YES to keep handling it)
*/
static int
handler_pay_json (struct MHD_Connection *connection,
@@ -1176,7 +1188,7 @@ handler_pay_json (struct MHD_Connection *connection,
root,
pc);
if (GNUNET_OK != ret)
- return ret;
+ return (GNUNET_NO == ret) ? MHD_YES : MHD_NO;
/* Check if this payment attempt has already succeeded */
if (GNUNET_SYSERR ==
@@ -1287,7 +1299,7 @@ handler_pay_json (struct MHD_Connection *connection,
pc->timeout_task = GNUNET_SCHEDULER_add_delayed (PAY_TIMEOUT,
&handle_pay_timeout,
pc);
- return GNUNET_OK;
+ return MHD_YES;
}