This commit is contained in:
Christian Grothoff committed 2007-07-09 03:27:23 +00:00
1 parent e8343cd44d
commit 73f261c56f
4 files changed
+39 -27

No files matched your search

+2 -2
View File
@@ -53,11 +53,11 @@ static int apc_all(void * cls,
}
static int ahc_nothing(void * cls,
struct MHD_Session * session,
struct MHD_Connection * connection,
const char * url,
const char * method,
const char * upload_data,
const char * version,
const char * upload_data,
unsigned int * upload_data_size) {
return MHD_NO;
}
+12 -8
View File
@@ -61,9 +61,10 @@ static size_t copyBuffer(void * ptr,
}
static int ahc_echo(void * cls,
struct MHD_Session * session,
struct MHD_Connection * connection,
const char * url,
const char * method,
const char * version,
const char * upload_data,
unsigned int * upload_data_size) {
const char * me = cls;
@@ -76,7 +77,7 @@ static int ahc_echo(void * cls,
(void*) url,
MHD_NO,
MHD_YES);
ret = MHD_queue_response(session,
ret = MHD_queue_response(connection,
MHD_HTTP_OK,
response);
MHD_destroy_response(response);
@@ -93,12 +94,13 @@ static int testInternalGet() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
1080,
&apc_all,
NULL,
&ahc_echo,
"GET");
"GET",
MHD_OPTION_END);
if (d == NULL)
return 1;
c = curl_easy_init();
@@ -157,12 +159,13 @@ static int testMultithreadedGet() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
1081,
&apc_all,
NULL,
&ahc_echo,
"GET");
"GET",
MHD_OPTION_END);
if (d == NULL)
return 16;
c = curl_easy_init();
@@ -231,12 +234,13 @@ static int testExternalGet() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_DEBUG,
1082,
&apc_all,
NULL,
&ahc_echo,
"GET");
"GET",
MHD_OPTION_END);
if (d == NULL)
return 256;
c = curl_easy_init();
+13 -9
View File
@@ -65,9 +65,10 @@ static size_t copyBuffer(void * ptr,
}
static int ahc_echo(void * cls,
struct MHD_Session * session,
struct MHD_Connection * connection,
const char * url,
const char * method,
const char * version,
const char * upload_data,
unsigned int * upload_data_size) {
struct MHD_Response * response;
@@ -77,12 +78,12 @@ static int ahc_echo(void * cls,
printf("METHOD: %s\n", method);
return MHD_NO; /* unexpected method */
}
/* FIXME: check session headers... */
/* FIXME: check connection headers... */
response = MHD_create_response_from_data(strlen(url),
(void*) url,
MHD_NO,
MHD_YES);
ret = MHD_queue_response(session,
ret = MHD_queue_response(connection,
MHD_HTTP_OK,
response);
MHD_destroy_response(response);
@@ -99,12 +100,13 @@ static int testInternalPost() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
1080,
&apc_all,
NULL,
&ahc_echo,
NULL);
NULL,
MHD_OPTION_END);
if (d == NULL)
return 1;
c = curl_easy_init();
@@ -169,12 +171,13 @@ static int testMultithreadedPost() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION |MHD_USE_DEBUG,
1081,
&apc_all,
NULL,
&ahc_echo,
NULL);
NULL,
MHD_OPTION_END);
if (d == NULL)
return 16;
c = curl_easy_init();
@@ -250,12 +253,13 @@ static int testExternalPost() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_DEBUG,
1082,
&apc_all,
NULL,
&ahc_echo,
NULL);
NULL,
MHD_OPTION_END);
if (d == NULL)
return 256;
c = curl_easy_init();
+12 -8
View File
@@ -77,9 +77,10 @@ static size_t copyBuffer(void * ptr,
}
static int ahc_echo(void * cls,
struct MHD_Session * session,
struct MHD_Connection * connection,
const char * url,
const char * method,
const char * version,
const char * upload_data,
unsigned int * upload_data_size) {
int * done = cls;
@@ -107,7 +108,7 @@ static int ahc_echo(void * cls,
(void*) url,
MHD_NO,
MHD_YES);
ret = MHD_queue_response(session,
ret = MHD_queue_response(connection,
MHD_HTTP_OK,
response);
MHD_destroy_response(response);
@@ -126,12 +127,13 @@ static int testInternalPut() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG,
1080,
&apc_all,
NULL,
&ahc_echo,
&done_flag);
&done_flag,
MHD_OPTION_END);
if (d == NULL)
return 1;
c = curl_easy_init();
@@ -204,12 +206,13 @@ static int testMultithreadedPut() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
1081,
&apc_all,
NULL,
&ahc_echo,
&done_flag);
&done_flag,
MHD_OPTION_END);
if (d == NULL)
return 16;
c = curl_easy_init();
@@ -293,12 +296,13 @@ static int testExternalPut() {
cbc.buf = buf;
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon(MHD_USE_IPv4 | MHD_USE_DEBUG,
d = MHD_start_daemon(MHD_USE_DEBUG,
1082,
&apc_all,
NULL,
&ahc_echo,
&done_flag);
&done_flag,
MHD_OPTION_END);
if (d == NULL)
return 256;
c = curl_easy_init();