diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-03-26 00:38:26 +0000 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2016-03-26 00:38:26 +0000 |
commit | e198febcf8cfb75d0ffa7dda5ff0d8fc7c661126 (patch) | |
tree | 1deff69b3dfde27231bf927801f21f9c27c6c13c /src/testcurl/https/test_https_get_select.c | |
parent | c39414cdc7a461ee573205cfe371853d0d1f94d8 (diff) | |
download | libmicrohttpd-e198febcf8cfb75d0ffa7dda5ff0d8fc7c661126.tar.gz libmicrohttpd-e198febcf8cfb75d0ffa7dda5ff0d8fc7c661126.zip |
Fix testsuite compiler warnings on W32
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 | { |