]> git.pld-linux.org Git - packages/wget.git/blame - wget-back-to-ipv4.patch
- added doc. entry for user_agent to info page
[packages/wget.git] / wget-back-to-ipv4.patch
CommitLineData
499ef906
ER
1--- wget-1.9.1.orig/src/main.c 2004-12-28 01:42:49.000000000 +0200
2+++ wget-1.9.1/src/main.c 2004-12-28 01:42:01.000000000 +0200
3@@ -380,6 +380,17 @@
df37a0d8
AM
4
5 append_to_log = 0;
6
7+#ifdef ENABLE_IPV6
8+ {
9+ int s = socket(AF_INET6, SOCK_STREAM, 0);
499ef906 10+ if (s < 0 && (errno == EAFNOSUPPORT || errno == EINVAL)) {
df37a0d8 11+ ip_default_family = AF_INET;
499ef906
ER
12+ } else {
13+ close(s);
14+ }
df37a0d8
AM
15+ }
16+#endif
17+
18 /* Construct the name of the executable, without the directory part. */
19 exec_name = strrchr (argv[0], PATH_SEPARATOR);
20 if (!exec_name)
e6c3237a 21
02537625
AM
22diff -urN wget-1.9.1.org/src/ftp-basic.c wget-1.9.1/src/ftp-basic.c
23--- wget-1.9.1.org/src/ftp-basic.c 2003-11-08 20:17:55.000000000 +0100
e6c3237a
AM
24+++ wget-1.9.1/src/ftp-basic.c 2005-04-25 00:18:36.000000000 +0200
25@@ -261,6 +261,7 @@
26 char *request, *respline;
27 ip_address in_addr;
28 unsigned short port;
29+ int af = AF_INET6;
30
31 char ipv6 [8 * (4 * 3 + 3) + 8];
32 char *bytes;
33@@ -276,10 +277,15 @@
02537625
AM
34 /* Huh? This is not BINDERR! */
35 return BINDERR;
36 inet_ntop (AF_INET6, &in_addr, ipv6, sizeof (ipv6));
37+
e6c3237a 38+ if (strncmp(ipv6, "::ffff:", 7) == 0) {
02537625 39+ memmove(ipv6, ipv6 + 7, sizeof(ipv6) - 7);
e6c3237a
AM
40+ af = AF_INET;
41+ }
02537625
AM
42
43 /* Construct the argument of EPRT (of the form |2|IPv6.ascii|PORT.ascii|). */
44 bytes = alloca (3 + strlen (ipv6) + 1 + numdigit (port) + 1 + 1);
e6c3237a
AM
45- sprintf (bytes, "|2|%s|%u|", ipv6, port);
46+ sprintf (bytes, "|%s|%s|%u|", (af == AF_INET6) ? "2" : "1", ipv6, port);
47 /* Send PORT request. */
48 request = ftp_request ("EPRT", bytes);
49 if (0 > iwrite (RBUF_FD (rbuf), request, strlen (request)))
This page took 0.133033 seconds and 4 git commands to generate.