aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/test_postprocessor_md.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/test_postprocessor_md.c')
-rw-r--r--src/microhttpd/test_postprocessor_md.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/microhttpd/test_postprocessor_md.c b/src/microhttpd/test_postprocessor_md.c
index 42c479cf..930f7fb3 100644
--- a/src/microhttpd/test_postprocessor_md.c
+++ b/src/microhttpd/test_postprocessor_md.c
@@ -114,13 +114,22 @@ post_data_iterator2 (void *cls,
114 uint64_t off, 114 uint64_t off,
115 size_t size) 115 size_t size)
116{ 116{
117 printf ("%s\t%s\n", key, data); 117 static char seen[16];
118
119 printf ("%s\t%s@ %llu\n",
120 key,
121 data,
122 (unsigned long long) off);
118 if (0 == strcmp (key, "text")) 123 if (0 == strcmp (key, "text"))
119 { 124 {
120 if ( (10 != size) || 125 if (off + size > sizeof (seen))
121 (0 != memcmp (data, "text, text", 10)) ) 126 exit (6);
122 exit (5); 127 memcpy (&seen[off],
123 found |= 1; 128 data,
129 size);
130 if ( (10 == off + size) &&
131 (0 == memcmp (seen, "text, text", 10)) )
132 found |= 1;
124 } 133 }
125 return MHD_YES; 134 return MHD_YES;
126} 135}
@@ -177,7 +186,6 @@ main (int argc, char *argv[])
177 exit (3); 186 exit (3);
178 if (found != 15) 187 if (found != 15)
179 exit (2); 188 exit (2);
180
181 found = 0; 189 found = 0;
182 postprocessor = malloc (sizeof (struct MHD_PostProcessor) 190 postprocessor = malloc (sizeof (struct MHD_PostProcessor)
183 + 0x1000 + 1); 191 + 0x1000 + 1);
@@ -191,9 +199,8 @@ main (int argc, char *argv[])
191 postprocessor->buffer_size = 0x1000; 199 postprocessor->buffer_size = 0x1000;
192 postprocessor->state = PP_Init; 200 postprocessor->state = PP_Init;
193 postprocessor->skip_rn = RN_Inactive; 201 postprocessor->skip_rn = RN_Inactive;
194 MHD_post_process (postprocessor, "text=text%2C+text", 11 + 6); 202 MHD_post_process (postprocessor, "text=text%2", 11);
195 // MHD_post_process (postprocessor, "text=text%2", 11); 203 MHD_post_process (postprocessor, "C+text", 6);
196 // MHD_post_process (postprocessor, "C+text", 6);
197 MHD_post_process (postprocessor, "", 0); 204 MHD_post_process (postprocessor, "", 0);
198 MHD_destroy_post_processor (postprocessor); 205 MHD_destroy_post_processor (postprocessor);
199 if (found != 1) 206 if (found != 1)