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