aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_iplimit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_iplimit.c')
-rw-r--r--src/testcurl/test_iplimit.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/testcurl/test_iplimit.c b/src/testcurl/test_iplimit.c
index 509e3955..daeac0cf 100644
--- a/src/testcurl/test_iplimit.c
+++ b/src/testcurl/test_iplimit.c
@@ -85,12 +85,12 @@ ahc_echo (void *cls,
85 void **req_cls) 85 void **req_cls)
86{ 86{
87 static int ptr; 87 static int ptr;
88 const char *me = cls;
89 struct MHD_Response *response; 88 struct MHD_Response *response;
90 enum MHD_Result ret; 89 enum MHD_Result ret;
90 (void) cls;
91 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 91 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
92 92
93 if (0 != strcmp (me, method)) 93 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
94 return MHD_NO; /* unexpected method */ 94 return MHD_NO; /* unexpected method */
95 if (&ptr != *req_cls) 95 if (&ptr != *req_cls)
96 { 96 {
@@ -98,9 +98,8 @@ ahc_echo (void *cls,
98 return MHD_YES; 98 return MHD_YES;
99 } 99 }
100 *req_cls = NULL; 100 *req_cls = NULL;
101 response = MHD_create_response_from_buffer (strlen (url), 101 response = MHD_create_response_from_buffer_copy (strlen (url),
102 (void *) url, 102 (const void *) url);
103 MHD_RESPMEM_MUST_COPY);
104 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 103 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
105 MHD_destroy_response (response); 104 MHD_destroy_response (response);
106 if (ret == MHD_NO) 105 if (ret == MHD_NO)
@@ -134,7 +133,7 @@ testMultithreadedGet ()
134 133
135 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 134 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
136 port, NULL, NULL, 135 port, NULL, NULL,
137 &ahc_echo, "GET", 136 &ahc_echo, NULL,
138 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2, 137 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
139 MHD_OPTION_END); 138 MHD_OPTION_END);
140 if (d == NULL) 139 if (d == NULL)
@@ -245,7 +244,7 @@ testMultithreadedPoolGet ()
245 return 0; 244 return 0;
246 245
247 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 246 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
248 port, NULL, NULL, &ahc_echo, "GET", 247 port, NULL, NULL, &ahc_echo, NULL,
249 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2, 248 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
250 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT, 249 MHD_OPTION_THREAD_POOL_SIZE, MHD_CPU_COUNT,
251 MHD_OPTION_END); 250 MHD_OPTION_END);