aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_urlparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_urlparse.c')
-rw-r--r--src/testcurl/test_urlparse.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/testcurl/test_urlparse.c b/src/testcurl/test_urlparse.c
index 0145b5f1..71ac668b 100644
--- a/src/testcurl/test_urlparse.c
+++ b/src/testcurl/test_urlparse.c
@@ -101,12 +101,12 @@ ahc_echo (void *cls,
101 void **req_cls) 101 void **req_cls)
102{ 102{
103 static int ptr; 103 static int ptr;
104 const char *me = cls;
105 struct MHD_Response *response; 104 struct MHD_Response *response;
106 enum MHD_Result ret; 105 enum MHD_Result ret;
106 (void) cls;
107 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */ 107 (void) version; (void) upload_data; (void) upload_data_size; /* Unused. Silent compiler warning. */
108 108
109 if (0 != strcmp (me, method)) 109 if (0 != strcmp (MHD_HTTP_METHOD_GET, method))
110 return MHD_NO; /* unexpected method */ 110 return MHD_NO; /* unexpected method */
111 if (&ptr != *req_cls) 111 if (&ptr != *req_cls)
112 { 112 {
@@ -118,9 +118,8 @@ ahc_echo (void *cls,
118 &test_values, 118 &test_values,
119 NULL); 119 NULL);
120 *req_cls = NULL; 120 *req_cls = NULL;
121 response = MHD_create_response_from_buffer (strlen (url), 121 response = MHD_create_response_from_buffer_copy (strlen (url),
122 (void *) url, 122 (const void *) url);
123 MHD_RESPMEM_MUST_COPY);
124 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 123 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
125 MHD_destroy_response (response); 124 MHD_destroy_response (response);
126 if (ret == MHD_NO) 125 if (ret == MHD_NO)
@@ -153,7 +152,7 @@ testInternalGet (int poll_flag)
153 cbc.pos = 0; 152 cbc.pos = 0;
154 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 153 d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG
155 | poll_flag, 154 | poll_flag,
156 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 155 port, NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
157 if (d == NULL) 156 if (d == NULL)
158 return 1; 157 return 1;
159 if (0 == port) 158 if (0 == port)