Jernej Simončič wrote:

> Here's another one that I thought was already fixed, but apparently
> wasn't - --connect-timeout doesn't work on Windows without this patch

You're right. This is needed:

--- src/connect.c~0     2014-12-02 09:49:37.000000000 +0200
+++ src/connect.c       2015-03-17 17:14:48.414375000 +0200
@@ -364,7 +364,12 @@ connect_to_ip (const ip_address *ip, int
        logprintf.  */
     int save_errno = errno;
     if (sock >= 0)
-      fd_close (sock);
+      {
+#ifdef WIN32
+       if (errno != ETIMEDOUT)
+#endif
+         fd_close (sock);
+      }


But I don't really understand why. Care to explain?

A simple test-case here on Win-10:

  timer & wget --connect-timeout=10 --tries=3 http://10.0.0.22:21 &timer

  --2015-12-12 12:42:23--  http://10.0.0.22:21/
  Connecting to 10.0.0.22:21... failed: Unknown error.
  Retrying.

  --2015-12-12 12:42:44--  (try: 2)  http://10.0.0.22:21/
  Connecting to 10.0.0.22:21... failed: Unknown error.
  Retrying.

  --2015-12-12 12:43:06--  (try: 3)  http://10.0.0.22:21/
  Connecting to 10.0.0.22:21... failed: Unknown error.
  Giving up.

  Timer 1 off: 13.53.40  Elapsed: 0.00.33,08

Without you patch, that command never finishes.

The message wrongly says "Unknown error", but that is another matter...

-- 
--gv

Reply via email to