gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (d2e271a4 -> dd212309)


From: gnunet
Subject: [libmicrohttpd] branch master updated (d2e271a4 -> dd212309)
Date: Mon, 16 Aug 2021 10:29:07 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from d2e271a4 connection.c: added assert to mute static analyzer
     new 6e7e5e26 test_get_chunked: fixed validation error report
     new dd212309 test_get_chunked: do not allocate buffer for cls when not 
needed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/testcurl/test_get_chunked.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index dbe7b7f8..7e29d342 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -180,7 +180,6 @@ ahc_echo (void *cls,
   static int aptr;
   const char *me = cls;
   struct MHD_Response *response;
-  struct MHD_Response **responseptr;
   enum MHD_Result ret;
 
   (void) url;
@@ -196,17 +195,20 @@ ahc_echo (void *cls,
     *ptr = &aptr;
     return MHD_YES;
   }
-  responseptr = malloc (sizeof (struct MHD_Response *));
-  if (NULL == responseptr)
-    _exit (99);
   if (! resp_string)
   {
+    struct MHD_Response **responseptr;
+    responseptr = malloc (sizeof (struct MHD_Response *));
+    if (NULL == responseptr)
+      _exit (99);
+
     response = MHD_create_response_from_callback (resp_sized ?
                                                   RESP_SIZE : MHD_SIZE_UNKNOWN,
                                                   1024,
                                                   &crc,
                                                   responseptr,
                                                   &crcf);
+    *responseptr = response;
   }
   else
   {
@@ -246,7 +248,6 @@ ahc_echo (void *cls,
       abort ();
   }
 
-  *responseptr = response;
   ret = MHD_queue_response (connection,
                             MHD_HTTP_OK,
                             response);
@@ -288,8 +289,8 @@ validate (struct CBC cbc, int ebase)
     {
       fprintf (stderr,
                "Got  `%.*s'\nWant `%.*s'\n",
-               RESP_BLOCK_SIZE, buf, RESP_BLOCK_SIZE,
-               &cbc.buf[i * RESP_BLOCK_SIZE]);
+               RESP_BLOCK_SIZE, &cbc.buf[i * RESP_BLOCK_SIZE],
+               RESP_BLOCK_SIZE, buf);
       return ebase * 2;
     }
   }

-- 
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]