aboutsummaryrefslogtreecommitdiff
path: root/src/curl/curl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/curl/curl.c')
-rw-r--r--src/curl/curl.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/curl/curl.c b/src/curl/curl.c
index 72bb17789..b7452330f 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -25,6 +25,7 @@
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include <jansson.h> 27#include <jansson.h>
28#include <microhttpd.h>
28#include "gnunet_curl_lib.h" 29#include "gnunet_curl_lib.h"
29 30
30#if ENABLE_BENCHMARK 31#if ENABLE_BENCHMARK
@@ -181,7 +182,8 @@ struct GNUNET_CURL_Context
181 * @return library context 182 * @return library context
182 */ 183 */
183struct GNUNET_CURL_Context * 184struct GNUNET_CURL_Context *
184GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb, void *cb_cls) 185GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
186 void *cb_cls)
185{ 187{
186 struct GNUNET_CURL_Context *ctx; 188 struct GNUNET_CURL_Context *ctx;
187 CURLM *multi; 189 CURLM *multi;
@@ -263,7 +265,10 @@ GNUNET_CURL_is_valid_scope_id (const char *scope_id)
263 * @return number of bytes processed from @a bufptr 265 * @return number of bytes processed from @a bufptr
264 */ 266 */
265static size_t 267static size_t
266download_cb (char *bufptr, size_t size, size_t nitems, void *cls) 268download_cb (char *bufptr,
269 size_t size,
270 size_t nitems,
271 void *cls)
267{ 272{
268 struct GNUNET_CURL_DownloadBuffer *db = cls; 273 struct GNUNET_CURL_DownloadBuffer *db = cls;
269 size_t msize; 274 size_t msize;
@@ -376,7 +381,9 @@ setup_job (CURL *eh,
376 } 381 }
377 job->easy_handle = eh; 382 job->easy_handle = eh;
378 job->ctx = ctx; 383 job->ctx = ctx;
379 GNUNET_CONTAINER_DLL_insert (ctx->jobs_head, ctx->jobs_tail, job); 384 GNUNET_CONTAINER_DLL_insert (ctx->jobs_head,
385 ctx->jobs_tail,
386 job);
380 return job; 387 return job;
381} 388}
382 389
@@ -497,7 +504,11 @@ GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx,
497 curl_slist_append (NULL, "Content-Type: application/json"))); 504 curl_slist_append (NULL, "Content-Type: application/json")));
498 } 505 }
499 506
500 job = GNUNET_CURL_job_add2 (ctx, eh, job_headers, jcc, jcc_cls); 507 job = GNUNET_CURL_job_add2 (ctx,
508 eh,
509 job_headers,
510 jcc,
511 jcc_cls);
501 curl_slist_free_all (job_headers); 512 curl_slist_free_all (job_headers);
502 return job; 513 return job;
503} 514}
@@ -616,6 +627,8 @@ GNUNET_CURL_download_get_result_ (struct GNUNET_CURL_DownloadBuffer *db,
616 (const char *) db->buf); 627 (const char *) db->buf);
617 return NULL; 628 return NULL;
618 } 629 }
630 if (MHD_HTTP_NO_CONTENT == *response_code)
631 return NULL;
619 json = NULL; 632 json = NULL;
620 if (0 == db->eno) 633 if (0 == db->eno)
621 { 634 {