summaryrefslogtreecommitdiff
blob: bcc3f28ab66b6861b4de7cf39b38897d0a1e49b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
? Makefile
? Makefile.in
Index: options.h
===================================================================
RCS file: /cvs/gnome/gftp/lib/options.h,v
retrieving revision 1.20
diff -u -r1.20 options.h
--- options.h	21 Jul 2003 00:26:41 -0000	1.20
+++ options.h	10 Nov 2003 01:55:49 -0000
@@ -111,6 +111,12 @@
   {"default_protocol", N_("Default Protocol:"),
    gftp_option_type_textcombo, "FTP", NULL, 0,
    N_("This specifies the default protocol to use"), GFTP_PORT_ALL, NULL},
+#if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR)
+  {"enable_ipv6", N_("Enable IPv6"), 
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
+   N_("Enable IPv6 support"), GFTP_PORT_ALL, NULL},
+#endif
 
   {"list_dblclk_action", "", 
    gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0,
Index: protocols.c
===================================================================
RCS file: /cvs/gnome/gftp/lib/protocols.c,v
retrieving revision 1.70
diff -u -r1.70 protocols.c
--- protocols.c	8 Nov 2003 12:23:20 -0000	1.70
+++ protocols.c	10 Nov 2003 01:55:54 -0000
@@ -1826,8 +1826,8 @@
   int port, sock;
 #if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR)
   struct addrinfo hints, *res;
+  int errnum, enable_ipv6;
   char serv[8];
-  int errnum;
 
   if ((request->use_proxy = gftp_need_proxy (request, service,
                                              proxy_hostname, proxy_port)) < 0)
@@ -1835,10 +1835,17 @@
   else if (request->use_proxy == 1)
     request->hostp = NULL;
 
+  gftp_lookup_request_option (request, "enable_ipv6", &enable_ipv6);
+
   request->free_hostp = 1;
   memset (&hints, 0, sizeof (hints));
   hints.ai_flags = AI_CANONNAME;
-  hints.ai_family = PF_UNSPEC;
+
+  if (enable_ipv6)
+    hints.ai_family = PF_UNSPEC;
+  else
+    hints.ai_family = AF_INET;
+
   hints.ai_socktype = SOCK_STREAM;
 
   if (request->use_proxy)
@@ -1926,7 +1933,7 @@
   if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
-                                 _("Failed to create a socket: %s\n"),
+                                 _("Failed to create a IPv4 socket: %s\n"),
                                  g_strerror (errno));
       return (GFTP_ERETRYABLE);
     }
Index: rfc959.c
===================================================================
RCS file: /cvs/gnome/gftp/lib/rfc959.c,v
retrieving revision 1.47
diff -u -r1.47 rfc959.c
--- rfc959.c	8 Nov 2003 12:23:20 -0000	1.47
+++ rfc959.c	10 Nov 2003 01:55:57 -0000
@@ -620,7 +620,7 @@
   if ((parms->data_connection = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
-				 _("Failed to create a socket: %s\n"),
+				 _("Failed to create a IPv4 socket: %s\n"),
 				 g_strerror (errno));
       gftp_disconnect (request);
       return (GFTP_ERETRYABLE);
@@ -767,7 +767,7 @@
   if ((parms->data_connection = socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
-				 _("Failed to create a socket: %s\n"),
+				 _("Failed to create a IPv6 socket: %s\n"),
 				 g_strerror (errno));
       gftp_disconnect (request);
       return (GFTP_ERETRYABLE);