diff options
Diffstat (limited to 'src/testcurl/https')
-rw-r--r-- | src/testcurl/https/test_empty_response.c | 8 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get_select.c | 16 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/testcurl/https/test_empty_response.c b/src/testcurl/https/test_empty_response.c index d327786c..49174108 100644 --- a/src/testcurl/https/test_empty_response.c +++ b/src/testcurl/https/test_empty_response.c | |||
@@ -70,7 +70,7 @@ testInternalSelectGet () | |||
70 | fd_set rs; | 70 | fd_set rs; |
71 | fd_set ws; | 71 | fd_set ws; |
72 | fd_set es; | 72 | fd_set es; |
73 | MHD_socket max; | 73 | int maxposixs; /* Max socket number unused on W32 */ |
74 | int running; | 74 | int running; |
75 | struct CURLMsg *msg; | 75 | struct CURLMsg *msg; |
76 | time_t start; | 76 | time_t start; |
@@ -134,11 +134,11 @@ testInternalSelectGet () | |||
134 | start = time (NULL); | 134 | start = time (NULL); |
135 | while ((time (NULL) - start < 5) && (multi != NULL)) | 135 | while ((time (NULL) - start < 5) && (multi != NULL)) |
136 | { | 136 | { |
137 | max = 0; | 137 | maxposixs = -1; |
138 | FD_ZERO (&rs); | 138 | FD_ZERO (&rs); |
139 | FD_ZERO (&ws); | 139 | FD_ZERO (&ws); |
140 | FD_ZERO (&es); | 140 | FD_ZERO (&es); |
141 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); | 141 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs); |
142 | if (mret != CURLM_OK) | 142 | if (mret != CURLM_OK) |
143 | { | 143 | { |
144 | curl_multi_remove_handle (multi, c); | 144 | curl_multi_remove_handle (multi, c); |
@@ -149,7 +149,7 @@ testInternalSelectGet () | |||
149 | } | 149 | } |
150 | tv.tv_sec = 0; | 150 | tv.tv_sec = 0; |
151 | tv.tv_usec = 1000; | 151 | tv.tv_usec = 1000; |
152 | select (max + 1, &rs, &ws, &es, &tv); | 152 | select (maxposixs + 1, &rs, &ws, &es, &tv); |
153 | curl_multi_perform (multi, &running); | 153 | curl_multi_perform (multi, &running); |
154 | if (running == 0) | 154 | if (running == 0) |
155 | { | 155 | { |
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 | { |