diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-13 17:08:19 +0000 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2006-09-13 17:08:19 +0000 |
commit | bd5df120f4a48869f9d85774af1cebaba00de1a8 (patch) | |
tree | b0224a285f3090f6e020564dbd25365acf20e887 /src | |
parent | d466d6a39f785c44a09adf3fc58b5a425c63f33b (diff) | |
download | xine-lib-bd5df120f4a48869f9d85774af1cebaba00de1a8.tar.gz xine-lib-bd5df120f4a48869f9d85774af1cebaba00de1a8.tar.bz2 |
Don't use the proxy if the host resolves to 127.0.0.1 (localhost).
Missing check for IPv6 localhost.
CVS patchset: 8224
CVS date: 2006/09/13 17:08:19
Diffstat (limited to 'src')
-rw-r--r-- | src/input/input_http.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c index 874cb891c..5de03e50b 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -19,7 +19,7 @@ * * input plugin for http network streams * - * $Id: input_http.c,v 1.120 2006/07/10 22:08:15 dgp85 Exp $ + * $Id: input_http.c,v 1.121 2006/09/13 17:08:19 dgp85 Exp $ */ #ifdef HAVE_CONFIG_H @@ -176,6 +176,16 @@ static int _x_use_proxy(http_input_class_t *this, const char *host) { return 1; } if (!info->h_name) return 1; + + if ( info->h_addr_list[0] ) { + /* \177\0\0\1 is the *octal* representation of 127.0.0.1 */ + if ( info->h_addrtype == AF_INET && !memcmp(info->h_addr_list[0], "\177\0\0\1", 4) ) { + lprintf("host '%s' is localhost\n", host); + return 1; + } + /* TODO: IPv6 check */ + } + target = info->h_name; host_len = strlen(target); |