aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_process_arguments.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_process_arguments.c')
-rw-r--r--src/testcurl/test_process_arguments.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c
index 30863164..b5238043 100644
--- a/src/testcurl/test_process_arguments.c
+++ b/src/testcurl/test_process_arguments.c
@@ -120,7 +120,12 @@ testExternalGet ()
120 fd_set rs; 120 fd_set rs;
121 fd_set ws; 121 fd_set ws;
122 fd_set es; 122 fd_set es;
123 MHD_socket max; 123 MHD_socket maxsock;
124#ifdef MHD_WINSOCK_SOCKETS
125 int maxposixs; /* Max socket number unused on W32 */
126#else /* MHD_POSIX_SOCKETS */
127#define maxposixs maxsock
128#endif /* MHD_POSIX_SOCKETS */
124 int running; 129 int running;
125 struct CURLMsg *msg; 130 struct CURLMsg *msg;
126 time_t start; 131 time_t start;
@@ -170,12 +175,13 @@ testExternalGet ()
170 start = time (NULL); 175 start = time (NULL);
171 while ((time (NULL) - start < 5) && (multi != NULL)) 176 while ((time (NULL) - start < 5) && (multi != NULL))
172 { 177 {
173 max = 0; 178 maxsock = MHD_INVALID_SOCKET;
179 maxposixs = -1;
174 FD_ZERO (&rs); 180 FD_ZERO (&rs);
175 FD_ZERO (&ws); 181 FD_ZERO (&ws);
176 FD_ZERO (&es); 182 FD_ZERO (&es);
177 curl_multi_perform (multi, &running); 183 curl_multi_perform (multi, &running);
178 mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); 184 mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
179 if (mret != CURLM_OK) 185 if (mret != CURLM_OK)
180 { 186 {
181 curl_multi_remove_handle (multi, c); 187 curl_multi_remove_handle (multi, c);
@@ -184,7 +190,7 @@ testExternalGet ()
184 MHD_stop_daemon (d); 190 MHD_stop_daemon (d);
185 return 2048; 191 return 2048;
186 } 192 }
187 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) 193 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
188 { 194 {
189 curl_multi_remove_handle (multi, c); 195 curl_multi_remove_handle (multi, c);
190 curl_multi_cleanup (multi); 196 curl_multi_cleanup (multi);
@@ -194,7 +200,7 @@ testExternalGet ()
194 } 200 }
195 tv.tv_sec = 0; 201 tv.tv_sec = 0;
196 tv.tv_usec = 1000; 202 tv.tv_usec = 1000;
197 select (max + 1, &rs, &ws, &es, &tv); 203 select (maxposixs + 1, &rs, &ws, &es, &tv);
198 curl_multi_perform (multi, &running); 204 curl_multi_perform (multi, &running);
199 if (running == 0) 205 if (running == 0)
200 { 206 {