aboutsummaryrefslogtreecommitdiff
path: root/src/testzzuf/test_post.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testzzuf/test_post.c')
-rw-r--r--src/testzzuf/test_post.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/testzzuf/test_post.c b/src/testzzuf/test_post.c
index 66077b4f..9bc3c604 100644
--- a/src/testzzuf/test_post.c
+++ b/src/testzzuf/test_post.c
@@ -50,6 +50,21 @@ struct CBC
50 size_t size; 50 size_t size;
51}; 51};
52 52
53
54static void
55completed_cb (void *cls,
56 struct MHD_Connection *connection,
57 void **con_cls,
58 enum MHD_RequestTerminationCode toe)
59{
60 struct MHD_PostProcessor *pp = *con_cls;
61
62 if (NULL != pp)
63 MHD_destroy_post_processor (pp);
64 *con_cls = NULL;
65}
66
67
53static size_t 68static size_t
54copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx) 69copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
55{ 70{
@@ -62,6 +77,7 @@ copyBuffer (void *ptr, size_t size, size_t nmemb, void *ctx)
62 return size * nmemb; 77 return size * nmemb;
63} 78}
64 79
80
65/** 81/**
66 * Note that this post_iterator is not perfect 82 * Note that this post_iterator is not perfect
67 * in that it fails to support incremental processing. 83 * in that it fails to support incremental processing.
@@ -142,7 +158,9 @@ testInternalPost ()
142 cbc.size = 2048; 158 cbc.size = 2048;
143 cbc.pos = 0; 159 cbc.pos = 0;
144 d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY /* | MHD_USE_DEBUG */ , 160 d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY /* | MHD_USE_DEBUG */ ,
145 11080, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); 161 11080, NULL, NULL, &ahc_echo, NULL,
162 MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
163 MHD_OPTION_END);
146 if (d == NULL) 164 if (d == NULL)
147 return 1; 165 return 1;
148 zzuf_socat_start (); 166 zzuf_socat_start ();
@@ -191,7 +209,9 @@ testMultithreadedPost ()
191 cbc.size = 2048; 209 cbc.size = 2048;
192 cbc.pos = 0; 210 cbc.pos = 0;
193 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION /* | MHD_USE_DEBUG */ , 211 d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION /* | MHD_USE_DEBUG */ ,
194 11080, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); 212 11080, NULL, NULL, &ahc_echo, NULL,
213 MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
214 MHD_OPTION_END);
195 if (d == NULL) 215 if (d == NULL)
196 return 16; 216 return 16;
197 217
@@ -252,7 +272,9 @@ testExternalPost ()
252 cbc.size = 2048; 272 cbc.size = 2048;
253 cbc.pos = 0; 273 cbc.pos = 0;
254 d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_DEBUG */ , 274 d = MHD_start_daemon (MHD_NO_FLAG /* | MHD_USE_DEBUG */ ,
255 1082, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); 275 1082, NULL, NULL, &ahc_echo, NULL,
276 MHD_OPTION_NOTIFY_COMPLETED, &completed_cb, NULL,
277 MHD_OPTION_END);
256 if (d == NULL) 278 if (d == NULL)
257 return 256; 279 return 256;
258 multi = curl_multi_init (); 280 multi = curl_multi_init ();