Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cory Nelson made libcurl use the WSAPoll() function if built for Windows

Vista (_WIN32_WINNT >= 0x0600)
  • Loading branch information...
commit 1fa3a5cce937168eaa3be11f7949ed046390afa7 1 parent fe8aee6
Daniel Stenberg authored September 24, 2006
4  CHANGES
@@ -6,6 +6,10 @@
6 6
 
7 7
                                   Changelog
8 8
 
  9
+Daniel (24 September 2006)
  10
+- Cory Nelson made libcurl use the WSAPoll() function if built for Windows
  11
+  Vista (_WIN32_WINNT >= 0x0600)
  12
+
9 13
 Daniel (23 September 2006)
10 14
 - Mike Protts added --ftp-ssl-control to make curl use FTP-SSL, but only
11 15
   encrypt the control connection and use the data connection "plain".
3  RELEASE-NOTES
@@ -11,6 +11,7 @@ Curl and libcurl 7.16.0
11 11
 
12 12
 This release includes the following changes:
13 13
 
  14
+ o uses WSAPoll() on Windows Vista
14 15
  o (FTP) --ftp-ssl-control was added
15 16
  o CURLOPT_SSL_SESSIONID_CACHE and --no-sessionid added
16 17
  o CURLMOPT_PIPELINING added for enabling pipelined transfers
@@ -54,6 +55,6 @@ advice from friends like these:
54 55
  Domenico Andreoli, Armel Asselin, Gisle Vanem, Yang Tse, Andrew Biggs,
55 56
  Peter Sylvester, David McCreedy, Dmitriy Sergeyev, Dmitry Rechkin,
56 57
  Jari Sundell, Ravi Pratap, Michele Bini, Jeff Pohlmeyer, Michael Wallner,
57  
- Mike Protts
  58
+ Mike Protts, Cory Nelson
58 59
 
59 60
         Thanks! (and sorry if I forgot to mention someone)
10  lib/select.c
@@ -5,7 +5,7 @@
5 5
  *                            | (__| |_| |  _ <| |___
6 6
  *                             \___|\___/|_| \_\_____|
7 7
  *
8  
- * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
  8
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
9 9
  *
10 10
  * This software is licensed as described in the file COPYING, which
11 11
  * you should have received as part of this distribution. The terms
@@ -74,7 +74,7 @@
74 74
  */
75 75
 int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
76 76
 {
77  
-#ifdef HAVE_POLL_FINE
  77
+#if defined(HAVE_POLL_FINE) || defined(CURL_HAVE_WSAPOLL)
78 78
   struct pollfd pfd[2];
79 79
   int num;
80 80
   int r;
@@ -92,9 +92,13 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
92 92
     num++;
93 93
   }
94 94
 
  95
+#ifdef HAVE_POLL_FINE
95 96
   do {
96 97
     r = poll(pfd, num, timeout_ms);
97 98
   } while((r == -1) && (errno == EINTR));
  99
+#else
  100
+  r = WSAPoll(pfd, num, timeout_ms);
  101
+#endif
98 102
 
99 103
   if (r < 0)
100 104
     return -1;
@@ -194,6 +198,8 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
194 198
   do {
195 199
     r = poll(ufds, nfds, timeout_ms);
196 200
   } while((r == -1) && (errno == EINTR));
  201
+#elif defined(CURL_HAVE_WSAPOLL)
  202
+  r = WSAPoll(ufds, nfds, timeout_ms);
197 203
 #else
198 204
   struct timeval timeout;
199 205
   struct timeval *ptimeout;
6  lib/select.h
@@ -7,7 +7,7 @@
7 7
  *                            | (__| |_| |  _ <| |___
8 8
  *                             \___|\___/|_| \_\_____|
9 9
  *
10  
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
  10
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
11 11
  *
12 12
  * This software is licensed as described in the file COPYING, which
13 13
  * you should have received as part of this distribution. The terms
@@ -25,6 +25,10 @@
25 25
 
26 26
 #ifdef HAVE_SYS_POLL_H
27 27
 #include <sys/poll.h>
  28
+#elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
  29
+/* for Vista, use WSAPoll(). */
  30
+#include <winsock2.h>
  31
+#define CURL_HAVE_WSAPOLL
28 32
 #else
29 33
 
30 34
 #define POLLIN      0x01

0 notes on commit 1fa3a5c

Please sign in to comment.
Something went wrong with that request. Please try again.