aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am2
-rw-r--r--src/curl/Makefile.am2
-rw-r--r--src/curl/curl.c21
3 files changed, 20 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e1d73ab01..16df77fb4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,6 +28,7 @@ if HAVE_MHD
28 JSON_DIR = json 28 JSON_DIR = json
29endif 29endif
30endif 30endif
31if HAVE_MHD
31if HAVE_LIBGNURL 32if HAVE_LIBGNURL
32 CURL_DIR = curl 33 CURL_DIR = curl
33else 34else
@@ -35,6 +36,7 @@ if HAVE_LIBCURL
35 CURL_DIR = curl 36 CURL_DIR = curl
36endif 37endif
37endif 38endif
39endif
38 40
39if BUILD_PULSE_HELPERS 41if BUILD_PULSE_HELPERS
40CONVERSATION_DIR = conversation 42CONVERSATION_DIR = conversation
diff --git a/src/curl/Makefile.am b/src/curl/Makefile.am
index ed5819dee..c6b350bc7 100644
--- a/src/curl/Makefile.am
+++ b/src/curl/Makefile.am
@@ -32,7 +32,7 @@ libgnunetcurl_la_LIBADD = \
32 $(LIB_GNURL) \ 32 $(LIB_GNURL) \
33 $(XLIB) 33 $(XLIB)
34libgnunetcurl_la_CPPFLAGS = \ 34libgnunetcurl_la_CPPFLAGS = \
35 $(CPP_GNURL) $(AM_CPPFLAGS) 35 $(CPP_GNURL) $(AM_CPPFLAGS) $(MHD_CFLAGS)
36 36
37#check_PROGRAMS = \ 37#check_PROGRAMS = \
38# test_curl 38# test_curl
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 {