aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2007-07-09 03:27:23 +0000
committerChristian Grothoff <christian@grothoff.org>2007-07-09 03:27:23 +0000
commit73f261c56f22f06705cbbeff5871ac4ce07afb57 (patch)
tree051892c32e17d88c377276a37c141cd6b4cadcee
parente8343cd44d334e373b1d6602147f3c45bee23572 (diff)
downloadlibmicrohttpd-73f261c56f22f06705cbbeff5871ac4ce07afb57.tar.gz
libmicrohttpd-73f261c56f22f06705cbbeff5871ac4ce07afb57.zip
compile
-rw-r--r--src/daemon/daemontest.c4
-rw-r--r--src/daemon/daemontest_get.c20
-rw-r--r--src/daemon/daemontest_post.c22
-rw-r--r--src/daemon/daemontest_put.c20
4 files changed, 39 insertions, 27 deletions
diff --git a/src/daemon/daemontest.c b/src/daemon/daemontest.c
index d0186f8f..e7378cdd 100644
--- a/src/daemon/daemontest.c
+++ b/src/daemon/daemontest.c
@@ -53,11 +53,11 @@ static int apc_all(void * cls,
53} 53}
54 54
55static int ahc_nothing(void * cls, 55static int ahc_nothing(void * cls,
56 struct MHD_Session * session, 56 struct MHD_Connection * connection,
57 const char * url, 57 const char * url,
58 const char * method, 58 const char * method,
59 const char * upload_data,
60 const char * version, 59 const char * version,
60 const char * upload_data,
61 unsigned int * upload_data_size) { 61 unsigned int * upload_data_size) {
62 return MHD_NO; 62 return MHD_NO;
63} 63}
diff --git a/src/daemon/daemontest_get.c b/src/daemon/daemontest_get.c
index d4030b06..3cd158ff 100644
--- a/src/daemon/daemontest_get.c
+++ b/src/daemon/daemontest_get.c
@@ -61,9 +61,10 @@ static size_t copyBuffer(void * ptr,
61} 61}
62 62
63static int ahc_echo(void * cls, 63static int ahc_echo(void * cls,
64 struct MHD_Session * session, 64 struct MHD_Connection * connection,
65 const char * url, 65 const char * url,
66 const char * method, 66 const char * method,
67 const char * version,
67 const char * upload_data, 68 const char * upload_data,
68 unsigned int * upload_data_size) { 69 unsigned int * upload_data_size) {
69 const char * me = cls; 70 const char * me = cls;
@@ -76,7 +77,7 @@ static int ahc_echo(void * cls,
76 (void*) url, 77 (void*) url,
77 MHD_NO, 78 MHD_NO,
78 MHD_YES); 79 MHD_YES);
79 ret = MHD_queue_response(session, 80 ret = MHD_queue_response(connection,
80 MHD_HTTP_OK, 81 MHD_HTTP_OK,
81 response); 82 response);
82 MHD_destroy_response(response); 83 MHD_destroy_response(response);
@@ -93,12 +94,13 @@ static int testInternalGet() {
93 cbc.buf = buf; 94 cbc.buf = buf;
94 cbc.size = 2048; 95 cbc.size = 2048;
95 cbc.pos = 0; 96 cbc.pos = 0;
96 d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv4 | MHD_USE_DEBUG, 97 d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
97 1080, 98 1080,
98 &apc_all, 99 &apc_all,
99 NULL, 100 NULL,
100 &ahc_echo, 101 &ahc_echo,
101 "GET"); 102 "GET",
103 MHD_OPTION_END);
102 if (d == NULL) 104 if (d == NULL)
103 return 1; 105 return 1;
104 c = curl_easy_init(); 106 c = curl_easy_init();
@@ -157,12 +159,13 @@ static int testMultithreadedGet() {
157 cbc.buf = buf; 159 cbc.buf = buf;
158 cbc.size = 2048; 160 cbc.size = 2048;
159 cbc.pos = 0; 161 cbc.pos = 0;
160 d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG, 162 d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
161 1081, 163 1081,
162 &apc_all, 164 &apc_all,
163 NULL, 165 NULL,
164 &ahc_echo, 166 &ahc_echo,
165 "GET"); 167 "GET",
168 MHD_OPTION_END);
166 if (d == NULL) 169 if (d == NULL)
167 return 16; 170 return 16;
168 c = curl_easy_init(); 171 c = curl_easy_init();
@@ -231,12 +234,13 @@ static int testExternalGet() {
231 cbc.buf = buf; 234 cbc.buf = buf;
232 cbc.size = 2048; 235 cbc.size = 2048;
233 cbc.pos = 0; 236 cbc.pos = 0;
234 d = MHD_start_daemon(MHD_USE_IPv4 | MHD_USE_DEBUG, 237 d = MHD_start_daemon(MHD_USE_DEBUG,
235 1082, 238 1082,
236 &apc_all, 239 &apc_all,
237 NULL, 240 NULL,
238 &ahc_echo, 241 &ahc_echo,
239 "GET"); 242 "GET",
243 MHD_OPTION_END);
240 if (d == NULL) 244 if (d == NULL)
241 return 256; 245 return 256;
242 c = curl_easy_init(); 246 c = curl_easy_init();
diff --git a/src/daemon/daemontest_post.c b/src/daemon/daemontest_post.c
index c74a3a02..585d633b 100644
--- a/src/daemon/daemontest_post.c
+++ b/src/daemon/daemontest_post.c
@@ -65,9 +65,10 @@ static size_t copyBuffer(void * ptr,
65} 65}
66 66
67static int ahc_echo(void * cls, 67static int ahc_echo(void * cls,
68 struct MHD_Session * session, 68 struct MHD_Connection * connection,
69 const char * url, 69 const char * url,
70 const char * method, 70 const char * method,
71 const char * version,
71 const char * upload_data, 72 const char * upload_data,
72 unsigned int * upload_data_size) { 73 unsigned int * upload_data_size) {
73 struct MHD_Response * response; 74 struct MHD_Response * response;
@@ -77,12 +78,12 @@ static int ahc_echo(void * cls,
77 printf("METHOD: %s\n", method); 78 printf("METHOD: %s\n", method);
78 return MHD_NO; /* unexpected method */ 79 return MHD_NO; /* unexpected method */
79 } 80 }
80 /* FIXME: check session headers... */ 81 /* FIXME: check connection headers... */
81 response = MHD_create_response_from_data(strlen(url), 82 response = MHD_create_response_from_data(strlen(url),
82 (void*) url, 83 (void*) url,
83 MHD_NO, 84 MHD_NO,
84 MHD_YES); 85 MHD_YES);
85 ret = MHD_queue_response(session, 86 ret = MHD_queue_response(connection,
86 MHD_HTTP_OK, 87 MHD_HTTP_OK,
87 response); 88 response);
88 MHD_destroy_response(response); 89 MHD_destroy_response(response);
@@ -99,12 +100,13 @@ static int testInternalPost() {
99 cbc.buf = buf; 100 cbc.buf = buf;
100 cbc.size = 2048; 101 cbc.size = 2048;
101 cbc.pos = 0; 102 cbc.pos = 0;
102 d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv4 | MHD_USE_DEBUG, 103 d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
103 1080, 104 1080,
104 &apc_all, 105 &apc_all,
105 NULL, 106 NULL,
106 &ahc_echo, 107 &ahc_echo,
107 NULL); 108 NULL,
109 MHD_OPTION_END);
108 if (d == NULL) 110 if (d == NULL)
109 return 1; 111 return 1;
110 c = curl_easy_init(); 112 c = curl_easy_init();
@@ -169,12 +171,13 @@ static int testMultithreadedPost() {
169 cbc.buf = buf; 171 cbc.buf = buf;
170 cbc.size = 2048; 172 cbc.size = 2048;
171 cbc.pos = 0; 173 cbc.pos = 0;
172 d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG, 174 d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION |MHD_USE_DEBUG,
173 1081, 175 1081,
174 &apc_all, 176 &apc_all,
175 NULL, 177 NULL,
176 &ahc_echo, 178 &ahc_echo,
177 NULL); 179 NULL,
180 MHD_OPTION_END);
178 if (d == NULL) 181 if (d == NULL)
179 return 16; 182 return 16;
180 c = curl_easy_init(); 183 c = curl_easy_init();
@@ -250,12 +253,13 @@ static int testExternalPost() {
250 cbc.buf = buf; 253 cbc.buf = buf;
251 cbc.size = 2048; 254 cbc.size = 2048;
252 cbc.pos = 0; 255 cbc.pos = 0;
253 d = MHD_start_daemon(MHD_USE_IPv4 | MHD_USE_DEBUG, 256 d = MHD_start_daemon(MHD_USE_DEBUG,
254 1082, 257 1082,
255 &apc_all, 258 &apc_all,
256 NULL, 259 NULL,
257 &ahc_echo, 260 &ahc_echo,
258 NULL); 261 NULL,
262 MHD_OPTION_END);
259 if (d == NULL) 263 if (d == NULL)
260 return 256; 264 return 256;
261 c = curl_easy_init(); 265 c = curl_easy_init();
diff --git a/src/daemon/daemontest_put.c b/src/daemon/daemontest_put.c
index 00538757..5fcae8b7 100644
--- a/src/daemon/daemontest_put.c
+++ b/src/daemon/daemontest_put.c
@@ -77,9 +77,10 @@ static size_t copyBuffer(void * ptr,
77} 77}
78 78
79static int ahc_echo(void * cls, 79static int ahc_echo(void * cls,
80 struct MHD_Session * session, 80 struct MHD_Connection * connection,
81 const char * url, 81 const char * url,
82 const char * method, 82 const char * method,
83 const char * version,
83 const char * upload_data, 84 const char * upload_data,
84 unsigned int * upload_data_size) { 85 unsigned int * upload_data_size) {
85 int * done = cls; 86 int * done = cls;
@@ -107,7 +108,7 @@ static int ahc_echo(void * cls,
107 (void*) url, 108 (void*) url,
108 MHD_NO, 109 MHD_NO,
109 MHD_YES); 110 MHD_YES);
110 ret = MHD_queue_response(session, 111 ret = MHD_queue_response(connection,
111 MHD_HTTP_OK, 112 MHD_HTTP_OK,
112 response); 113 response);
113 MHD_destroy_response(response); 114 MHD_destroy_response(response);
@@ -126,12 +127,13 @@ static int testInternalPut() {
126 cbc.buf = buf; 127 cbc.buf = buf;
127 cbc.size = 2048; 128 cbc.size = 2048;
128 cbc.pos = 0; 129 cbc.pos = 0;
129 d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv4 | MHD_USE_DEBUG, 130 d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
130 1080, 131 1080,
131 &apc_all, 132 &apc_all,
132 NULL, 133 NULL,
133 &ahc_echo, 134 &ahc_echo,
134 &done_flag); 135 &done_flag,
136 MHD_OPTION_END);
135 if (d == NULL) 137 if (d == NULL)
136 return 1; 138 return 1;
137 c = curl_easy_init(); 139 c = curl_easy_init();
@@ -204,12 +206,13 @@ static int testMultithreadedPut() {
204 cbc.buf = buf; 206 cbc.buf = buf;
205 cbc.size = 2048; 207 cbc.size = 2048;
206 cbc.pos = 0; 208 cbc.pos = 0;
207 d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG, 209 d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
208 1081, 210 1081,
209 &apc_all, 211 &apc_all,
210 NULL, 212 NULL,
211 &ahc_echo, 213 &ahc_echo,
212 &done_flag); 214 &done_flag,
215 MHD_OPTION_END);
213 if (d == NULL) 216 if (d == NULL)
214 return 16; 217 return 16;
215 c = curl_easy_init(); 218 c = curl_easy_init();
@@ -293,12 +296,13 @@ static int testExternalPut() {
293 cbc.buf = buf; 296 cbc.buf = buf;
294 cbc.size = 2048; 297 cbc.size = 2048;
295 cbc.pos = 0; 298 cbc.pos = 0;
296 d = MHD_start_daemon(MHD_USE_IPv4 | MHD_USE_DEBUG, 299 d = MHD_start_daemon(MHD_USE_DEBUG,
297 1082, 300 1082,
298 &apc_all, 301 &apc_all,
299 NULL, 302 NULL,
300 &ahc_echo, 303 &ahc_echo,
301 &done_flag); 304 &done_flag,
305 MHD_OPTION_END);
302 if (d == NULL) 306 if (d == NULL)
303 return 256; 307 return 256;
304 c = curl_easy_init(); 308 c = curl_easy_init();