diff options
Diffstat (limited to 'src/include/gnunet_curl_lib.h')
-rw-r--r-- | src/include/gnunet_curl_lib.h | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index 875cfa3bd..9de58d608 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h | |||
@@ -225,13 +225,9 @@ typedef void | |||
225 | * upon its completion. Note that the context will make use of the | 225 | * upon its completion. Note that the context will make use of the |
226 | * CURLOPT_PRIVATE facility of the CURL @a eh. | 226 | * CURLOPT_PRIVATE facility of the CURL @a eh. |
227 | * | 227 | * |
228 | * This function modifies the CURL handle to add the | ||
229 | * "Content-Type: application/json" header if @a add_json is set. | ||
230 | * | ||
231 | * @param ctx context to execute the job in | 228 | * @param ctx context to execute the job in |
232 | * @param eh curl easy handle for the request, will | 229 | * @param eh curl easy handle for the request, will |
233 | * be executed AND cleaned up | 230 | * be executed AND cleaned up |
234 | * @param add_json add "application/json" content type header | ||
235 | * @param jcc callback to invoke upon completion | 231 | * @param jcc callback to invoke upon completion |
236 | * @param jcc_cls closure for @a jcc | 232 | * @param jcc_cls closure for @a jcc |
237 | * @return NULL on error (in this case, @eh is still released!) | 233 | * @return NULL on error (in this case, @eh is still released!) |
@@ -239,13 +235,70 @@ typedef void | |||
239 | struct GNUNET_CURL_Job * | 235 | struct GNUNET_CURL_Job * |
240 | GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, | 236 | GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, |
241 | CURL *eh, | 237 | CURL *eh, |
242 | int add_json, | ||
243 | GNUNET_CURL_JobCompletionCallback jcc, | 238 | GNUNET_CURL_JobCompletionCallback jcc, |
244 | void *jcc_cls); | 239 | void *jcc_cls); |
245 | 240 | ||
246 | 241 | ||
247 | /** | 242 | /** |
248 | * Schedule a CURL request to be executed and call the given @a jcc | 243 | * Schedule a CURL request to be executed and call the given @a jcc |
244 | * upon its completion. Note that the context will make use of the | ||
245 | * CURLOPT_PRIVATE facility of the CURL @a eh. | ||
246 | * | ||
247 | * This function modifies the CURL handle to add the | ||
248 | * "Content-Type: application/json" header. | ||
249 | * | ||
250 | * @param ctx context to execute the job in | ||
251 | * @param eh curl easy handle for the request, will | ||
252 | * be executed AND cleaned up | ||
253 | * @param jcc callback to invoke upon completion | ||
254 | * @param jcc_cls closure for @a jcc | ||
255 | * @return NULL on error (in this case, @eh is still released!) | ||
256 | */ | ||
257 | struct GNUNET_CURL_Job * | ||
258 | GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx, | ||
259 | CURL *eh, | ||
260 | GNUNET_CURL_JobCompletionCallback jcc, | ||
261 | void *jcc_cls); | ||
262 | |||
263 | |||
264 | /** | ||
265 | * Force use of the provided username and password | ||
266 | * for client authentication for all operations performed | ||
267 | * with @a ctx. | ||
268 | * | ||
269 | * @param ctx context to set authentication data for | ||
270 | * @param userpass string with "$USERNAME:$PASSWORD" | ||
271 | */ | ||
272 | void | ||
273 | GNUNET_CURL_set_userpass (struct GNUNET_CURL_Context *ctx, | ||
274 | const char *userpass); | ||
275 | |||
276 | |||
277 | /** | ||
278 | * Force use of the provided TLS client certificate | ||
279 | * for client authentication for all operations performed | ||
280 | * with @a ctx. | ||
281 | * | ||
282 | * Note that if the provided information is incorrect, | ||
283 | * the earliest operation that could fail is | ||
284 | * #GNUNET_CURL_job_add() or #GNUNET_CURL_job_add2()! | ||
285 | * | ||
286 | * @param ctx context to set authentication data for | ||
287 | * @param certtype type of the certificate | ||
288 | * @param certfile file with the certificate | ||
289 | * @param keyfile file with the private key | ||
290 | * @param keypass passphrase to decrypt @a keyfile (or NULL) | ||
291 | */ | ||
292 | void | ||
293 | GNUNET_CURL_set_tlscert (struct GNUNET_CURL_Context *ctx, | ||
294 | const char *certtype, | ||
295 | const char *certfile, | ||
296 | const char *keyfile, | ||
297 | const char *keypass); | ||
298 | |||
299 | |||
300 | /** | ||
301 | * Schedule a CURL request to be executed and call the given @a jcc | ||
249 | * upon its completion. Note that the context will make use of the | 302 | * upon its completion. Note that the context will make use of the |
250 | * CURLOPT_PRIVATE facility of the CURL @a eh. | 303 | * CURLOPT_PRIVATE facility of the CURL @a eh. |
251 | * | 304 | * |