diff options
Diffstat (limited to 'src/testcurl/https/test_https_get_select.c')
-rw-r--r-- | src/testcurl/https/test_https_get_select.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/https/test_https_get_select.c b/src/testcurl/https/test_https_get_select.c index 38ab1879..487b475e 100644 --- a/src/testcurl/https/test_https_get_select.c +++ b/src/testcurl/https/test_https_get_select.c | |||
@@ -84,7 +84,12 @@ testExternalGet (int flags) | |||
84 | fd_set rs; | 84 | fd_set rs; |
85 | fd_set ws; | 85 | fd_set ws; |
86 | fd_set es; | 86 | fd_set es; |
87 | MHD_socket max; | 87 | MHD_socket maxsock; |
88 | #ifdef MHD_WINSOCK_SOCKETS | ||
89 | int maxposixs; /* Max socket number unused on W32 */ | ||
90 | #else /* MHD_POSIX_SOCKETS */ | ||
91 | #define maxposixs maxsock | ||
92 | #endif /* MHD_POSIX_SOCKETS */ | ||
88 | int running; | 93 | int running; |
89 | struct CURLMsg *msg; | 94 | struct CURLMsg *msg; |
90 | time_t start; | 95 | time_t start; |
@@ -146,11 +151,12 @@ testExternalGet (int flags) | |||
146 | start = time (NULL); | 151 | start = time (NULL); |
147 | while ((time (NULL) - start < 5) && (multi != NULL)) | 152 | while ((time (NULL) - start < 5) && (multi != NULL)) |
148 | { | 153 | { |
149 | max = 0; | 154 | maxsock = MHD_INVALID_SOCKET; |
155 | maxposixs = -1; | ||
150 | FD_ZERO (&rs); | 156 | FD_ZERO (&rs); |
151 | FD_ZERO (&ws); | 157 | FD_ZERO (&ws); |
152 | FD_ZERO (&es); | 158 | FD_ZERO (&es); |
153 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); | 159 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs); |
154 | if (mret != CURLM_OK) | 160 | if (mret != CURLM_OK) |
155 | { | 161 | { |
156 | curl_multi_remove_handle (multi, c); | 162 | curl_multi_remove_handle (multi, c); |
@@ -159,7 +165,7 @@ testExternalGet (int flags) | |||
159 | MHD_stop_daemon (d); | 165 | MHD_stop_daemon (d); |
160 | return 2048; | 166 | return 2048; |
161 | } | 167 | } |
162 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) | 168 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock)) |
163 | { | 169 | { |
164 | curl_multi_remove_handle (multi, c); | 170 | curl_multi_remove_handle (multi, c); |
165 | curl_multi_cleanup (multi); | 171 | curl_multi_cleanup (multi); |
@@ -169,7 +175,7 @@ testExternalGet (int flags) | |||
169 | } | 175 | } |
170 | tv.tv_sec = 0; | 176 | tv.tv_sec = 0; |
171 | tv.tv_usec = 1000; | 177 | tv.tv_usec = 1000; |
172 | select (max + 1, &rs, &ws, &es, &tv); | 178 | select (maxposixs + 1, &rs, &ws, &es, &tv); |
173 | curl_multi_perform (multi, &running); | 179 | curl_multi_perform (multi, &running); |
174 | if (running == 0) | 180 | if (running == 0) |
175 | { | 181 | { |