diff options
Diffstat (limited to 'src/microhttpd/test_postprocessor_md.c')
-rw-r--r-- | src/microhttpd/test_postprocessor_md.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/microhttpd/test_postprocessor_md.c b/src/microhttpd/test_postprocessor_md.c index bfa2d76a..07400f09 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 | } |
@@ -151,7 +160,6 @@ main (int argc, char *argv[]) | |||
151 | exit (3); | 160 | exit (3); |
152 | if (found != 15) | 161 | if (found != 15) |
153 | exit (2); | 162 | exit (2); |
154 | |||
155 | found = 0; | 163 | found = 0; |
156 | postprocessor = malloc (sizeof (struct MHD_PostProcessor) | 164 | postprocessor = malloc (sizeof (struct MHD_PostProcessor) |
157 | + 0x1000 + 1); | 165 | + 0x1000 + 1); |
@@ -165,9 +173,8 @@ main (int argc, char *argv[]) | |||
165 | postprocessor->buffer_size = 0x1000; | 173 | postprocessor->buffer_size = 0x1000; |
166 | postprocessor->state = PP_Init; | 174 | postprocessor->state = PP_Init; |
167 | postprocessor->skip_rn = RN_Inactive; | 175 | postprocessor->skip_rn = RN_Inactive; |
168 | MHD_post_process (postprocessor, "text=text%2C+text", 11 + 6); | 176 | MHD_post_process (postprocessor, "text=text%2", 11); |
169 | // MHD_post_process (postprocessor, "text=text%2", 11); | 177 | MHD_post_process (postprocessor, "C+text", 6); |
170 | // MHD_post_process (postprocessor, "C+text", 6); | ||
171 | MHD_post_process (postprocessor, "", 0); | 178 | MHD_post_process (postprocessor, "", 0); |
172 | MHD_destroy_post_processor (postprocessor); | 179 | MHD_destroy_post_processor (postprocessor); |
173 | if (found != 1) | 180 | if (found != 1) |