diff options
Diffstat (limited to 'src/include/taler_mhd_lib.h')
-rw-r--r-- | src/include/taler_mhd_lib.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h index 3af413fa8..aba7cd8e2 100644 --- a/src/include/taler_mhd_lib.h +++ b/src/include/taler_mhd_lib.h | |||
@@ -125,6 +125,21 @@ TALER_MHD_reply_json (struct MHD_Connection *connection, | |||
125 | 125 | ||
126 | 126 | ||
127 | /** | 127 | /** |
128 | * Send JSON object as response, and free the @a json | ||
129 | * object. | ||
130 | * | ||
131 | * @param connection the MHD connection | ||
132 | * @param json the json object (freed!) | ||
133 | * @param response_code the http response code | ||
134 | * @return MHD result code | ||
135 | */ | ||
136 | MHD_RESULT | ||
137 | TALER_MHD_reply_json_steal (struct MHD_Connection *connection, | ||
138 | json_t *json, | ||
139 | unsigned int response_code); | ||
140 | |||
141 | |||
142 | /** | ||
128 | * Function to call to handle the request by building a JSON | 143 | * Function to call to handle the request by building a JSON |
129 | * reply from a format string and varargs. | 144 | * reply from a format string and varargs. |
130 | * | 145 | * |
@@ -151,8 +166,8 @@ TALER_MHD_reply_json_pack (struct MHD_Connection *connection, | |||
151 | * @return MHD result code | 166 | * @return MHD result code |
152 | */ | 167 | */ |
153 | #define TALER_MHD_REPLY_JSON_PACK(connection,response_code,...) \ | 168 | #define TALER_MHD_REPLY_JSON_PACK(connection,response_code,...) \ |
154 | TALER_MHD_reply_json (connection, GNUNET_JSON_PACK (__VA_ARGS__), \ | 169 | TALER_MHD_reply_json_steal (connection, GNUNET_JSON_PACK (__VA_ARGS__), \ |
155 | response_code) | 170 | response_code) |
156 | 171 | ||
157 | 172 | ||
158 | /** | 173 | /** |