]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
- Victor Snezhko helped us fix bug report #1603712
authorDaniel Stenberg <daniel@haxx.se>
Tue, 2 Jan 2007 22:34:56 +0000 (22:34 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 2 Jan 2007 22:34:56 +0000 (22:34 +0000)
  (http://curl.haxx.se/bug/view.cgi?id=1603712) (known bug #36) --limit-rate
  (CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE) are broken
  on Windows (since 7.16.0, but that's when they were introduced as previous
  to that the limiting logic was made in the application only and not in the
  library). It was actually also broken on select()-based systems (as apposed
  to poll()) but we haven't had any such reports. We now use select(), Sleep()
  or delay() properly to sleep a while without waiting for anything input or
  output when the rate limiting is activated with the easy interface.

CHANGES
RELEASE-NOTES
docs/KNOWN_BUGS
lib/select.c

diff --git a/CHANGES b/CHANGES
index 1cd5ccb27877514e56c88c11187e2b3212a4e26c..4e58026ba5992bd978f5107e4bd2db465a92b1f6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,16 @@
                                   Changelog
 
 Daniel (2 January 2007)
+- Victor Snezhko helped us fix bug report #1603712
+  (http://curl.haxx.se/bug/view.cgi?id=1603712) (known bug #36) --limit-rate
+  (CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE) are broken
+  on Windows (since 7.16.0, but that's when they were introduced as previous
+  to that the limiting logic was made in the application only and not in the
+  library). It was actually also broken on select()-based systems (as apposed
+  to poll()) but we haven't had any such reports. We now use select(), Sleep()
+  or delay() properly to sleep a while without waiting for anything input or
+  output when the rate limiting is activated with the easy interface.
+
 - Modified libcurl.pc.in to use Libs.private for the libs libcurl itself needs
   to get built static. It has been mentioned before and was again brought to
   our attention by Nathanael Nerode who filed debian bug report #405226
index b53e2a34a8d0093678ccaddefcc75e8014833dfb..33fee20895b8a78f540f81e50c1bfca050dbaab6 100644 (file)
@@ -42,6 +42,9 @@ This release includes the following bugfixes:
    would still make libcurl use the proxy...
  o curl_easy_duphandle() now makes a handle that is valid for the multi
    interface since the magic number is set fine
+ o libcurl.pc now uses Libs.private for "private" libs
+ o --limit-rate (CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE)
+   now work on windows again
 
 Other curl-related news:
 
@@ -61,6 +64,7 @@ advice from friends like these:
  Ciprian Badescu, Dmitriy Sergeyev, Nir Soffer, Venkat Akella, Toon Verwaest,
  Matt Witherspoon, Alexey Simak, Martin Skinner, Sh Diao, Jared Lundell,
  Stefan Krause, Sebastien Willemijns, Alexey Simak, Brendan Jurd,
- Robson Braga Araujo, David McCreedy, Robert Foreman
+ Robson Braga Araujo, David McCreedy, Robert Foreman, Nathanael Nerode,
+ Victor Snezhko
 
         Thanks! (and sorry if I forgot to mention someone)
index 3c25d9f79015922f3f3b1b3e2d50b0cfec3c7083..2ccabb82f905d1a4c1b43185fb17219e21e7a255 100644 (file)
@@ -10,13 +10,6 @@ may have been fixed since this was written!
   when doing the different passes in the NTLM negotiation and thus fail to
   negotiate (in seemingly mysterious ways).
 
-36. --limit-rate (CURLOPT_MAX_SEND_SPEED_LARGE and
-  CURLOPT_MAX_RECV_SPEED_LARGE) are broken on Windows (since 7.16.0, but
-  that's when they were introduced as previous to that the limiting logic was
-  made in the application only and not in the library). This problem is easily
-  repeated and it takes a Windows person to fire up his/hers debugger in order
-  to fix. http://curl.haxx.se/bug/view.cgi?id=1603712
-
 35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very
   bad when used with the multi interface.
 
index 672e5b8cfdc7d3aef298dbf930180c147c3d6fe0..33a005e70af6801bc2a608d5df20243b1a86ba50 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -141,6 +141,21 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
   timeout.tv_sec = timeout_ms / 1000;
   timeout.tv_usec = (timeout_ms % 1000) * 1000;
 
+  if((readfd == CURL_SOCKET_BAD) && (writefd == CURL_SOCKET_BAD)) {
+    /* According to POSIX we should pass in NULL pointers if we don't want to
+       wait for anything in particular but just use the timeout function.
+       Windows however returns immediately if done so. I copied the MSDOS
+       delay() use from src/main.c that already had this work-around. */
+#ifdef WIN32
+    Sleep(timeout_ms);
+#elif defined(__MSDOS__)
+    delay(ms);
+#else
+    select(0, NULL, NULL, NULL, &timeout);
+#endif
+    return 0;
+  }
+
   FD_ZERO(&fds_err);
   maxfd = (curl_socket_t)-1;