changeset 641:efe90b739e98

2004-12-12 Brian Masney <masneyb@gftp.org> * lib/gftp.h lib/protocols.c (gftp_connect_server) - if getaddrinfo() is not defined in the system, save the current index of the host that we are connected to
author masneyb
date Sun, 12 Dec 2004 11:52:17 +0000
parents cad45ebbc520
children b9e8b22bf3b1
files ChangeLog lib/gftp.h lib/protocols.c
diffstat 3 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Dec 12 11:26:15 2004 +0000
+++ b/ChangeLog	Sun Dec 12 11:52:17 2004 +0000
@@ -1,4 +1,8 @@
 2004-12-12 Brian Masney <masneyb@gftp.org>
+	* lib/gftp.h lib/protocols.c (gftp_connect_server) - if getaddrinfo()
+	is not defined in the system, save the current index of the host that we
+	are connected to
+
 	* src/gtk/gftp-gtk.c (toolbar_hostedit) - use gftp_disconnect() instead
 	of gftpui_disconnect(). The gftpui_disconnect() function will clear out
 	the directory in the request structure
@@ -3139,7 +3143,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.376 2004/12/12 11:26:15 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.377 2004/12/12 11:52:17 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/gftp.h	Sun Dec 12 11:26:15 2004 +0000
+++ b/lib/gftp.h	Sun Dec 12 11:52:17 2004 +0000
@@ -386,6 +386,7 @@
                   *current_hostp;
 #else
   struct hostent host, *hostp;
+  int curhost;
 #endif
 
   int ai_family;
--- a/lib/protocols.c	Sun Dec 12 11:26:15 2004 +0000
+++ b/lib/protocols.c	Sun Dec 12 11:52:17 2004 +0000
@@ -2240,7 +2240,6 @@
 #else /* !HAVE_GETADDRINFO */
   struct sockaddr_in remote_address;
   struct servent serv_struct;
-  int curhost;
 
   if ((request->use_proxy = gftp_need_proxy (request, service,
                                              proxy_hostname, proxy_port)) < 0)
@@ -2306,10 +2305,13 @@
     }
 
   disphost = NULL;
-  for (curhost = 0; request->host.h_addr_list[curhost] != NULL; curhost++)
+  for (request->curhost = 0;
+       request->host.h_addr_list[request->curhost] != NULL;
+       request->curhost++)
     {
       disphost = request->host.h_name;
-      memcpy (&remote_address.sin_addr, request->host.h_addr_list[curhost],
+      memcpy (&remote_address.sin_addr,
+              request->host.h_addr_list[request->curhost],
               request->host.h_length);
       request->logging_function (gftp_logging_misc, request,
                                  _("Trying %s:%d\n"),
@@ -2325,7 +2327,7 @@
       break;
     }
 
-  if (request->host.h_addr_list[curhost] == NULL)
+  if (request->host.h_addr_list[request->curhost] == NULL)
     {
       close (sock);
       return (GFTP_ERETRYABLE);