gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/03: extending test (MD)


From: gnunet
Subject: [libmicrohttpd] 01/03: extending test (MD)
Date: Sat, 11 Jul 2020 19:46:00 +0200

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

commit 774c461f8a24c2c89cee95c22f187bc277974e0b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jul 11 19:12:28 2020 +0200

    extending test (MD)
---
 src/microhttpd/test_postprocessor_md.c | 52 ++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/src/microhttpd/test_postprocessor_md.c 
b/src/microhttpd/test_postprocessor_md.c
index bfa2d76a..42c479cf 100644
--- a/src/microhttpd/test_postprocessor_md.c
+++ b/src/microhttpd/test_postprocessor_md.c
@@ -126,6 +126,32 @@ post_data_iterator2 (void *cls,
 }
 
 
+static enum MHD_Result
+post_data_iterator3 (void *cls,
+                     enum MHD_ValueKind kind,
+                     const char *key,
+                     const char *filename,
+                     const char *content_type,
+                     const char *transfer_encoding,
+                     const char *data,
+                     uint64_t off,
+                     size_t size)
+{
+  fprintf (stderr,
+           "%s\t%s\n",
+           key,
+           data);
+  if (0 == strcmp (key, "y"))
+  {
+    if ( (1 != size) ||
+         (0 != memcmp (data, "y", 1)) )
+      exit (1);
+    found |= 1;
+  }
+  return MHD_YES;
+}
+
+
 int
 main (int argc, char *argv[])
 {
@@ -173,5 +199,31 @@ main (int argc, char *argv[])
   if (found != 1)
     exit (4);
 
+  found = 0;
+  postprocessor = malloc (sizeof (struct MHD_PostProcessor)
+                          + 0x1000 + 1);
+  if (NULL == postprocessor)
+    return 77;
+  memset (postprocessor,
+          0,
+          sizeof (struct MHD_PostProcessor) + 0x1000 + 1);
+  postprocessor->ikvi = post_data_iterator3;
+  postprocessor->encoding = MHD_HTTP_POST_ENCODING_FORM_URLENCODED;
+  postprocessor->buffer_size = 0x1000;
+  postprocessor->state = PP_Init;
+  postprocessor->skip_rn = RN_Inactive;
+  {
+    const char *chunk =
+      
"x=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%2Cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%2C%2C%2C%2C%2C%2Cxxxxxxxxxxxxxxxxx%2Cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%2Cxxxxxxxxxxxxxxxxxxxxxxxxx%2C%2C%2C%2C%2Cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%2C%2C%2C%2C%2Cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%2C%2C%2C%2Cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 [...]
+      "&y=y&z=z";
+
+    MHD_post_process (postprocessor, chunk, strlen (chunk) );
+  }
+  MHD_post_process (postprocessor, "", 0);
+  MHD_destroy_post_processor (postprocessor);
+
+  if (found != 1)
+    exit (5);
+
   return EXIT_SUCCESS;
 }

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