changeset 547:34a3f10d8bae

2004-9-6 Brian Masney <masneyb@gftp.org> * lib/gftp.h lib/misc.c lib/protocols.c lib/rfc959.c - fixes for hosts that have IPv6 and IPv4 hostnames and a IPv6 connection cannot be made * lib/rfc2068.c - removed unused variable
author masneyb
date Wed, 08 Sep 2004 00:34:15 +0000
parents 5d13fa48c275
children 73ff02592d35
files ChangeLog lib/gftp.h lib/misc.c lib/protocols.c lib/rfc2068.c lib/rfc959.c
diffstat 6 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Sep 08 00:18:10 2004 +0000
+++ b/ChangeLog	Wed Sep 08 00:34:15 2004 +0000
@@ -1,4 +1,10 @@
 2004-9-6 Brian Masney <masneyb@gftp.org>
+	* lib/gftp.h lib/misc.c lib/protocols.c lib/rfc959.c - fixes for
+	hosts that have IPv6 and IPv4 hostnames and a IPv6 connection cannot
+	be made
+
+	* lib/rfc2068.c - removed unused variable
+
 	* lib/protocols.c lib/sshv2.c lib/sslcommon.c - cleanups to the
 	functions that write/read to/from the network. Retry the operation
 	if EAGAIN is returned
@@ -2801,7 +2807,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.317 2004/09/08 00:18:09 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.318 2004/09/08 00:34:15 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/gftp.h	Wed Sep 08 00:18:10 2004 +0000
+++ b/lib/gftp.h	Wed Sep 08 00:34:15 2004 +0000
@@ -379,6 +379,7 @@
   struct hostent host, *hostp;
 #endif
 
+  int ai_family;
   int server_type;		/* The type of server we are connected to.
                                    See GFTP_DIRTYPE_* above */
   unsigned int free_hostp : 1, 		/* Should we free the hostp structure 
--- a/lib/misc.c	Wed Sep 08 00:18:10 2004 +0000
+++ b/lib/misc.c	Wed Sep 08 00:34:15 2004 +0000
@@ -587,6 +587,7 @@
   newreq->port = req->port;
   newreq->use_proxy = req->use_proxy;
   newreq->logging_function = req->logging_function;
+  newreq->ai_family = req->ai_family;
   newreq->free_hostp = 0;
   newreq->hostp = NULL;
 
--- a/lib/protocols.c	Wed Sep 08 00:18:10 2004 +0000
+++ b/lib/protocols.c	Wed Sep 08 00:34:15 2004 +0000
@@ -2159,6 +2159,8 @@
           close (sock);
           continue;
         }
+
+      request->ai_family = res->ai_family;
       break;
     }
 
@@ -2185,6 +2187,7 @@
 
   g_return_val_if_fail (sock != -1, GFTP_EFATAL);
 
+  request->ai_family = AF_INET;
   if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
--- a/lib/rfc2068.c	Wed Sep 08 00:18:10 2004 +0000
+++ b/lib/rfc2068.c	Wed Sep 08 00:34:15 2004 +0000
@@ -705,7 +705,6 @@
   void *read_ptr_pos;
   ssize_t retval;
   size_t sret;
-  int ret;
 
   params = request->protocol_data;
   params->read_ref_cnt++;
--- a/lib/rfc959.c	Wed Sep 08 00:18:10 2004 +0000
+++ b/lib/rfc959.c	Wed Sep 08 00:34:15 2004 +0000
@@ -937,7 +937,7 @@
   g_return_val_if_fail (request->datafd > 0, GFTP_EFATAL);
 
 #ifdef HAVE_IPV6
-  if (GFTP_GET_AI_FAMILY(request) == AF_INET6)
+  if (request->ai_family == AF_INET6)
     return (rfc959_ipv6_data_connection_new (request));
   else
     return (rfc959_ipv4_data_connection_new (request));