gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (cc5032b8 -> 203d885e


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (cc5032b8 -> 203d885e)
Date: Fri, 03 May 2019 17:12:03 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from cc5032b8 Added MHD_lookup_connection_value_n().
     new 9631f33b test_postprocessor_amp: fixed to really test something
     new 203d885e test_postprocessor*: fixed to use updated struct 
MHD_HTTP_Header

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/microhttpd/test_postprocessor.c       | 12 ++++++++++++
 src/microhttpd/test_postprocessor_amp.c   | 12 ++++++++++--
 src/microhttpd/test_postprocessor_large.c |  2 ++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/test_postprocessor.c 
b/src/microhttpd/test_postprocessor.c
index 36b32f6d..acbb5b02 100644
--- a/src/microhttpd/test_postprocessor.c
+++ b/src/microhttpd/test_postprocessor.c
@@ -137,6 +137,8 @@ test_urlencoding (void)
   connection.headers_received = &header;
   header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
   header.value = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
+  header.header_size = MHD_STATICSTR_LEN_(MHD_HTTP_HEADER_CONTENT_TYPE);
+  header.value_size = 
MHD_STATICSTR_LEN_(MHD_HTTP_POST_ENCODING_FORM_URLENCODED);
   header.kind = MHD_HEADER_KIND;
   pp = MHD_create_post_processor (&connection,
                                   1024, &value_checker, &want_off);
@@ -181,6 +183,8 @@ test_multipart_garbage (void)
     header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
     header.value =
       MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x";
+    header.header_size = MHD_STATICSTR_LEN_(MHD_HTTP_HEADER_CONTENT_TYPE);
+    header.value_size = 
MHD_STATICSTR_LEN_(MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", 
boundary=AaB03x");
     header.kind = MHD_HEADER_KIND;
     pp = MHD_create_post_processor (&connection,
                                     1024, &value_checker, &want_off);
@@ -214,6 +218,8 @@ test_multipart_splits (void)
     header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
     header.value =
       MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x";
+    header.header_size = strlen (header.header);
+    header.value_size = strlen (header.value);
     header.kind = MHD_HEADER_KIND;
     pp = MHD_create_post_processor (&connection,
                                     1024, &value_checker, &want_off);
@@ -245,6 +251,8 @@ test_multipart (void)
   header.value =
     MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x";
   header.kind = MHD_HEADER_KIND;
+  header.header_size = strlen (header.header);
+  header.value_size = strlen (header.value);
   pp = MHD_create_post_processor (&connection,
                                   1024, &value_checker, &want_off);
   i = 0;
@@ -280,6 +288,8 @@ test_nested_multipart (void)
   header.value =
     MHD_HTTP_POST_ENCODING_MULTIPART_FORMDATA ", boundary=AaB03x";
   header.kind = MHD_HEADER_KIND;
+  header.header_size = strlen (header.header);
+  header.value_size = strlen (header.value);
   pp = MHD_create_post_processor (&connection,
                                   1024, &value_checker, &want_off);
   i = 0;
@@ -313,6 +323,8 @@ test_empty_value (void)
   connection.headers_received = &header;
   header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
   header.value = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
+  header.header_size = strlen (header.header);
+  header.value_size = strlen (header.value);
   header.kind = MHD_HEADER_KIND;
   pp = MHD_create_post_processor (&connection,
                                   1024, &value_checker, &want_off);
diff --git a/src/microhttpd/test_postprocessor_amp.c 
b/src/microhttpd/test_postprocessor_amp.c
index ef271810..6c0ebff4 100644
--- a/src/microhttpd/test_postprocessor_amp.c
+++ b/src/microhttpd/test_postprocessor_amp.c
@@ -5,6 +5,7 @@
 #include <string.h>
 #include <stdio.h>
 
+uint64_t num_errors;
 
 int check_post(void *cls, enum MHD_ValueKind kind, const char* key,
                  const char* filename, const char* content_type,
@@ -16,6 +17,7 @@ int check_post(void *cls, enum MHD_ValueKind kind, const 
char* key,
   if ((0 != strcmp(key, "a")) && (0 != strcmp(key, "b")))
     {
       printf("ERROR: got unexpected '%s'\n", key);
+      num_errors++;
     }
 
   return MHD_YES;
@@ -30,21 +32,27 @@ main (int argc, char *const *argv)
   struct MHD_PostProcessor *pp;
   (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
 
+  num_errors = 0;
   memset (&connection, 0, sizeof (struct MHD_Connection));
   memset (&header, 0, sizeof (struct MHD_HTTP_Header));
   connection.headers_received = &header;
   header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
   header.value = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
+  header.header_size = strlen (header.header);
+  header.value_size = strlen (header.value);
   header.kind = MHD_HEADER_KIND;
 
   pp = MHD_create_post_processor (&connection,
                                   4096, &check_post, NULL);
+  if (NULL == pp)
+    return 1;
 
   const char* post = 
"a=xx+xx+xxx+xxxxx+xxxx+xxxxxxxx+xxx+xxxxxx+xxx+xxx+xxxxxxx+xxxxx%0A+++++++xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%0A+++++++--%3E%0A++++++++++++++%3Cxxxxx+xxxxx%3D%22xxx%25%22%3E%0A+++++++++++%3Cxx%3E%0A+++++++++++++++%3Cxx+xxxxxxx%3D%22x%22+xxxxx%3D%22xxxxx%22%3E%0A+++++++++++++++++++%3Cxxxxx+xxxxx%3D%22xxx%25%22%3E%0A+++++++++++++++++++++++%3Cxx%3E%0A+++++++++++++++++++++++++++%3Cxx+xxxxx%3D%22xxxx%22%3E%0A++++++++++++++++++
 [...]
 
-  MHD_post_process (pp, post, strlen(post));
+  if (MHD_YES != MHD_post_process (pp, post, strlen(post)))
+    num_errors++;
   MHD_destroy_post_processor (pp);
 
-  return 0;
+  return num_errors == 0 ? 0 : 2;
 }
 
diff --git a/src/microhttpd/test_postprocessor_large.c 
b/src/microhttpd/test_postprocessor_large.c
index 13e8c78f..3421f734 100644
--- a/src/microhttpd/test_postprocessor_large.c
+++ b/src/microhttpd/test_postprocessor_large.c
@@ -80,6 +80,8 @@ test_simple_large ()
   connection.headers_received = &header;
   header.header = MHD_HTTP_HEADER_CONTENT_TYPE;
   header.value = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
+  header.header_size = strlen (header.header);
+  header.value_size = strlen (header.value);
   header.kind = MHD_HEADER_KIND;
   pp = MHD_create_post_processor (&connection, 1024, &value_checker, &pos);
   i = 0;

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



reply via email to

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