From 53207f93b0886adddf9bc0fa6ac1ba88db7a6682 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Fri, 30 Sep 2022 15:32:43 +0300 Subject: testcurl: Muted some compiler warnings, minor refactoring Used new API for creating of responses to avoid 'const' drops --- src/testcurl/test_get_close_keep_alive.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/testcurl/test_get_close_keep_alive.c') diff --git a/src/testcurl/test_get_close_keep_alive.c b/src/testcurl/test_get_close_keep_alive.c index 7857f2ad..ef020833 100644 --- a/src/testcurl/test_get_close_keep_alive.c +++ b/src/testcurl/test_get_close_keep_alive.c @@ -315,14 +315,14 @@ ahc_echo (void *cls, void **req_cls) { static int ptr; - const char *me = cls; struct MHD_Response *response; enum MHD_Result ret; + (void) cls; (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silence compiler warning. */ - if (0 != strcmp (me, method)) + if (0 != strcmp (MHD_HTTP_METHOD_GET, method)) return MHD_NO; /* unexpected method */ if (&ptr != *req_cls) { @@ -333,9 +333,8 @@ ahc_echo (void *cls, if (slow_reply) usleep (200000); - response = MHD_create_response_from_buffer (strlen (url), - (void *) url, - MHD_RESPMEM_MUST_COPY); + response = MHD_create_response_from_buffer_copy (strlen (url), + (const void *) url); if (NULL == response) { fprintf (stderr, "Failed to create response. Line: %d\n", __LINE__); @@ -960,14 +959,14 @@ startTestMhdDaemon (enum testMhdThreadsType thrType, d = MHD_start_daemon (((int) thrType) | ((int) pollType) | MHD_USE_ERROR_LOG, *pport, NULL, NULL, - &ahc_echo, "GET", + &ahc_echo, NULL, MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, MHD_OPTION_END); else d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | ((int) pollType) | MHD_USE_ERROR_LOG, *pport, NULL, NULL, - &ahc_echo, "GET", + &ahc_echo, NULL, MHD_OPTION_THREAD_POOL_SIZE, testNumThreadsForPool (pollType), MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL, -- cgit v1.2.3