aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_process_arguments.c
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-06-16 00:41:21 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-06-16 00:42:44 +0300
commite8d937beb5e0bf118c381846f2392cab973a2528 (patch)
treea7bec6dece0675986811e967d7e9756cc19e415a /src/testcurl/test_process_arguments.c
parent36bf651023e2f810bd2ae4aa1ab2354338b9f00c (diff)
downloadlibmicrohttpd-e8d937beb5e0bf118c381846f2392cab973a2528.tar.gz
libmicrohttpd-e8d937beb5e0bf118c381846f2392cab973a2528.zip
Make testsuite parallel build compatible (part 1)
Diffstat (limited to 'src/testcurl/test_process_arguments.c')
-rw-r--r--src/testcurl/test_process_arguments.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c
index 20556082..def5cd98 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -130,18 +130,37 @@ testExternalGet ()
130 struct CURLMsg *msg; 130 struct CURLMsg *msg;
131 time_t start; 131 time_t start;
132 struct timeval tv; 132 struct timeval tv;
133 int port;
134
135 if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
136 port = 0;
137 else
138 {
139 port = 1410;
140 if (oneone)
141 port += 5;
142 }
133 143
134 multi = NULL; 144 multi = NULL;
135 cbc.buf = buf; 145 cbc.buf = buf;
136 cbc.size = 2048; 146 cbc.size = 2048;
137 cbc.pos = 0; 147 cbc.pos = 0;
138 d = MHD_start_daemon (MHD_USE_ERROR_LOG, 148 d = MHD_start_daemon (MHD_USE_ERROR_LOG,
139 21080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END); 149 port, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
140 if (d == NULL) 150 if (d == NULL)
141 return 256; 151 return 256;
152 if (0 == port)
153 {
154 const union MHD_DaemonInfo *dinfo;
155 dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
156 if (NULL == dinfo || 0 == dinfo->port)
157 { MHD_stop_daemon (d); return 32; }
158 port = (int)dinfo->port;
159 }
142 c = curl_easy_init (); 160 c = curl_easy_init ();
143 curl_easy_setopt (c, CURLOPT_URL, 161 curl_easy_setopt (c, CURLOPT_URL,
144 "http://127.0.0.1:21080/hello+world?k=v+x&hash=%23foo&space=%A0bar"); 162 "http://127.0.0.1/hello+world?k=v+x&hash=%23foo&space=%A0bar");
163 curl_easy_setopt (c, CURLOPT_PORT, (long)port);
145 curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer); 164 curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, &copyBuffer);
146 curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc); 165 curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
147 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1); 166 curl_easy_setopt (c, CURLOPT_FAILONERROR, 1);