The patch following allows to enter in options dialog (for one session
only) one host name to redirect all requests to. This is intended for
debugging or tunneling sites which have virtual hosts. I hope someone
will find it useful and maybe it'll be merged in the source.
---------patch begins------------
diff -ur elinks-0.10-20050823/src/lowlevel/dns.c
elinks-0.10-20050823.mod/src/lowlevel/dns.c
--- elinks-0.10-20050823/src/lowlevel/dns.c 2005-05-01
15:15:32.000000000 -0600
+++ elinks-0.10-20050823.mod/src/lowlevel/dns.c 2005-12-03
23:59:21.000000000 -0700
@@ -86,9 +86,26 @@
#endif
int i;
+ unsigned char * singleaddr, * oldname;
+ FILE * log;
+
if (!name || !addrs || !addrno)
return -1;
+ if ((singleaddr=get_opt_str("protocol.single-address")) )
+ {
+ if (singleaddr[0])
+ {
+ oldname=name;
+ name=singleaddr;
+ }
+ else
+ {
+ oldname=0;
+ }
+ }
+
+
#ifdef CONFIG_IPV6
/* I had a strong preference for the following, but the glibc is really
* obsolete so I had to rather use much more complicated getaddrinfo().
@@ -112,6 +129,9 @@
}
#endif
+ if(oldname)
+ name=oldname;
+
#ifdef CONFIG_IPV6
for (i = 0, ai_cur = ai; ai_cur; i++, ai_cur = ai_cur->ai_next);
#else
diff -ur elinks-0.10-20050823/src/protocol/protocol.c
elinks-0.10-20050823.mod/src/protocol/protocol.c
--- elinks-0.10-20050823/src/protocol/protocol.c 2005-05-01
15:32:11.000000000 -0600
+++ elinks-0.10-20050823.mod/src/protocol/protocol.c 2005-12-03
23:13:15.000000000 -0700
@@ -259,6 +259,10 @@
"domains as well. If it's blank, NO_PROXY environment variable
is\n"
"checked as well.")),
+ INIT_OPT_STRING("protocol", N_("One address to replace all the ip
queries"),
+ "single-address", 0, "",
+ N_("All the queries will be sent with usual headers but to this
IP.")),
+
NULL_OPTION_INFO,
};
static struct module *protocol_submodules[] = {
_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev