aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-01-25 23:26:25 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-01-25 23:26:25 +0000
commit5aeef9c1c87f2f72f10807a609ced1976ab46cd2 (patch)
tree2989dc65cfaf49acc6e014c256b920dc1e01b95b /src/main.c
parentddd3fe594861e671ea4951371f4a3c0885c3f24f (diff)
- Craig A West brought CURLOPT_NOPROXY and the corresponding --noproxy option.
They basically offer the same thing the NO_PROXY environment variable only offered previously: list a set of host names that shall not use the proxy even if one is specified.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index f8e53384d..f99550dcf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -448,6 +448,7 @@ struct Configurable {
char *userpwd;
char *proxyuserpwd;
char *proxy;
+ char *noproxy;
bool proxytunnel;
bool ftp_append; /* APPE on ftp */
bool mute; /* shutup */
@@ -772,6 +773,7 @@ static void help(void)
" -N/--no-buffer Disable buffering of the output stream",
" --no-keepalive Disable keepalive use on the connection",
" --no-sessionid Disable SSL session-ID reusing (SSL)",
+ " --noproxy Comma-separated list of hosts which do not use proxy",
" --ntlm Use HTTP NTLM authentication (H)",
" -o/--output <file> Write output to <file> instead of stdout",
" --pass <pass> Pass phrase for the private key (SSL/SSH)",
@@ -1666,6 +1668,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"$2", "socks5-hostname", TRUE},
{"$3", "keepalive-time", TRUE},
{"$4", "post302", FALSE},
+ {"$5", "noproxy", TRUE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
@@ -2175,6 +2178,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
case '4': /* --post302 */
config->post302 = toggle;
break;
+ case '5': /* --noproxy */
+ /* This specifies the noproxy list */
+ GetStr(&config->noproxy, nextarg);
+ break;
}
break;
case '#': /* --progress-bar */
@@ -3641,6 +3648,8 @@ static void free_config_fields(struct Configurable *config)
free(config->proxy);
if(config->proxyuserpwd)
free(config->proxyuserpwd);
+ if(config->noproxy)
+ free(config->noproxy);
if(config->cookie)
free(config->cookie);
if(config->cookiefile)
@@ -4559,6 +4568,7 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
my_setopt(curl, CURLOPT_TRANSFERTEXT, config->use_ascii);
my_setopt(curl, CURLOPT_USERPWD, config->userpwd);
my_setopt(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
+ my_setopt(curl, CURLOPT_NOPROXY, config->noproxy);
my_setopt(curl, CURLOPT_RANGE, config->range);
my_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
my_setopt(curl, CURLOPT_TIMEOUT, config->timeout);