From b2339578854c2a261f264997e4c94b676d6a723a Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 1 Oct 2009 07:59:45 +0000
Subject: [PATCH] - Tom Mueller correctly reported in bug report #2870221  
 (http://curl.haxx.se/bug/view.cgi?id=2870221) that libcurl returned an  
 incorrect return code from the internal trynextip() function which caused  
 him grief. This is a regression that was introduced in 7.19.1 and I find it  
 strange it hasn't hit us harder, but I won't persue into figuring out  
 exactly why.

---
 CHANGES       | 7 +++++++
 RELEASE-NOTES | 3 ++-
 lib/connect.c | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CHANGES b/CHANGES
index d0dbdb1b4e..f982d8feae 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,13 @@
                                   Changelog
 
 Daniel Stenberg (1 Oct 2009)
+- Tom Mueller correctly reported in bug report #2870221
+  (http://curl.haxx.se/bug/view.cgi?id=2870221) that libcurl returned an
+  incorrect return code from the internal trynextip() function which caused
+  him grief. This is a regression that was introduced in 7.19.1 and I find it
+  strange it hasn't hit us harder, but I won't persue into figuring out
+  exactly why.
+ 
 - Constantine Sapuntzakis: The current implementation will always set
   SO_SNDBUF to CURL_WRITE_SIZE even if the SO_SNDBUF starts out larger.  The
   patch doesn't do a setsockopt if SO_SNDBUF is already greater than
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index b3a1d013b8..a6fe91ab72 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -34,6 +34,7 @@ This release includes the following bugfixes:
  o received cookies without explicit path got saved wrong if the URL had a
    query part
  o don't shrink SO_SNDBUF on windows for those who have it set large already
+ o connect next bug
 
 This release includes the following known bugs:
 
@@ -45,6 +46,6 @@ advice from friends like these:
  Karl Moerder, Kamil Dudka, Krister Johansen, Andre Guibert de Bruet,
  Michal Marek, Eric Wong, Guenter Knauf, Peter Sylvester, Daniel Johnson,
  Claes Jakobsson, Sven Anders, Chris Mumford, John P. McCaskey,
- Constantine Sapuntzakis
+ Constantine Sapuntzakis, Michael Stillwell, Tom Mueller
 
         Thanks! (and sorry if I forgot to mention someone)
diff --git a/lib/connect.c b/lib/connect.c
index aaeee67620..affb7fec56 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -502,7 +502,7 @@ static bool trynextip(struct connectdata *conn,
       /* store the new socket descriptor */
       conn->sock[sockindex] = sockfd;
       conn->ip_addr = ai;
-      break;
+      return FALSE;
     }
     ai = ai->ai_next;
   }
-- 
GitLab