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, } 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; } 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, } 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(); 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, } 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(); 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, } 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();