gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: handle 204 status code


From: gnunet
Subject: [gnunet] branch master updated: handle 204 status code
Date: Fri, 24 Apr 2020 20:41:26 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 189032944 handle 204 status code
     new 91fd7860c Merge branch 'master' of git+ssh://gnunet.org/gnunet
189032944 is described below

commit 18903294439021a77377bc63c74b284c82ad3894
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Apr 24 20:36:28 2020 +0200

    handle 204 status code
---
 src/Makefile.am      |  2 ++
 src/curl/Makefile.am |  2 +-
 src/curl/curl.c      | 21 +++++++++++++++++----
 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
   JSON_DIR = json
 endif
 endif
+if HAVE_MHD
 if HAVE_LIBGNURL
   CURL_DIR = curl
 else
@@ -35,6 +36,7 @@ if HAVE_LIBCURL
   CURL_DIR = curl
 endif
 endif
+endif
 
 if BUILD_PULSE_HELPERS
 CONVERSATION_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 = \
   $(LIB_GNURL) \
   $(XLIB)
 libgnunetcurl_la_CPPFLAGS = \
- $(CPP_GNURL) $(AM_CPPFLAGS)
+ $(CPP_GNURL) $(AM_CPPFLAGS) $(MHD_CFLAGS)
 
 #check_PROGRAMS = \
 #  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 @@
  */
 #include "platform.h"
 #include <jansson.h>
+#include <microhttpd.h>
 #include "gnunet_curl_lib.h"
 
 #if ENABLE_BENCHMARK
@@ -181,7 +182,8 @@ struct GNUNET_CURL_Context
  * @return library context
  */
 struct GNUNET_CURL_Context *
-GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb, void *cb_cls)
+GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
+                  void *cb_cls)
 {
   struct GNUNET_CURL_Context *ctx;
   CURLM *multi;
@@ -263,7 +265,10 @@ GNUNET_CURL_is_valid_scope_id (const char *scope_id)
  * @return number of bytes processed from @a bufptr
  */
 static size_t
-download_cb (char *bufptr, size_t size, size_t nitems, void *cls)
+download_cb (char *bufptr,
+             size_t size,
+             size_t nitems,
+             void *cls)
 {
   struct GNUNET_CURL_DownloadBuffer *db = cls;
   size_t msize;
@@ -376,7 +381,9 @@ setup_job (CURL *eh,
   }
   job->easy_handle = eh;
   job->ctx = ctx;
-  GNUNET_CONTAINER_DLL_insert (ctx->jobs_head, ctx->jobs_tail, job);
+  GNUNET_CONTAINER_DLL_insert (ctx->jobs_head,
+                               ctx->jobs_tail,
+                               job);
   return job;
 }
 
@@ -497,7 +504,11 @@ GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx,
                  curl_slist_append (NULL, "Content-Type: application/json")));
   }
 
-  job = GNUNET_CURL_job_add2 (ctx, eh, job_headers, jcc, jcc_cls);
+  job = GNUNET_CURL_job_add2 (ctx,
+                              eh,
+                              job_headers,
+                              jcc,
+                              jcc_cls);
   curl_slist_free_all (job_headers);
   return job;
 }
@@ -616,6 +627,8 @@ GNUNET_CURL_download_get_result_ (struct 
GNUNET_CURL_DownloadBuffer *db,
                   (const char *) db->buf);
     return NULL;
   }
+  if (MHD_HTTP_NO_CONTENT == *response_code)
+    return NULL;
   json = NULL;
   if (0 == db->eno)
   {

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]