gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated: -minor cleanups


From: gnunet
Subject: [libmicrohttpd] branch master updated: -minor cleanups
Date: Tue, 07 Jun 2022 17:40:31 +0200

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 82abaee6 -minor cleanups
82abaee6 is described below

commit 82abaee62f000d379646ee412af45a1f8a1ddc87
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jun 7 17:40:28 2022 +0200

    -minor cleanups
---
 src/microhttpd/test_set_panic.c | 39 ++++++++++++++++++++++-----------------
 src/testcurl/test_post_loop.c   |  7 ++-----
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/src/microhttpd/test_set_panic.c b/src/microhttpd/test_set_panic.c
index 935312a7..554155fb 100644
--- a/src/microhttpd/test_set_panic.c
+++ b/src/microhttpd/test_set_panic.c
@@ -146,28 +146,28 @@
 
 #if defined(HAVE___FUNC__)
 #define externalErrorExit(ignore) \
-    _externalErrorExit_func(NULL, __func__, __LINE__)
+  _externalErrorExit_func (NULL, __func__, __LINE__)
 #define externalErrorExitDesc(errDesc) \
-    _externalErrorExit_func(errDesc, __func__, __LINE__)
+  _externalErrorExit_func (errDesc, __func__, __LINE__)
 #define mhdErrorExit(ignore) \
-    _mhdErrorExit_func(NULL, __func__, __LINE__)
+  _mhdErrorExit_func (NULL, __func__, __LINE__)
 #define mhdErrorExitDesc(errDesc) \
-    _mhdErrorExit_func(errDesc, __func__, __LINE__)
+  _mhdErrorExit_func (errDesc, __func__, __LINE__)
 #elif defined(HAVE___FUNCTION__)
 #define externalErrorExit(ignore) \
-    _externalErrorExit_func(NULL, __FUNCTION__, __LINE__)
+  _externalErrorExit_func (NULL, __FUNCTION__, __LINE__)
 #define externalErrorExitDesc(errDesc) \
-    _externalErrorExit_func(errDesc, __FUNCTION__, __LINE__)
+  _externalErrorExit_func (errDesc, __FUNCTION__, __LINE__)
 #define mhdErrorExit(ignore) \
-    _mhdErrorExit_func(NULL, __FUNCTION__, __LINE__)
+  _mhdErrorExit_func (NULL, __FUNCTION__, __LINE__)
 #define mhdErrorExitDesc(errDesc) \
-    _mhdErrorExit_func(errDesc, __FUNCTION__, __LINE__)
+  _mhdErrorExit_func (errDesc, __FUNCTION__, __LINE__)
 #else
-#define externalErrorExit(ignore) _externalErrorExit_func(NULL, NULL, __LINE__)
+#define externalErrorExit(ignore) _externalErrorExit_func (NULL, NULL, 
__LINE__)
 #define externalErrorExitDesc(errDesc) \
-  _externalErrorExit_func(errDesc, NULL, __LINE__)
-#define mhdErrorExit(ignore) _mhdErrorExit_func(NULL, NULL, __LINE__)
-#define mhdErrorExitDesc(errDesc) _mhdErrorExit_func(errDesc, NULL, __LINE__)
+  _externalErrorExit_func (errDesc, NULL, __LINE__)
+#define mhdErrorExit(ignore) _mhdErrorExit_func (NULL, NULL, __LINE__)
+#define mhdErrorExitDesc(errDesc) _mhdErrorExit_func (errDesc, NULL, __LINE__)
 #endif
 
 
@@ -443,6 +443,7 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
   size_t add_hdrs_size;
   size_t buf_alloc_size;
   char *send_buf;
+
   mhd_assert (0 != port);
   mhd_assert (NULL != req_body || 0 == req_body_size);
   mhd_assert (0 == req_body_size || NULL != req_body);
@@ -525,7 +526,9 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
     if (! chunked)
     {
       int prn_size;
-      memcpy (send_buf + clnt->req_size, MHD_HTTP_HEADER_CONTENT_LENGTH ": ",
+
+      memcpy (send_buf + clnt->req_size,
+              MHD_HTTP_HEADER_CONTENT_LENGTH ": ",
               MHD_STATICSTR_LEN_ (MHD_HTTP_HEADER_CONTENT_LENGTH ": "));
       clnt->req_size += MHD_STATICSTR_LEN_ (
         MHD_HTTP_HEADER_CONTENT_LENGTH ": ");
@@ -550,9 +553,11 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
                                             ": chunked\r\n");
     }
   }
-  if (0 != add_hdrs_size)
+  if (NULL != add_headers)
   {
-    memcpy (send_buf + clnt->req_size, add_headers, add_hdrs_size);
+    memcpy (send_buf + clnt->req_size,
+            add_headers,
+            add_hdrs_size);
     clnt->req_size += add_hdrs_size;
   }
   /* Terminate header */
@@ -562,7 +567,7 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
   /* Add body (if any) */
   if (! chunked)
   {
-    if (0 != req_body_size)
+    if (NULL != req_body)
     {
       memcpy (send_buf + clnt->req_size, req_body, req_body_size);
       clnt->req_size += req_body_size;
@@ -570,7 +575,7 @@ _MHD_dumbClient_create (uint16_t port, const char *method, 
const char *url,
   }
   else
   {
-    if (0 != req_body_size)
+    if (NULL != req_body)
     {
       int prn_size;
       prn_size = snprintf (send_buf + clnt->req_size,
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index ec42ffce..f9238faa 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -521,7 +521,7 @@ testExternalPost ()
       if ((CURLM_OK == curl_multi_timeout (multi, &ctimeout)) &&
           (ctimeout >= 0) && ((uint64_t) ctimeout < timeout64))
         timeout64 = (uint64_t) ctimeout;
-      if ( (c == NULL) || (0 == running) )
+      if (0 == running)
         timeout64 = 0; /* terminate quickly... */
       tv.tv_sec = timeout64 / 1000;
       tv.tv_usec = (timeout64 % 1000) * 1000;
@@ -576,14 +576,11 @@ testExternalPost ()
           fprintf (stderr, "libcurl haven't returned OK code\n");
           abort ();
         }
-        curl_multi_remove_handle (multi, c);
-        curl_easy_cleanup (c);
-        c = NULL;
         break;
       }
       MHD_run (d);
     }
-    if (c != NULL)
+    if (NULL != c)
     {
       curl_multi_remove_handle (multi, c);
       curl_easy_cleanup (c);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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